When log shows a lot of Garbage Collection hits, what code change shall we need?
Do we need to free some objects?
Will we speed up the code with object reusal?
I could spike this to find out, but I'm going to use SO. In my unit tests (qunit) I use the asynchShould (alias for asynchTest) test. Part of the assertion is to wait for the completion/success of the request. Like this:
asyncShould('talk to customer list server', 1, function() {
stop(2000);
var forCustomerList = newCustomerListRequest();
forCustomerList.page = 'helpers/helper.php';
forCustomerList.data += '&action=customerListServer&DB=11001';
var originalSuccess = forCustomerList.success;
forCustomerList.success = function(msg) {
if (msg.flash !== undefined && msg.data !== undefined && msg.status !== undefined) {
ok(true, 'json structure correct')
}
else {
ok(false, 'json structure not correct');
}
originalSuccess(msg);
start();
};
testController.getServerData(forCustomerList);
})
I used to see any .net source code (like System.String) with ReSharper and Visual Studio 2008. since I migrated to Visual studio 2010, this option doesn't give the full source code but just the definitions of the class.
How can I fix this, to use the microsoft's symbols server again?
In order to fully understand and take advantage of the new features and enhancements provided with the coming of the new .NET Framework 4.0, I would like to get an example of real-world application of the Code Contracts.
Anyone has a good example of application of this feature?
I would like to get a code sample with a brief explanation to help me get up and running with it.
Thanks! =)
Two divs are next to eachother, both floating left within a wrapper. In IE and firefox they appear correctly, but in Chrome, the 2nd floating div clears down below Div A. When I remove "float:left" in the css, it goes to the correct position in Chrome, but clears down in IE and firefox (as it should). I dont know why it is appearing this way in Chrome. Any ideas?
friends,
i want to set android:layout_centerVertical="true" property of layout
through java code of an image.
can any one guide me how to achieve this. here is my code.
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
params.height = (int)totalHeight;
img.setLayoutParams(params);
i have tried using setScaleType(ScaleType.FIT_CENTER) but no use.
any help would be appriciated.
I am going to development a product related to security. It's my personal belief that any security related product should release it's source code for review. However, I also want to sell it as a commercial product and keep the code ownership to myself and don't expect deviated work.
Is there a software license for this purpose? Thanks.
I have an Objective-C iPad app I want to build an opaque static library from so I can give it to testers using X-code to test without giving them the source code. How can I do this?
I've had a big problem in some library code, which I've pinned down to a single statement:
System.out.println((String) null);
Ok, the code doesn't actually look like that, but it certainly calls println with a null argument. Doing this causes my whole applicaio to throw an unexpected NullPointerException.
In general, should println throw this exception under that circumstance, or is this non-standard behavior due to a poor implementation of the out instance?
I am implementing a function to recursively reverse a linked-list, but getting seg-fault.
typedef struct _node {
int data;
struct _node *next;
} Node, *NodeP;
NodeP recursiveReverseList(NodeP first){
if(first == NULL) return NULL;
if(first->next == NULL) return first;
NodeP rest = recursiveReverseList(first->next);
rest->next = first;
first->next = NULL;
return first;
}
Can you please help?
P.S. The iterative version is working fine though. Its not homework. Just practicing C.
Thank you all :)
Hi
I have a grouped table with two sections where I display text with different length and therefore cell height.
I have solved the problem with the different length/height with constrainedToSize in cellForRowAtIndexPath.
Now I want to add a section with one single row in which I want to show a picture.
How should I best implement that? (still a bit of a beginner with the Objective C)
I would guess that I would have to create an UIImageView and somehow link that to the cell, but my biggest concern is how do I do with the dequeueReusableCellWithIdentifier now that I will have two different type of cells?
Appreciate any advice that will help me save time from trial and error!
I was wondering what happens to the code contained in an <mx:Script> tag. If I define a function tehre, it just becomes a member function of the generated class. But I noticed that it seems OK for the compiler if I just write some (static) method calls there (specifically, I call Font.registerFont()). I feel kind of guilty for doing this, because I have no idea what's really happening and when the code gets executed.
Real Example.
I have a closed source server-side program for "internal purposes only" (no distribution or selling).
I want to use "MYSQL C++ Connector" in my server application in my VPS (MYSQL C++ Connector is GPL).
Do I have to make my application "GPL" and distribute my source code?
Can I use the GPL Source Code in my closed source application. (There is no distribution or selling of my application — it is for internal purposes only.)
I want to get better at JQuery, but I don't know what type of application I should make to test my skills. What would you suggest that would not be too hard so I would get frustrated as a beginner.
Any help is appreciated.
Thanks!
(sorry if I sound like a noob, by the way =P)
I would like to customize my layout definition (declared in my_layout.xml file) from code.
Unfortunately I can use findViewById() function to find the specific views (defined in my_layout.xml file) and customize them from code only after I called setContentView(R.layout.my_layout).
But what if I want to customize my layout first, before calling setContentView()? How can I access the specific views before calling setContentView()?
I have a column of states, and, depending on the query, I want to order by results by a particular state, then by id (Asc or Desc, depending). For instance, I might want to show all rows with state "HI", sorted by ID desc, and then all the other rows, sorted by id desc.
I was hoping I could do this in one query, rather than getting all my favored state results, and then getting the rest. Can I?
This questions concerns mostly Unix/Linux style C++ development. I see that many C++ libraries store their header files in a "include" folder and source files in an "src" folder. For the sake of conformance I adopted this in my own code. But it is not clear to me whether this should be done for application code as well. I've seen a few cases where a flat directory structure is used for that. What would be the recommended approach?
I am using exec() inside a a script that runs as a daemon and forks child processes using the pear class Net_Server.
I am getting a strange issue whereby the return code (the third param of of exec) comes back as -1. When I run the command on the command line, or with exec in a normal php script the return code is 0 as it should be. Anyone have any idea why this is happening, and how to fix it?
Is there a static code analyzer for PHP files? The binary itself can check for syntax errors, but I'm looking for something that does more, like unused variable assignments, arrays that are assigned into without being initialized first, and possibly code style warnings. Open-source programs would be preferred, but we might convince the company to pay for something if it's highly recommended.
hi
im looking at some external code and saw a line of ruby code that looks like this
string_name = string_name[3..-1]
what does the [n..-x] do or mean?
thanks
Hi all,
Somehow the following code is very slow on another server, on my own server it works ok
http://www.bldd.nl/stackoverflow/test.php
How should i optimize this code??
Kind regards
Hey,
what i read on several help-pages, was, that getting jquery code completion to work, was just:
getting targeted browsers right (the
only one i choose was firefox 3.x or
later)
putting jquery file into project (it
is now visible in "source files")
adding the "script type"etc.-line (tried filename with and without / before )
Did this... but still no code completion. Any ideas? Got windows 7 and netbeans 7, 32bit system.
Wtf is wrong? :(
http://www.loaditup.de/files/615138.png
For example: I want to accept or reject a photo.
The input button for accept and the form is:
<form method="post" action="viewRequests.php">
<input type="submit" onClick="showAlertBox()">
</form>
showAlertBox() is a javascript function which shows a confirmation dialog with Yes or No. If I choose No then the form submission should not be triggered.
what to do in this case
I will probably start with C and then Lisp. Although I started programming in C, I did not program in it as much as I want. It's fun working with the low level stuff. Learning C helped me a lot when I started working. I've only started learning Lisp now and I found it amazing that the concepts it supported from the very start are still very relevant today. Well I think it's better late than never.
Possible Duplicates:
Whats the worst piece of code you have come across?
Examples of some of the worst code you’ve had to manage?
This mess reminded of some of the stuff I've had to work on. I was wondering if anyone else had nasty refactoring war stories and especially if you found unique or helpful solutions.