text
stringlengths
8
267k
meta
dict
Q: Working with a remainder of Zero with modulo operation? I'm having some difficulty working with a remainder of zero with the modulo operator. Basically this is a line of my code fday= (day+24) % 30 I'm trying to just add 24 to any day and take the remainder of it. However, if a user enters 6 for the day, the res...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623373", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: How to invoke method on PSObject from managed C++ I'm trying to execute a WMI function using the PowerShell class from a managed C++ function. But I can't work out how to call a method on the object that is returned in the PSObject list from the PowerShell.Invoke() method. (On the command line I would just do (gwmi ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623374", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Shared preferences is not applied right away I have a list of activities on clicking one of which i will get a ListView. On this ListView here, I can apply the preferences using a menu button. But this preferences is not applied right away to the ListView. I have to go back and navigate my way through the parent l...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623376", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is there an assembler available for Mac OS 7.5.2? Following my last quesiton (Is there a compiler available for Mac OS 7.5.2?), I'm wondering if there is an assembler that I can download for Mac OS 7.5.2? I'm not particularly interested in finding an IDE, but I may need a suitable text editor. Also, it would be nice...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623377", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Replacing the elements that meet special condition in List with Python in a functional way I have a list [1, 2, 3, -100, 2, -100]. I need to replace -100 with "ERROR", and others to their corresponding string. I could code like this. resList = [] for val in list: if val == -100: resList.append("ERROR") ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623378", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: sleep system call in thread I am using pthread library for multi-threading. Inside thread function, I use sleep system call. Will this block a single thread or the whole process. Thanks. A: Generally, sleep affects only the calling thread. Real, kernel-managed threads run independently of each other. In an app th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623381", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Native bitmap processing and ALPHA_8 I'm trying to convert an image to grayscale through a native function, using a piece of code taken from Android in Action (2nd ed.; you can also see it here). Unfortunately, the returned bitmap object, instead of grayscale, ends up empty. This is how I load the (.png) image: Bitm...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623382", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: C++11 Pointer Uniquify Helper Function In C++11, I'm missing a syntatic sugar for uniquifying a pointer into std::unique_ptr. I therefore wrote the following litte helper function std::uniquify_ptr typically used to easy (non-constructor) assignment of mutable class members (typically different kinds of caches). #in...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623383", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why doesn't this code work to set up basic Android OpenGL? Hey I am trying to just set up the basic structure for some basic graphics. However, when I run this code the app makes me force quit on the emulator. I am using Android 2.3. I used this website to get this far http://developer.android.com/resources/tutorial...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623385", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: SSL configuration with play framework and the chain file I have configured play internal web-server with SSL with following configuration: https.port=9443 certificate.key.file=conf/host.key certificate.file=conf/host.cert but the problem is that the newest firefox is unable to authenticate and gives the following m...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623392", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Undefined References In Antlr C Runtime Example I'm having a problem running the C runtime example at http://www.antlr.org/depot/examples-v3/C/treeparser from Antlr. I've downloaded and installed the C runtime from http://www.antlr.org/download/C. The library libantlr3c.a is located in /usr/local/lib, and the antlr ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623393", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What's easiest way to get a previous iPhone app version onto my device? (for testing upgrade to upcoming app version) Background: Have got v2 of an iPhone application in XCode now, with v1 on the app store. So on my iPhone I have working versions of v2. Aim: So I want a quick way to load the true original versio...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623395", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Override Ctrl-C I am supposed override the CtrlC signal and use it to print a message. It is not supposed to end the program. What happens so far is that when CtrlC is pressed it prints the message, but ends the program. When I asked my professor he told me to do this: You need to make your signal handler keep from...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623401", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How to convert a std::istream to std::wistream I have an istream and some code expects a wistream. I literally want every char of a source stream zero extended to a wchar_t. I don't care about code pages, I don't care about localization, I simply want to seamlessly pipe this input, what's the fastest way to do it? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623403", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: simple C++ comparision if statement I have a function in C++ that takes a char array thingArray[6] and places ' ' onto each place. like: for (int i =0; i<5; i++) { thingArray[i] = ' '; } now I have another function that sticks a character if it finds an empty space in the array. please say the arr...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623404", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to highlight the menu item for the sort type of data on the page? In this site I would like to highlight the type of sort on the menu. I found many source to do this with css or javascript but I could not understand them enough to apply them to this site (they seem to be for pull-down menus). Can you direct me a...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623409", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Learning the reddit JSON API using Apigee. How do I submit a story? Accordng to https://github.com/reddit/reddit/wiki/API I need to: "Post the following to http://www.reddit.com/api/submit: uh=f0f0f0f0&kind=link&url=yourlink.com&sr=funny &title=omg-look-at-this&id%23newlink&r=funny&renderstyle=html I believe uh is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623411", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Will having an iFrame on someone else's domain transfer pagerank to my site? I am having a hard time finding a good answer to this question. I see that Google treats the content in the iframe as its own seperate site, but what I want to know is if it transfers any pagerank to my site. What I am letting other sites...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623413", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Change animation in runtime I want to achieve simple tasks - before dialog is dismissed, I want to set different close animation depending on my logic (getWindow().getAttributes().windowAnimations = ...). For examle, I have 2 buttons on dialog and i want to slide left if first is pressed, slide right if second is pr...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623414", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: timertask-based logout give me problems In this website I need a system that logs the user out after 10 minutes. In order to login I use a simple procedure of inserting a user (in my case called Lid) instance, and the logout invalidates the session, additionally, when the user logs in a timertask within a timer star...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623422", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Android memory leak example from Google I/O I just had a look at the google io video "memory management for android". Slides are available here http://dubroy.com/memory_management_for_android_apps.pdf. The memory leak example is on slide 36. I do not understand why this causes a leak after orientation change. I do ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623423", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Raven DB: How is 'smuggler' different from 'Import/Export'? With Raven DB, there is a program called "Smuggler" which allows dumps to be taken of Raven DB. However, there is also an option within Raven DB Management Studio to 'Import/Export' database. What is the difference? A: There is no difference, Import/Export...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623428", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: TYPEFACE.JS Selecting different fonts I'm trying to create a font preview form like on dafont.com or a similar website using typeface.js. I'm having trouble getting typeface.js to render font for anything but a heading tag. Further, how can I choose which font to use from a dropdown? Thanks SO much! A: Have you rea...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623433", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Sharepoint 2010 List Creation Limit Does anyone knows if sharepoint 2010 have some kind of limitation related to list creation? I need to create a web application with 120.000 lists for a specific reason. It is that possible? There will be some performance issues? Cheers, A: I don't think theres a limitation for ho...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623435", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What conditions must be met for iPad/iPhone hardware accelerated animations? I'm just wandering what I must do to get hardware accelerated animations ? Do I have to se doctype HTML5 or can I use HTML4.01 or something similar ? Are there any other limitations / things I must do/use? Also, where can I find a list of c...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623437", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Regex work in chrome and explorer but not in firefox I am using Jquery to validate my textbox. my particular regex condition is... /^[A-Za-z.-\s]*$/.. that is alphabets, space, hyphen, and dots. Issue is it work great and efficiently in Chrome and explorer but firefox gives error for this regex. I checked using fir...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623438", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How to trigger the select event handler in jqueryui autocomplete combobox? I have a jqueryui autocomplete combo-box widget in which once the user selects something in the combobox, the select event handler within the combo-box makes an ajax call to render content in another div element. EG: [combo-box] > [div] The d...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623439", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Issue with SBJsonParser my iPhone application is receiving from my web service this json string: {"res":true,"users":[{"id":"79","username":""},{"id":"81","username":""},{"id":"83","username":""},{"id":"80","username":""},{"id":"82","username":""}]} I'm handling it with the following code: SBJsonParser *jsonParser ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623443", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Handle Malformed Remote JSONP Response this is a continuation of my original question here link You can see through my rather lengthy conversion with aaronfrost that we determined the jquery was loading in the .php (as seen on the network tab in CHROME) however it's trying to be ran as a script immediately. My que...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623447", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: EF and POCOs. How to properly set up my project Recently I started working with EF 4.1 in .NET and had sort of positive experience until today when I tried to set up my own project (so far I was working on projects started by somebody else). The thing just doesn't want to work out of the box. I don't do anything spe...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623448", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: ASP.NET: Implementing ISessionIDManager for cookieless sessions? Question: I'm writing a custom session provider. So far it works excellently. I decided I wanted to add a customized ISessionIDManager, to control the session id. It already works fine for cookie sessions. But when I swich to cookieless, like this: <se...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623453", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Getting the average RGB color of a CGImageRef in iOS I've been struggling with this for a couple of hours, and I'm hoping someone else has some insight. I'm looking for a way to get the average RGB color of a 1x1 UIImage. So far I've created a CGImageRef from the UIImage, but I'm really new to CoreGraphics, so I'm n...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623455", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why do I get a segmentation fault while iterating through this vector? I need to go through this vector and delete the duplicates. A segmentation fault is occurring somewhere within this code. My guess is that it has something to do with deleting elements while the iterator is going through, but I don't really have ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623457", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: PHP Authentication class for Twitter and Facebook I'm looking for a simple PHP class that supports Twitter and Facebook authentication. I don't need to access their respective API's or post anything. just simple, painless, basic auth. A: Maybe janrain coud fit you if you don't have enough traffic or you are able t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623460", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: compact storage for non static binary trees I have seen array based implementations of static binary trees which do not waste memory for pointers and instead do operations on the current index to go to its parent or children. Is there any articles that talk about similar methods for binary trees where you will have ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623462", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What's the best way of constantly resizing elements with the mouse? What's the best way of constantly resizing elements using clicking and holding a resize image in the bottom-right corner of the element? Is there a specific empty element that has resizing built in or a style to use that would be better than using a...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623464", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: NHibernate - Is there a way to map a formula that uses sql function and returns Table?! I have a sql function that returns table and I need to map it to a collection i'm trying with formula but as far as i can tell formula is good only to single returned value (right?!?) is there a way to use formula and map it to a...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623465", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can encode('ascii', 'ignore') throw a UnicodeDecodeError? This line data = get_url_contents(r[0]).encode('ascii', 'ignore') produces this error UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 11450: ordinal not in range(128) Why? I assumed that because I'm using 'ignore' that it should be ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623476", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Advice needed: Geolocation for c# web app - need country location to set what user can see or not My scenario is I want to trap the user's country when they access the web page. Based on the user's country i want to set a cookie that will allow me to do a simple "if" statement in the code behind that would let them...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623481", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: html * adding unwanted space underneath every * I am getting an unwanted visual quirk from creating <li>'s within an <ul>. It is producing an unwanted space underneath each item. This is the simplified code that I am currently using. <ul style="margin:0; padding:0;"> <li style="border:1px solid #000; margin:0; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623485", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Zero Threaded Process? Does a process have to have at least one thread in it? Is it possible for a process to be void of any threads, or does this not make sense? A: A process usually has at least one thread. Wikipedia has the definition: a thread of execution is the smallest unit of processing that can be schedu...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623493", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: String of boolean values to an array? I created the code below to print out all of the values of a string to 'true' or 'false'. I would like to fill an array with all the printed values "True true false true...." Right now when I print out the values of the String str if it is not in the loop I only get the first ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623494", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Enlightening Usage of C++11 decltype I've just seen this really nice talk Rock Hard: C++ Evolving by Boris Jabes. In the section of the talk concerning Higher-Order Generic Programming he says that the following is an example of a function that is more generic with regards to its return type and leads to fewer templ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623496", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: Weird unresolved external errors I'm getting some Unresolved External Errors I can't seem to find a solution for: 1>MyApp.obj : error LNK2019: unresolved external symbol "public: void __thiscall Path::AddPoint(struct Point2D const &)" (?AddPoint@Path@@QAEXABUPoint2D@@@Z) referenced in function "public: static long _...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623503", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Loop through navigation menu with jQuery relative(?) links: http://api.jquery.com/each/ http://api.jquery.com/jQuery.each/ hello i got this navigation menu <table> <tr> <td><div id="menuItem1" class="menuItem"><a href="http://www.w3schools.com">PORTFOLIO</a></div></td> <td><div id="me...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623510", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is it possible to XOR multiple items in assembler? Just wondering if it would be possible to XOR multiple bytes in assembler. Since you would normally do XOR al,A I'm just not sure how it would be done. Any help would be appreciated, thanks. A: Advanced architectures may provide an instruction for this. In fact, o...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623514", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Specific Combinations in C#, unable to grasp it I've been looking into combinations lately, I've tried various 3rd party solutions, and tried to get my head around it myself. Without success I might add. I need to generate a 13 length string with all possible combinations of say.. int 0-2, I.E 0 0 0 0 0 0 0 0 0 0 0 ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623516", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to intercept all requests for favicon.ico in SpringMVC? I've got a controller that will respond to /favicon.ico appropriately. But I just realized that when you're in a sub page such as /subpage/index.html the browser (at least chrome) is requesting /subpage/favicon.ico. Is there a clean way to just respond to a...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623524", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: CakePHP; how to make find conditions dependent upon foreign key of $id parameter I'm new to programming so please forgive me if this is a noob question! I'm using Cake to build a blog, with the models users and entries. I have a View page for the blog entries and I would like to add a list with all the other entries...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623528", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Installed Nginx with passenger-install-nginx-module. How do I uninstall it? I'm on Mac OSX. Nginx is installed in /opt/nginx. How do I uninstall it? Any thoughts? A: gem uninstall passenger will remove passenger and all these dependencies passenger, passenger-install-apache2-module, passenger-install-nginx-mo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623533", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Adding controls to GroupBox during runtime I'm trying to create a GroupBox, add a Grid (or StackPanel) to it then put some TextBlocks on it, all during runtime. This is what i've tried GroupBox groupBox1 = new GroupBox(); Grid grid1 = new Grid(); groupBox1.Width = 85; groupBox1.Height = 60; grid1.Height = 85; grid...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623534", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: attr('defaultValue') is returning undefined using jQuery 1.6.3 I have a simple script in jQuery that works perfectly with jQuery 1.5.2 as you can see in this jsFiddle. What is supposed to happen is that when you bring focus to the text field, the default value is removed. And when if you leave the field blank, the...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623535", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Is this a proper way of calling synchronous methods asynchronously? I was using code like this: handler.Invoke(sender, e); But the problem with that code is that it is synchronous and all it really does is update the GUI. It is not necessary for the server to wait for it to complete so it should be made asynchronou...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623544", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Where is sublime.py? Sublime Text2 text editor is extended via python scripts, using these modules: import sublime, sublime_plugin I've searched my computer and found sublime_plugin.py file. But where is sublime.py? A: I believe that Sublime is provided dynamically when you call the plugin via the console. Remembe...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623547", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is there a way to distinguish mice in JavaScript? I am wanting to hook up several mice - each one used for different types of input. Is there a way in JavaScript to distinguish between each mouse? I know that JS may not seem like the right language for this, but I want to use one mouse for web navigation, and the o...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623554", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to randomly generate numbers from 3000 to 80000 ending with zeros only? I would like to randomly generate numbers like: 3000 4000 5000 etc... between 3000 and 80000. How might I do that? A: <?php echo $your_number = (rand(3,80) * 1000); demo A: I think this is what you mean: $number = rand(3,80)*1000; you ca...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623555", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Handling large String lists in java I've got a task, where I've got to go through several billion string lines and check, whether each of those is unique. All the lines themselves cannot be accommodated within the RAM memory of the PC. Also, the number of lines is likely to be larger than Integer.MAX_VALUE. I'm assu...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623571", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Values in array of structs turning into garbage values I have an issue that's really confusing me... Below I am calling an initialize function: void Initialize (List *L) { char* initialize = "initialize"; int i; for (i=0; i<MAXLISTSIZE; i++) { strncpy(L->items[i].name,initialize,MAXNAMESIZE); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623573", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Replace html of a div after anchor tag? This is a quick example not my actual code. Onclick of the div button, how do i replace the html after the anchor tag or parent div title? The jQuery code here replaces everything in the div title i only want to replace what is after the anchor tag. script $(function() { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623577", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to establish a secure connection with MySQL/PHP I'm currently doing a Capstone project and I need to establish a secure connection between PHP and MySQL. Is it there some kind of method ? A: You can use SSL to connect to MySQl. This specifics of this varies based on your platform.
{ "language": "en", "url": "https://stackoverflow.com/questions/7623581", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: passing a pointer of a reference/passing a reference of a reference Do I get a usual pointer as I pass a pointer to a reference of a variable or do i get a pointer to the reference? And what do i get as I pass a reference to a reference? I am using the stack implementation of the standard library in a class, and i w...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623585", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Trying to turn Simple_form gem's collection radio's wrapper into * element I am using the simple_form gem (https://github.com/plataformatec/simple_form) to help out the forms in my app. But I'd like to display the many radio buttons I've got here in li tag. Simple_form now generates span wrapper tag for each radio ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623587", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Safe dynamic include from $_GET Is this a safe way to include pages from a $_GET parameter: $pg = basename($_GET['pg']); if (is_file('views/' . $pg . '.php')) { require 'views/' . $pg . '.php'; } I sanitize the parameter using basename() and all the possible files for including are in a "views/" subdirectory. It ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623592", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Short-urls without index files? I'm wondering how urls like these are generated: http://www.example.com/Xj7hF This is a practice I have seen used by many url shorteners as well as other websites that supposedly don't want to display data in the url in a parameter format. Surely they can't be placing index files in t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623597", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: C++11 resources and compilers What is the recommended resource(s) for learning the new features in C++11? Is there any book on it yet? Does latest versions of g++/Visual Studio support it? A: The current versions of g++ and VC++ each support some features of C++11, but neither supports everything (overall, I'd say...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623598", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Exporting Excel File to View (MVC) I have to Export Data to View as Excel , Actually I have Implemented,but my doubt is when to use return new FileContentResult(fileContents, "application/vnd.ms-excel"); vs return File(fileContents, "application/vnd.ms-excel"); and How can set Downloadable Filename in each of thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623599", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Sync local file with HTTP server location (in Python) I have an HTTP server which host some large file and have python clients (GUI apps) which download it. I want the clients to download the file only when needed, but have an up-to-date file on each run. I thought each client will download the file on each run usin...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623600", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: memcpy causing 'exc bad access' I'm trying to loop through an array and copy across data, but after 1023 loops, I get an exc bad access message thrown and I have a feeling it might be to do with my memory. In my loop, I need to append data to my totalValues array, so I did this: memcpy(totalValues + totalCopied, tem...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623602", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Push to remote Mercurial repository I have a Mercurial repository on a remote VPS. The VPS has SSH access enabled. What are my options for pushing code changes from my development machine to the remote VPS? A: If your VPS has Mercurial installed, simply: hg push ssh://username@host/path/relative/to/home or add to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623607", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Is this an inefficient way to write a SQL query? Let's suppose I had a view, like this: CREATE VIEW EmployeeView AS SELECT ID, Name, Salary(PaymentPlanID) AS Payment FROM Employees The user-defined function, Salary, is somewhat expensive. If I wanted to do something like this, SELECT * FROM TempWorkers t INNER...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623608", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: MATLAB parallel computing setup I have a quad core computer; and I use the parallel computing toolbox. I set different number for the "worker" number in the parallel computing setting, for example 2,4,8.............. However, no matter what I set, the AVERAGE cpu usage by MATLAB is exactly 25% of total CPU usage; an...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623614", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Inputstream reader skips over some text Hi guys so this is an exert from the code I have public ItemList() throws Exception { //itemList = new List<Item>() ; List<Item> itemList = new ArrayList<Item>() ; URL itemPhrases = new URL("http://dl.dropbox.com/u/18678304/2011/BSc2/phrases.txt"); // Initiliz...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623617", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: XNA C# HUD SpriteFont I added a SpriteFont to my HUD and this is what I get: http://i557.photobucket.com/albums/ss13/KookehMonsters/Dev/Untitled-1.png All those white spots are from my camera panning and the text following along. What's going on? Label displayName = new Label(); displayName.Text = "...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623626", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Antialiasing PNG resize in Qt? In a PyQt based GUI program, I'm drawing a few PNG file as QPixmap after resize. So here is basically what happens: bitmap = QPixmap( "foo.png" ) bitmap.scaleToHeight(38) # original is larger than this scene.addItem(QGraphicsPixmapItem(bitmap)) # Add to graphics scene The problem is: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623631", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How do I convert a string into two integers in Clojure? A json-encoded string is passed into my function, and I need to split that string based on a delimiter, then convert the first two delimited values into integers and assign them to variables which will be used within the function. I've got code that works, thou...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623633", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: how many kernels running parallel in Mathematica? Wolfram site states that typically only 4 cores are used with its Parallel feature. If you want more than 4 you need to contact them and pay up. I have a machine with 2 quad-core hyperthreaded processors. When I run Parallel commands, it starts up 16 kernels 2 x 4 x...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623636", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How to build FourSquare like leaderboard (users above and below you) I'm looking for a way to implement Foursquare's style of leaderboard where instead of showing you the top 10 for example it shows the you 2 people above you and 2 people below you between your friends. I'm hoping to avoid having to pull down everyo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623639", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: xpath dom preg_match I have this code with google map coordinates inside and i try to get coordinates but somewhere is a problem; The code is: <iframe width="430" scrolling="no" height="250" frameborder="0" src="http://maps.google.cz/maps/ms?msa=0&hl=cs&brcurrent=5,0,0&ie=UTF8&vpsrc=6&msid=207589766138527801127.0004...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623641", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: resetting a stringstream How do I "reset" the state of a stringstream to what it was when I created it? int firstValue = 1; int secondValue = 2; std::wstringstream ss; ss << "Hello: " << firstValue; std::wstring firstText(ss.str()); //print the value of firstText here //How do I "reset" the stringstream here? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623650", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "104" }
Q: Vowel datatype in Haskell, is it possible? I have written the following code to remove vowels from a sentence: main = print $ unixname "The House" vowel x = elem x "aeiouAEIOU" unixname :: [Char] -> [Char] unixname [] = [] unixname (x:xs) | vowel x = unixname xs | otherwise = x : unix...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623651", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Prohibit the posting of HTML in textarea form field I have a text area where a user can define a post. This field should allow BBCODE but not HTML. Currently HTML is allowed but it should not be. How can I disallow HTML tags to be posted by the user? A: There are two main choices here. You can either escape the HT...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623652", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Having problems when returning a variable using jquery I dont know why this code doesnt work :S function check(){ var haySaldo=false; $.post("controlarSaldo.php", function(data) { if(data>0) haySaldo=true; }); return haySaldo; } Information: data=1000 I put an alert of haySaldo insid...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623658", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Security between rails and nodejs I have an app that is mostly in rails but also uses nodejs for some realtime features, for example, chat. Users log in via Rails and get assigned a session, etc as usual. However, what's the best way to authenticate with nodejs as that same user? For example I would like to prevent ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623660", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Display content inside 'Blogger' to max-width correctly How can I enclose the content section of my blog to display any items(JPEGs/video) to a certain width??? I'd like to re-size only if the items are larger then "...px" I currently use 'blogger', I can either manipulate the html for my entire blog or make up tags...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623664", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: using php variables in a html email using swiftmailer Im using swiftmailer to send my emails from my site. I'm trying to get a html email to send but i want to pass a php variable in to the email. Is this possible and if so where am i going wrong? ->setBody( '<html>' . ' <head></head>' . ' <body>' . ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623667", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Android: make rounded layout with two background colors I wanted to make a rounded shape and apply it as a background on a layout. This i have under control, but i wanted to make the background like a progressbar. that is i want it to look something like this image: I want to be able to control where the bg change ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623671", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Access XML from 3rd-party SOAP service? I'm using a vendor-created SOAP client to access their SOAP service in my Jersey 1.3 REST application. In certain cases, I would like like to access the response's XML, instead of the client's proxy class. Is there a way to do this? I also have access to their WSDL if that wo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623675", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Adding controls and their events dynamically I have a problem in asp.net I'm developing a website in visual studio 2008 using (asp.net/vb) I have to allow registered users to build pages and add controls that are already defined by the same user. My problem is how to build this page dynamically? In other words, I'd ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623681", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: CMFCPropertyGridProperty list of values? Is there a standard way to hold a user editable list of values in a CMFCPropertyGridProperty? I'm thinking a string with semi-colon delimiter (that seems to be the windows standard). If I want an edit interface for this how would I build that? A: One option: You can inheri...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623682", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: checkbox inside an update panel does not get its state I have 2 checkboxes inside an Updatepanel: <asp:UpdatePanel> <asp:CheckBox CssClass="checkboxDivE"/> <asp:CheckBox CssClass="checkboxDivE"/> <asp:UpdatePanel> in js, jquery: $('.checkboxDivE').live('click', function (e) { alert($(this).is(':checked'...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623685", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: MS Access: An error in vba of my form I have a simple MS Access form that has 3 objects: a text box, a list box, and a button. The intended use of the form is as follows: the user enters a name in the text box, selects an item from the list box, then clicks the button to add the data to a table. However, when I cli...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623686", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Accessing program messages output to error stream I've created a class which processes files and if it encounters certain specific errors, it outputs relevant error messages to the error stream. I am working on another class that needs to access these error messages. I'm not sure how to do this. I am a beginner in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623688", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I use variables in less with the Rails 3.1 Asset Pipeline I am converting a number of less files into a rails app, and running into problems with the processing of variables and other less features. I require my assets in application.css, but when viewing the page see the following error: Less::ParseError: va...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623690", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Random data loss on iOS after restarting app Clearly I must not be doing something right but this happens on random occasions. I can't make the issue appear by following certain steps so it has become extremely hard to debug. I have an app in which every time an object is added, or deleted it writes the file to a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623695", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is this always the address for GDB debug program? I will narrow down my questions: The entry address in GDB stays the same for the same program (even after reboot, and after rewriting the source code). Why is that? For example 0x80483f4 is the starting address. **0x80483f4** <main()> push %ebp ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623696", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: PHPmailer failing if trying to send two emails in same script I'm using PHPmailer to send emails and I've created a function that prepares the email and sends it. If I try to use this function more than once in a script it stops the script execution when it trys to send a second email using the same function. my fun...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623697", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: wget can't download - 404 error I tried to download an image using wget but got an error like the following. --2011-10-01 16:45:42-- http://www.icerts.com/images/logo.jpg Resolving www.icerts.com... 97.74.86.3 Connecting to www.icerts.com|97.74.86.3|:80... connected. HTTP request sent, awaiting response... 404 Not ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623698", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "35" }
Q: CMake Header Generator Updates In CMake I currently have a simple Python script to generate a header, but if I update the script itself CMake won't re-run the script. Is there a way I can get CMake to do this? A: It seems you are directly invoking your code generation script when cmake is run. While it is possible ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623699", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Java - find position of a string in a List of storage object I guess the title of this questions says it all, or says nothing... After couple of hours of googling, trying things and reinventing Java I decided to ask you. I have this storage class: class AppInfo implements Comparable<AppInfo > { private Strin...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623700", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Pointer arithmetic for structs Given a struct definition that contains one double and three int variables (4 variables in all), if p is a pointer to this struct with a value 0x1000, what value does p++ have? This is not a homework problem, so don't worry. I'm just trying to prepare for a test and I can't figure out...
{ "language": "en", "url": "https://stackoverflow.com/questions/7623704", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }