Daily Archives

Articles indexed Thursday April 1 2010

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

  • JQuery: json to object?

    - by user305270
    var gallery = new TGallery([[{"image":{"updated_at":"2010-03-20T00:00:00Z","title":"dfgdfg","spam_reports":0,"by_profile_id":1,"comment_count":0,"id":1,"description":"htt","on_type":"profile","adult_reports":0,"on_id":1,"created_at":"2010-03-20T00:00:00Z"}]]); Then in the TGallery class I would like to convert the json object to a js object. thanks without a plugin if is possible... :)

    Read the article

  • Initializing a property in c#

    - by Shonna
    I have a constructor I am trying to build with the header public KsuPoint(double x0, double y0) now i also have properties in the class as shown below private double x; public double X { get { return x; } } private double y; public double Y { get { return y; } } This constructor is suppose to initialize the properties X and Y ... is this correct? or am i off? public KsuPoint(double x0, double y0) { new KsuPoint(x0, y0); }

    Read the article

  • m2eclipse and WTP and adding local project source

    - by user228369
    Hi, I have a spring mvc project in eclipse, and its setup to use maven. I can resolve all my external dependencies, but now I want to include another local project in my workspace. Normally, I would do this through the java build path, and add a project reference. But if I do that manually, m2eclipse just removes those references from my classpath file. I'm assuming this is because maven wants to handle all dependencies. So I enable dependency management on the local project (the source files i want to include), and now when I add dependencies, this project shows up, and it adds it as a jar type (which is correct). I also ran maven-package to create a snapshot of the source project. But the jar is never added in the maven library list, and the project doesn't build because it can't find the classes. What am I doing wrong? Thanks for the help!

    Read the article

  • install make command without already having make (mac os 10.5)

    - by adam n
    I'm trying to write a script that uses the make command, but Mac os 10.5 doesn't come with make installed by default, and when you download the make source code from gnu's website, you have to use make itself to compile and install it. which is hard if you don't have it in the first place. How can I install make? (I know you can get make by installing Xcode and the developer tools that come with mac os, but I don't want people to have to go find their mac os install dvds to be able to use the script.) It doesn't even have to be make, i'm just looking for a utility that you can easily download in a script (using ftp or curl) and use to compile source code.

    Read the article

  • PHP PDO Related: Update SQL Statement not Updating the content of Database

    - by Rachel
    I am trying to implement update statement using prepared statement in php script but it appears that it is not update record in the database and am not sure why and so would appreciate if you can share some insights. Code $query = "UPDATE DatTable SET DF_PARTY_ID = :party_id, DF_PARTY_CODE = :party_code, DF_CONNECTION_ID = :connection_id WHERE DF_PARTY_ID = ':party_id'"; $stmt = $this->connection->prepare($query); $stmt->bindValue(':party_id', $data[0], PDO::PARAM_INT); $stmt->bindValue(':party_code', $data[1], PDO::PARAM_INT); $stmt->bindValue(':connection_id', $data[2], PDO::PARAM_INT); $stmt->execute(); Inspiring Solution leading to this approach. Any Suggestions ?

    Read the article

  • Enforce numbers in mobile web form

    - by Peter Smit
    I have a simple webform targeted for Opera Mini and Opera Mobile. I'm using just a HTML input element. Now I would like to restrict the element to only have integer numbers. Is there a way to enforce this in this browser (possible even that the phone will have it's number mode on when entering the form)? And if I wanted to allow floats, is something possible then?

    Read the article

  • Wordpress autoformatting

    - by incrediman
    Why is Wordpress autoformatting my html? It keeps breaking my html code by adding <br>'s and <p>'s everywhere. I mean ffs, it even adds them around html comments. And forget javascript - it adds <div> tags around every line. How can I make it stop? Note: I only want to disable this for a specific page, and the issue is only occuring when editing html using the html content editor within the admin panel.

    Read the article

  • why use branches in svn?

    - by ajsie
    i know that you could organize your files according to this structure in svn: trunk branches tags that you copy the trunk to a folder in branches if you want to have a seperate development line. later on you merge this branch back to trunk. but i wonder why me and my group should do this. why should one copy the trunk to a branch and work with this copy just to merge it back to the trunk, and mean while the code is frequently updated/commited to stay in sync with the trunk. why not just work with the trunk then? what is the benefits with creating a branch? would be great if someone could shed a light on this topic. thanks in advance

    Read the article

  • How to integrate KVC in MVC?

    - by Paperflyer
    So I have an MVC-application in Cocoa. There are some custom views, a controller and a model. Of course, the views need to know some stuff, so they get their data from the controller. However, they do not use accessors in the controller, they use KVC with a keypath that calls right through to the model: // In view.m time = [timeSource valueForKeyPath:@"theModel.currentTime"]; // timeSource is a pseudo-delegate of the view that holds the controller This simplifies things a great deal and technically, the views still don't know the model in person (that is, in pointer). But of course, they access it directly. Is that a usual (or at least sensible) usage of KVC and MVC? Or how would you implement this kind of communication?

    Read the article

  • Is this an acceptable UI design decision?

    - by DVK
    OK, while I'm on record as stating that StackExchange UI is pretty much one of the best websites and overall GUIs that I have ever seen as far as usability goes, there's one particular aspect of the trilogy that bugs me. For an example, head on to http://meta.stackoverflow.com . Look at the banner on top (the one that says "reminder -- it's April Fool's Day depending on your time zone!"). Personally, I feel that this is a "make the user do the figuring out work" anti-pattern (whatever it's officially called) - namely, instead of making your app smart enough to only present a certain mode of operations in the conditions when that mode is appropriate, you simply turn on the mode full on and put an explanation to the user of why the mode is on when it should not be (in this particular example, the mode is of course displaying the unicorn gravatars starting with 00:00 in the first timezone, despite the fact that some users still live in March 31st). The Great Recalc was also handled the same way - instead of proactively telling the user "your rep was changed from X to Y" the same nearly invisible banner was displayed on meta. So, the questions are: Is there such an official anti-pattern, and if so,m what the heck do i call it? Do you have any other well-known examples of such design anti-pattern? How would you fix either the SO example I made or you your own example? Is there a pattern of fixing or must it be a case-by-case solution?

    Read the article

  • Windows 7 - SyncToy alternative - Sync folder with Network drive...

    - by alex
    I have a Windows 7 laptop, which i want to back up to a network folder. There is a drive (partition) on my laptop machine that i want to backup to a network drive- if i delete a file in the folder on my laptop, it should also be deleted from the backup... I used to use syncToy, however i understand this does not work correctly with windows 7 - at least not with a large number of files. Are there any alternatives?

    Read the article

  • Why doesn't this method print its text? (java)

    - by David
    here's the method: public static int chooseStrat () { String[] strats = new String[1] ; strats[0] = "0 - Blob" ; int n ; boolean a = false ; while (a == false) ; { System.out.println ("Which strategy should the AI use?(#)") ; printArrayS (strats) ; n = getInt () ; System.out.println ("you selected "+n+"."+" are you sure you want the computer to use the "+ strats[n]+ " ?(Y/N)") ; String c = getIns () ; while ((((!( (c.equals ("y")) || (c.equals ("Y")) )) && (!( (c.equals ("n")) || (c.equals ("N")) ) ) ))) ; { System.out.println ("try again") ; c = getIns () ; } if ( (c.equals ("Y")) || (c.equals ("y")) ) a = true ; } return n ; } When i run this it never prints "Which strategy should the AI use?(#)" it just tries to get an entry from the keyboard. why does it do this?

    Read the article

  • Setting a WebControls TabIndex based on the ControlId of another control

    - by Daniel Ballinger
    I have an ASP.NET Webforms site that is regularly having features added. The majority of time a new WebControl is added to the page and I need to increment the TabIndex to all subsequent controls on the page. I'd prefer a more robust solution than choosing an arbitrary gap between the initial assigned tab indexes. Setting the tab indexes using the designer tab order functionality is one option but I'd prefer to stay in the source view. Ideally, if I had three check boxes I'd like to be able to define the tabindex based off the previous controls tabindex. Then I'd only need to insert the new control and change one existing control. <asp:CheckBox ID="checkBoxA" runat="server" TabIndex="0"/> <asp:CheckBox ID="checkBoxB" runat="server" TabIndexAfterControlId="checkBoxA"/> <asp:CheckBox ID="checkBoxC" runat="server" TabIndexAfterControlId="checkBoxB"/> My first thought was to extend System.Web.UI.WebControls.WebControl with a new property, but extension properties aren't supported.

    Read the article

  • Delphi label and asm weirdness?

    - by egon
    I written an asm function in Delphi 7 but it transforms my code to something else: function f(x: Cardinal): Cardinal; register; label err; asm not eax mov edx,eax shr edx, 1 and eax, edx bsf ecx, eax jz err mov eax, 1 shl eax, cl mov edx, eax add edx, edx or eax, edx ret err: xor eax, eax end; // compiled version f: push ebx // !!! not eax mov edx,eax shr edx, 1 and eax, edx bsf ecx, eax jz +$0e mov eax, 1 shl eax, cl mov edx, eax add edx, edx or eax, edx ret err: xor eax, eax mov eax, ebx // !!! pop ebx // !!! ret // the almost equivalent without asm function f(x: Cardinal): Cardinal; var c: Cardinal; begin x := not x; x := x and x shr 1; if x <> 0 then begin c := bsf(x); // bitscanforward x := 1 shl c; Result := x or (x shl 1) end else Result := 0; end; Why does it generate push ebx and pop ebx? And why does it do mov eax, ebx? It seems that it generates the partial stack frame because of the mov eax, ebx. This simple test generates mov eax, edx but doesn't generate that stack frame: function asmtest(x: Cardinal): Cardinal; register; label err; asm not eax and eax, 1 jz err ret err: xor eax, eax end; // compiled asmtest: not eax and eax, $01 jz +$01 ret xor eax, eax mov eax, edx // !!! ret It seems that it has something to do with the label err. If I remove that I don't get the mov eax, * part. Why does this happen? Made a bug report on Quality Central.

    Read the article

  • How do I change the URL for the wordpress author archive page?

    - by Ben Burleson
    Instead of www.example.com/author/xyz, I want to use www.example.com/artist/xyz. I was hoping it was as easy as copying author.php to artist.php in my theme directory, but no such luck. Where does wordpress handle the special processing for the author archive pages? .htaccess rewriting is another option, but I wasn't able to get anything to work with the existing wordpress rewrite rules. Thanks,

    Read the article

  • kext for 10.4 - 10.6

    - by zaph
    I have a filter scheme driver with four binaries for 10.4 PPC, 10.4 i386, 10.5 & 10.6 i386 and 10.6 x86_64. I need to put them all into one kext. I don't think I can just lipo them together because of the two different i386 binaries. How can I get them all into the same kext bundle?

    Read the article

  • How to check if variable is a CFString?

    - by Sheehan Alam
    I am trying to set some text on a label descriptionLabel.text = [NSString stringWithFormat:mySTUser.bio]; The bio property of mySTUser is an NSString. Sometimes it is not an NSString when I set it. How can I check if mySTUser.bio is an NSString so I can prevent it from being assigned to my label text?

    Read the article

  • Complex SQL Query similar to a z order problem

    - by AaronLS
    I have a complex SQL problem in MS SQL Server, and in drawing on a piece of paper I realized that I could think of it as a single bar filled with rectangles, each rectangle having segments with different Z orders. In reality it has nothing to do with z order or graphics at all, but more to do with some complex business rules that would be difficult to explain. Howoever, if anyone has ideas on how to solve the below that will give me my solution. I have the following data: ObjectID, PercentOfBar, ZOrder (where smaller is closer) A, 100, 6 B, 50, 5 B, 50, 4 C, 30, 3 C, 70, 6 The result of my query that I want is this, in any order: PercentOfBar, ZOrder 50, 5 20, 4 30, 3 Think of it like this, if I drew rectangle A, it would fill 100% of the bar and have a z order of 6. 66666666666 AAAAAAAAAAA If I then layed out rectangle B, consisting of two segments, both segments would cover up rectangle A resulting in the following rendering: 4444455555 BBBBBBBBBB As a rule of thumb, for a given rectangle, it's segments should be layed out such that the highest z order is to the right of the lower Z orders. Finally rectangle C would cover up only portions of Rectangle B with it's 30% segment that is z order 3, which would be on the left. You can hopefully see how the is represented in the output dataset I listed above: 3334455555 CCCBBBBBBB Now to make things more complicated I actually have a 4th column such that this grouping occurs for each key: Input: SomeKey, ObjectID, PercentOfBar, ZOrder (where smaller is closer) X, A, 100, 6 X, B, 50, 5 X, B, 50, 4 X, C, 30, 3 X, C, 70, 6 Y, A, 100, 6 Z, B, 50, 2 Z, B, 50, 6 Z, C, 100, 5 Output: SomeKey, PercentOfBar, ZOrder X, 50, 5 X, 20, 4 X, 30, 3 Y, 100, 6 Z, 50, 2 Z, 50, 5 Notice in the output, the PercentOfBar for each SomeKey would add up to 100%. This is one I know I'm going to be thinking about when I go to bed tonight. Just to be explicit and have a question: What would be a query that would produce the results described above?

    Read the article

  • What is the correct Qt idiom for exposing signals/slots of contained widgets?

    - by Tyler McHenry
    Suppose I have a MyWidget which contains a MySubWidget, e.g. a custom widget that contains a text field or something. I want other classes to be able to connect to signals and slots exposed by the contained MySubWidget instance. Is the conventional way to do this: Expose a pointer to the MySubWidget instance through a subWidget() method in MyWidget Duplicate the signals and slots of MySubWidget in the MyWidget class and write "forwarding" code Something else? Choice 1 seems like the least code, but it also sort of breaks encapsulation, since now other classes know what the contained widgets of MyWidget are and might become dependent on their functionality. Choice 2 seems like it keeps encapsulation, but it's a lot of seemingly redundant and potentially convoluted code that kind of messes up the elegance of the whole signals and slots system. What is normally done in this situation?

    Read the article

  • Alternative for my preg_replace code

    - by Ben Sinclair
    Here is my code... basically it finds any page-NUMBER- within a variable and then replaces it with a page url from an array $content_text = preg_replace("/page-(\d+)-/sie", '$pageurl[$1]', $content_text); It works a treat until the NUMBER it finds isn't in the array and it returns an error... Is there another efficient way I could do this instead? I liked my code above because it was simple but I may have to use more complex code...

    Read the article

  • Rounded Rect UIButton without the border

    - by Dave DeLong
    I'm trying to draw a normal rounded rect UIButton, but without the border. Ideally I'd like to be able to change some setting on the UIButton to disable the border. My problem is that if I change the button type to "custom", I don't get the nice blue selection gradient (which I want to keep), and I have no idea how to draw it manually.

    Read the article

  • Why do I get garbage output when printing an int[]?

    - by Kat
    My program is suppose to count the occurrence of each character in a file ignoring upper and lower case. The method I wrote is: public int[] getCharTimes(File textFile) throws FileNotFoundException { Scanner inFile = new Scanner(textFile); int[] lower = new int[26]; char current; int other = 0; while(inFile.hasNext()){ String line = inFile.nextLine(); String line2 = line.toLowerCase(); for (int ch = 0; ch < line2.length(); ch++) { current = line2.charAt(ch); if(current >= 'a' && current <= 'z') lower[current-'a']++; else other++; } } return lower; } And is printed out using: for(int letter = 0; letter < 26; letter++) { System.out.print((char) (letter + 'a')); System.out.println(": " + ts.getCharTimes(file)); } Where ts is a TextStatistic object created earlier in my main method. However when I run my program, instead of printing out the number of how often the character occurs it prints: a: [I@f84386 b: [I@1194a4e c: [I@15d56d5 d: [I@efd552 e: [I@19dfbff f: [I@10b4b2f And I don't know what I'm doing wrong.

    Read the article

  • Issue on file existence in C

    - by darkie15
    Hi All, Here is my code which checks if the file exists : #include<stdio.h> #include<zlib.h> #include<unistd.h> #include<string.h> int main(int argc, char *argv[]) { char *path=NULL; FILE *file = NULL; char *fileSeparator = "/"; size_t size=100; int index ; printf("\nArgument count is = %d", argc); if (argc <= 1) { printf("\nUsage: ./output filename1 filename2 ..."); printf("\n The program will display human readable information about the PNG file provided"); } else if (argc > 1) { for (index = 1; index < argc;index++) { path = getcwd(path, size); strcat(path, fileSeparator); printf("\n File name entered is = %s", argv[index]); strcat(path,argv[index]); printf("\n The complete path of the file name is = %s", path); if (access(path, F_OK) != -1) { printf("File does exist"); } else { printf("File does not exist"); } path=NULL; } } return 0; } On running the command ./output test.txt test2.txt The output is: $ ./output test.txt test2.txt Argument count is = 3 File name entered is = test.txt The complete path of the file name is = /home/welcomeuser/test.txt File does not exist File name entered is = test2.txt The complete path of the file name is = /home/welcomeuser/test2.txt File does not exist Now test.txt does exist on the system: $ ls assignment.c output.exe output.exe.stackdump test.txt and yet test.txt is shown as a file not existing. Please help me understand the issue here. Also, please feel free to post any suggestions to improve the code/avoid a bug. Regards, darkie

    Read the article

  • dotnet Cologne 2010

    - by WeigeltRo
    Am 28.5 findet in Köln die dotnet Cologne 2010 statt, eine von der .NET User Group Köln und der von mir geleiteten Gruppe Bonn-to-Code.Net gemeinsam organisierten Konferenz zum Launch von Visual Studio 2010 und .NET Framework 4. Die Registrierung ist seit Anfang März möglich, und obwohl es bisher kaum konkrete Details zu den Sprechern und Vorträgen gab, haben sich bereits über 250 Teilnehmer angemeldet. Das zeugt von hervorragender Mund-zu-Mund-Propaganda, nicht zuletzt ein klares Zeichen für den Erfolg der letztjährigen dotnet Cologne 2009. Hinter den Kulissen brach ein wahrer Sturm von Vortragsvorschlägen über das Orga-Team (bestehend aus Stefan Lange, Albert Weinert und mir) herein. In mehreren Runden versuchten wir, die richtige Mischung zwischen einführenden und tiefgehenden Themen zu finden. Dabei wurde schnell klar, dass wir nicht mit den ursprünglich geplanten drei Tracks auskommen würden. Deshalb haben wir nach reiflicher Überlegung einen vierten Track eingerichtet, darüber hinaus bieten wir - nach dem Vorbild anderer Konferenzen - dieses Jahr auch Lunch-Sessions an. Seit heute steht nun ein Großteil der Vorträge offiziell fest, nur noch einige wenige Slots sind noch frei. Wer bisher mit der Anmeldung gezögert hat, sollte schnell einen Blick hineinwerfen und sich entscheiden. Denn ab einer der Marke von 300 Teilnehmern wird eine Warteliste eingerichtet. Zwar werden erfahrungsgemäß später einige Plätze wieder frei, aber wer ganz sicher einen Platz bei der dotnet Cologne 2010 haben möchte, sollte sich bald anmelden. Denn: Ein ganzer Tag vollgepackt mit Informationen, viele bekannte Namen der deutschen .NET-Community nicht nur auf der Sprecherliste-, sondern auch unter den Teilnehmern – und am Abend dann noch die Grillfete des dotnet Forum. Wer da nicht dabei ist, der wird wird echt etwas verpassen…

    Read the article

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