Jump to content

Dany Marmur

  • Content Count

  • Joined

  • Last visited

  • Days Won


Dany Marmur last won the day on January 13

Dany Marmur had the most liked content!

Community Reputation

125 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. IMHO Readability is key (1) performance is a boon (2). In that order.
  2. ATM i'm, refactoring my todo-lists. This process does not involve Delphi/Emba or any such (so OT), but rather papers and pens (colourised). @Clément a lot of them to get rid of. But then again... in every instance... is it really needed?
  3. Dany Marmur

    New free firebird tool... (Didn't make it ;) )

    @Tommi Prami, interesting. How do i communicate with the author? I can only find a Linked-in-link.
  4. I often find refactored code with comments about *why* something was done in a certain way... But it's not anymore. It was refactored. Artifactual comments will increase as more refactoring tools become available. So the need of comment refactoring tools will arise. // The LNotSoGoodAName variable is... bla bla because bla... Var LStringentName: integer; Var LThisIsThat: string;
  5. Dany Marmur

    What are your compiler settings for debug builds?

    Yes, in his brilliant book, "Delphi High Performance" (Packt), Primož writes "This kind of checking is so important that I always leave it in my code, even in the release version. Accessing a nonexistent array or string element may not seem so dangerous, but what if you are writing into that element? If this is not caught, your code just overwrites some other data with nonsense values. This leads to extremely hard to find problems! By default, range checking is turned off even in debug build and you really should turn it on in every program.". So when i read it i did it. I immediately found a dangerous thingy in 3rd party code. After deploying i found one or two pitfalls in my own code too. Sure, for specific time-critical tasks/processes it have to be measured.
  6. Dany Marmur

    What are your compiler settings for debug builds?

    @Attila Kovacs,the few but important cases where this has helped... 10 hours of beer and burgers and sweat to ind those edge cases compared to the (little) extra processor power required. Also factor in what the users do when things get shaky, like print everything just in case.... No, i think in the long run it should be on. Tomorrow if i have time i'll look up the quote from Primozs book.
  7. As long as you are absolutely sure that your separator will not occur in any "value". No problems. I have some cases where i push over 1000 integer values as a long string to a stored proc instead of trying to parameter:ize it. The sp parses the input and can load a GTT for an efficient join. Works the other way too, i.e receive a "whatever-separated" string up to the client. I i know there will be a limited number of "sub-values" list. So yes, this is not bad design IMHO.
  8. Dany Marmur

    What are your compiler settings for debug builds?

    Range checking ON for ALL builds.
  9. Dany Marmur

    Just wanted to brag a bit :-)

  10. Dany Marmur

    Cannot perform this operation on a closed dataset

    That might have been me. Generally, when you change the SQL text, a re-prepare is needed. That cannot be done on an open query. Not your problem above. When you change the parameter values, the query needs to be re-executed (in a prepared state) and that entails close + re-open. In a lot of cases the DAC will help you with this (like in a master-detail relationship) and i can confess that back when it took me some time to understand this. You DAC should offer different ways of handling this, IMHO. I cannot answer that (no FireDAC sources), @Uwe Raabe pointed in the right direction. I would put an event handler on the query's OnClose and a brekapint in that handler. Then look at the call-stack and put breakpoints below that. Eventually you will find the "culprit". One more thing, you use a method called "Open" that takes the parameter value as argument. To me that sound like something you do only once. When the value is changed, some other method should be used. Maybe something like "qQueryname.Refresh([ cYear ] );". But again, i do not know. I have a lot of [pseudocode]: aQ.Params[0].AsInteger := aVar; if aQ.Open then aQ.Refresh else aQ.Open; HTH
  11. Dany Marmur

    Why can't I install this monospaced font in Delphi ?

    Lars still prefers Source Code Pro.
  12. @Turan Can i do not use Delphi like you do, so i know nil about your specific problem. But i must give you points for you calmness and courage in you replies, especially considering the language barrier. That is the plus i gave on the OP. Other posters get annoyed, frustrated and angry. Keep it up!
  13. Dany Marmur

    Cannot perform this operation on a closed dataset

    @bazzer747, thanks! I was also a bit fast in my reply and should duly apologise too. All good!! I have no idea of your economy or Delphi edition. But tracing into library code is my way of getting understanding. I have Delhi Pro so FireDAC sources are not included. So i do not use FireDAC because it will leave me hanging. Docs are key but almost never enough IMHO. Regards and good luck!
  14. Dany Marmur

    Cannot perform this operation on a closed dataset

    Please. If that was a reaction to my post then RTFM on you. It was a GUESS because i did not know you use FireDAC. Had i known that i'd not even commented because i do not have access to the FireDAC sources. Thus i do not use it.
  15. Dany Marmur

    Scheduled tasks at system time

    I have this running in a legacy windows service. Much neater stuff available today but it goes like this: A worker thread is kicked in action at an interval. Say 2 minutes. An array or a couple of boolean flags exists. The parent thread that starts the worker thread is responsible for setting the flags and the worker for clearing them (after successful execution). Key is that the tread is allowed to finish. It may be a job (check something) that should be done at each thread start. If the worker crash it will not clear the flag and the job will be run again next time (of course, you should send some kind of alert in this case). Also if a job is more than 2 minutes (the interval) then if more is required it will be done on the next run. It uses very basic CriticalSection for the flags. Of course, this solution is very simple and depending on the needs it may fall short and get messy but for just a couple of different actions it will suffice. HTH, /D