instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
EDIT: Updated code with new Pastebin link but it's still stopping at the info->citizens[x]->name while loop. Added realloc to loops and tidied up the code. Any more comments would be greatly appreciated
I'm having a few problems with memory allocation overflowing
http://pastebin.com/vukRGkq9 (v2)
No matter what I try, ... | stackexchange/codereview |
I've had a user send me an email to ask if I can make some modifications to my application so that it is more friendly to blind people.
Although he's explained the problems that he is having, I really have no idea on how to approach this. I can't find any guidelines from Apple. Is there any information available, or d... | stackexchange/codereview |
I am stuck with this problem and not getting any idea about this.?
I do have some images in the application, and I want to insert some text in to that images which I take as input from the user?
I don't have any idea how to accomplish this task? Is it possible or not.
Basic Idea is : I do have images in to the applicat... | stackexchange/codereview |
I'm an absolute beginner to programming and i'm just doing some exercises exercises for the beginning.
First of all, i'm using Visual C++ 2010 to compile C-Code. I just create a new project and choose an empty console application. After that, I create a ressource file named test.c and change in the file properties the... | stackexchange/codereview |
Is it possible to share admin area (having admin controllers,modules and views) among multiple projects. I want to design admin module having common functionality like admin user-role management, modules management etc. that will be shared with multiple projects. There can be possibility one of project may hold custom ... | stackexchange/codereview |
In a popup window, I create a string dynamically which represents a function existing in the window.opener
e.g. funcstring = 'getProductListings("user_id",true)';
This is one of several possible functions that could be created dynamically, so I can't just hardcode it into the window.opener function call.
Then I want to... | stackexchange/codereview |
I ended up with a detached head today, the same problem as described in: git push says everything up-to-date even though I have local changes
As far as I know I didn't do anything out of the ordinary, just commits and pushes from my local repo.
So how did I end up with a detached HEAD?
| stackexchange/codereview |
In magento, after rebuilding programmatically the flat product catalog with the script I found at http://www.magentocommerce.com/boards/viewthread/43238/ I keep getting the error exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.display_price_group_0' in 'fi... | stackexchange/codereview |
Does anyone know how to make multiple layouts in refinery? It doesn't have to be in the user admin I just need to be able to programmatically tell some refinery pages to use one layout and others to use a different one.
thanks.
| stackexchange/codereview |
I am using AlphaImageLoader to display my transparent PNG in IE6. The HTML is,
<div id="infoBox">
<a href="links.html">Links</a>
</div>
The CSS is,
#infoBox
{
background:url('/images/bg.png') !important;
background:;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src='/ima... | stackexchange/codereview |
what is the purpose of command name and command argument for a control example button? when should we go for this?
| stackexchange/codereview |
For a CS class I need to solve an assigned problem using three data structures: Queue, PriorityQueue, and Stack. I wanted to write a single solution to the problem using an abstract data structure. I would implement the ADT with a wrapper class of each required data type. This is what I have so far:
An interface call... | stackexchange/codereview |
I am not experienced in Ruby, so my code feels "ugly" and not idiomatic:
def logged_in?
!user.nil?
end
I'd rather have something like
def logged_in?
user.not_nil?
end
But cannot find such a method that opposites nil?
| stackexchange/codereview |
Is it possible to be notified if a user selects cancel button from the printing prompt in IE ? Basically I want a print-cancelled kind of notification.
I read somewhere that IOlecommandtarget interface can be used to be notified for our own controls, but can the same be used for system controls like print ? Can anyone ... | stackexchange/codereview |
I'm working on a (rather horrible) project that involves importing a C++ class hierarchy through a dll interface. One of the more horrible details requires me know the 'decorated' names for the various class elements that are exposed - mostly member functions and static data.
There are many ways to achieve this - the ... | stackexchange/codereview |
const char *Greet(const char *c) {
string name;
if(c)
name = c;
if (name.empty())
return "Hello, Unknown";
return name.c_str();
}
int _tmain(int argc, _TCHAR* argv[])
{
cout << Greet(0) << '\t' << Greet("Hello, World") << endl;
return 0;
}
I see 2 bugs with the above code.
Ret... | stackexchange/codereview |
I am getting file list in my Java program using list() method of File class. When I run my program on Knoppix I get ???? instead of Cyrillic file names. It seems that problem is in knoppix, not java. I tried to use options for mounting file system, such as nls and iocharset, but it has no effect (or may be I use it in ... | stackexchange/codereview |
I have a page that has a form using this ajaxForm jQuery plugin. The form submits, and when it's complete, there is a call using $.get() to load some new content to the page.
My problem is, the Googlebot "appears" to be indexing the url in the $.get() method.
My first question is, is that even possible? I was under th... | stackexchange/codereview |
So this is the dumbest thing I've struggled with in awhile. I cannot get the state of a simple radio button set to toggle something on the page.
<label for="completeSw"><span>Completed?</span></label>
<input type="radio" id="completeSw" name="completeSw" value="1"/>Yes
<input type="radio" id="completeSw" name="complete... | stackexchange/codereview |
In C there is a switch construct which enables one to execute different conditional branches of code based on an test integer value, e.g.,
int a;
/* Read the value of "a" from some source, e.g. user input */
switch (a) {
case 100:
// Code
break;
case 200:
// Code
break;
default:
// Code
br... | stackexchange/codereview |
I am very new in jquery and json.i know jsp and java
in my project job i have to implement a data grid same like shows in http://www.trirand.com/blog/jqgrid/jqgrid.html#
i this example site i need a datagrid using Json object.
i explore all in internet but i cant find any help of that.
please provide me an example with... | stackexchange/codereview |
In my database has column names such as 'delete' or 'listen-control' and so on. These cannot be changed, so I would like to alias the names so as to avoid problems in my application.
I found the following code but it is outdated (05 Aug 2005) and doesn't work with Rails 3:
module Legacy
def self.append_features(base)... | stackexchange/codereview |
I have always used this code to sort items in a list then submit the order back into the database.
But the code doesn't work in Firefox, or Chrome. It jumps and then clears out the contents of the list. It's been used since 2002 works very fine in IE only..
var list;
function moveUp() {
list = document.forms[0].li... | stackexchange/codereview |
I've recently built a webapp using jQTouch & packaged in PhoneGap (both latest versions). I'm now attempting to optimise the app, and was hoping to get some information on how to correctly setup the of the document.
Currently I simply have the jQTouch javascript (no phonegap.js), and it seems to package and run ok on... | stackexchange/codereview |
I am new in Hibernate.when i save particular entity then it rewrite data from existing one.
I have used ID as auto generated as below:
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="id")
private int id;
Here i save Entity as below:
class StudDAO() {
public static void main(String[] args){
StudDA... | stackexchange/codereview |
in VBA I assign variables with values retreived from a recordset like this:
variable1 = rs("column1")
variable2 = rs("column2")
Can I do the same in C#?
| stackexchange/codereview |
Here is the code for the table:
<table align="center" width="303" height="740" border="1" cellpadding="10">
<tr>
<th width="130" height="41" scope="col">URL1 - Normal</th>
<th width="121" scope="col">URL2 - Hover</th>
</tr>
<tr>
<td height="94"><img src="http://i1018.photobucket.com/albums/af309/5416... | stackexchange/codereview |
Possible Duplicate:
Quickly reading very large tables as dataframes in R
Hi,
trying to read a large dataset in R the console displayed the follwing errors:
data<-read.csv("UserDailyStats.csv", sep=",", header=T, na.strings="-", stringsAsFactors=FALSE)
> data = data[complete.cases(data),]
> dataset<-data.frame(user_i... | stackexchange/codereview |
We have a push based web-application. Recently, we planned to make an iPhone app for it. Much like Facebook has it's iPhone application as well as web presence. We are looking for a UI framework that can get us going quickly. I've leafed through PhoneGap and couple other JS based UI frameworks mentioned here. I am bit ... | stackexchange/codereview |
why can't I get this code here to work? I want to call this on a byte array that was previously compressed....anyway, it just returns an empty string...
public static string FromGZipToString( this byte[] source )
{
using( MemoryStream stream = new MemoryStream( ) )
{
stream.Write( so... | stackexchange/codereview |
Does anyone know of a gem/plugin for rails which can be used to manage bibliography or publication references? This tends to be quite standard format, so I am hoping there is something out there?
thanks
| stackexchange/codereview |
I am using libstdc++ on MAC for developing extensions for firefox. I am getting crashes inside libstdc+ library when I am referring to it across multiple firefox extensions. I was thinking whether libstdc++ for XCode compiler is reentrant or not. If not, is there any version of libstdc++ is available with is reentrant ... | stackexchange/codereview |
In eclipse, how do I add the debugging buttons: step, continue, and pause buttons to the toolbar of the java perspective? When I right click to customize perspective I don't see where I could add those buttons.
CLARIFICATION: I'd like to add these buttons directly to my java perspective if I can, I don't like switchin... | stackexchange/codereview |
I have a header file which has the html <head> tag in it. I'm trying to set the <base href="/mysite/"> in this file, but when I include it (such as into my index.php file), it doesn't actually change my base href. Any absolute URLs in index.php (e.g. /css/style.css) try to load from host/css/style.css rather than hosth... | stackexchange/codereview |
I have a Cmd console set up to auto-complete card names for a Magic: the Gathering collection management system.
It uses the text parameter to query the database for cards, and uses the results to auto-complete/suggest cards.
However, these cards names have multiple words, and Cmd runs auto-completion from the last spa... | stackexchange/codereview |
I'm trying to use the new GWT CellTable widget but my table needs to support one row expansion, i.e. there is a zippy on the left of a row and when it's clicked, the row should expand to provide more detail information and this row should span across all columns. Is it possible to achieve this with the CellTable? How d... | stackexchange/codereview |
I am running Android 2.2 on a netbook (Android x86).
The keyboard shortcut, Alt + F7 doesn't lead me back to graphics screen (GUI) from the console.
Does anyone know any alternative to this shortcut?
| stackexchange/codereview |
I have a table which contains two type of data, either for Company or Employee.
Identifying that data by either 'C' or 'E' & a column storing primary key of it.
So how can I give foreign key depending on data contained & maintain referential integrity dynamically.
id | referenceid | documenttype
---------------------... | stackexchange/codereview |
I need to update on of my splitView's from a modalView, but I am not having any luck.
for instance: From my rootView (which is a UITableVIewController) if I set an option to hide a certain section from the rootView table in my ModalView, when I dismiss the modalview, the setting doesnt take affect on screen for the tab... | stackexchange/codereview |
I'm starting to learn MongoDB, using the NoRM C# driver in an ASP.NET MVC project. I'm just writing POCO classes right now, and have question on how to implement relationships between Blog Posts, Comments, and Tags. I think I have the Post & Comment, but not sure what to do on the Tags. In SQL, they are many-to-many re... | stackexchange/codereview |
So I have a SharePoint feature definition that deploys page layouts to a publishing site. The definition looks something like this:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Page Layouts" Url="_catalogs/masterpage" RootWebOnly="True">
<File Path="Page Layouts\layout1.aspx" Url="lay... | stackexchange/codereview |
I am trying to get the resolution of a JPEG image without decoding the file. I got several samples from internet but none is working properly. It seems to be this way because many JPEG files are not standard, though any graphic application (Irfan, PSP, Firefox etc) can open them.
The header of a JPEG was supposed to be... | stackexchange/codereview |
With Jquery is there a way to highlight/select(like if someone were to select it with the mouse) the text inside of a div that i click on? not a textbox, just a normal div.
i'm trying to make a 'short url' box, where when someone clicks on the textarea, it highlights all the text, but it also needs to NOT allow people ... | stackexchange/codereview |
In an asp.net web service (asmx), how do I hide the error messages that are sent to the client when it doesn't send the proper parameter: "Missing parameter: parameterName."?
In the web.config I have a custom error page setup that works in actual errors, but this doesn't appear to effect the web service parameter valid... | stackexchange/codereview |
I have a simple Bluetooth app on android that connects to a device using RFCOMM. On the first connection, the device needs to be paired. Android does this by adding a "Bluetooth pairing request" notification which the user then needs to click on by first pulling down the notification area.
I know this is "standard" A... | stackexchange/codereview |
I am writing a web application in which I am using jQuery.ajax() for HTTP GET, POST, PUT operations. In blackberry mobile browser, this is not working and giving the following error.
Error:
NETWORK_ERROR: XMLHttpRequest Exception 101
In iphone browser, this is working fine. Can any one help me out in solving this.
T... | stackexchange/codereview |
Greetings,
I need to make action in other (not mine) application. Lets say, Photoshop toolbar. Is there any way to click any button of Photoshop's toolbar from my cocoa application?
...
I found:
- NSRunningApplication
- Accessibility API
- Quartz Events
- ...and this
But it's still not enought. Any idea? Any soluti... | stackexchange/codereview |
My coworker is trying to register some COM components (which I wrote) via RegAsm.exe and it says he needs Administrator privileges. His account has admin privileges but he is not logged in as Administrator. Is there a way to use his regular user account and succeed at this task?
| stackexchange/codereview |
this is what i have:
MediaPlayer.Play(DataFile.AllMusicTitles[0].SongFile);
System.Threading.Thread.Sleep(3000);
MediaPlayer.Play(DataFile.AllMusicTitles[1].SongFile);
System.Threading.Thread.Sleep(3000);
MediaPlayer.Play(DataFile.AllMusicTitles[0].SongFile);
play s0, sleep, play s1, sleep, then play s0, then... | stackexchange/codereview |
I want to verify the correctness of a soft link in svn. But I don't want to checkout. Is there any method? I try "svn ls", but it cannot give information about soft link.
| stackexchange/codereview |
I need to iterate the fields and compute sum of few columns group by the value in another column .
For ex base table is
C1 C2 C3 C4 C5
a1 2 3 4 q
a1 4 5 7 a
a2 34 56 6 e
a2 4 5 5 5
a3 3 3 3 4
a3 3 3 3 3
The result table should be
c2 c3 c4
a1 6 8 11
a2 38 61 11
a3 6 6 6
50 75 28
I... | stackexchange/codereview |
I'm building a PHP library that throws various custom Exceptions when it encounters errors. I need to log those exceptions and provide various implementations of the Logger so they could be logged in a file or a database.
The exceptions need to be logged whether they are caught or not, so that excludes implementing any... | stackexchange/codereview |
How do I draw a background image with round corners and a shadow on a BlackBerry?
| stackexchange/codereview |
I would like to add a "preview" stripe to a site.
I like what blogger does when you click to preview editing a post (Anteprima means preview in italian)
Do you know how to make it as a layer in order to plug it without modifying the main html code of my site?
| stackexchange/codereview |
We have variable $menu with HTML inside (there is no loop, it comes from a function).
On echo it gives the code like this:
<ul id="menu">
<li id="some-id" class="many classes"><a title="one" href="#">text</a></li>
<li id="some-id" class="many classes"><a href="#">text</a></li>
<li id="some-id" class="many c... | stackexchange/codereview |
I have a solution composed of a web application and multiple projects, is it possible to share the configuration in the web application across all the solution?
Thanks
| stackexchange/codereview |
When I try to compile my code where ann is an annotation, coordinate is a 2d coordinate, and latit is a float
ann.coordinate.latitude = latit;
I get an error message saying Ivalue required as left operand of assignment. What does this error mean and why is it showing up?
| stackexchange/codereview |
I am not very good with sqls and I am trying to understand an sql statement which I haven't seen before. We're using Oracle and the IBatis framework so this might be specific to one of those. I am not really sure.
SELECT
....
,....
,....
, PKG_LABEL.GET_LABEL_NAME('UOM',T100.CASE_DIM_UOM_CODE) AS caseDimensionsUOM
,... | stackexchange/codereview |
I'm trying to wrap up a custom authentication system for internal use for a project I'm working on in MVC.
We currently have a partner that hosts an external site with forms authentication. Certain sections of this site redirect to a section on our internal site. Passed along with this redirection is an id and a se... | stackexchange/codereview |
l = $("#chat > div.monologue:last div.message:not(.pending):last");
| stackexchange/codereview |
I want to convert a lambda expression referencing a property or sub-property of an object, e.g. x => x.Address.City into a string Address.City. Is there an existing framework method (MVC, EF, ...?) that does this or do I need to roll my own? If the latter, any code out there already that does this?
| stackexchange/codereview |
I added a table to a database that my application uses and wrote some code to work with that table. Everything worked fine for my on my phone and in the emulator, so I sent the update to the market.
This cause me to receive quite a few stack traces in the developers console cause by
android.database.sqlite.SQLiteExcept... | stackexchange/codereview |
Is there a web site that can verify your web pages. Specifically, let's say you created a web page on Monday and you want your users to be assured that when they view the same page on Tuesday, that it's the same page that was posted on Mondya (without any modifications).
Thank you.
| stackexchange/codereview |
This might be the wrong way of doing things, but I pass an array from LabView into my C++ function as a simple array of char. I then create an OpenCV image and point the pointer to my data that was passed. At the end of the function I use cvReleaseImage to delete all the OpenCV images, would that remove the data off my... | stackexchange/codereview |
I'm exporting data to a csv file using Asp.net and I need to know from the System.Globalization.CultureInfo.CurrentCulture if I should use "," or ";" as a value separator. For example US needs "," and Europe needs ";". How can I find out which one to use from the CurrentCulture?
Thanks!
| stackexchange/codereview |
I want to process some HTML code and remove the tags as in the example:
"<p><b>This</b> is a very interesting paragraph.</p>" results in "This is a very interesting paragraph."
I'm using Python as technology; do you know any framework I may use to remove the HTML tags?
Thanks!
| stackexchange/codereview |
One of site's I visit has Java Applet, which must use certificate based authentication. I got this cert and added it to Java's key store(cacert) as well as to key chain of Mac.
When applet starts it offers to choose certificate for authentication from list - but this list is empty.
Does anybody know about this issue in... | stackexchange/codereview |
We have written a feature that allows our users to upload a file to a nas device using UNC path. The feature has not been stressed tested and I'm not 100% convinced CFFILE can handle the load. Does cffile use multi-threading to perform writes to the file system and what kind of load can cffile support?
| stackexchange/codereview |
I am using Ruby on rails. I am trying to retrieve timestamp column from particular table.
Activerecord returns me the date, if timestamp contains all zeros.
e.g: If timestamp stored is 2010-09-06 00:00:00:000, it returns me 2010-09-06.
But if I have 2010-09-06 00:00:20:000, it returns me in the expected format(i.e: 20... | stackexchange/codereview |
I am using zend framework for my project and I have a requirement to route the path where I want it. For example:
I have a path www.example.com/module/controller/action1 and I want to internally route in to www.example.com/module/controller/action2.
But the main problem is I do not want to use the function in which I ... | stackexchange/codereview |
I'm watching a Ryan Bates screencast on polymorphic relationships, and he uses this private method for finding all comments related to a nested model.
So I could find all the comments of a given Post with this :
def find_commentable
params.each do |name, value|
if name =~ /(.+)_id$/
return $1.classify.const... | stackexchange/codereview |
I currently have a method whereby there is an
<input type="text" id="politician" name="politician"
onkeyup="showResult(this.value)" value="Enter a politician's name"/>
tag. In that same file that includes the input tag, there is a link to an external javascript file called ajax.js
The contents of that file are as fo... | stackexchange/codereview |
I have a 6x8 grid of System.Windows.Controls.Canvas objects. The top left canvas does not receive mouse events while all the others do. I tried OnMouseMove and OnMouseClick events.
A child object isn't handling the event because System.Windows.Media.VisualTreeHelper#GetChildrenCount() doesn't show any children. I could... | stackexchange/codereview |
I am downloading a file from a remote location to my local machine. The paths I am using are saved in web.config and are in following format:
<add key="FileFolder" value="Files/"/>
<add key="LocalFileFolder" value="D:\REAL\" />
the code I am using to download is:
CreateDirectoryIfDoesNotExist();
WebClient webClien... | stackexchange/codereview |
I have a simple class that looks a bit like this:
@protocol Recorder
@property(BOOL) isRunning;
- (void) start;
- (void) stop;
@end
And the method implementations:
- (void) start {
if (running)
return;
…
running = YES;
}
- (void) stop {
if (!running)
return;
…
running = NO;
}
... | stackexchange/codereview |
I have got the following code in a button on a form, but I want to get the OID or ID value of the saved object so that I can load it directly later.
procedure TFormMain.ButtonNewClick(Sender: TObject);
var
Employee: Variant;
OId: Variant;
begin
Employee := Factory.New('Sample.Employee', True);
if VarIsNull(Empl... | stackexchange/codereview |
I would like to create an abstract class which will create concrete instances depending on initialization parameter. Example:
class SomethingGeneric
def self.new(type, arg)
class_name = "#{type.capitalize}Something"
if obj.const_defined?(class_name)
a_class = obj.const_get(class_name)
else
... | stackexchange/codereview |
I'm new in Infopath developing, please help. :(
So I'm developing work-flow with custom task edit form.
I designed infopath form CustomApprovalForm.xsn in Infopath Designer 2010 and then I published this form to Workflow project in Module folder which named Form(ApproveWF/Form/).
Then I configured all needed propertie... | stackexchange/codereview |
I have written a code which sends queries to Google and returns the results. I extract the snippets(summaries) from these results for further processing. However, sometime non-english words are in these snippets which I don't want them. for example:
/\u02b0w\u025bn w\u025bn unstressed \u02b0w\u0259n w\u0259n/
I only ... | stackexchange/codereview |
How can I get the document object out of this?
var xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml");
| stackexchange/codereview |
In my previous post on this subject i have made little progress (not blaming anyone except myself!) so i'll try to approach my problem statement differently.
how do i go about writing the algorithm to generate a list of primitive triples?
all i have to start with is:
a) the basic theorem: a^2 + b^2 = c^2
b) the fact th... | stackexchange/codereview |
I'm using the PECL intl module to localize dates and numbers in a PHP project. In all other languages I'm using (40), localizing ordinal numbers works fine. In Swedish, however, I get strange output. It appears to be the template constants used to generate the ordinals.
$fnf = new NumberFormatter('sv_FI', NumberFormatt... | stackexchange/codereview |
Given this java code...
PreparedStatement s = prepare("SELECT ...")
ResultSet r = s.executeQuery()
r.next()
s = prepare("UPDATE ...")
s.setInt(1, r.getInt(3))
s.setInt(2, r.getInt(1))
s.executeUpdate()
s = prepare("UPDATE ...")
s.setInt(1, r.getInt(3))
s.setInt(2, r.getInt(2))
s.executeUpdate()
It seems to me that MyS... | stackexchange/codereview |
Say I have a current running process known, how can I turn this into a Process object in Java?
The process is already running, so I don't want to spawn off another one, I just want to encapsulate it into a Process object that I can use within the java code.
Something along the lines of:
int pid = getPid();
Process proc... | stackexchange/codereview |
Folks,
I have method that returns true if all characters are "legal" and false if a single character is "illegal". The definition is below (legal = letters, numbers, and some characters like $, - , %, etc). I want a newline and/or carriage return character to be "illegal". However, the method below thinks that its l... | stackexchange/codereview |
I have been tasked with writing an xsd, for an xml file format that my company has created.
Unfortunately one of the tags contains two variables, here is an example of the tag
<to_1.1.1.0_24>
The 1.1.1.0 is an ip address and as such can change, and the 24 is the netmask.
Is there anyway of expressing this within an x... | stackexchange/codereview |
I'm using Syncfusion to change the style of my WPF application to the Office 2007 Blue style. But the OpenFileDialog shows in the default style of my OS (XP) and there doesn't seem to be any way to change its style.
Is there a way to make the style of the dialog consistent with the rest of the application? (Apart from ... | stackexchange/codereview |
Whats up.
I'm looking for some information about linking a vBulletin user database with my actual website's database. I do already have a users table, users have their main website profiles and all, but I would also like them to be able to use the same account on the forum (forum not up yet)
So is it fairly simple to d... | stackexchange/codereview |
I am trying to write a menu whose subitems vanish when the page is loaded.
If you need full HTML, I will copy it, however it just consists of a bunch of DIVs, the items under the headers have a class of subitems.
I have managed to do what I need via:
$(document).ready(
$(".subitems").hide()
);
However, in ... | stackexchange/codereview |
i have use delphi xe recently but exe size is very big because of rtti(i think)
howto remove rtti , and can i make my application size as small as delphi 2009 application(490 kb) without comprssion; and what is the use of rtti
| stackexchange/codereview |
I have a StringBuilder a. I have to append a's content to StringBuilder b. If b is null, then assign b=a, otherwise b.append(a.toString()).
Is there any performance difference on checking if the StringBuilder is null or not?
method_a(StringBuilder a, StringBuilder b) {
if (b != null) {
b.append(a.toString(... | stackexchange/codereview |
I have the following code
package myPackage;
import org.neo4j.graphdb;
import org.neo4j.kernel.EmbeddedGraphDatabase;
public class dbServlet extends HttpServlet {
public void init() throws ServletException {
// Start up the database here
GraphDatabaseSer... | stackexchange/codereview |
I have a LinkedList<Individual> where Individual is a class that has a field processorTime.
It is needed to sort this LinkedList (descending order) basing on a function estimate(processorTime) which returns integers.
Please, tell me how can I do this?
| stackexchange/codereview |
I have some (sort of) Singletons which exist in three context:
Per AppDomain
Per HttpApplication
Per Web Request
Right now, I'm creating a child container per HttpApplication and another child per Web Request. This is necessary because some components SHOULD actually share singleton instances across the three layers.... | stackexchange/codereview |
This is a repost of my question over on the gamedev.stackexchange but there seems to be more Game Center questions and answers here.
I'm in the process of developing a game for the iPhone and I want to add Game Center support to it. The problem, as I see it, is that I need to have named my app, created an icon and uplo... | stackexchange/codereview |
Hi i have a XSD that i want to parse. Note that i don't want validate it against a XML but get all enumerations that i have there. For example
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="fruitNames">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="banana" />
<xsd:e... | stackexchange/codereview |
In most of my classes that work with defaults I make the defaults object settable:
@property(retain) NSUserDefaults *defaults;
This is supposed to make testing easier:
// In a nearby test class:
- (void) setUp {
[super setUp];
NSUserDefaults *isolatedDefaults = [[NSUserDefaults alloc] init];
[someObjectBei... | stackexchange/codereview |
Scenario:
I have a Git Repo hosted in GitHub:
https://Nerian@github.com/Nerian/JPovray.git
Which can be accessed by SVN clients at:
http://svn.github.com/Nerian/JPovray.git
And I have another SVN server hosted in school servers. I want this server to be a mirror from the repo at GitHub.
It is a school requirement to u... | stackexchange/codereview |
I am trying to use one of these algorithms to convert a RGB image to grayscale:
The lightness method averages the most prominent and least prominent colors:
(max(R, G, B) + min(R, G, B)) / 2.
The average method simply averages the values: (R + G + B) / 3.
The formula for luminosity is 0.21 R + 0.71 G + 0.07 B.
But... | stackexchange/codereview |
I have some code that someone wants to put on their site. Here is the code i received from them:
<script language="JavaScript" src="http://dm4.contactatonce.com/scripts/PopIn.js" type="text/javascript"></script>
<script language="JavaScript" src="http://dm4.contactatonce.com/PopInGenerator.aspx?MerchantId=44542&Provid... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.