Daily Archives

Articles indexed Monday May 24 2010

Page 1/108 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • 10 lines of code per day is the global average!? -- true?

    - by Earlz
    Ok so last year I participated in a high school curriculum contest thing at a college(I currently attend this college). I actually got 1st in it but was still a bit angry I didn't get every single one right. The most baffling of questions on there was How many lines of code does the average programmer write per day? A. 5 B. 10 C. 25 D. 30 Aside from being a subjective question which depended on language and everything else I was more baffled at what they had as the correct answer. 10. Even on my bad days at my job I touch more than 10 lines of code(either adding, modifying, or deleting) per day. And when I took this test I had only programmed as a hobby where it was common for me to write a few hundred lines for one of my new projects per day. Where are they getting this random number of ten!? Is this published somewhere? A quick googling found me nothing.

    Read the article

  • Problem in importing database in MySQL

    - by Krt_Malta
    I have a .sql file with some database backups inside. Now I want to restore them back to MySQL. How can I this using command line of MySqL please? I found this: mysql -u username -p -h localhost database_name < dumpfile.sql but I don't know what username should be, what database_name should be and how I could browse to a .sql file in another folder.

    Read the article

  • Error while creating in app purchase in itunes connect

    - by MW
    I'm having trouble while creating an In App Purchase in iTunes Connect. I have created a test user and am able to see the form for creating the in app purchase. However, when pressing 'Save' I get the following error message: "There was an error saving changes. Please try again later. If the problem persists, please contact us." This error has persisted for about 24 hours now. Have you encountered this problem, and do you know any way to get around it? Edit 2009-11-10: I just received a response from my email to Apple. It stated that they will start looking into it, and expect to have a solution within three business days. As soon as I hear something new, I'll post it here.

    Read the article

  • Emacs: selective c-auto-newline

    - by Yktula
    When c-auto-newline is set to non-nil, it re-indents the current line and inserts a carriage return and then indents the new line. However. I'm using 1TBS indent-style, which means if/else statements are made like this: if (n == 1) { exit(EXIT_SUCCESS); } else { perror("n"); } Also, I write do/while write loops like this: do { printf("%d\n", n++); } while (n < 64); As such, while I do want a newline automatically inserted after every opening brace and semicolon, I don't want newlines to be automatically inserted after an if statement or do loop is concluded with a closing brace. How can I have GNU Emacs (23.2.1, *nix) selectively insert newlines like that? Along the same lines, can I have Emacs insert an opening brace, a newline, and a closing brace on another newline, while putting the cursor in the middle of the two braces after closing parentheses following an if statement, function declaration, and the like?

    Read the article

  • How do I create midi data to trigger an Ultrabeat pattern in Logic?

    - by user289581
    I've made some Ultrabeat patterns but I can't figure out how to trigger them. I make the pattern on C-1, then I go back to the arrange window and hit record and then hit C1 on my keyboard, and it doesn't play the pattern, it just plays a single note. I have Pattern Mode enabled on Ultrabeat and I'm using a one-shot trigger but I can't seem to trigger my pattern to play at all. What am I doing wrong?

    Read the article

  • Difference dynamic static 2d array c++

    - by snorlaks
    Hello, Im using opensource library called wxFreeChart to draw some XY charts. In example there is code which uses static array as a serie : double data1[][2] = { { 10, 20, }, { 13, 16, }, { 7, 30, }, { 15, 34, }, { 25, 4, }, }; dataset->AddSerie((double *) data1, WXSIZEOF(dynamicArray)); WXSIZEOF ismacro defined like: sizeof(array)/sizeof(array[0]) In this case everything works great but in my program Im using dynamic arrays (according to users input). I made a test and wrotecode like below: double **dynamicArray = NULL; dynamicArray = new double *[5] ; for( int i = 0 ; i < 5 ; i++ ) dynamicArray[i] = new double[2]; dynamicArray [0][0] = 10; dynamicArray [0][1] = 20; dynamicArray [1][0] = 13; dynamicArray [1][1] = 16; dynamicArray [2][0] = 7; dynamicArray [2][1] = 30; dynamicArray [3][0] = 15; dynamicArray [3][1] = 34; dynamicArray [4][0] = 25; dynamicArray [4][1] = 4; dataset->AddSerie((double *) *dynamicArray, WXSIZEOF(dynamicArray)); But it doesnt work correctly. I mean point arent drawn. I wonder if there is any possibility that I can "cheat" that method and give it dynamic array in way it understands it and will read data from correct place thanks for help

    Read the article

  • Fine-grained permissions on SVN Repository

    - by Jim
    Hello, I'm trying to setup a SVN repo for a whole bunch of users. Different users need to have different levels of access to areas of the repository. A trivial example might be that frontend engineers need access to the "view" and "controllers" but not "model", while backend engineers need access to the "controllers" and "model" but not "view". It needs to be one repository, because (as far as I know) that's the only way to ensure that commits touching multiple modules are atomic. Is there a fine-grained way to control user access to a repository? Thanks!

    Read the article

  • Example of [NSDictionary getObjects:andKeys:]

    - by eagle
    I couldn't find a working example of the method [NSDictionary getObjects:andKeys:] on Google. The only link I could find, doesn't compile. I provided the errors/warnings here in case someone is searching for them. The documentation says that it returns a C array. NSDictionary *myDictionary = ...; id objects[]; // Error: Array size missing in 'objects' id keys[]; // Error: Array size missing in 'keys' [myDictionary getObjects:&objects andKeys:&keys]; for (int i = 0; i < count; i++) { id obj = objects[i]; id key = keys[i]; } . NSDictionary *myDictionary = ...; NSInteger count = [myDictionary count]; id objects[count]; id keys[count]; [myDictionary getObjects:&objects andKeys:&keys]; // Warning: Passing argument 1 of 'getObjects:andKeys:' from incompatible pointer type. for (int i = 0; i < count; i++) { id obj = objects[i]; id key = keys[i]; } Please provide a working example of this method.

    Read the article

  • " not all code paths return a value" when return enum type

    - by netmajor
    I have enum list and method and i get error: " not all code paths return a value" Some idea whats wrong in my method ? I am sure I always return STANY type :/ Thanks for help :) private enum STANY { PATROL, CHAT, EAT, SEARCH, DIE }; private STANY giveState(int id, List<Ludek> gracze, List<int> plansza) { // Sprawdz czy gracz stoi na polu z jedzeniem i nie ma 2000 jednostek jedzenia bool onTheFood = false; onTheFood = CzyPoleZjedzeniem(id, gracze, plansza, onTheFood); if (onTheFood && (gracze[id].IloscJedzenia < startFood / 2)) return STANY.EAT; // Sprawdz czy gracz nie stoi na polu z innym graczem bool allKnowledge = true; allKnowledge = CzyPoleZInnymGraczem(id, gracze, allKnowledge); if (!allKnowledge) return STANY.CHAT; // Jesli ma ponad i rowna ilosc jedzenia patroluj if (gracze[id].IloscJedzenia >= startFood / 2) return STANY.PATROL; // Jesli ma mniej niz polowe jedzenia szukaj jedzenia if (gracze[id].IloscJedzenia > 0 && gracze[id].IloscJedzenia < startFood / 2) return STANY.SEARCH; // Jesli nie ma jedzenia umieraj if (gracze[id].IloscJedzenia <= 0) return STANY.DIE; }

    Read the article

  • What is an efficient way to write password cracking algorithm (python)

    - by Luminance
    This problem might be relatively simple, but I'm given two text files. One text file contains all encrypted passwords encrypted via crypt.crypt in python. The other list contains over 400k+ normal dictionary words. The assignment is that given 3 different functions which transform strings from their normal case to all different permutations of capitalizations, transforms a letter to a number (if it looks alike, e.g. G - 6, B - 8), and reverses a string. The thing is that given the 10 - 20 encrypted passwords in the password file, what is the most efficient way to get the fastest running solution in python to run those functions on dictionary word in the words file? It is given that all those words, when transformed in whatever way, will encrypt to a password in the password file. Here is the function which checks if a given string, when encrypted, is the same as the encrypted password passed in: def check_pass(plaintext,encrypted): crypted_pass = crypt.crypt(plaintext,encrypted) if crypted_pass == encrypted: return True else: return False Thanks in advance.

    Read the article

  • Visual Studio Add-in to view open files

    - by pfunk
    I frequently have 10 or more files open in Visual Studio at one time. I am looking for an add-in that will duplicate the functionality of the "Windows" Window, but in a NON-Modal, dockable type window. In other words a window with a list of the files open in the IDE, that I can dock next to the Solution explorer or something, and just click on to switch to that open file (if anyone has ever used Textpad, the Document Selector is exactly what I am talking about). Anyone seen an Add-in like that? Note: I am NOT talking about another Window Layout manager

    Read the article

  • Which WYSIWYM editor to use?

    - by AJ
    I need a WYSIWYM markdown editor for my web application and I heard WMD was the obvious choice. To my surprise WMD breaks in IE8. What other option do I have, or is there a version that's been tested on IE8 and is compatible?

    Read the article

  • Visual Studio 2010 and discovery of advantage server error

    - by Tina Nipe
    I installed VS 2010 on a Windows 7 64 bit machine. When I try and connect to an advantage database through the server explorer using the Advanatage OLEDB driver I get a cannot discover advantage database server error. I can connect to the database using the ARC just fine. I was able to connect in VS 2008 just fine. Any ideas on why I can't connect in VS 2010?

    Read the article

  • How to send an IM in C or C++ on Windows

    - by dave9909
    Specifically I am talking about using AIM and sending instant messages to an existing AIM screename. How would I accomplish this? I am trying to do it the simplest way possible -efficiency is not that important. I thought maybe all I would have to do is open a socket connections some how but I am probably wrong.

    Read the article

  • What is the difference between these two nloglog(n) sorting algorithms? (Andersson et al., 1995 vs.

    - by Yktula
    Swanepoel's comment here lead me to this paper. Then, searching for an implementation in C, I came across this, which referenced another paper on an algorithm described here. Both papers describe integer sorting algorithms that run in O(nloglog(n)) time. What is the difference between the two? Have there been any more recent findings about this topic? Andersson et al., 1995 Han, 2004

    Read the article

  • Access $('selector').data in functions/objects

    - by John
    How do I access values set by $.data() inside a function or object $('#timers').data('firsttimer', 100); //prints 100 document.write($('#timers').data('firsttimer')); function blah(){ //Prints nothing document.write($('#timers').data('firsttimer')); } blah(); See this jsfiddle for easy access to test the code http://jsfiddle.net/JUfd8/

    Read the article

  • LINQ-to-SQL: How can I prevent 'objects you are adding to the designer use a different data connecti

    - by Timothy Khouri
    I am using Visual Studio 2010, and I have a LINQ-to-SQL DBML file that my colleagues and I are using for this project. We have a connection string in the web.config file that the DBML is using. However, when I drag a new table from my "Server Explorer" onto the DBML file... I get presented with a dialog that demands that do one of these two options: Allow visual studio to change the connection string to match the one in my solution explorer. Cancel the operation (meaning, I don't get my table). I don't really care too much about the debate as why the PMs/devs who made this tool didn't allow a third option - "Create the object anyway - don't worry, I'm a developer!" What I am thinking would be a good solution is if I can create a connection in the Server Explorer - WITHOUT A WIZARD. If I can just paste a connection string, that would be awesome! Because then the DBML designer won't freak out on me :O) If anyone knows the answer to this question, or how to do the above, please lemme know!

    Read the article

  • UINavigationController does not set view properties correctly when pushed

    - by Sheehan Alam
    I have a UITabBarControllerDelegate that pushes a new view controller when a certain tab is pressed: - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { MyView* myView = [[[MyView alloc] initWithNibName:@"MyView" bundle:nil]autorelease]; if([self.tabBarController.selectedViewController.title isEqualToString:@"Friends"]){ NSLog(@"Clicked Friends"); myView.reloadFriends = TRUE; [self.navigationController myView animated:YES]; } } However, if I change my code to set the tabbar's selected view controller to myView everything works, but I don't get my navigation bar: if([self.tabBarController.selectedViewController.title isEqualToString:@"Friends"]){ NSLog(@"Clicked Friends"); myView.reloadFriends = TRUE; self.tabBarController.selectedViewController = myView; } How can I set the reloadFriends property in MyView and have the navigation bar at the top?

    Read the article

  • How should I use this SetSPN command when installing SharePoint

    - by Paul Rowland
    In the SharePoint install document I have it says, If you use a domain user account for the SQL Server service account, you must make sure that a valid service principal name (SPN) for that account and instance of SQL Server on their database server exists in their environment. This is the case regardless of whether you use NTLM or Kerberos authentication for Office SharePoint Server 2007. You must configure the SPN for that account in the domain using the Setspn.exe command-line tool. Setspn.exe is installed by default on computers running Windows Server 2008. Run the following command on a computer that is joined to the same domain as the user/service account. setspn -a <http/<farmclusterdnsname> <serviceaccountname> What should the parameters be in this case? I guess the serviceaccountname would be 'domain\username' not sure what the first parameter should be though. This is the technet link for SetSPN.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >