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 in any manner.
...
I need to be able to manipulate a large (10^7 nodes) graph in python. The data corresponding to each node/edge is minimal, say, a small number of strings. What is the most efficient, in terms of memory and speed, way of doing this?
A dict of dicts is more flexible and simpler to implement, but I intuitively expect a list of lists to be...
We looked at this answer for C in this question:
http://stackoverflow.com/questions/24886/is-there-a-performance-difference-between-i-and-i-in-c
What's the answer for C++?
...
What are people's tips for an efficient workday. For example, sometimes I find myself procrastinating over something, generally just putting it off (especially if there is no deadline breathing down my neck). To counter this, I sometimes try creating a list of things to do for the next hour or so. This often can work, but I'd still occas...
I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are affected by... well, what? Document size in bytes? Number of nodes? And is the relati...
Answers for multiple databases welcome!
...
I like putting shortcuts of the form "g - google.lnk" in my start menu so google is two keystrokes away. Win, g.
My eight or so most frequent applications go there.
I also make links to my solution files I am always opening "x - Popular Project.lnk"
Are there any better ways to automate opening frequently used applications?
...
Hello,
I am a solo developer, working in a very small web development firm. There is occasional support for development from contractors, but for the most part, if code is written in the office, I am writing it.
Many of the articles and such on here talk extensively about the tools and techniques used for collaboration of developers ...
Team building, in my opinion, is often misunderstood concept!
The wikipedia definition is also very theoretical.
But i think it is real critical skill for any team leader.
So, How do you "team-build"?
Do you just book some conference room in a big hotel and discuss the same things you do at your regular meetings?
Or you do you tak...
I have a dict, that looks like this:
{
'foo': {
'opt1': 1,
'opt2': 2,
},
'foo/bar': {
'opt3': 3,
'opt4': 4,
},
'foo/bar/baz': {
'opt5': 5,
'opt6': 6,
}
}
And I need to get it to look like:
{
'foo': {
'opt1': 1,
'opt2': 2,
...
I'm not talking about the kind you get in college, but rather implementing progress reports on the Job for developers.
My thoughts in organizing a development team is encouraging and, to some extend, requiring regular progress updates were developers would report on what they did in the last hour or few hours and how long tasks took. Be...
After watching The Dark Knight I became rather enthralled with the concept of the Prisoner's Dilemma. There must be an algorithm that that maximizes one's own gain given a situation.
For those that find this foreign: http://en.wikipedia.org/wiki/Prisoner%27s_dilemma
Very, very interesting stuff.
Edit: The question is, what is, if any,...
Are there good efficiency savings using Sql Server 2005 over Sql Server 2000?
Or does it just have more services etc
Has anyone seen their system work any quicker after making the upgrade?
...
Alright. So I have a very large amount of binary data (let's say, 10GB) distributed over a bunch of files (let's say, 5000) of varying lengths.
I am writing a Java application to process this data, and I wish to institute a good design for the data access. Typically what will happen is such:
One way or another, all the data will be ...
I have a need to run a relatively large number of virtual machines on a relatively small number of physical hosts. Each virtual machine isn't doing to much - each only needs to run essentially one basic network service - think SMTP or the like. Furthermore, the load on each is going to be extremely light.
Unfortunately, the numbers are...
I have a poorly designed database. One of the most important tables has 11,000+ entries. We would like to expand our system, and I am wondering if this table grew to 5x its size, would this be a problem? It's 15360 kB in size... if that matters.
I'm using phpMyAdmin, the server is a Fedora Linux box (nothing fancy), The load is light....
Is there a better way to do this?
-(NSDate *)getMidnightTommorow {
NSCalendarDate *now = [NSCalendarDate date];
NSCalendarDate *tomorrow = [now dateByAddingYears:0 months:0 days:1 hours:0 minutes:0 seconds:0];
return [NSCalendarDate dateWithYear:[tomorrow yearOfCommonEra]
month:[tomorrow mon...
Hey,
I got to create script that would compare thousands of large texts (to each other). And I'm wondering if MySQL is the best solution for this. Is there any other free databse system I could use to do simple - but processor-time consuming computing?
Please, throw me into your knowledge's pool!
Edit: Nature of documents - 500-7000 c...
I'm writing a page that can use a couple of different themes, and I'm going to store some information about each theme in the web.config.
Is it more efficient to create a new sectionGroup and store everything together, or just put everything in appSettings?
configSection solution
<configSections>
<sectionGroup name="SchedulerPage">...
Is it less efficient to use TEXT than varchar in an SQL database?
If so why?
If not why would you not just always use TEXT?
I'm not targetting a specific database here but oracle is probably the most relevant, although I'm testing on MySQL for the time being as part of a proof of concept.
...