Omgili - forum search, search forums  
  

Discussions about efficient code

Displaying 1 - 10 out of 45,254 discussions.  
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
I want to print the first 10000 prime numbers. Can anyone give me the most efficient code for this? Clarifications: It does not matter if your code is inefficient for n >10000. The size of the code does not matter. You cannot just hard code the values...
Started by on , 19 posts by 18 people.  
/^1 adapted code found on the CodeProject to create the following: ArrayList primeNumbers = new on an ancient Pentium II-350 Sieve of Eratosthenes....
Not efficient at all, but you can use a regular expression to test for prime numbers.
As all of you may know, Java code is compiled and interpreted by JVMs. My questions deal with optimization: Is it optimized at run-time by the JVM only or also at compile-time? In order to write efficient code, where can I find the list of supported optimizations...
Started by on , 7 posts by 7 people.  
Have performance goals The Java HotSpot JIT compiler can detect... .
I'd definitely choose writing code for readability and maintainability over supposed optimisations, not just Java): Write code that is as readable and maintainable as possible.
Hi all, I'm trying to write more readable and more efficient code, I've always hated if if if chains .. is it possible to write the following statement in some other more "elegant" way like maybe using ternary ops : if(text.length < 1){ if(errtext....
Started by on , 6 posts by 6 people.  
(Not that it matters in the context you're they're more clear to a reader... .
You could throw in a ternary (I'm assuming, but with a non-optimising compiler it's also less efficient.
Cannot be empty"; } Your code as quoted seems quite clear.
Ask your Facebook Friends
I have been looking around online and I cant seem to find an article on this that isn't totally outdated. Does anyone have any good articles that give some good advice? What I have read so far is good, and a bit helpful, but I want to have modern code...
Started by on , 8 posts by 8 people.  
Here's a link to show ....
It promotes reuse and makes code a lot more readable.
Edit for the Question Edit Clean and efficient already, I suggest making your PHP code object-oriented.
Use Smarty Write to patterns as much as possible.
This could sound a subjective question, but what i am looking for is specific instances which you would have encountered related to this. 1) How to make a code, cache effective-cache friendly? (More cache hits, as less cahce misses as possible). from ...
Started by on , 13 posts by 13 people.  
Similarly, algorithms which access contiguous memory blocks will be more efficient than algorithms which jump through memory in a random order to guarantee that a data structure that....
Within a single cache-line are therefore more efficient.
If(strpos($string, "PENIS") != false){ echo 'This word is not allowed'; } if(strpos($string, "VAGINA") != false){ echo 'This word is not allowed'; } Okay, so I am trying to check the submit data to see if there are inappropriate words. Instead of making...
Started by on , 8 posts by 8 people.  
You really want !==, since strpos() will return 0 if the first .
Question-code, you test strpos != false.
Let me preface by saying I am not knocking .Net (it helps me earn my living)... I recently heard of a site were the developer/owner bragged that he had minimal hardware to support his site (plentyoffish.com). This site is listed as being in the top 50...
Started by on , 7 posts by 7 people.  
Way more performance than just picking a fast langauge and writing code that isn't tuned of maintaining the code is also important....
What else is there? PHP? Java? Ruby? Sure you could code up your web.
Is actually quite efficient.
This code block works - it loops through a file that has a repeating number of sets of data and extracts out each of the 5 pieces of information for each set. But I I know that the current factoring is not as efficient as it can be since it is looping...
Started by on , 8 posts by 8 people.  
Which means from your code, but it looks like each line can have one "hit" at most; if that's indeed the case '%-8s =' % s, print vals[k] might work --....
", ] I don't see the above code working if there is more than one value in each line.
Hey all. Just wanting to know is this the most efficient way of getting values from a db: given; | Channel | |Issue | |Topic | | path(ck)| |channelID(fk)| |issueID(fk)| One channel has many Issues One Issue has many Topics path is an alternate key I have...
Started by on , 4 posts by 4 people.  
I think this is what your code is trying to accomplish: var channels = db.channels.Where (c =>.
I would like to know how programmers do review of code written by others. I find myself bit sloppy in that respect. When ever a experienced programmer sends a request for reviewing code, I fail to be serious when going through the code just for the reason...
Started by on , 5 posts by 5 people.  
Use Static Code review tools such as CPPTest and Dynamic Code review tools such as Purify questions to ask yourself while reviewing each other's code, ideally tailoring it to the languages you code in, the projects you work....
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost