[Solved] constant parameters in a function [closed]

Applying the const modifier to a parameter indicates that the parameter may not be changed by the function. It does not mean, though, that if the parameter’s value is assigned to another variable then that variable can’t be changed. The purpose is to assure callers that data they pass to the method will not be … Read more

[Solved] Ruby on Rails variables, object attributes, and methods that use a : before or after them

:symbol {key: value} When the colon is before the variable / object, it denotes a “symbol”, meaning a piece of data to be placed there. The symbol can typically be used in the likes of calling an attribute (key) or in part of a hash: @user.comment[:created_at] When the colon is after the variable / object, … Read more

[Solved] null pointer exception in java servlet [closed]

I got a “null pointer exception” fault in java servlet. Could someone tell me what happens? And how to avoid that? That happens when you’re trying to access/invoke some reference which is actually null. SomeObject someObject = null; someObject.doSomething(); // Throws NullPointerException. You need to make sure that you only access/invoke it when it is … Read more

[Solved] spin the pin game – iphone sdk [closed]

Please read http://www.raywenderlich.com He has taken a lot of care in creating a great valuable resource for learning iPhone development, animation in particular. You’ll be ready in no time 😀 In a nutshell, there are three ways you can do this. use Cocos2D Use CoreAnimation Use UIView’s animation methods, but I’d favor the other two … Read more

[Solved] How can I take an integer input from user and store it to an array? [closed]

Try changing the last line to: print str(number) This will change the list into a printable string representation. If you want to learn more about strings and formatting, check out Chapter 7 of the Python Tutorial. Actually, the whole tutorial is pretty awesome. 🙂 EDIT: David is correct in his comment below…print converts lists to … Read more

[Solved] alert with background mask by jquery.? [closed]

On the demo you have custom built solution with a lot of options. Without using any plugins or custom scripts – you will not be able to customize alert dialog. very, very simple sample: .alert { width:200px; height:80px; margin:-40px 0 0 -100px; position:absolute; left:50%; top:50%; background:red; text-align:center; } $(‘#btnAlert’).click(function () { var $alertDiv = $(‘<div … Read more

[Solved] Autocomplete textbox with hyperlink

Let me give a snippet of code that i use function updateAutoSrch() { $(“#searchpro”).autocomplete({ source: function( request, response ) { $.ajax({ url: “search”, data: {proname: proname}, dataType: “json”, success: function( data ) { response( $.map( data, function( item ) { return { label: item.user_name, value: item.user_name, userid: item.user_id, profile_image_path: item.profile_image_path } })); } }); } … Read more

[Solved] LINQ: Howto get person count by personid [closed]

Max : var biggestGrpOfPeopleHavingSamePersonId = people.GroupBy(x => x.personid).Max(x => x.Count()); Top : var top3peopleGroups = people.GroupBy(x => x.personid).OrderByDescending(x => x.Count()).Take(3); EDIT : The first query returns an element of type IGrouping<TKey,TValue> where TKey is of the same type of personid and TValue is of type Person. The second query returns an IEnumerable<> of objects like … Read more

[Solved] How does this select in MongoDB [closed]

db.rendaxeducacao.aggregate([ {$math : {idh : 2000} // fiter only where idh=2000 }, {$group: { _id: 1, max_idheducacao : {$max : $idheducacao} // find max } }, {$project:{ // select cidade _id:0, cidade:1 } } ]) rendaxeducacao = collection solved How does this select in MongoDB [closed]

[Solved] Asp.net: Sorting with gridview and objectDataSource [closed]

Here is a question that has been previously answered. For the actual sorting, you would call collectionOfObjects.OrderBy(x => x.PropertyToSortOn); You could use a switch to change what to sort on based on what is passed into the method via the args. So it would look a little more like this switch(propertyName) { case “property1”: collectionOfObjects.OrderBy(x … Read more