instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm going to be running a node.js server in a Windows environment (via Cygwin) on an internal network that needs access to the Windows login information of the client. The best method I've come up with is to have an iFrame with an ASP page that just does Response.Write(Request.ServerVariables("AUTH_USER")) Then, get...
stackexchange/codereview
I have a repeater that is looping a user control, like this: <asp:Repeater ID="repItems" runat="server" EnableViewState="false" OnItemCommand="repItems_ItemCommand"> <ItemTemplate> <dmg:confirmItem runat="server" OnDataBinding="confirmitemIte...
stackexchange/codereview
I have a model called job and I want to set a datetime attribute (started_time) to MySQL now() value. how can I do that in Django? I don't want to use the model auto_now or auto_now_add methods, since I have other applications who share the same DB and I don't want to handle timezones, thus I want to delegate that to M...
stackexchange/codereview
Hello I am having a problem with Django trying to get it deployed on a server using apache. for some reason when I write this information in my httpd.conf file. <location "/mysite"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings Pyt...
stackexchange/codereview
It works if the html file is local (on my C drive), but not if the html file is on a server and the image file is local. Why is that? Any possible workarounds?
stackexchange/codereview
I've written an application with tornado to support real time updates on my website through HTTP streaming. It works in all browsers except IE7 and IE8. Here is the code that handles the HTTP streaming: ... code to create xhr object xhr.open('GET', 'http://192.168.0.173:8888', true); xhr.onreadystatechange = function()...
stackexchange/codereview
I am benchmarking an app I made which uses repcached (memcached with replication) for storing objects and taking some load off the db. While benchmarking the index page I run ab -c 400 -n 5000 http://mysite When I use just one memcache server with list($server, $port) = explode(':', $settings->memcached_servers[0]); $...
stackexchange/codereview
I was wondering what do you guys use to design the .jsp file? I know it needs to be coded, but is there an easy way to build the layout in jsp? Tables..etc
stackexchange/codereview
Below is a section of my customized Expander template: <Grid x:Name="ExpandSiteContainer" Visibility="Visible" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" DockPanel.Dock...
stackexchange/codereview
I am doing some processing with Groovy/Grails and the results are a map of type <String, Float>. When returning the JSON object to the calling function (in this case, it's a flot diagram which requires [number,number] format), the key needs to be a number. This, in theory, is fine as my key to the map is a number in st...
stackexchange/codereview
I have a List<MyObject> ... MyObject has a propert called LineId (integer)... So, I need separate all consecutive LineId in List ... Example : List<MyObject> : LineId =1 LineId =1 LineId =1 LineId =2 LineId =1 LineId =2 The result must be 4 separeted lists: LineId =1 LineId =1 LineId =1 ------------- LineId =2 ------...
stackexchange/codereview
I need a Java library, code snippet,... to get the Frequency distribution of the 64 DCT coefficients of a JPEG file. Any ideas? Thx!
stackexchange/codereview
I've been looking around trying to find a simple binomial coefficient algorithm, to no avail. The problem is the language I'm using for class is a bit... odd. A lot of it is using Yacc and Lex. Anyways we did an example in class: n=12; p=1; i=1; while (i <= n) { p = p * i; print p; i = i + 1; };...
stackexchange/codereview
Edited: how can i save the first string and then use the strcat func void *threads_sorting (void *arg) { struct args_sort *mydata; mydata = (struct args_sort *) arg; FILE *forig char *file_name; //file_name = (char*)malloc( sizeof(char) * 10 ); file_name = mydata->fname; printf ("File Name: %s\n", file_name);...
stackexchange/codereview
What I'm doing is grabbing JSON off a website to deserialise it with a DataContract class. So what if the response I get doesn't match the class? I would be getting a SerializationException, but I'm thinking it would be better as an InnerException to a different exception, as the response is therefore incomplete or not...
stackexchange/codereview
I found that Dojo has the most awesome and unappreciated feature - Declarative widget instantiations/layouts. This is the type of instantiation where you create the widget with raw html, and don't need any javascript (simply by specifying the dojoType attribute). (I discovered this by following this awesome (although h...
stackexchange/codereview
I'm new in iPhone apps and GData API. I want to use Google Documents like a data storage for my multi-user application, there is a need to control access rights to data: If the first user takes data, then he can read & write it, all others users will be able only to read. But when first user finishes his work with dat...
stackexchange/codereview
I'm currently working on a function in MYSQL, I have a comma delimited string (1,22,344,55) from another table, How can I split this in MYSQL to an array (NOT temp_table). Also, is there a similar function in MYSQL where I can do foreach()?
stackexchange/codereview
I have a winforms application i have been working on that runs multiple tests on consumer accounts. The tests require a one time login in order to execute. string paramaters = "authmethod=on&chkRememberMe=on&login-form-type=pwd&password=" + pw.Text + "&userid=" + uid.Text + "&username=" + uid.Text; string strRe...
stackexchange/codereview
I have a situation where I am sending data to a Controller via jQuery $.ajax, the data is a serialized json string. (MVC 3.0) It binds it fine - my controller receives the results and they are correct. Now then, I am having a problem with it posting back validation. I suspect it is because not all of my objects are bou...
stackexchange/codereview
Possible Duplicate: .trim() in JavaScript not working in IE Is there any way to make .trim() work in Internet Explorer 6.
stackexchange/codereview
Hi I've this situation and I dont know why it's happening.. I have a selectonemenu like this <ice:selectOneMenu id="ddlProfesion" value="#{FrmClientes.profesionSeleccionado}" style="width:230px"> <f:selectItems value="#{SessionBean1.listaProfesion}"/> <f:converter converterId="DefaultSelectItemConverter" /> </ice:...
stackexchange/codereview
I'm looking for java library which allow "normalization" of text. Something similar to standart Normalizer, but wider (something like utf8proc LUMP). It should replace all kind of special charachters to ASCII equivalents (if it possible of course). All variants of space to code 32, all variants of minuses (long, short...
stackexchange/codereview
I've building a very basic iphone app where the user will be able to enter or select a very large numeric cash value (usually in the thousands or millions). At the moment I am using a simple text box entry with number pad selected. I am going to use the example of a Football transfer fee as an analogy. A transfer fee c...
stackexchange/codereview
I want to write a jquery function that will take a number of div elements by id or class and the screen scroll so that they are in view. I know that this may not be possible if the divs are spread over the page and not possible to get all in view, but would like to be able to get some in view for the user to be aware o...
stackexchange/codereview
I have problem with this exception: Hibernate.HibernateException : Could not create the driver from Hibernate.Driver.SqlServerCeDriver. ----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. ----> NHibernate.HibernateException : The IDbCommand and IDbConnection imp...
stackexchange/codereview
I'm using JPA 2.0 and I'm using a generated schema. Here is my mapping: @Entity @Table(name = "CBV_USER") public class CbvUser implements Serializable { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) @Column(name = "Login") private String login; @Basic(optional = ...
stackexchange/codereview
According to Apple's MPMoviePlayerController doc: MPMoviePlayerPlaybackDidFinishNotification - This notification is not sent in cases where the movie player is displaying in fullscreen mode and the user taps the Done button. Seems to me this is dead wrong. Using the code below, playerPlaybackDidFinish gets called when ...
stackexchange/codereview
Maybe a silly question, but I'm trying to get a cronjob to work. Although this could be a question for serverfault I think its also a SO-question. Anyway: I have set up a cronjob to be executed everey 1 minute of every hour, day (number), day (name) and month. The given command is: /home/easybr01/domains/easybranding.n...
stackexchange/codereview
In visual studio, I create a reference to the Aspose assembly and use the Document class in my code. It looks fine at design-time, but when I go to compile I get the error 'Type Aspose.Words.Document' is not defined.' If I do anything that changes the project file, like add or drop a reference or add a new file, the er...
stackexchange/codereview
I am trying to build some simple Ruby scripts to run on a local machine and automate some Twitter functions, for my own use only. I am having difficulty getting OAuth authorization to work. I registered the application at http://dev.twitter.com/apps and retrieved its consumer key and secret, and I retrieved the access ...
stackexchange/codereview
I’m exploring Core Data custom migration, for which I need to run a test on the existing store to see whether it is compatible with the currently loaded mom. And to do that, I need to get the metadata from the store. So I do this in the AppDelegate class: NSFileManager *fileManager = [NSFileManager defaultManager]; NSS...
stackexchange/codereview
I have a query that has a select statement that contains the following: ,COUNT(u.[Unit]) ,up.[Number_Of_Stops] I need to only count the units where number of stops <> 0. This has more details in the query so I can't just say WHERE number_of_stops <> 0. It has to be within the select statement. Thanks
stackexchange/codereview
Here is my setup: I have an asp.net button on a page -- <asp:Button id="btnSelectEmp" runat="server" Text="Select Employee" /> I have a .js file with the following jQuery click event -- $("input[id$='_btnSelectEmp']").click(function ($e) { $("div[id$='_divEmpSearch']").css("display", "inline"); $e.preventDefault()...
stackexchange/codereview
string Edate = collection["effectiveDatePicker"].ToString(); string Cdate = collection["cancelDatePicker"].ToString(); The Date I am getting is 20101112 or 20101116 Then I am doign soemthign like this to assing my Datetime variable h.Edate= DateTime.ParseExact(collection["effectiveDatePicker"].ToString(), "yyyyMMdd", ...
stackexchange/codereview
I need to synchronize application state between compact framework devices. (And eventually windows phone 7 devices). Since this information doesn't always change that much, and it can be relatively large I was thinking on using binary diffs to optimize transfers. Something like VCDIFF or bsdiff would probably work grea...
stackexchange/codereview
The tomcat 6.0 document at http://tomcat.apache.org/tomcat-6.0-doc/config/context.html says: Only if a context file does not exist for the application in the $CATALINA_BASE/conf/[enginename]/[hostname]/, in an individual file at /META-INF/context.xml inside the application files. If the web application is packaged as ...
stackexchange/codereview
How do I get Arabic running on a BlackBerry? I've downloaded various simulators supporting different carriers and I've not seen Arabic offered as an input language.
stackexchange/codereview
I currently have this update code set up to rotate and move my camera. float move = 0.5f; float look = 0.01f; //Rotation if (Keyboard[Key.Left]) { modelview = Matrix4.Mult (modelview, Matrix4.CreateRotationY (-look)); } if (Keyboard[Key.Right]) { modelv...
stackexchange/codereview
i have an application where i'm creating divs by dragging across a canvas. I need these divs to be draggable and resizable. Here's my function: function createDiv( $startX, $startY, $stopX, $stopY ) { if ($startX==$stopX || $startY==$stopY) return; var zona = $('<div class="zona"></div>'); $(zona)....
stackexchange/codereview
I had two question about Erlang. Is design pattern of concept to be suitable for use in Erlang? Want to understand the architecture quickly. Could you recommend any great framework and how to learn? what view-point to explain this erlang framework. Thanks for you.
stackexchange/codereview
Hy I take two pictures from a webcam and split them into a 9 pieces. Then i match the pieces of the two pictures. The problem is that my webcam have a picture noise. So my programm thinks that in every piece of the second picture have chanced something. I need a logical push to solve my problem please help.
stackexchange/codereview
The code in question: TreeNode categoryNode = categories.Nodes[category]; //BREAKPOINT HERE categoryNode.Add("New Node") My question is less about the code itself (it all makes sense to me), so much as the debugger. When at the break point I want to look at the TreeNodes in categories.Nodes, but categories.Nodes is a...
stackexchange/codereview
I have a working USername token profile working using WCF, I am trying to add support for encryption on the client call, the webservice is expecting an encrypted soap header. I installed a certificate in my Local store using MMC. In my c# code below I have code that loads the certificate and assigns it to the proxy. I...
stackexchange/codereview
Can anybody explain me this piece of assembly code? LINEAR_DATA_SEL equ $-gdt dw 0FFFFh dw 0 db 0 db 92h ; present, ring 0, data, expand-up, writable db 0CFh ; page-granular (4 gig limit), 32-bit db 0 Here I have already googled about the command equ, dw and db but I can't understand w...
stackexchange/codereview
Which better ways exist to avoid an abundance of isset() in the application logic, and retain the ability to see debug messages (E_NOTICE) when required? Presumption first: E_NOTICE is not an error, it's a misnomer and should actually be E_DEBUG. However while this is true for unset variables (PHP is still a scripting ...
stackexchange/codereview
I believe the Google API allows you to get coordinates for a given address. However, most (or should I say all) of the examples I've found aren't for vb. Usually it's some javascript example that just leaves me confused. Here's some code I have that uses a geocoding service. This works great. It's just that I want to q...
stackexchange/codereview
I have 2 tables in my database. One is for orders, and one is for companies. Orders has this structure: OrderID | attachedCompanyIDs ------------------------------------ 1 1,2,3 2 2,4 And Company has this structure: CompanyID | name -------------------...
stackexchange/codereview
Is there a keyboard shortcut to use in ReSharper to see suggestions and apply them? When I inspect code issues in a Solution, I find it slow to use the mouse to move from one issue/recommendation to the next, and see each suggestion. I'd like to know a shortcuts for: Navigating to the next issue/suggestion Display pos...
stackexchange/codereview
I am making a Test Engine so i want to restrict PrintScreen of my application
stackexchange/codereview
I need to measure the time it takes to load different web pages, each page about once per hour for a week. I suspect that the performance of the networks between my computer and the web-server vary too much over time (not only throughput but also latency). How can I schedule Internet Explorer to go to certain web pages...
stackexchange/codereview
I can't find any free thumb icons for voting like the ones here http://www.99points.info/wp-content/uploads/2010/07/youtube.jpg. Everything I find is too colored or detailed. Does anyone know a good website where I would find such icons or an icon set?
stackexchange/codereview
I have a abstract class which has some common methods for all of my models. I have inherited this class in all my models. Now there is a requirement to send the mail whenever a model is deleted. So I have override the delete() method in my abstract class. This leads to the recursive call of same method because calling ...
stackexchange/codereview
I've got a pip requirements file that I'm using with virtualenv to automatically grab dependencies for my application. The application depends on both NumPy and SciPy and as such my pip requirements file includes: numpy==1.5.0 scipy==0.8.0 However, when running this pip in a new virtualenv, the installation fails with...
stackexchange/codereview
I would like to repeatedly execute a subprocess as fast as possible. However, sometimes the process will take too long, so I want to kill it. I use signal.signal(...) like below: ppid=pipeexe.pid signal.signal(signal.SIGALRM, stop_handler) signal.alarm(1) ..... def stop_handler(signal, frame): print 'Stop test'+t...
stackexchange/codereview
I am trying to set the Validation Message manually without the common practice where you throw an exception. I know I can manually change the state of the control as follows: VisualStateManager.GoToState(this.TextBox, "InvalidFocused", true); Now I just want to set the error message manually... Anyone know how? I kno...
stackexchange/codereview
My application has a modal panel where the user can upload files and choose a "document type" in a drop-down select. I was using an <f:setPropertyActionListener> to set the document type value during the upload event, but sometimes the property is set after the upload has been processed. Probably it's happening becaus...
stackexchange/codereview
Processes get CPU time as managed by the OS process scheduler. Since threads run in parallel within a single process, does this mean that a process's CPU time is further distributed(sliced) among threads? Or can the scheduler directly distribute CPU time among threads bypassing the parent process?
stackexchange/codereview
I have to call a stored procedure from oracle sever that not under our control so after digging i wrote a script in groovy to know the content of this procedure and it was like this PROCEDURE SAM2_update_message_status ( msg_id IN NUMBER, sam4_id IN NUMBER, msg_status IN NUMBER...
stackexchange/codereview
I have a singleton class and the lines in the init method cause memory leak, and I don't kwno why... this is my implementation static timerController *sngTimer = nil; @implementation timerController @synthesize repeatingTimer; @synthesize dateComp; @synthesize bPause; +(timerController *) singletonTimer { @synch...
stackexchange/codereview
The errors are appearing only with file streams After removing vector.h file, the program runs properly I want to use vector.h in future programs // Using Stanford CS106B Library #include "genlib.h" #include "vector.h" // After removing this file, the program runs but i cannot use vector ...
stackexchange/codereview
I'm creating a program that can essentially download files multiple locations, and send them to multiple locations, based on paths that users enter. These can be either Network Paths/Local Paths, HTTP paths or FTP paths. Rather than download from one of the source locations, then send to each target, and repeat, I'd li...
stackexchange/codereview
I'm using on money_format with the first parameter being '%n' to include the dollar sign, and I have the locale set to en_US but it still doesn't include it. Why?
stackexchange/codereview
I'd like to add the list of filters in the title of my executeIndex method. Does anyone know if it's possible to override the admin generator list title from the executeIndex method? I've been searching for hours to find the list.title variable in the generator config and how to override it. Any ideas would be apprecia...
stackexchange/codereview
Working on a legacy ASP.NET 2.0 project. Anyone know of a free dynamic control that will render itself based upon the type it's assigned to? For example, if I pass it a DateTime property, it should render as a date time picker. If I give it a string... a simple text box. Give it a list, and it will create a dropdown or...
stackexchange/codereview
We are trying to develop an Android based text reader for books in Daisy3 (http://www.daisy.org/z3986/structure/SG-DAISY3/index.html) format. Currently we are only focusing on rendering the text part and not on the audio (daisy3 format has both text and audio, primarily for users with reading disabilities). I want to ...
stackexchange/codereview
With MySQL, I'm able to store large blocks of text in a TEXT column, pull like I would any other column type with no problem. It seems when I try to do the same with CLOB on Oracle, I get errors. Here's where I'm pulling: <?php $comments = 'SELECT q2_other, q4_comments, q9_describe, q10, q11_comments, q12_describe, add...
stackexchange/codereview
I saw how to set a WPF rich text box in RichTextBox Class. Yet I like to save its text to the database like I used to, in Windows Forms. string myData = richTextBox.Text; dbSave(myData); How can I do it?
stackexchange/codereview
I've found something like below on the net //Get S60 version and display it on label switch (QSysInfo::s60Version ()) { case QSysInfo::SV_S60_3_1: return "S60 version: S60 3.1"; case QSysInfo::SV_S60_3_2: return "S60 version: S60 3.2"; case QSysInfo::SV_S60_5_0: return "S60 version: S60 5.0"; case QSysI...
stackexchange/codereview
i need to connect to customer database in access that contains field with the char ' he has field: PartNo' i try to run this query: select PartNo' from myTable and got error. (i connect to the database and run query Through C#) how i can Solve this problem ? (i can't change the customer table's and field's) thank's in ...
stackexchange/codereview
I have a PHP web application that needs to call a function in a C++ library. This library is provided by a vendor (libfoo.a on a linux machine). My first instinct is to create a C++ executable that links against libfoo.a, and passes command-line parameters to the function. The PHP web application can then do a sys...
stackexchange/codereview
I have a custom control in which I add checkboxes. I want to rearrange the checkboxes when i check them, I mean the selected ones should appear on top of the control. Please suggest an efficient way to do it ?
stackexchange/codereview
what's the result for windows phone 7 IE compatibility test? Answers should be specific with reference to what works and what doesn't. Quirksmode says nothing. EDIT: The test should consider css 2 & 3, DOM core, DOM HTML, DOM events, CSS Object model view, like in this site: http://www.quirksmode.org/compatibility.html...
stackexchange/codereview
I do some numerical calculation in Java, C# and C++. Some of them save a lot of data (to the text file). What is the fastest way to do it? C++. ofstream file; file.open(plik); for(int i=0;i<251;i++){ for(int j=0;j<81;j++) file<<(i-100)*0.01<<" "<<(j-40)*0.01<<" "<<U[i][j]<<endl; file<<endl; } Which I ...
stackexchange/codereview
everyone... I'm new to C# and such languages... I've read two articles by Skeet, one about heap/stack, and other about reference types and value types. And I assume my question is simple, but it's not clarified to me after reading those articles. Do reference types allocate new memory when passed to methods? For exampl...
stackexchange/codereview
Im looking for the appropriate way to insert date into one table based on the value of a field in another table.
stackexchange/codereview
I've been having issues with django's template system tag 'ifchanged'. I can't quite pin down it's behavior. Basically, if I had a setup like this: {% for c in list %} {% ifchanged c.group %} group has changed! {% else %} {% ifchanged c.active %} item is active! {% endifch...
stackexchange/codereview
I have some code that looks like the following coming back from an XHR response: jQuery(':text:not(:hidden)').removeAttr("disabled"); This is a result of input fields being disabled after form submit. The XHR response returns this tidbit of jQuery and re-enables controls. Works great on every browser, even "partially"...
stackexchange/codereview
Any tricks to do delayed task execution (i.e. scheduling) based on Redis? Perhaps some clever way to delay BLPOP for a given number of seconds?..
stackexchange/codereview
I need to download a page from my controller and use Webclient to do so, which isn't Mockable? How do I test around this or can I just leave the direct reference in there?
stackexchange/codereview
I am new to rails and this is stopping me. I am trying to run rspec spec/ and I get errors. Can anyone help me? This is the code I am getting: /Library/Ruby/Gems/1.8/gems/rspec-rails-2.0.0.a6/lib/rspec/rails/transactional_database_support.rb:33: uninitialized constant Rspec::Core (NameError) from /Library/Ruby...
stackexchange/codereview
I have an mp4 file called lebron.mp4 in my Resources folder: -(IBAction)videoButtonClicked:(id)sender{ NSString *url = [[NSBundle mainBundle] pathForResource:@"lebron" ofType:@"mp4"]; MPMoviePlayerViewController* moviePlayerViewController = [[MPMoviePlayerViewControl...
stackexchange/codereview
Very simply put : the line currentItem.toggleClass('open'); doesn't seem to work. More precisely, when inspecting the results with firebug, I can see the class "open" flashing (appearing and immediately disappearing) on the relevant element. So it's like the function is actually triggered twice (of course I only click ...
stackexchange/codereview
I have a flash var stored in my html file: <script type="text/javascript"> var flashvars = { map:"mapGAcentury21.xml" }; var params = { menu: "false", scale: "noScale", allowFullscreen: "true", allowScriptAccess: "always", bgcolor: "#FFFFFF" }; ...
stackexchange/codereview
Strange issue... I have no idea why this isn't working on my server. For some reason the IF's aren't working. The major one thats puzzling me is the one that checks the file extension. Even if it doesn't match for some reason its returning TRUE on my server and not my computer. if (isset($_POST['submit'])) { $...
stackexchange/codereview
I am writing a Asp.net MVC 2 application that uses Forms Authentication and currently I am having a problem with our iPhone application in regards to the authentication/login over the web. We have developed a simple iPhone app that uses the the UIWebView control. At this stage, all the app does is navigate to our Asp.N...
stackexchange/codereview
I am trying to devise an implementation of dijkstras with fibonacci heaps. What I am trying to understand is if it is possible to represent, other than the minimum distance in O(logn) (with delete) but the neighbors of any given node? Or does this violate the fibonacci heap structure? Otherwise I would have to build a ...
stackexchange/codereview
In our Magento shop we need a few rewrite rules that redirect to another domain. I know how to do that in the Magento Backend Rewrite URl Module, but cannot find a way to let the redirect keep it's parameters. Is there anyway to do this in Magento, or must this be done with Apache mod_rewrite?
stackexchange/codereview
Hoping someone can assist with this what seems to me a peculiar problem.. My mind is pulsing a little here as it's blown my understanding of the Android Activity Lifecycle.. Let me try to make things clearer. Problem: I'm receiving a 'StaleDataException' during the 'getView' method of a custom adapter (extending BaseAd...
stackexchange/codereview
For the sake of learning C and understanding the difference between Binary Files and Text Files, I'm attempting to write a string to file as both file types like so: char * string = "I am a string!"; FILE * filePtrA = fopen("/output.txt", "wt"); fwrite(string, strlen(string), 1, filePtrA); FILE * filePtrB = fopen("/o...
stackexchange/codereview
This is pandastream's pandauploader . Except I want it to be sent via AJAX. Anyone know how I would convert this? :javascript $("#returned_video_id").pandaUploader(#{Panda.signed_params('post', "/videos.json", :profiles => 'f1eb0fe2406d3fa3530eb7324f410789').to_json}, { onsuccess: function(){ $(".opened_pho...
stackexchange/codereview
I have a treeview that when the user interacts with individual nodes, the colours change. The code is: treeview.selectednode.forecolor = color.red; When the user presses a button, I want the whole set of nodes to change to black for example. So I code as such: treeview.forecolor = color.black; It works fine, except f...
stackexchange/codereview
I manually drew a sphere, at last :) I want my sphere to be red, but the outlines to be green: In order to achieve this I did the following. I drew a solid sphere in red, and then I drew the same sphere, but wireframe and green. When I turned DEPTH_TEST on, I got some weird behavior, like this: And in order to avoid t...
stackexchange/codereview
Please show the simple and up to date standard way to create a python package for python 2.x I'd prefer to use pip for installing the package later. The package should contain a single class: class hello: def greet(self): print "hello" One should be able to do the following later: pip install my_package-0.1.1......
stackexchange/codereview
I usually use midentify, which spits out a nicely formatted string, that is easy to preg_match It however, fails sometimes, so I wanna do a fall-back method via ffmpeg. ffmpeg -i hello.avi spits this out: Input #0, avi, from 'hello.avi': Metadata: encoder : Nandub v1.0rc2 Duration: 01:11:16.56, star...
stackexchange/codereview
i have a csv file with data like this: -0.0889 4.53 -0.0449 2.25 -0.013 -3 0.0304 -4.28 0.0669 -2.03 0.1332 -1.72 And it goes on and on. I need a solution to plot it as a not connected points on simple 2D chart and save it as png file to see if data is organized by a clearly visible pattern.
stackexchange/codereview
When autorotating to Landscape mode the size of my UIWebView changes perfectly, only the content remains in Portrait mode. How do I let the UIWebView display the content in Landscape mode as well? Edit There is really nothing special about the code; I connect the UIWebView in the Nib file and in the UIViewController I...
stackexchange/codereview
When I call to_json on my Factory Girl object, I get a nil.[] error. I'm using DataMapper on Rails 3, and when I call to_json on a real DataMapper object, it works just fine. Any idea why the Factory Girl object is failing? Factory.define :something do |b| b.date_foo { 3.days.ago - 4.hours } b.date_bar { 3.days.ago...
stackexchange/codereview
Here is the trivial inheritance (STI) setup: class Parent < ActiveRecord::Base end class Daughter < Parent end class Son < Parent end Quick try in console. Expecting Parent.subclasses to return two subclasses, but got nothing! ruby-1.9.2-p0 > Parent.subclasses => [] Also, calling ruby-1.9.2-p0 > Daughter.subcl...
stackexchange/codereview
Has anyone used vaadin in a real project and wishes to share his experience? I am amidst a framework selection process for a RIA project and any feedback would really help. My key concerns are productivity and performance. It would really nice to know how you would compare it to the more mainstream JSF+Seam stack, if y...
stackexchange/codereview