instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have a UITableViewCell that has a textLabel and a UITextField attached as a subview like this: cell = [tableView dequeueReusableCellWithIdentifier:Value1CellIdentifier]; cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:Value1CellIdentifier] autorelease]; cell.accessoryType = U...
stackexchange/codereview
Is there a Bash script and/or daemon that I can write that will detect a specific USB drive and then sync that drive with a directory?
stackexchange/codereview
I've a text file containing record of a dump of database table in a custom format, this text have a character in a specific position that identifies the operation with the record : M = Insert or Update D = Delete Record Therefore if i find a D record in text file i need to delete record into database, instead if i fi...
stackexchange/codereview
Is there a way to change a Tkinter widget's font style without knowing the widget's font family and font size? Use case: We create our UI using standard Tkinter widgets (Label, Entry, Text, etc). While our application runs we may want to dynamically change the font style of these widgets to bold and/or italics using th...
stackexchange/codereview
So I am a beginner with .NET, Visual Studio, C#, etc. But I am wondering something about the code behind a form and a difference I am seeing in 2008 versus 2005. So lets say I have a simple Windows Form app, C#, and I throw a couple controls on it. Then I add some MessageBox.Show event handlers for the default events....
stackexchange/codereview
I have written down a code that should do garbage collection for c programs. The problem is that I need to run it for a large number of objects say 100 mb dynamically allocated. Is there any tool that can help me find out the memory usage of my c code at runtime. It would be pretty helpful if I can come to know the cu...
stackexchange/codereview
I'm trying to rehost the designer, but every time I slap a workflow into the designer: _workflowDesigner = new WorkflowDesigner(); // added to UI here Properties.Content = _workflowDesigner.PropertyInspectorView; _workflowDesigner.Load(myWorkflowInstance); where myWorkflowInstance is a workflow defined in a referenced...
stackexchange/codereview
I plan to work on each img of an html file. Those images must not contain the word "noresize". I built the regex to get img : #<img(\s[^>]*)>#ie This is working quite well but I can't find how to specify "without noresize". I tried something like that : #<img(\s[^>]*)((?!noresize).)>#ie But obviously, that's not what...
stackexchange/codereview
I've written a kext for OS X that implements a USB-based framebuffer using (IOKit) libusb and jpeglib. Both of those are dylibs, and for some reason they won't link properly in XCode, and the OS won't resolve the dependencies when it attempts to load the kext. The background of this whole thing is that Samsung makes an...
stackexchange/codereview
Im creating a website that has three columns of content..... navigation float: left; main content centered right column float: right; Is it possible to drop shadow all three of these areas. I tried and it didn't work wondering if the divs prohibit the end result?
stackexchange/codereview
I'm trying to create a regular expression that will tokenize a string of the following format: Program.EXE someparam:[[REG|HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows]] someotherparam[[DATA|User]] couldbeanotherparam The regular expression I'm looking for is to get all [[REG|any text]] OR [[DATA|any text]] occurrenc...
stackexchange/codereview
I'm porting an OS X application written in C++ with the SDL 1.2 framework to iOS using the SDL 1.3 framework. There have been some changes to the methods, and I am having trouble rewriting a couple of pieces of code. Here are the comments and declarations for the SDL_PeepEvents method from 1.2.14: /** * Checks the e...
stackexchange/codereview
So Ive spent quite some time today with sql lite and saw the .net4 providers were very un stable. So I figured I'll use SqlCE. Its supposed to have a zero config/install instead its the most confusing way to deploy the thing. I check numerous SO questions and these articles: Link Link A More updated short guide: http:/...
stackexchange/codereview
Perhaps I don't understand events fully. I'm building a Windows Phone 7 app in Silverlight. I have a UserControl that wraps a ListBox, called EditableListBox. The ListBox has a data template. The items in the list box are wrapped by EditableListItem objects. The data template is as follows: <DataTemplate> <Grid Man...
stackexchange/codereview
I have a System.Reflection.MethodInfo and would like to have a method that creates a delegate(preferably a Func<...> or an Action<...>) that represents that method, given an instance to invoke it on. So ideally I would like something like the following psuedo-code: public TDelegate GetMethod<TDelegate>(MethodInfo metho...
stackexchange/codereview
I have some code that looks like the following: jQuery("[name='myform']").live('submit', function() { $(this).ajaxForm({ target: '#someform', beforeSerialize: function(form, options) { alert("BeforeSerialize happening."); jQuery('form[name=myform] input[type=submit]').attr('disabled', 'disabled'...
stackexchange/codereview
I have a table like the following table: UserID Num1 Num2 Code Name Cat 7293 32:16.0 50:22.0 3 Jim 33 7293 32:16.0 59:28.0 4 Jim 12 7316 32:16.0 55:32.0 4 Karen 33 7316 32:16.0 28:31.0 4 Karen 7 7287 32:16.0 01:27.0 2 Mike 33 7299 32:16.0 18:53.0 4 Sue 16 7302 32:17....
stackexchange/codereview
com.microsoft.sqlserver.jdbc.SQLServerException: The system is out of memory. Use server side cursors for large result sets:Java heap space. Result set size:280,236,031. JVM total memory size:423,297,024. I am trying to fetch a big data set from SQL and I get following error. Let me know if anyone have seen somethin...
stackexchange/codereview
I have got an strange problem but I am quite sure, for you it is not. If it is so, please help me or explain. I have an array of 39 UIImages which will be used for animating UIImageView. and after playing the animation, memory does not release. - (void)viewDidLoad { NSAutoreleasePool *pool = [[NSAutoreleasePool all...
stackexchange/codereview
I have a WCF service that is load balanced on multiple boxes. We have setup host headers in IIS for the service website so that the host name, not the machine name, will show up in the WSDL (like this: http://forums.asp.net/p/1096811/1659596.aspx). Now we have a requirement that an internal process needs to be able to...
stackexchange/codereview
I'm using gmaps v3 and I am using a kml file to display polygon shapes. What I want to do, is that if I have a LNG/LAT coordinate, how to find whether it falls on the boundary or inside the shape? I understand you can do this with V2 maps but not V3. So then my questions are: Can I import the coordinates into my db in ...
stackexchange/codereview
I have an MVC2 application with a form (like ya do). The user enters a query into the form (in the /Cars/Index view) and hits the "submit" button which posts to the Details action of CarsController - the Details view renders with results, and all is well and good. The user can enter a URL (such as /Cars/Details/123-12...
stackexchange/codereview
We have a swf banner with buttons/links on our site header. When our customers DO NOT enter the "www" before our URL the banner links do not work - do not forward to the page. When our customers enter the "www" in the URL It works. First Thoughts, Is it a security setting in the browsers? I tried the latest version of ...
stackexchange/codereview
I am developing an iPhone game and want to sell it in different regions, making it available in a number of languages. Should the app be repackaged in each different version for each language, (e.g. Japanese, English, Chinese etc), or would one game package all the art and language and then detect where it is and disp...
stackexchange/codereview
I am developing an Android app and I am doing some heavy work (bringing data from an online web page and parsing it to store in database) in a service. Currently, it is taking about 20+ mins and for this time my UI is stuck. I was thinking of using a thread in service so my UI doesn't get stuck but it is giving error. ...
stackexchange/codereview
I've a code to get year, month and day for one of my application. package com.cera.hyperionUtils; import java.util.*; public class HypDate { public static int curdate(int field) { //1. Specify integer 1 for YEAR, 2 for MONTH, 5 DAY_OF_MONTH Calendar c = new GregorianCalendar(); c.setLenient(true); //Allow...
stackexchange/codereview
I am doing some manipulation of the options contained in a Select element. Is there a way to remove all elements Search an element in the list of already present options update an option attribute (e.g. set as selected) I am using jQuery 1.4.3
stackexchange/codereview
I know this has been discussed here many times, but none of the answers I found here, seem to address my problem. I have this variable (in height) layout, and wnat the footer to always stick to the bottom. I have used the min-height: 100%; to the container div, and got it somehow to always be in the bottom. trouble is,...
stackexchange/codereview
I have a kiosk web page that users use to sign in at an event. On the page there is a form with a name and email input. To prevent slow responses due to connection problems I have set up the ui to send asynchronous ajax posts. The problem is that the connection may not be available, but I don't want to lose the data th...
stackexchange/codereview
As I try to use a message properties in taglib of my grails application it is empty. <g:set var="pos" value="${message(code:"rating.positive.title")}" /> <foo:bar someNew="bla" positiveTitle="${pos}" bean="${item}" /> results in log of the attrs of taglib (def bar) someNew=bla positiveTitle= bean=item Any idea why th...
stackexchange/codereview
I'm loading images with this class. I need help on how to stop them from loading when dealloc is called. This class is extending UIImageView. Also any other advice for designing the class is appreciated, i'll want for example to dispatch the loaded bytes. @implementation RCPhoto - (id)initWithFrame:(CGRect)frame dele...
stackexchange/codereview
Does this ever happen to you? You are sitting at your development machine and you are made aware of an unhandled exception in a deployed asp.net application. You visit the deployed web app. You can't see the exception detail in your browser, because custom errors is set to remote only. So you have to login to the web s...
stackexchange/codereview
How do I find the number of children of the root element in an XML document using PHP and SimpleXML? DLiKS
stackexchange/codereview
I need to get the following scripts running. // File: script_a.php <?php exit(1); ?> // File: script_b.php <?php system('php script_a.php', $return); var_dump($return); ?> Now my problem: On my windows system running script_b.php shows int(1) as expected. On our Unix-Server I always get int(0), what makes...
stackexchange/codereview
I find that File.Copy will gladly copy a file onto itself without throwing an exception. By mistake I copied a sqlite database file onto itself, and the file is no longer a valid database. I have repeated this as a test several times and get the same result. Using winmerge (or a text editor) I see that the result file...
stackexchange/codereview
Hi guys i have a problem with the browsers back button when i click on it. The problem is I log into my webapp and the home page appears. when i click the back button of the browser. i can see the login page. But i don't want this to happen i want the session to be maintained throught till i click the log out button. ...
stackexchange/codereview
Please take a look at the screenshot on the left: http://bit.ly/a4F5Ln Could anyone tell me what view components are those with texts Notebook and Selected tags? Could it be TwoLineListItem? Any examples using it? Basically, I'd like to replace Spinner components with something similar. Thanks! EDIT: Hmmm... how to rep...
stackexchange/codereview
I'm trying to incorporate Ninject with my ASP.NET MVC 3 RC application. From the tutorials I found, I'm supposed to set the ServiceLocator via MvcServiceLocator.SetCurrent in the Global.asax file, but I can't seem to find this in ASP.NET MVC 3 RC. Has this been changed to something else?
stackexchange/codereview
Other than the purely obvious: "It translates Perl to C."; are there any real world uses (a.k.a. hacks) for the Perl compiler's optimized C translation backend, B::CC?
stackexchange/codereview
I just saw this here #include <stdio.h> int main(int argc, char *argv[printf("Hello, world!\n")]) {} What this does is print "Hello World!" But what's actually going on here? The best I can guess is that it gets compiled and thrown at the top of the execution stack, but the syntax doesn't even look legal to me ...
stackexchange/codereview
This is my first attempt to inline Java code in Perl. We cannot use the standard SFTP command on our system. This is out of my power. We have a jarfile called SFTP.jar which can be used. The previous person before me was able to get Inline::Perl to work, but his implementation was sloppy, and I'd like to clean it up. I...
stackexchange/codereview
For this program i have only used field separators from data files in shell script. But I am trying to use the standard library function ifstream() to read in from a data file. The only problem is I am getting the data like so A:KT5:14:executive desk: This is for a hash table, and I need to separate the values in the l...
stackexchange/codereview
I am trying to Construct a URI. But I am unable to handle bad URIs. Is there any way we can handle bad URIs? Code I am using: if (reviews[e.Item.ItemIndex].URL.ToString().Contains("http:")) { oURI = new Uri(reviews[e.Item.ItemIndex].URL.ToString()); } else { oURI = new Uri("http://"+ reviews[e.Item.ItemIndex]...
stackexchange/codereview
I can get the data with NO problem...but I cannot delete the data. Any Suggestions..?? Cursor cu = getContentResolver().query(CONTENT_URI, null, null, null, null); if (cu.moveToFirst()) { numberInDb = cu.getString(2); System.out.println("Number in ...
stackexchange/codereview
I am trying to install app inventor on my Samsung intercept. I have gone through the steps in the set up computer and phone. When it was time to plug in the USB connection the two notifications did not display. Please, if anyone knows of any additional steps I need to take I would appreciate some advise.
stackexchange/codereview
In one of my projects am going to connect with alot of servers remotely through SSH using PHP. There are two solutions for it, phpseclib and the ssh2 PECL Extension for PHP which is based on the libssh2 library. So can anyone please compare both and mention their pros and cons etc?
stackexchange/codereview
My first question on SO! :) Thanks in advanced! I'm having a problem with jqgrid multiple selection functionality. I can only define a single multiple selection key and above that shift doesnt select more than 1 row into the collection at a time. Any clue on a different grid plugin or a work around for this functionali...
stackexchange/codereview
I'm a bit new to ant, but couldn't find an answer to this at all. What I need is that the java program takes a while to load in a bunch of data (a huge xml file), and I need the ant task to wait until it is completely done. Right now I deal with this problem with a sleep. Here's some sudo of how it is now: the java cod...
stackexchange/codereview
I have the following application.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.currency.mobile.android"> <uses-permission android:name="android.permission.INTERNET"/> <application android:icon="@drawable/icon" android:label="@string/...
stackexchange/codereview
When i open the info slide the panel ads a margin.. how can i fix it.. the problem ocurs only in IE (IE tab plugin for firefox) and in IE7 and IE8 the tooltip is not showing.. Thank you very much. Link to site
stackexchange/codereview
I thought I could use my DbContext with a DomainService just the same way I use it with any MVC app: public class DatabaseContext : DbContext { public DbSet<User> Users { get; set; } } public class UserDomainService : DomainService { private DatabaseContext db; public UserDomainService() { d...
stackexchange/codereview
I want to remove hyphens (-), slashes (/) and white space () from a string name(i) so that I can use it as a structure field name. This is the ugly way I am currently doing it using the function strrep: cell2mat(strrep(strrep(strrep(name(i), '-',''),'/',''),' ', '')) I have also tried other variations, such as: strrep...
stackexchange/codereview
I am currently writing a jQuery UI plugin and investigate therefore the existent jQuery UI sources. In the _create method of the accordion plugin this is assigned to self (link to source), but then both this and self are used side by side in that method. So why do they chose to assign to self at all?
stackexchange/codereview
I am currently working on the cell selection function for a datagridview, I draw rectangles around the cells to simulate the selection, using co-ordinates and size for the rectangle. The problem arises when I scroll down or right to select more cells. While selecting, the rectangles are drawn with the same dimensions a...
stackexchange/codereview
UPDATE: Thank you for the help so far. I've just tested the program connecting directly to it from the browser, instead of thru an XMLHttpRequest. Going straight from the browser is working flawlessly. However, this connection must be handled via an XMLHTTPRequest. According to FireBug, it's receiving the full resp...
stackexchange/codereview
Does anybody know how to read/write an atomic Booleanfield in Django? I'm trying to do the following: I've a field in a model called email_sent. Whenever I get a instant payment notification (IPN) from our payment processor I want to send a notification email. Since I get multiple notifications, and I just want to sent...
stackexchange/codereview
We have a newly written JAAS module and were wondering where to place the database connection setting for the DataSource object. Typically in a Tomcat web application, this would be reference in the 'web.xml' file to point to an XML file located in '$catalina_home/conf/Catalina/localhost'. Where can we place similar co...
stackexchange/codereview
I've recently seen a delegate method (that appears to work) and looks like this: -(void) doSomethingWithThisPieceOfData:(void *)theData; The delegate method then casts theData as: -(void) doSomethingWithThisPieceOfData:(void *)theData { anObject *myObject; myObject = (anObject)theData; .... } Why does this work and is ...
stackexchange/codereview
I've got problem with writing a converter from hex to bin, dec to bin etc. Here's my code, when I debug it I've got an error "Use of unassigned local variable Dec_Int10", could you help me? How can I fix this error? protected void Button_Click (object sender, Event Args e) { if (Page.IsValid) { i...
stackexchange/codereview
Me and a colleague are having a debate: We have a singleton class that is used at multiple places in our code base. Originally, the class was designed in such a way that you could get the class object but that object would not be completely initialized. By this I mean: mySingleton.getInstance().SomeMethod(); SomeMetho...
stackexchange/codereview
Is there a way to make this query faster: $qur = mysql_query(" SELECT id, firstname, lastname, (firstname = '$firstname' AND lastname = '$lastname') AS full FROM users WHERE (firstname = '$firstname' AND lastname='$lastname') OR (firstname LIKE '$firstname%' AND lastname LIKE '$lastname%') OR firstname LIKE '$f...
stackexchange/codereview
I'm making a web browser based real time game. I'm using jQuery ajax calls to call a web service method for the client to update their speed & location via json data. Returned is a list of strings which contain data for the locations and speeds of all other players. At the moment I'm not even passing any data and am re...
stackexchange/codereview
I'm studying on a book called "the art of hacking" and after the theory, I'm trying to do some exercises on real old vulnerabilities just to do some exercises. So, I "configure", "make" and "make install" an ftp vulnerable service and then I launch it as root. At this point, I need to debug the ftp service while it is ...
stackexchange/codereview
Is there a thing , like listener , knowing of a view is moved?
stackexchange/codereview
I am starting out with the tab bar application in XCode and I want to put a table view in one of the tabs. I know how to physically put the table view into a tab with interface builder, but I need to be able to edit the data in the table, so I'm not just left with blank cells. So, how can I edit the data in the table? ...
stackexchange/codereview
I have some questions regarding VB.NET bit shifting. I understand the << >> operators are bit shift operators in VB.NET. I have a two-byte hex value, 0x3ACC, and each bit in these two bytes represents either a day, month or year. The bit structure of this hex value is yyyy yyym mmmd dddd. I am confused as to how I shou...
stackexchange/codereview
I have 3 questions concerning events: Should I always unsubscribe events that were subscribed? What happens if I do NOT? In the below examples, how would you unsubscribe from the subscribed events? I have for example this code: Ctor: Purpose: For database property updates this.PropertyChanged += (o, e) => { switc...
stackexchange/codereview
Given a finite dictionary of entity terms, I'm looking for a way to do Entity Extraction with intelligent tagging using Lucene. Currently I've been able to use Lucene for: - Searching for complex phrases with some fuzzyness - Highlighting results However, I 'm not aware how to: -Get accurate offsets of the matched p...
stackexchange/codereview
I have a spreadsheet that has a small number of inputs, which drive a large number of intermediate calculations, which in turn drive a small number of expensive calculations that depend on many of the intermediate values. Some of the calculations use UDFs which return both single return values and arrays, while others...
stackexchange/codereview
What is the semantic difference between these 3 ways of using ivars and properties in Objective-C? 1. @class MyOtherObject; @interface MyObject { } @property (nonatomic, retain) MyOtherObject *otherObj; 2. #import "MyOtherObject.h" @interface MyObject { MyOtherObject *otherObj; } @property (nonatomic, retain) MyO...
stackexchange/codereview
I can't get my head around how I can get only the files that were changed in my last revision, and not the complete repo, which i get by using Clone. This would be super helpful to for instance, deploy the last changed files. What do I do? Thanks
stackexchange/codereview
I am searching for a javascript library that can mimick the moving chart on the windows task manager Performance tab - CPU usage history.Any help is welcome.
stackexchange/codereview
We are using TIBCO JMS 4.3.3 with the same version of .Net TIBCO.EMS.dll for .net 2.0 We are having huge problems with stuck messages in queues. We are consuming messages from one queue which is bridged from the topic. Our application creates multiple consumers with long lived sessions - each long lived sessions has on...
stackexchange/codereview
I'm working on a Scala API (for Twilio, by the way) where operations have a pretty large amount of parameters and many of these have sensible default values. To reduce typing and increase usability, I've decided to use case classes with named and default arguments. For instance for the TwiML Gather verb: case class Gat...
stackexchange/codereview
I would like to bump a menu item out 5px on mouseover and have it return to its original position using Scriptaculous. I am using the afterFinish callback to ensure that the bump-out Move effect is completed before the bump-back-in Move effect runs. The problem is that the item doesn't return to its original position i...
stackexchange/codereview
how can I strip trace() messages from a flex and flash applications ? I write flash and flex applications and i use a lot of trace messages for debugging, but when i product the actual swf i want it to be stripped from any trace messages. thanks
stackexchange/codereview
I am downloading image from url and set to Imageview.but sometime the bitmap returns null? why this happened?.. My code is Bitmap bm = null; URL myFileUrl =null; try { myFileUrl= new URL(url); } catch (MalformedURLException e) { // TODO Auto-generated catch block ...
stackexchange/codereview
Hello i am trying to develop a video gallery However the problem is that i should limit their dimensions. So if the site owner wants to add a video he should paste the embed code.. <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/R6uJGqS-KQY?fs=1&amp;hl=el_GR"></param><param name="al...
stackexchange/codereview
I am totally new to this and I am taking a class for fun that has now turned into a big headache. I have this html DOM file that references an XML file that I need to have show up on the screen in a browser. It should only print the elements of, title, first, last, location, discription. The CSS and Schema both validat...
stackexchange/codereview
I'm creating a small tool that will fetch new issues from our redmine repository and do some utility task on them. I'm planning the tool to run in background and to poll redmine for new issues ~ every minute. I have no problems getting all issues via GET /issues.xml API, but I don't know how to correctly poll new is...
stackexchange/codereview
I want to have a link to my twitter page that references it with my twitter ID and not twitter name. This is because I want to build the link into an app and the twitter name for the account may change in future.
stackexchange/codereview
I'm using OpenLayers to render a OpenLayers.Geometry.LineString on a OpenLayers.Layer.Vector layer. The idea is that the line, sometimes, can contain a big amount of points, which will make the web browser stall. I can't touch the server code because we retrieve the data from external website. Is there an elegant way t...
stackexchange/codereview
I'm working on a swing application. I don't want to migrate it to SWT, but I'd like to use some benefits of Eclipse RCP application. Especially, I want to use the update technology to distribute application updates. It would be great if you knew a tutorial on how to build an Eclipse RCP application that can start a cus...
stackexchange/codereview
I fear that there is something obviously wrong with my code, but I have come across a situation where the Form.Load event is not firing when I create and show my form. The form is not subclassed (as I've seen some problems with that in some searches), and I am not getting any errors thrown when I step through the code...
stackexchange/codereview
running cherrypy with mod_wsgi on apache along with another php app. The cherrypy app is NOT mounted on root, but rather on something like 'localhost/apps/myapp' via WSGIScriptAlias in the apache config file. In testapp.py, I have tried the following, and when I try to access localhost/apps/myapp in a browser: app = ch...
stackexchange/codereview
Is there a way to load a vector graphics file and then render it using OpenGL? This is a vague question as I don't know much about file formats for vector graphics. I know of SVG, though. Turning it to raster isn't really helpful as I want to do real time zooming in on the objects.
stackexchange/codereview
I have written the following program that is intended to dump all network device traffic to a file. I know the problem involves the use of JpcapWriter. Why am I getting the error message shown below? import jpcap.*; import jpcap.packet.*; public class dumptraffic { private static final int maxPackets = 100; p...
stackexchange/codereview
I have a rails rake task and I want it to ignore what is in database.yml and use something else. How do I do this?
stackexchange/codereview
Hey I have 3 tables called STUDENT, COURSE and ENROLLMENT. STUDENT has a PK of S_ID(student ID) and COURSE has PK of C_ID(course ID). In enrollment it only has S_ID and C_ID. I have an object data source to show all the students name (in text, and S_ID as the value) in a drop down menu and it will show which courses he...
stackexchange/codereview
I'm attempting to learn the ropes of Game Development and Android and it's been a great learning experience so far, but the Android Activity Lifecycle stuff has me a little stuck. Let's say I have three Activities - Game Menu Level Select The Actual Game (2d Game using the SurfaceView). I would think I need to ...
stackexchange/codereview
I am developing a non-document-based core data app for OS X 10.6. It is based on the template generated by XCode 3.2.4 when "Create document-based application" is not checked and "Use Core Data for Storage" and "Include Spotlight Importer" are checked. My spotlight importer sets kMDItemDisplayName to a summary of the r...
stackexchange/codereview
I noticed something about CPython's object deallocation which piqued my curiosity. Let's say I define a type that prints a message from its tp_dealloc function: static void pyfoo_Bar_dealloc(pyfoo_Bar* self) { PySys_WriteStdout("Bar freed\n"); self->ob_type->tp_free((PyObject*)self); } I've also done th...
stackexchange/codereview
I installed Python 2.7 on my mac from source. Before, I could use the arrow keys to scroll through my history. Now, I get this: >>> print 'stupid' 'stupid' >>> ^[[A # This is my feeble attempt at scrolling up. Scrolling still works if I use Python 2.6 Is there a config file for this or is this something that I have to...
stackexchange/codereview
#include <stdio.h> typedef struct size { unsigned int a:1; unsigned int b:31; unsigned int c:1; } mystruct; int main() { mystruct a; printf("%d", sizeof(a)); return 0; } With int b:31, the output is 8. With int b:1, the output is 4. With int b:32, the output is 12. C...
stackexchange/codereview
I would like to download some code samples (or even full projects) to learn from. The only place I know of is Sourceforge, but I want top-notch, flawless* code. Not to say there is anything wrong with SF but it's a toss up, and I don't want to learn from someones bad habits. I've been through gametutorials.com and nehe...
stackexchange/codereview
Am I able to get the user's mobile number of the iPhone device? (of cause without asking the user for this information)
stackexchange/codereview
I am working on a To-Do application to get some practice with Rails3 and MongoDB. I have an Item which was a tag and a tag will have many items associated with it. My Issue: The show.html.erb does not want to display the tag name. # models/item.rb class Item include Mongoid::Document field :name field :completed, :...
stackexchange/codereview
Is it possible to tell if there are any ongoing 'GET' requests with javascript? I have a feeling that it is not. Basically I don't want to make a seperate request while the other "more important" requests are going as this one is fairly heavy. So I was curious if it is possible to tell if there are currently 'get' requ...
stackexchange/codereview
I tried this query on MySQL server (5.1.41)... SELECT max(volume), dateofclose, symbol, volume, close, market FROM daily group by market I got this result: max(volume) dateofclose symbol volume close market 287031500 2010-07-20 AA.P 500 66.41 AMEX 242233000 2010-07-20 AACC 16200 3.98 NA...
stackexchange/codereview
I'l be short and sweet! How can I put an object like JSplitPane in my gui QT application?
stackexchange/codereview