text
stringlengths
8
267k
meta
dict
Q: Combining generators I have a function that returns a list via yield. I use this function as follows: myList = [] for i in range(10): myList = myList + list(myListGenerator(i)) pickleFile = open("mystuff.dat", "wb") pickle.dump(myList, pickleFile) pickleFile.close() I'm just wondering if this is the most effi...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623052", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: C++ RNG (Mersenne Twister) needs seed I have written a RNG class which holds different algorithms, however it does not work as expected. Besides the fact that i want use normal (rather than uniform) distribution my code always returns either the same number (max) or just 2 numbers out of the interval [min,max]: std:...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623055", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to convert string into int array in C# I am making a credit card validator program in which I am asking for a string which is going to be a 16 digit number (credit card #) and I want to convert that into an int array. How do I do that? I need to then multiply every other digit starting from the first digit by 2....
{ "language": "en", "url": "https://stackoverflow.com/questions/7623057", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: jQuery Object Serialize What is the difference between this? $("form").serialize(); and this? var theForm = $("form"); $(theForm[0]).serialize(); How do you get the second sample to serialize like the first one? A: try this: var theForm = $("form"); theForm.eq(0).serialize(); A: First one selects all forms and ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623066", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: C++ Windows Shell Extensions - Win7 32bit - 64bit compatibility issues i have visual studio 2005 and i am writing a shell extension for windows explorer. It works in Windows Vista 32bit where i compile the project. It also works on Windows 7 64bit when the project has been compiled on Windows7 64bit. Now i want to t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623067", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Stringstream not working with doubles when _GLIBCXX_DEBUG enabled I'm using _GLIBCXX_DEBUG mode to help find errors in my code but I'm having a problem which I think is an error in the library, but hopefully someone can tell me I'm just doing something wrong. Here is a short example which repro's the problem: #defi...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623070", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: What is the best timer technique for exact one second intervals? I am writing a simple timekeeping app for a specialized outdoor sport. The app performs a series of calculations every second, and displays information of interest to the user. Elapsed time is key to the accuracy of the calculated results. Ideally the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623072", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Insert an HTML Object element in Webbrowser's document In a Webbrowser control there is a webpage (the document). I know how to insert any HTML element into the body. The problem is, how can I insert an <object> along with its <param>? I must keep the existing document, so I wouldn't use Webbrowser1.Document.Write()...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623076", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Unit test controller - membership error I want to create a Unit test for the following controller but it got fail in the Membership class: public class AccountController:BaseController { public IFormsAuthenticationService FormsService { get; set; } public IMembershipService MembershipServic...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623078", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Possible for server to run scripts So I realize this question is broad, as I'm looking for a place to start. Is it possible to have a server that for example runs PHP scripts every day, or every 2 minutes? Pretty much, I don't want to put these tasks in the users script, because I'm scared they would get run a lot m...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623080", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is the Current State of the Art in AJAX + Rails? I was quite surprised to read about RJS in Rails 3. Is this the way most rails sites work with AJAX? And if I'm working with Backbone (and this is a good example), won't it have conflicts with ujs? A: Rjs is easy to use but is not the proper way to deal with Aja...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623083", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Align an anchor inside a div to right I really don't know how to do this. I tried: #menu-right div { position: fixed; text-align: right; } But this didn't work. Perhaps it is because a is not text. But how do I do this with text? A: As I understand the problem this solution should work. div#menu-righ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623085", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to redirect when ActionNotFound in Rails I have a controller SubscriptionsController with only actions new and create. How would I redirect to new if say someone tries to visit GET /subscriptions which would normally trigger the index action? config/routes.rb resource :subscriptions, :only => [:new, :create] ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623086", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: File output to Notepad .txt I can't word this well, so I'll just state the facts instead. Situation: My C++ program outputs extended ascii characters to a text file. Problem: When I open up my text file with Notepad, it displays those characters incorrectly. (I am using Windows XP) Conclusion: If I had to guess, I w...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623089", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What are "separately compiled C++ templates"? Once I saw a statement that "separately compiled C++ templates" is a standard feature that none of available C++ compilers support. What are those "separately compiled templates" and why are they ignored? A: C++98 introduced the export keyword which allowed you to have ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623094", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Colorbox plugin not resizing after jQuery UI tabs load (First, let me say that I read every similar post with the resize callback. I've also tried the Colorbox API and can't find anything.) I'm using the Colorbox plugin. Inside of the plugin, there are jQuery UI tabs. The tabs work (i.e., are switching and displayin...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623095", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Style input type = text I have an anchor with background icon which is nice styled. I would like to use it as if user clicks on it choose file window appear. Simple input type = text doesn't look nice for me. Is it possible to hide it and control appearance of browse windows from my anchor? Thanks for any help, sol...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623097", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Java: Get random line from a big file I've seen how to get a random line from a text file, but the method stated there (the accepted answer) is running horrendously slow. It runs very slowly on my 598KB text file, and still slow on my a version of that text file which has only one out of every 20 lines, at 20KB. I n...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623099", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: rails how to show an array in the view with has_and_belongs_to_many I have Flowers and colors. I have set up a has_and_belongs_to_many relationship. Through the console I can do: q=Flower.first q.colors => [#<Color id: 1, name: "Red", hex_code: "#FF0000", created_at: "2011-10-01 19:59:26", updated_at: "2011-10-01 1...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623103", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Check Formatting of a String This has probably been answered somewhere before but since there are millions of unrelated posts about string formatting. Take the following string: 24:Something(true;false;true)[0,1,0] I want to be able to do two things in this case. I need to check whether or not all the following co...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623104", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: php adding up numbers I think this might be an easy question for the professionals out there, but here goes. Basically I want to get the total word count of a bunch of paragraphs. Right now I can get the word count of each paragraph, but I can't figure out how to add them all up. $para // an array of paragraph strin...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623106", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: C++ class variables as method parameters? When we are defining the method of a class, is it alright if we use the class variables (whether public or private) as the method's-parameters? In other words which one would be "more correct?" Having defined , class myclass{ public: int x, y; double foo(int, int, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623110", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Multiple Fork example in C I am trying to have a program that uses multiple forks. I used this example to get myself started Multiple fork() Concurrency it works perfectly as is. However, when I try to add a print statement in the child like this: if ((p = fork()) == 0) { // Child process: do your work ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623117", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: (id)sender = nil? I have the following code that updates the value of a textfield with the current time. My question is: Why do you send nil as the sender at the bottom part of the code? [self showCurrentTime:nil]; CurrentTimeViewController.m - (IBAction)showCurrentTime:(id)sender { NSDate *now = [NSDate date]; sta...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623120", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: securely pass data to AS3 from mySQL I need to pass private data from MySQL to a flash file securely. I have a PHP script that is assigning variables on the server side - how do I pass this to flash without being available publically? I assume XML and an HTTP query string are out of the question because of securit...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623123", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Mysql SELECT not working I have the tables: users ID | RANK | NAME | EMAIL | PASS 01 | 1 | Foo | foo@bar.com | $06$uhAMXXZowVIDQ.ZR1gky.u3f/UBkLW8Kd8cbyDt2eNx1qnZH2AUmW allow ID | RANK | STEP 01 | 1 | 1 02 | 1 | 2 03 | 1 | 3 04 | 2 | 1 05 | 4 | * And, I need to know all allowed step...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623132", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: hyperlink doesn’t work in Access form I have an Access form in which I am unsuccessful in formatting the record to be in hyperlink format. The form is in datasheet-view format, which contains records with a link to a website. The form’s datasource is a select-query. The hyperlink is created with the following ex...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623134", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Drupal CCK checkbox edit in views I'm running D6.22 with Views 2.12. I use Views to create a "search / manage content" page for my site editors. Is there a way, within Views, to show a CCK checkbox, and allow someone to select / unselect the checkbox from the View? I'd like for my client to be able to see a list o...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623136", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Rspec testing in ruby mine always returns false I have a class User as follows class User < ActiveRecord::Base has_one :session has_and_belongs_to_many :posts has_and_belongs_to_many :replies attr_accessor :clear_text_password; validates_presence_of :username validates_uniqueness_of :username valida...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623140", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Rails 3 nested resources short name? I'm in the process of upgrading a Rails 2.3 app to Rails 3. In the Rails 2.3 router, it was possible to set a :name_prefix of nil on nested resources to get a shorter name. The actual URL would still be fully qualified, but the code could use a shorter name. E.g.,: map.resou...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623142", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Get postback control in PageRequestManager endRequest event how could I get the ID of the control that caused the postback in the PageRequestManager endRequest event? I looked at EndRequestEventArgs with Firebug but could not find such property. I am using .NET 4. Thank you. A: If there is no “postback control ID” ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623154", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to call Action Helper as broker method in View Helper? I have Action Helper that is database abstraction layer. I would like to access it in View Helper to read and present some data from the model. In Controller I call Action Helper as broker method, but how to achieve the same in View Helper? Somewhere in con...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623158", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: AVAudio detect note/pitch/etc. iPhone xcode objective-c I'm making an app on the iphone and I need a way of detecting the tune of the sounds coming in through the microphone. (I.e. A#, G, C♭, etc.) I assumed I'd use AVAudio but I really don't know and I can't find anything in the documentation.. Any help? A: Music...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623166", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Loading a method using a string variable How can i work with something like: $parameter = "get_something()"; $value = $this->method->$parameter; I'm getting the error "undefined property $get_something()" (note the $). A: Try to use $name = "get_something"; $value = $this->method->$name(); instead
{ "language": "en", "url": "https://stackoverflow.com/questions/7623167", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Component Based Architecture in game development I have been thinking of trying out component based architecture for game development. I have read some blog posts and articles about it but I have a few things I have not sorted out yet. When I say component based I mean that you can add components to a ComponentManag...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623169", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Check for match in other column I am trying to fabricate an SQL query that will provide these results: | Category Title | Subcategory Of | ----------------------------------- | Category 1 | | | Category 2 | | | Category 3 | | | Category 4 | ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623170", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: notification opening a new window no matter what in Java Android I want to launch a notification. When I click on it, it opens a NEW window of the app. Here's my code: public class Noficitation extends Activity { NotificationManager nm; static final int uniqueID = 1394885; @Override protected void onCreate(Bundle s...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623172", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I edit song metadata in Node using C++? I am trying to make a program in Node that automatically fills in metadata for a song (album,artist,name,etc.) Is there a module out there that would let me do this? If not, how would I write one in C++? A: If you're talking about ID3 tags, you can try Tim Smart's node...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623174", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Delete models and collections Using Backbone.js: When a user logs out is it normal to delete a bunch of models and collections? That's what I plan to do in my application to prevent zombie data/bindings but I dont know if it's the best way to handle things. If this is a good practice should I just call delete this ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623178", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: HTML Error Returned on Production ASP.NET MVC 2 Site but Not on localhost I have a RESTful API created with ASP.NET MVC2 that returns all data as XML: string xml = Serialize(Data, context, AcceptCharsetList, encoding); context.HttpContext.Response.ContentEncoding = encoding; context.HttpContext.Response.Charset = en...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623179", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: CCSprite not rendering when made in a method from an external class I'm sure this is really obvious to someone, but this simple thing is really frustrating me. I have a class I made called Class_Sprite, which is a sub-class of CCSprite. I have a method in this class that is supposed to both create the texture for an...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623183", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to enable go.vim by default (automatically)? The instructions on the Vim site says to just put the file in the /syntax folder. This works all right and well. But, for me to use the syntax I must set the following :set syntax=go Every single time. So, I know I am doing something wrong. I just don't know what. He...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623184", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: insert multiple rows from array into table with unique ID I have copied and modified a script off the internet. The script originally deleted selected records from a mysql table query. I have modified the script to insert the selected records into another table with the insert into statement. I would like to know ho...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623186", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Will the value of a set $_SERVER['HTTP_CLIENT_IP'] be an empty string? I have a simple script which determines the user's IP address: function GetIp(){ if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet { $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SER...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623187", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Android: OpenGL textures too large, can't figure out why Why do my textures seemingly take up so much space? My app, which uses opengl heavily, produces the following heap stats* during operation: Used heap dump 1.8 MB Number of objects 49,447 Number of classes 2,257 Number of class loaders 4 Number of GC roots...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623188", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: C++11 File Streams Has C++11 move semantics made the use of std::ifstream and std::ofstream easier or safer with regards to exceptions? I guess it depends on the standard library aswell. Any differences there between GCC, ICC and VC++ Compiler? A: No. The exception safety aspects of the std::stream classes has not...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623193", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Building dll with g++ for use with MSVC application My end-goal here is to execute g++ from my MSVC application to build dlls at runtime. The dlls which g++ creates will then be loaded by the MSVC app for use. Just messing around with some test code using the command line I managed to build a dll but it seems to hav...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623200", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Should subtype/supertype used in databses? I have a comments table for blogs, articles, profiles. A comments table could be a supertype and comments_blog, comments_article, comments_profile could be subtypes. Should supertype/subtype be used in database design since it is object oriented design or should have 3 dist...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623205", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Playing an audio file, from a web page, on a smartphone I'm creating an alternate page of a web site just for smartphones that needs to play an audio file. I can reformat for mp3, ogg, wav, whatever works. I've tried the HTML5 "audio" tag and tested on an iPhone, with no luck. Anyone have any ideas and/or a link to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623206", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Goal Seek, in Mathematica For an experiment, we generated in Matlab some images made out of 8 Disks. We constrained, the minimum distance between the disks and between the disks and the frame as well as the location of the Disks Center Of Gravity (COG). Bellow an example of a composition with the COG on the upper l...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623209", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Parallel file matching, Python I am trying to improve on a script which scans files for malicious code. We have a list of regex patterns in a file, one pattern on each line. These regex are for grep as our current implementation is basically a bash script find\grep combo. The bash script takes 358 seconds on my b...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623211", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Warning trying to get a string from an array ,iOS My program works OK, but I get this warning when compiling: format not a string literal and no format arguments RomanosBasicos is an array of Strings: RomanosBasicos=[[NSArray alloc] initWithObjects:@"M",@"CM",@"D",@"CD",@"C",@"XC",@"L",@"XL",@"X",@"IX",@"V",@"IV"...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623212", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Attempting to install gearmand on AWS Linux EC2, yum can't find necessary packages with default repos I'm attempting to install gearmand on a micro EC2 instance running Amazon Linux 64 bit by following this guide: http://planet.mysql.com/entry/?id=28654 But I'm running into a problem with sudo yum install -y libeven...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623214", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Simple Java Scanner issue I haven't been doing Java long. In this script where it says Thread.sleep(10000); you can still type (I use eclipse) I really don't know why it enables you to type in the output when I have no uno.nextLine(); before or after the 10 second waiting. Please help! Thanks import java.util.Scanne...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623215", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: PHP Convert number to currency I've had a good look around for any help with my problem so hopefully someone can help me here. Basically i have a number which is saved into a $price, the number is 15900. Which should translate to 159.00. Does anyone know how to do this? A: Use number_format for this. It will return...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623216", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Google analytics track search with Codeigniter I have a Codeigniter app and i want to track the search with Google Analytics. The thing is: GA asks for a parameter and my URL is something like: http://domain.com/search/searchterm. No query strings, just clean URL's. How can i do it ? Thanks. A: Short of changing yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623222", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: BitmapFactory.decodeFile(); In my application, I have a file: private File TEMP_PHOTO_FILE = new File(Environment.getExternalStorageDirectory(), "temp_photo.jpg"); This is declared directly in my class, and is visible to all the methods there in. I want to use this: Bitmap thePhoto = BitmapFactory.decodeFile(Uri.fr...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623223", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Passing Values Back and Forth from Browser to Controller Using JSON I found a workaround for errors parsing JSON strings sent from (Firefox) browser using JSON.parse() in my controller, but isn't there a better solution? rails 2.3.12 json (1.6.1)    View --> Controller views/theme_maps/edit.html.erb: (javascr...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623224", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: IRC client - No reply on JOIN I am writing a IRC client in C++ (with the help of the SFML library), but it is behaving strangely. I send the NICK and USER commands and I can connect to the server, but the JOIN command has many strange thing happening that I have to write "Random code that magically works" to solve. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623230", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Rails3 / Rails2 - Routing issue Today I tried to follow the basic "Twitter" tutorial on : --> http://www.noupe.com/ajax/create-a-simple-twitter-app.html But in the midle of the tutorial I have an issue. It says that you should edit /config/routes.rb and add this piece of code : ActionController::Routing::Routes.dra...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623238", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: grails when does ID get assigned? I'm doing myDomainObject.save(flush: true) and then attempting to read the id assigned to myDomainObject in the next statement, and I get a value of "null". My application needs to use this id as an invoice # (to send out via a service) as soon as I can get the new id. My question...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623240", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: PHP Mail Function with Multiple Table Query I'm working on a script that allows visitors to enter their email address to receive a notification upon a photo upload by other users. For testing purposes, I used this code to query just my "email" table, and it works perfectly when a new photo is uploaded: $data = mysq...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623242", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: rails including javascript or files only on certain pages Ok Im new to rails in general and these default loaders and cache loaders an all that stuff they make some sense to me. But my question is. If I want to include a certain JS file or 2 or specific script on a particular page how would I do that. with rails I ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623248", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is it possible to bypass sorting of localdata when using grouping in jqgrid? I have client-side data (local data) always sorted, and I don't want jqgrid to re-sort the data for grouping (like server-side sorted data behaviour-- groupDataSorted = true). Is it possible to bypass/disable sorting of data before grouping...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623254", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is there a way to do an Ajax Post to an ASPX page that doesn't call a static function? The question says it all. I am having no trouble making Ajax calls into my ASPX page - as long as I use static methods. However, I'd like to store a result in the session and so need a "live" function call. Any ideas? A: Post ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623258", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Conversion/Casting between two pointers Lately I've been doing a lot of exercises with file streams. When I use fstream.write(...) to e.g. write an array of 10 integers (intArr[10]) I write: fstream.write((char*)intArr,sizeof(int)*10); Is the (char*)intArr-cast safe? I didn't have any problems with it until now bu...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623270", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: AFNetworking Post Request I'm a newbie in obj-c and have been using asihttp for some of my projects. When doing a post request in asihttp its done this way. ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setPostValue:height forKey:@"user[height]"]; [request setPostValue:...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623275", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "82" }
Q: substream from istream Suppose I have an ifstream which represents a large file containing lots of sub-files aggregated together. I want to be able to create a "sub" istream from the larger ifstream (given a size and offest) representing a part of the file so other code can read from that substream as if it was an i...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623277", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Showing branch hierarchy at the command line? I'm curious if there is a way to show branch hierarchy on the command line? For instance if I use git branch, instead of seeing output like this: * master joes_work refactoring experiment You see output like this: * master joes_work refactoring experimen...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623278", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "92" }
Q: PHP - Mixing object Injection & inheritance This is a follow up question on the following answer : Parent Object in php class A { protected function doSomeStuff(){ echo 'a method that all children will need to call'; } } class B { protected $_parent; public function __construct($parent) { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623281", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Export SQL data from android to MS SQL server 2008 I'm fairly still new to android and I was wondering, what is the best way to get data from an android device to MS SQL server 2008? I've seen a number of people who have commented on several ways to do this but I'm looking for a means of somehow exporting the data a...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623288", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: post a link from jquery to call a ASHX asp.net I have this function: function exportdata(ID) { $.ajax({ type: "POST", url: "export.ashx?ID=" + ID, data: "{}", /*contentType: "application/json; charset=utf-8",*/ dataType: "json" }); } It works fine but w...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623289", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: VSTO Add in for Office 365 I have a couple of Excel Add ins. If I move to Office 365, will these add ins be available ? Is there any development support(VSTO) for Office 365 ? A: I to have been curious about the answer to this, so went looking online. From the following site, I'd say the answer is no. It looks li...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623290", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: hide input[type=submit] and show loading image not working using jquery, i am trying to hide the submit button and show an ajax loading gif once it is clicked. it is working fine, but the form does not get submitted anymore. heres my jquery code: $('input[type=submit]').click(function () { $(this).parent('p').ht...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623292", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is there a command to move the whole SVG path to a new position? Is there a command to move the whole SVG path to a new position, instead of adding the offsets to each point of the path? A: <path transform="translate(x, y)" d="...."> If your path already has transforms and you'd rather not interfere with them: <g ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623296", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Setting modified flag in a class Say I have a class Car that has 2 properties: NSMutableArray *parts and BOOL modified parts is an array of custom object called Part. I want modified to be set to YES if any property of any Part in the array is modified. Is this a good candidate for KVO or is there a better way to do...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623297", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What technology can be used for animating a MIPS Pipeline? For my Computer Architecture class, I have to create an Animated MIPS Pipeline Simulation with the colors and everything. Any idea which technology can be used to accomplish this? I can do the coding in several high-level languages but I have no idea how to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623298", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is it possible to get .class from a generic class? How does one do something like: Schema<ArrayList<UnitInstanceData>> scheme = RuntimeSchema.getSchema(ArrayList<UnitInstanceData>.class)); A: The .class is runtime access to the class object. At runtime generics are gone, having been eliminated by "type e...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623299", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: BLOB's in SQL that stores a Video file I am hoping someone can explain how to use BLOBs. I see that BLOBs can be used to store video files. My question is why would a person store a video file in a BLOB in a SQL database? What are the advantages and disadvantages compared to storing pointers to the location of the v...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623306", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Does MySql Have xml support like SQL Server? Does MySql Have xml support like SQL Server? I have searched and can't seem to find anything. In SQL-Server I can use FOR XML to build xml output from my queries. Is a similar method available in MySQL 5.1? A: To some extent, but not like MSSQL. See http://dev.mysql.c...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623308", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Solve "The command "taskkill /F /IM MyApp.vshost.exe" exited with code 128" error Context When debugging (with the Debug menu F5) a Visual Studio solution, a process called MyApp.vshost.exe is created. When you stop the debug indecently - I mean using the Stop Debug menu SHIFT+F5 and not waiting for a code line like...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623310", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Drupal defining node grid data I need to define a 10*10 grid of nodes. Each cell in the grid has to contain exactly one node. A newly created node gets inserted into the next available cell and a new node can not be step to occupy an occupied cell. That's the scenario I am trying to accomplish but I need suggestions...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623312", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is the equivalent of Android's Html.fromHtml() in WP7? Is there a quick and dirty way to render HTML in a textblock in a fashion similar to Android's Html.fromHtml()? I am aware of how to manually parse it with something like the HtmlAgilityPack, but all I really want is for it to render like its source in the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623313", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: getting oauth_problem: signature_invalid error in Java running my first OAuth provider/consumer example. My provider is the below jsp running on Tomcat 7 <%@page import="net.oauth.*, net.oauth.server.*" %> <% String consumerSecret="testsecret"; String consumerKey="testkey"; OAuthMessage message=OAuthServlet...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623316", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Pixel collision detection? In my app, I have a bunch of CCSprites and I want to have a collision detection feature that will work only when the non-transparent pixels in the CCSprites collide. I don't want to be restricted to color between the colliding sprites. I think thats what the 'Pixel Perfect Collision Detect...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623321", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why do I keep getting two of same random values in this code? Possible Duplicate: Why does it appear that my random number generator isn't random in C#? I have the following code: int a; int aa; Random aRand = new Random(); Random aaRand = new Random(); a = aRand.Next(20)...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623322", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: How to take a look at the next character in a stream in C? Possible Duplicate: C equivalent to fstream's peek Say I have a file with characters in it. I want to look at what the next character is without moving the pointer, just to "peak" at it. how would I go about doing that? FILE *fp; char c, d; fp = fopen (f...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623323", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: std::hash_set vs std::unordered_set, are they the same thing? I know hash_set is non-standard and unordered_set is standard. However, I am wondering, performance wise, what is the difference between the two? Why do they exist separately? A: Regarding the question "are they the same thing" from the subject line: bas...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623328", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Strange exception with python's cgitb and inspect.py I have a function that decodes an exception and pushes the info to a file. Following is what I do basically: exc_info = sys.exc_info txt = cgitb.text(exc_info) Using this, I got the following exception trace: Traceback (most recent call last): File "<stdin>",...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623329", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I protect OAuth keys from a user decompiling my project? I am writing my first application to use OAuth. This is for a desktop application, not a website or a mobile device where it would be more difficult to access the binary, so I am concerned on how to protect my application key and secret. I feel it would...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623335", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: 2D coordinates of Histogram3D from a given point of view I found that plot on the web. I don`t know which kind of Distribution yields this. I would like to draw such plot on paper. But get some help from Mathematica if possible : With this image as example could I obtain the 2D coordinate of each visible bar edges ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623336", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: mysql (5.1) > select * from database.table where not foo (on all fields) I want to select everything in a table where the cell's value is not foo. I thought it would be something similar to WHERE NOT NULL, like SELECT * FROM database.table WHERE NOT 'foo';, but that just returned the column headers with no data. edi...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623341", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: AS3 - URLload local files with absoute path I am trying to open local hard drive files inside AS3. I'm getting a security error with this code: var soundFile:URLRequest = new URLRequest("c:\slushy.mp3"); Is it possible to URLload an absolute path on the hard drive? Edit: so this appears to be a sandboxing issue. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623348", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: MVC3 Want Clientside Validation to trigger for two fields when one of the two is modified I am creating an MVC3 website and added a couple of security questions to the "My MVC Application" Registration routine in the form of dropdown boxes. I created a custom validator to check the second dropdown box and if the sel...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623355", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Sortable linked list of objects For a school lab I have to make a linked list of messages and then sort those messages by priority, with "High" priority being pulled out first, then medium, then low. I've been trying to figure this out for days and I can't wrap my mind around the sorting. I've been trying to get i...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623356", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Statusnet installation Issue I have been trying to deploy statusnet on Amazon EC2. I have set up the AMI and did other necessary things. Now when it comes to installation I get this error: "No configuration file found. I looked for configuration files in the following places: /etc/statusnet/statusnet.php /etc/stat...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623357", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Unable to filter a data frame? I am using something like this to filter my data frame: d1 = data.frame(data[data$ColA == "ColACat1" & data$ColB == "ColBCat2", ]) When I print d1, it works as expected. However, when I type d1$ColB, it still prints everything from the original data frame. > print(d1) ColA ColB -...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623362", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: AS3 - Cancel PHP request That script below is for uploading an image via PHP. Now I'ld like to give the user the option to cancel the upload. How to cancel the PHP request once it got send? package { import com.adobe.images.PNGEncoder; import flash.display.BitmapData; import flash.display.MovieClip; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623367", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Maven Learning Questions In eclipse I've installed m2e plugin. I am trying to understand how do you know the names of properties for dependencies to add to pom file? Say for instance how do you know which artifact id to use? <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactI...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623368", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: extjs 3.3: floating panel I am trying to create a floating panel over other pre-created panels, I tried following simple codes, but failed: var testPanel = new Ext.Panel({ id: 'testP', width: 50, height: 100, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623370", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }