instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I recently started to programm in delphi. Now, I've got an exercice. I have to save a top score in a text file. I've got this function: {Voeg topscore toe aan het goede bestand.} function addTopScore(sudokuNumber : Integer; naam : String; tijd : Integer; fouten : Integer):boolean; var buffer : TStringList; aantal, ...
stackexchange/codereview
I have a navigation bar at the top of a page I am developing. I want a certain <div> to be centered in the bar (which is another <div>). Is there an easy way to do this with CSS? I tried using pixels but that does not work when you resize the window. I am trying to center it horizontally not vertically. Update: The <di...
stackexchange/codereview
I wanted to run a test of a sketch I just made ported to processing.js. When I load the webpage, I get the following errors from the javascript console in Chrome: XMLHttpRequest cannot load file:///Users/aoeuaoeu/Desktop/projects/local%20site%20files/_/ee.pde. Origin null is not allowed by Access-Control-Allow-Origin....
stackexchange/codereview
echo (int) ( (0.1+0.7) * 10 ); Why does the above output 7? I understand how PHP rounds towards 0, but isn't (0.1+0.7) * 10 evaluated as a float and then casted as an integer? Thanks!
stackexchange/codereview
I had many photos, each photo size is 200x150px,each line has four photos,there have 4 lines. When I click one of them, the photo will fadeout with some introduce text, the original array photos will move to the both side of the page.(there should be have a animate action) When I close the fadeout photo, the original p...
stackexchange/codereview
How do I generate random RSA public and private keys (RSAParameters) using RSACryptoServiceProvider class? Each time I create a new instance of RSACryptoServiceProvider, I end up exporting the same keys. Thanks
stackexchange/codereview
I have a very simple webpage that I'm trying to construct. It has an img tag including an SVG image file that scales to 100% of the page's width. I also have a collection of DIVs that I'd like to "fix" in place relative to the image. I started with absolute positioning using ems, but realized quickly that I'd have to m...
stackexchange/codereview
I would like to obtain a sub-query's return row count in the query itself. Then I will use it in the main query in an if case. I have added an example and, as a dummy string I put QUERY_ROW_COUNT.Is there any function to achieve this? Thanks in advance...Regards... SELECT period_id, lt_id, period_name, ...
stackexchange/codereview
I have a UITableView which displays a list. If I touch an item, it should navigate to another UITableView. If again an item is selected, it should navigate to an another UITableView. Simply to say, it should work like a folder. The UITableView may contain a folder in it. When the folder is selected, it should list the ...
stackexchange/codereview
Using the AWT.Transferable, I get an argument "data: Any" which is actually of type java.util.Arrays.ArrayList. How can I cast the "data" explicitly to this type? It seems I do not have any access to the "ArrayList"-Type itself...
stackexchange/codereview
The FFTW manual says that its fftw_complex type is bit compatible to std::complex<double> class in STL. But that doesn't work for me: #include <complex> #include <fftw3.h> int main() { std::complex<double> x(1,0); fftw_complex fx; fx = reinterpret_cast<fftw_complex>(x); } This gives me an error: error: invali...
stackexchange/codereview
I'm a novice to php's date() and strtotime, and have been attempting to find out the solution to this for the great portion of the day with no real solution (I've come close, but to no avail). What I have is a typical database row with a 'submitted' column, which is entered via a submitted=NOW() (in datetime format). ...
stackexchange/codereview
I am working with MKPinAnnotationView annotations pins over a MKMapView. Into the view that I am developing, there is a map centered on a pin. When I call the view the pin drops down and if I make a click over it, it shows the annotation information (canShowCallout = YES). How I can get this callout just when I open th...
stackexchange/codereview
first of all, let me say that I'm a total JAVA newbie. But I have this problem. I need to insert data in to a set of parent child tables. The data structure looks this data item 1 - (level 1 data)    data item 1.1 - (level 2 data)    data item 1.2 data item 2    data item 2.1    data item 2.2        data it...
stackexchange/codereview
I have several threads and one of them is running HTPP service using ProcessBuilder. HttpThread class ProcessBuilder pb = new ProcessBuilder(command); Process process pb.start(); process.waitFor(); int exitValue = process.exitValue(); I would like to have another thread wait when the service is started. What is the ...
stackexchange/codereview
Are Java EE 6 CDI events transactional? If I fire an event in a transaction, and subsequently roll back the transaction, are the effects of the Event listener rolled back as well? Is this behaviour dependent on the event listener itself supporting transactions? What about if I try and roll-back the exception from wit...
stackexchange/codereview
I would like to surround this entire block of code in a try/catch since its causing an error when there is nothing in the grid array. Whats the best way to do this? <?php foreach ($grid->result() as $idx => $row): ?> <?php if ($idx % 3 == 2): ?> <div class="img_grid_3"><img src="/images/thumb/<?= $row->images_name...
stackexchange/codereview
I'm building a website with Python/Django. Users submit tags. Each tag can contain multiple words. Each tag has an ID number. I want to make sure tags that are formatted slightly differently are still being recognized as the same tag. For example, if one user submitted the tag "electric guitar" and the other submitted ...
stackexchange/codereview
I am using UIImagePickerController to take photos on iPhone. I'd like to adjust the photo on the fly, it appears that I could use UIImagePickerController to adjust the shape of the photo on the fly, but I am not able to find a way to change the color on the fly. For example, change all the color to black/white. Thanks...
stackexchange/codereview
I'm using libxml2 to parse the following XML string: <?xml version=\"1.0\"?> <note> <to> <name>Tove</name> <name>Tovi</name> </to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> Formatted as a C-style string: "<?xml version=\"1.0\"...
stackexchange/codereview
All, There are so many programming languages/Operating systems/device drivers i.e. softwares that are built using C and C++. I was wondering if C and C++ were the only 2 low level programming languages that all companies ever had to build their own product(s)? If there are, why do C and C++ get so much preference over ...
stackexchange/codereview
I have a query that needs to return the "week of year" of a date field but the customer of the query uses a non-standard first day of the week so TO_CHAR with 'IW' isn't returning the expected result. In this case the first day of the week is Saturday and Friday is the seventh day of the week. With T-SQL I'd use DATEPA...
stackexchange/codereview
By default jquery-mobile adds a back button on each page after main page. I wish to know how can I add the home button also ? Here is an example: http://jquerymobile.com/demos/1.0a1/#experiments/api-viewer/index.html Note: This link is only good for firefox/chrome Thanks.
stackexchange/codereview
I am trying to identify the height of a div element in HTML, but I am not able to access the value outside of the function. This is the jQuery: jQuery.noConflict(); (function($) { $(function() { $tmp_cont = $('<div></div>'); $tmp_cont.html($content); $tmp_cont.hide(); $('body').ap...
stackexchange/codereview
Possible Duplicate: Coding in Other (Spoken) Languages When writing code, do people from other parts of the world have to use the English language keywords for code written in things like .NET, PHP, SQL, etc? Someone else actually asked me this and after a few minutes of thought, I was actually stumped. The questi...
stackexchange/codereview
I do not want my app to switch to the "task bar" when the Home button is pressed. That's why I would like it to be closed upon Home press. I added this entry to the info.plist file but this does not change the behaviour: application does not run in background (and I checked the box...) I rebuilt the whole app both in d...
stackexchange/codereview
I have a bash script like this #!/bin/sh firefox & The Firefox window opens, but it doesn't have focus. What can I do so that it has the focus automatically? I could use some X window tools / commands, but how do I get the window ID of Firefox? The window name is changing with the URLs displayed and therefore not usef...
stackexchange/codereview
I've a class with [] operator overloaded. I also have a thread to start... How can I bind [] to the thread? I tried this: threadpool.schedule( bind( static_cast< MyClass (MyClass::*)(const MyClass &arg )>( &MyClass::operator[]), arg ) ) but VS2008 says: error C2664: 'boost::threadpool::thread_pool::schedule': cannot...
stackexchange/codereview
I am having a cookie problem in the below example. the cookie does get created and when i put a debug point after its creation i can check whats in the cookie with a watch. however, when i restart the website, the cookie is still there, but has become empty and will not create the model (all fields empty are null.) I l...
stackexchange/codereview
I'm trying to replace MultiAutoCompleteTextView Drop down list with a ListView, which it should have same functionality as drop down list, that means, when I click in one of items it should be added to MultiAutoCompleteTextView box, o so on, but filtering the ListView as you type. So I came up with this raw code withou...
stackexchange/codereview
Consider the following code snippet: public static Task<string> FetchAsync() { string url = "http://www.example.com", message = "Hello World!"; var request = (HttpWebRequest)WebRequest.Create(url); request.Method = WebRequestMethods.Http.Post; return Task.Factory.FromAsync<Stream>(request.BeginGetRequ...
stackexchange/codereview
Has anyone managed to generate java code from a JAXB schema file without XJC? Somewhat similar to JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler() used to dynamically compile java code on the fly. Note: Running on JDK 6, meaning that com.sun.* tools packages are deprecated (thanks Blaise Doughan for t...
stackexchange/codereview
i had used this plugin before, but now when i want to use it for another project it simply does not work, where am i going wrong. here is the code i am using in my root index.php file <html> <head> <link href="/uploadify/uploadify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="/uploadify/j...
stackexchange/codereview
I am trying to create several similar visual styles for my programs, each with a different color theme. To do this, I have implemented the use of icons to represent the different states of JCheckBoxs and JRadioButtons. Instead of making one full set of icons for every possible color, is there any way I can just take on...
stackexchange/codereview
we have set up Paypal as a hook into an e-commerce application, where users just enter their paypal account, and we link their clients through to their Paypal account when buying products. This works great, and paypal asks you to login to pay for your purchases. But we don't want clients to be forced to create a paypal...
stackexchange/codereview
Would like to detect esc key to escape the forever loop in pseudo code: forever [ url: ask "Url: " if (url = esc) [ break ] ] Is this possible ?
stackexchange/codereview
I'm trying to get a stream from a url:http://actueel.nl.pwc.com/site/syndicate.jsp but i get the 403 error. It doest requier login. I used fiddler to check why IE can open it while my code doesn't. What i got was that there were 2 connections done when opening the link in IE. 1 succeeded while the other got a 403. The...
stackexchange/codereview
I have a file that needs to be brought into a different branch. How do I do this from the command line. Everything seems to be geared to merging, where the file already exists in both branches.
stackexchange/codereview
I am sure this should be easier than I'm making it but I'm trying to get the following response from my source. Please could somebody help me with the xpath? I am trying to select the line elements with the values "extract". In real world, I'm reading a text file and using xml and want to pick out the lines which re...
stackexchange/codereview
I'm working on a project where I have models: Client, User, and Extensions, just to make this simple. A User has to be associated with one Client in order to have an Extension number. A User can have extensions, say, 100 and 101. Another User, associated with another Client, can have the same extensions 100 and 101. So...
stackexchange/codereview
I have a table called 'Orders' and a field called 'count'. The Order details are in another table called 'order_details'. How can I populate the field 'count' with the amount of orders from the 'order_details' table. I am using a foreign key currently between these two tables for joins. The idea behind what I am asking...
stackexchange/codereview
Say you have multiple MVP triads in your application (WinForms .NET 2.0 app) and each triad looks after one area of responsibility. What is your preferred way of coordinating the communication between the MVP triads? Option 1 A coordinator object that "has" each model and looks after the coordination through subscribin...
stackexchange/codereview
I'm currently working on a Linux TCP/IP server. The server program is running in C. I'm currently testing it, but each time I exit it with Ctrl-c, the port it's using is not released, neither is the database it's been writing to unlocked. How does one define a subroutine that will exit when a Ctrl+C signal is received?...
stackexchange/codereview
Can someone provide me with a simple example of Asynchronous page processing in ASP.NET Webforms 2.0 (I'm using VS 2010, so new syntax like lambdas are ok)? I have some long running requests that I don't want tying up IIS threads. For simplicity's sake, let's say my current code looks like this: protected void Page_Loa...
stackexchange/codereview
bool? x = true; if (x == true) looks awkward. But sometimes that is exactly what is needed. Is there a better way? EDIT: Thank you all for the attempts, but so far I have not found a way that would beat the original. I guess I will just need to deal with awkwardness, perhaps comment it.
stackexchange/codereview
I'm currently using VS2008 with SQL Server Express 2005 with great success. I got all the bits to install VS2010 and SQL Server 2008 Express R2, and plan to tackle this over a weekend. My question is this: What is the best approach to update my system to the latest bits. I'd like to uninstall VS2008 and SQL Server 200...
stackexchange/codereview
I am totally beginner in programming. I played a bit with xcode. But my question is: How to make an application like a book with pictures, texts and sounds, and that when children change their page, image, text and sound are in the context? I need to find a tutorial for it or if someone wants to teach us. We really wa...
stackexchange/codereview
I know that I can create a google search box on my personal homepage using something like this (very basic code) <form method="get" action="http://www.google.com/search"> <input type="text" name="q" /> <input type="submit" value="Google Search" /> </form> Is it possible to change this to only return resul...
stackexchange/codereview
I wanted to create this page expand effect with mootools. http://www.curtziegler.com/sitedemo/portfolio/education.html I've searched online and I can't seem to find anything on it. Thanks in advance for any help.
stackexchange/codereview
class HelloWorld { public static void main(String[] args) { System.out.println("hey"); } } Command prompt session: C:\Users\zobdos\Desktop>javac HelloWorld.java C:\Users\zobdos\Desktop>dir *.class Volume in drive C is OS Volume Serial Number is A45E-7B01 Directory of C:\Users\zobdos\Deskto...
stackexchange/codereview
Path.combine can only combine two string, is there a qucik way to combine three and four strings?
stackexchange/codereview
I'm in a dilemma. Which is best to use and why.. switch or if? switch ($x) { case 1: //mysql query //echo something break; case 2: //mysql query //echo something break; } ... if ($x == 1) { //mysql query //echo something } if ($x == 2) { //mysql query //echo something }
stackexchange/codereview
I saw this javascript code and I don't understand what it does. Url = function() { } $Url = new Url(); Why there is no var keyword used ? Is this any kind of object initialization ?
stackexchange/codereview
There are surely many ways how to use strings in C++: char*, w_char*, CString, std::string, then some typedefs like LPTSTR and other permutations of letters that no one except experienced C++ programmers understands. I remember reading an article (a long time ago), where the author was criticising C++ for its inconsist...
stackexchange/codereview
<root> <gallery name="First"/> <gallery name="Second"/> <gallery name="Third"/> </root> I think I have solved part of a previous problem and now have the foreach loop correct? Still I can't get it to save the xml. $objXML = new SimpleXMLElement(XML_FILE_NAME, null, true); foreach($objXML->xpath('/root/gallery/...
stackexchange/codereview
Is there a way to inspect a NSPredicate object for the purposes of serializing it into a URL? I am trying to retrieve the data remotely and need to translate the predicate object into a URL with querystring parameters that the server understands. This was inspired by a talk given in WWDC 2010 called "Building a Server ...
stackexchange/codereview
In a Flex Project, whenever there's an error, I fill in the error data into a hidden TextInput then show the control to the user. I want to make it so that after showing the TextInput, it will automatically hide itself after some time with a fade effect. How would I go about doing that?
stackexchange/codereview
Upon Compiling and Running, when I try to load the page in either Google Chrome or Mozilla Firefox it just shows the blue progress thing rotating in circles, and for a split second it will show a percentage and then that disappears Code for entire LoginPage public partial class LoginPage : UserControl { pub...
stackexchange/codereview
I'm trying to make cross-threaded calls in C#. Whenever I invoke the methods of an object created in the context of thread A from a static method called from thread B, the method always runs in thread B. I don't want that, I want it run on the same thread as the thread A object whose methods I am calling. Invoke works ...
stackexchange/codereview
I'm creating a web-app interface which will allow users to construct sentences by clicking on words/phrases. Each word of phrase will be contained in its own page element, eg. a <div>. So the div class would need to allow: dragging into a different order relative to the other divs/words (ie. sorting) an X (only visibl...
stackexchange/codereview
I'm trying to convert this T-SQL to a LINQ-SQL query: -- top 3 pros for city select top 3 description, ispro, COUNT(*) as numberofvotes from tblProCon where IdPrimaryCity = @IdPrimaryCity and IsPro = 1 group by IdPrimaryCity, IsPro, description union -- top 3 cons for city select top 3 description, ispro, COUNT(*) as...
stackexchange/codereview
I have an array like this: Array ( [0] => Array ( [datetime] => 2010-11-06 21:25:53 [movieID] => 1197624 [personID] => 0 [more indexes]... ) [1] => Array ( [datetime] => 2010-11-06 21:32:56 [movieID] => 1197624 ...
stackexchange/codereview
I'm writing a virtual machine - not an existing architecture emulator like Virtualbox, but rather something like the JVM or BEAM - with its own instruction set, memory model, etc. Eventually I'm planning to implement a very small and simple (but turing-complete) high-level language that would compile into its bytecode,...
stackexchange/codereview
<style> .wrapper{ width:900px; height:auto; padding:0px; margin:auto; background:#000000; position:relative; } .header{ width:900px; height:200px; float:left; padding:0px; margin:0px; background:#00FFFF; } .body_content{ width:900px; height:500px; floa...
stackexchange/codereview
I need to use in my application the search functionality used in the Maps IPhone application. The application user should be able to search locations by a commercial name and then to select one of the annotations (pins) proposed on the map. Is this function available to use easily?
stackexchange/codereview
I am trying to automate the daily retrieving of a web file using .NET. The file is a PDF located at an address similar to: http://www.example.com/?s=doc20101022 and these are the headers of HTTP request registered for debug using IE HTTP/1.1 200 OK Server: Apache/2.2.3 (CentOS) Vary: User-Agent,Accept-Encoding Expires:...
stackexchange/codereview
I hope this question is not too stupid. I need to make a button like the +/- button on the new print function in iOS4.2. http://www.geeky-gadgets.com/wp-content/uploads/2010/09/Airprint.jpg Would that be a segmented control ? Thanks
stackexchange/codereview
Consider the following code: DECLARE @TaskId int; SET @TaskId = 594725; SELECT Report.Amount FROM Report WHERE Report.TaskId = @TaskId; SELECT Report.Amount FROM Report WHERE (@TaskId = -1 OR Report.TaskId = @TaskId); I have a nonclustered index on the table Report with the column TaskId indexed. The first SELECT us...
stackexchange/codereview
How do I make a DIV always float on the screen's top right corner, so that even when I scroll the page down, the DIV still shows up in the same fixed location? Thanks.
stackexchange/codereview
So I have a Struts2 application that I'm working on. On my front page I have a section that will display any exceptions my application throws. This worked well until I added a custom Interceptor. Here is my interceptor code: public String intercept(ActionInvocation actionInvocation) throws Exception { String res...
stackexchange/codereview
I just installed python 2.7 from the python website, and was surprised to find that ttk wasn't included. Did I make a mistake installing, or is ttk really not included in the standard release? Anyway, where can I get a copy of ttk to install in my python instalation. Note: I also heard that the activestate release has ...
stackexchange/codereview
I have a device I'm polling for lots of different fields, every x milliseconds the device returns a list of ids and values which I need to store with a time stamp in a DB of sorts. Users of the system need to be able to query this DB for historic logs to create graphs, or query the last timestamp for each value. A si...
stackexchange/codereview
I have a results.txt file which looks like this: [["12 - 22 - 30 - 31 - 34 - 39 - 36"], ["13 - 21 - 28 - 37 - 39 - 45 - 6"], ["2 - 22 - 32 - 33 - 37 - 45 - 11"], ["3 - 5 - 11 - 16 - 41 - 48 - 32"], ["2 - 3 - 14 - 29 - 35 - 42 12"], ["14 - 30 - 31 - 36 - 44 - 47 26"]] I want to replace the " - " in the results.txt file...
stackexchange/codereview
1) Does anyone know if it is possible to loop through an irregular enumeration in Delphi (XE)? Looping over a normal enumeration is ok. From Delphi Basics: var suit : (Hearts, Clubs, Diamonds, Spades); begin // Loop 3 times For suit := Hearts to Diamonds do ShowMessage('Suit = '+IntToStr(Ord(suit))); end; But, if...
stackexchange/codereview
My goal is to use to make it easy for non-programmers to execute a Python script with fairly complex options, on a single local machine that I have access to. I'd like to use the browser (specifically Safari on OS X) as a poor man's GUI. A short script would process the form data and then send it on to the main progr...
stackexchange/codereview
When I run a query 'SELECT name, Age, city from Contacts' I get a few hundred rows. I want to divide the results after the query executes, like this **Name Age Status** ABC 12 Young DFD 14 Young JGH 19 Mature ITR 18 Mature DLE 29 Adult MJE 23 Adult Here the Status field is computed dep...
stackexchange/codereview
i have two jbuttons of different sizes. I have placed smaller jbutton over other jbutton of bigger size. I have also added MouseListener to bigger size jbutton which is performing some action on mouse OnClick. The problem is that, i want to change the control of mouse from bigger size jbutton to smaller size jbutton w...
stackexchange/codereview
I am trying to compile a C program that requires the use of several libraries. The problem is, the order the libraries are linked in causes the compilation to fail. Is there anyway to get GCC to figure out the correct order, or for me to figure out the correct order without having to try every possibility? mipsel-linux...
stackexchange/codereview
I need to create am index in SQL however it needs to display the records by entering only a part of the name. The index should be created to retrieve the student information using part of the student name (i.e. if the name if Johnanesburg; the user can input John) I used the syntax below but it wont work create index S...
stackexchange/codereview
I am trying to validate file upload by supported file types, for now I am comparing ContentType property with list of supported file types like "text/xml" "application/x-zip-compressed" etc. I have found these strings simply by trying to upload various files and checking the value of ContentType property in debug mode....
stackexchange/codereview
How would you go about comparing a spoken word to an audio file and determining if they match? For example, if I say "apple" to my iPhone application, I would like for it to record the audio and compare it with a prerecorded audio file of someone saying "apple". It should be able to determine that the two spoken word...
stackexchange/codereview
What's the best Java library to use if I want to import graphics in some custom format (basically an array of bytes with a specified height, width, bytes per pixel and depth) and then work on it? Image resizing and cutting functionality would be useful if it was included. Should support saving to some lossless format t...
stackexchange/codereview
I execute the following code: public static void test() { Pattern p = Pattern.compile("BIP[0-9]{4}E"); Matcher m = p.matcher("BIP1111EgjgjgjhgjhgjgjgjgjhgjBIP1234EfghfhfghfghfghBIP5555E"); System.out.println(m.matches()); while(m.find()) { System.out.println(m.group()); } } What i cannot explain is when the co...
stackexchange/codereview
how we can read a pdf using lisp and separate the table of content. This can be done by other languages but in lisp this is bit difficult any can help me with a sample code? http://www.rajive-hsenid.appspot.com/ this is done by python now i am trying to do this with lisp please help me..
stackexchange/codereview
I can't get my JNDI datasource running. Followed the official grails doc I set up a datasouce in Config.groovy: grails.naming.entries = [ "mydatasource": [ type: "javax.sql.DataSource", auth: "Container", description: "Development Datasource", ...
stackexchange/codereview
how can i use a pic i inserted in picturebox into mycodes?thanks public KingPiece(Image image, ChessColor color) : base(image, color) { ValidMoves = new Point(0, -1); // Up 1 ValidMoves = new Point(1, -1); // Up 1, Right 1 ValidMoves = ...
stackexchange/codereview
This is probably a very easy one to answer but still getting my head around structuring functions and bits in jQuery (and jquerytools). I've managed to parse the form and receive an email from the script but instead of displaying an alert box I would like to display another small div with a thank you message for X numb...
stackexchange/codereview
I just received a VS 2005 Solultion which I converted to 2008, which went fine. Now I am trying to do some more coding but running into this error. Lets say I create a new class called "siteFunctions", and try to run a method from this in the code behind and try to build the solution I get the following error Type "sit...
stackexchange/codereview
this is a silly n00b question but i just don't get it to work. I do believe that i need to convert to NSString and leverage "stringWithUTF8String:" but do not understand exactly how to implement it in this code so i get the right output in the NSLog. I have been looking around but it still do not work. The plist is cor...
stackexchange/codereview
I'm looking for PHP5 ORM which fully supports composite (multi-column) relations based on composite primary keys and foreign keys. I hoped that Doctrine 2 would solve this problem but it doesn't. It's a basic feature in relational data modelling but none of PHP ORM software I know supports it. I've recently found that ...
stackexchange/codereview
I've configured my database.yml to point to my existing mysql database how can I generate models from it? rails generate model existing_table_name only gives an emty model..
stackexchange/codereview
How do I pass a pointer to a pointer to a struct as a function parameter in C#? I am trying to use a function from a DLL which has one of its arguments as a double pointer. For e.g., struct mystruct { int a; char b; }; [DllImport("mydll.dll")] private static extern int func_name(int a, char b, mystruct** c); I ...
stackexchange/codereview
I want to add Game center for my project but now I get some stuck and can't find any solution for my problem by Google :( When I call method showleaderboard in my project, leaderboard appear and success to load my score in gamecenter but it don't receive touch (this screen look like freeze). This is my code: -(void) Sh...
stackexchange/codereview
Java has the convienient System.getProperty("user.home") to get the user's "home" directory in a platform-independent way. What's the equivalent in Ruby? I don't have a Windows box to play around with, and I feel like relying on tildes in filenames isn't the cleanest way. Are there alternatives?
stackexchange/codereview
I have a large query running that loops over multiple stored procedures. Based on business rules, I'm calling the appropriate stored procedures for each record that is in my loop. The problem is that those stored procedures sometimes generate multiple result sets. What happens then is that in SQL Server Management Stud...
stackexchange/codereview
I have a website that contains ~100K pages (200-300 concurrent users). Each page has his own record in mysql InnoDB table - page: page_id page_parent left_id right_id page_subject page_children page_depth .... As you can see I use nested set model to display hierarchy of pages, etc etc.. Everything seems to be fine ex...
stackexchange/codereview
I had to track the dirty objects. And it works fine with the parent doc. But when I change the embedded or referenced in doc, the dirty has to be accessed via the embedded/referenced in doc itself. How can I track the dirty on the parent doc itself??
stackexchange/codereview
I'm running from appname import model, which gives me: ImportError: No module named google.appengine.api So I add the following Python path (the only path I could find): PYTHONPATH=/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/:~/src/app...
stackexchange/codereview
I have parent/children relationship: newsItem 1-* comment. How can I select a list of newsItems and also count of comments for each newsItem using one Criteria query? I want to do something like this: select news_item.*, count(comment.id) from news_item left join comment on comment.news_item_id = news_item.id group by ...
stackexchange/codereview
I want to split a string into parts based on a regex (\$\d+\$), but I also want to know what the value of these split-points is. So for example, if have the string: <option value="beholder" selected="selected">$33685$</option> <option value="gnuchess_fancy">$33687$</option> <option value="gnuchess_simple">$33689$</opti...
stackexchange/codereview