set<int> s;
s.insert(1);
s.insert(2);
...
s.insert(n);
Iwonder how much time it takes for s.find(k) where k is a number from 1..n?
I assume it is log(n). Is it correct?
I have a classifieds website, and users may post classifieds, add images, remove classifieds etc etc...
I have no idea what to set the permissions to on folders.
For instance, a php script which I have uploads a file to a directory.
What would you have set the directory permissions to?
Nobody need access to the directory, only the php script...
Just wonder if anybody has a good (brief) article about setting the "right" permissions?
Thanks
We are in web era standalone applications are almost gone everyone wants their internet application to run inside browser, programming languages like Ruby, Python and scala are becoming more and more mainstream.
Sometimes Iwonder what these programming language offer which make them top choice of IT companies, if I plan to become a freelance web developer is it worth learning C# or Java. I read beginner's book for both of them, but to master any of them require some time investment.
I wonder if scala.dbc supports stored procedures?
The mysql jdbc backend I'm using supports it, bonus points for a code illustration to show how it works.
Since it came out a few days ago, I am sure at least some members of SO had a chance to try it out.
For those that did, Iwonder if you could share the following:
Whether you liked/disliked it
What you liked/disliked
Whether it's worth upgrading
To ensure fairness (and to make the mods happy) I will make this CW.
I'm browsing through OpenJDK sources and cannot find the place where optimized code is replaced.
Iwonder how this can be done in protected mode, isn't it some kind of selfmodifing code which should be prevented by the OS?
I wonder how to list content of tar file only down to some level?
I understand "tar tvf mytar.tar" will list all files, but sometimes I wish I can just see directories down to some level.
Similarly for command "ls" how to control the level of subdirectories that will be displayed? By default, it will only show the direct subdirectories, but not further.
Thanks and regards
I need to determine how many channels a sound track has in a QuickTime movie. I can get to the track, then I am stuck. Iwonder if the answer would be in a QTFormatDescription, but I can't figure out how to get one for the track. I am using Objective-C on Mac OS 10.6.
I wonder if syntax as follows would be helpful in your opinion as a code readability improvent and self-commenting of code:
std::map<std::string name, std::vector<int> scores> myMap;
In this example it clearly says and no other comment is needed, what for we are using myMap variable.
Looking forward to your opinions.
Hi,
in C++, using printf I want to print a sequence of number, so I get, from a "for" loop;
1
2
...
9
10
11
and I create files from those numbers. But when I list them using "ls" I get
10
11
1
2
..
so instead of trying to solve the problem using bash, Iwonder how could I print;
0001
0002
...
0009
0010
0011
and so on
Thanks
I have been developing websites in n-tier structure and so far my requirements are fulfilled. But as powerful frameworks like Zend Framework, symphony are getting popular, Iwonder how to know if it is time to shift to a framework?
I am in a kind of dilemma? Can anyone suggest me the right option !
I never need to store objects in a hash table. The reason is twofold:
coming up with a good hash function is difficult and error prone.
an AVL tree is almost always fast enough, and it merely requires a strict order predicate, which is much easier to implement.
The Equals() operation on the other hand is a very frequently used function.
Therefore Iwonder whether it is necessary to implement GetHashCode (which I never need) when implementing the Equals function (which I often need)?
Zend Framework 2/Doctrine 2 seems like my server side framework of choice but iwonder if its advisable or worth it to start with Zend Framework 1.x first, since 2 is not out yet, or learn other things like say C#, Design Patterns etc
I want to initialize an instance of one of the subclasses of a superclass depending on the arguments to init:
[[Vehicle alloc] initWithItinerary: shortWay]; // returns a bicycle
[[Vehicle alloc] initWithItinerary: longWay]; // returns a car
I can't find examples of code like this. Iwonder if this is not idiomatic in Objective C, or I simply am not looking in the right places.
Python has string.find() and string.rfind() to get the index of a substring in string.
Iwonder, maybe there is something like string.find_all() which can return all founded indexes (not only first from beginning or first from end)?
For example:
string = "test test test test"
print string.find('test') # 0
print string.rfind('test') # 15
#that's the goal
print string.find_all('test') # [0,5,10,15]
Hello,
Recently I needed to generate a huge HTML page containing a report with several thousand row table. And, obviously, I did not want to build the whole HTML (or the underlying tree) in memory. As result, I built the page with the old good string interpolation, but I do not like the solution.
Thus, Iwonder whether there are Python templating engines that can yield resulting page content by parts.
Hi,
I have just started to learn about the pros of foreign keys in database design (mySQL / innoDB) and Iwonder if there's any way to temporarily bypass the foreign key when doing a specific delete query, to just delete in the parent table, and not from the linked child tables.
Thanks
i'm playing around with c# reflection api. i can easily load type info of classes, methods etc. in an assembly.
now iwonder how can i load and read the code inside a method?
I have recently done a very simple highlighting with jQuery and a highlight plugin. It looks like this:
$('myButton').click(function() {
$('body').highlight($('#myInputText').val());
});
But Iwonder how can I do the Chrome like highlighting, I mean highlight the letters whenever I type in some letter in textbox without submitting. I think maybe use a keyup event... Any ideas?
I just upgraded my slime using elpa in Emacs. But Iwonder if things are like they should be now, because when I removed the old version using elpa, it complained it could not remove a certain folder. So, when I start up Emacs (I know, I shouldn't have closed it), how I can see which slime version actually gets used? Is there a command like M-x slime-version ?
Hi,
I am interested in getting the profiling of some number crunching program. I compiled it with -g and -pg options and linked it and got it gmon.out. After reading the info (plain text) it looks a bit ugly. Iwonder if there are some open source tools for getting a graphical representation of the 10 functions where the program spends the most of the time as well as a flux diagram.
Thanks
i wonder how long it will take to master Symfony and use it to code?
i already know mvc + oop and have used CodeIgniter before to code.
are we talking about days, weeks or months giving that i will dedicate 8-12 hours a day to learn it.
I wonder if there is a supported way to access the SharePoint 2010 SQL Server through an API?
I'm not talking about modifying any SharePoint Database directly (I know that that is still unsupported), but I'd like to store some data that my application needs, and instead of asking the user to enter a Connection String, I'd prefer to create my own database on the SQL Server that SharePoint uses.
I think I could use the new Service Application stuff, but that seems a bit overkill?