text
stringlengths
8
267k
meta
dict
Q: Tomcat/jsp/servlet /web.xml issue I am working on a project for school and am completely frustrated. The project is to get a simple JSP/Servlet demo working on our personal websites and after probably 20+ hours of work I am still unsuccessful in getting this accomplished. The really frustrating thing I've been giv...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535629", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Android: Convert first letter of string to lower case I'm looking for a way to convert the first letter of a string to a lower case letter. The code I'm using pulls a random String from an array, displays the string in a text view, and then uses it to display an image. All of the strings in the array have their firs...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535630", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Put PDF into NSData How do I put my PDF into NSData? I have the location of the PDF as a string in my Documents Directory of the app. When I try to email it, I see the PDF in the body of the email (vs seeing an attachment icon. I don't know if that's normal or not). But when I receive the email on the other end,...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535635", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Question regarding NTFS Change Journal USN records This maybe a somewhat silly question, but I haven't been able to find the answer anywhere. Is there any way to find out what the last record in the change journal is? When we run the FSTCL query for the first time it takes too long to enumerate all the records. Is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535638", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Content disappears for fraction of a second on offline web app load I've observed this on iOS 4.3 to 5.0. When you create a even a simple offline web app, meaning one HTML file + few assets such as CSS and JS (all present in the cache manifest), it works offline (I tested in Airplane Mode) – BUT, when you add such a...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535643", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How smart is MongoDB? There seems to be almost no documentation about how to design databases for MongoDB. So I thought I'll start by posting my questions here. Assume this collection (fruits_inventory) as an example: { "name" : "Orange", "type" : "citric", "available" : 3 } { "name" :...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535644", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-4" }
Q: Remove a tracking from a git branch I have a "feature/admin" branch that is tracking multiple branches (origin/feature/admin and development, the latter being local) - I want to remove the local tracking (so my local branch only tracks the remote branch origin/feature/admin). I've tried removing it with git branch -...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535651", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Updating DBGrids in Master-Detail views when updating Cells in Delphi I am using TADOConn and TADODataSet units pulling data and connected to TDataSources and TDBGrids. I have my DBGrids displaying information properly and editing information in the detail view accurately reflects in the backing database. What I wo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535653", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Positive Look ahead in Regular Expressions? I'm trying to extract some characters or words from a string using regular expressions.. Examples of my string contains "Size: M" or "Size: Medium" and I want to extract "M" and "Medium" These can be anywhere within a long string so... I was trying to use the following bu...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535665", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Fault free ColdFusion app update process When updating a ColdFusion website, with svn or git, there is a moment where half of the repo is updated and the other half is not, during which a request could occur, which could mean epic fails in some cases. So it seems like I need a way of pausing the requests made while ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535667", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: auto-Writing/auto-Inputting application for a lousy routine web-based submitions? I've started learning python for a week, as always love to learn as much languages as I can ; as python is one of the easiest languages, but still there's lots of things teachers won't tell. Interacting with web pages is an obvious exa...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535669", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: About TidHttp, mshtml, ActiveX, COMObj in Firemonkey (Delphi) I was reviewing the following interesting article, "Extract Links from HTML page using Delphi", and I tested in Firemonkey and it's very useful, however this code uses objects from Mshtml, ActiveX, and COMObj, so my questions are: * *do those objects a...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535672", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Executing a javascript that is injected as a script element via bookmarklet? I am using bookmarklet to inject a element in document with a custom JS script file. I did it like this: var newscript = document.createElement('script'); newscript.type = 'text/javascript'; newscript.async = true; newscript.src = 'http://...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535676", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: bash: passing paths with spaces as parameters? I have a bash script that recieves a set of files from the user. These files are sometimes under directories with spaces in their names. Unfortunately unlike this question all the filenames are passed via the command line interface. Let's assume the paths are correctly ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535677", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: How to retrieve class values from WEKA using MATLAB I'm trying to retrieve classes from WEKA using MATLAB and WEKA API. All looks fine but classes are always 0. Any idea ?? My data set has 241 atributes, applying WEKA to this dataset I'm obtaining correct results. 1st train and test objects are created than classifi...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535689", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Pass data into change event callback? Using backbone.js - I want to bind an event to any change in the model and the collections/models that are nested inside it. Right now I do an @bind 'change', () -> when initializing the base model. How can I pass data on any change, even that of deep nested models? Does the ch...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535691", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Parser ASP page with PHP With this code <?php /*GET ALL LINKS FROM http://www.w3schools.com/asp/default.asp*/ $page = file_get_contents('http://www.codacons.it/rassegna_quest.asp?idSez=14'); preg_match_all("/<a.*>(.*?)<\/a>/", $page, $matches, PREG_SET_ORDER); echo "All links : <br/>"; foreach($matches as $mat...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535692", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Universal app splash screen errors I have created a universal app in x code 4 and am attempting to use their "launch images". I am however running into an issue where once the iPad splash screen displays it will flash to the iPhone splash screen quickly before going into the application. Has anyone else run into t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535694", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to infer the type of an object and use that type in a generic parameter during construction Is there another way of declaring my ProductController for the logger that is being injected? public class ProductController : Controller { private readonly LoggingInterface.ILogger<ProductController> _logger; pr...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535698", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Subscribe to all messages from NServiceBus I'd like to subscribe to all messages being sent across the NServiceBus system, for the purpose of logging and monitoring. However trying to listen for IMessage doesn't work, ideas? A: NServiceBus has explicit support for auditing through the ForwardReceivedMessagesTo con...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535700", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Objective C - UITabViewController disable tabBar I'm using a UITabBarController in my app. How can I disable people from clicking the tabs? Trying to disallow people from clicking away to another section before some of the things that is going on is done. Thank you, Tee A: Figured it out. UITabBarController.tabba...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535701", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Rails 3 Make Text into a Clickable Link I've made a Rails 3 app and I've got a form on my page in which I have users copy and paste a link and then submit it (much like Reddit) and then ideally, the link would appear on the main page for other users to click on. However, whenever users paste the URL's into my form,...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535702", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Source property of Silverlight object <div id="silverlightControlHost" > <object id="idThObject" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="ClientBin/MySolution.xap"/> <!--<param name="source" value="http...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535706", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Grails Searchable Plugin with a logical OR I am using the Searchable plugin's query builder to try and build a query that searches some content and only returns objects that the user is the audience of or the audience is global. The code I would like to have would be similar to: { term("content", content) or { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535707", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I check if the android phone is charging I am writing an android application. I would like to know how can I check if the phone is charging when my application starts? I have read this How to know if the phone is charging But this only register and get notified when there is a change in charging state of the...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535713", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Convert 8 bit ( 16 Color Palette ) PNG to proper 4 bit ( 16 color Palette ) with Java or Python? I have a bunch of images, to many to do by hand that are 16 color 8 bit PNG format that I need in 16 4 bit format, they all have the same palette. I am scouring Google for the best library to use, but I am not finding mu...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535716", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Why do I get an extra element at the end in JSON? I'm working on some website, and am using JSON. My problem is the JSON.parse method, I use it to send a simple array, and append to an array the values. And I always get an extra element at the end that us just commas. here is the simplified code: responseText = '["d...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535724", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is garbage collection detrimental to the performance of this type of program I'm building a program that will live on an AWS EC2 instance (probably) be invoked periodically via a cron job. The program will 'crawl'/'poll' specific websites that we've partnered with and index/aggregate their content and update our dat...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535726", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: jquery select div inside div I am trying to get this to alert only the div clicked on, vs alerting the div clicked and then the container div's. when I click on the third div I would like it to only alert "third". thanks for the help. <div id="first"> <div id="second"> <div id="third"> t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535734", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Python sys.exit() help? I am working in Python and am trying to have a line of code execute and after it executes I am calling sys.exit() to have the script itself "exit." However, it seems that sys.exit() is executing before the line of code above it executes. Below is the code I am trying to implement: if somethin...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535735", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Using --no-rdoc and --no-ri with bundler When using gem install gem_name I can pass --no-rdoc and --no-ri switches to skip generating RDoc/RI documentation for the gem on install. Is there a similar way to do this with bundle install? A: Bundler doesn't include rdoc and ri. There is nothing you need to do. A: See...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535737", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "123" }
Q: Organizing static data in C++ I'm working on some embedded software where there is some static information about "products". Since the information for a certain product never changes during execution I would like to initialize these data structures at compile time to save some space on the stack/heap. I made a Produ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535743", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do I delete values in MySQL according to primary key on another table Example my db structure olddb & newdb newdb ID email Name ----------------------- 1 john@yahoo.com John 2 peter@yahoo.com Peter olddb ID email ------------------- 1 john@yahoo.com 2 peter@yahoo.com 3 rambo@hello....
{ "language": "en", "url": "https://stackoverflow.com/questions/7535752", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is there a better Solr and P2P integration option? In thinking about my applications network service needs using the Java language I've more or less boiled it down to a combination of using Solr, P2P and REST. An automated notifier service would be good to include too. Although I like JXTA I'm not sure it is doing s...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535755", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Should these expressions evaluate differently? I was somewhat confused until I found the bug in my code. I had to change a.matched_images.count #True when variable is 0 to a.matched_images.count > 0 #False when variable is 0 Since I quickly wanted to know whether an object had any images, the first code will appe...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535765", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: An API to do game AI research in shooters I'm looking to do a machine learning related course project. I'm basically looking for a framework for a top view 2d shooter game, and apply machine learning algorithms to it. There is a framework available to do research in car racing, called TORCS, and I was looking someth...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535768", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Python - Converting a Number to a Letter without an if statement I am making a program for my own purposes (a naming program) that completely generates a random name. The problem is I cannot assign a number to a letter, so as a being 1 and z being 26, or a being 0 and z being 25. It gives me a SyntaxError. I need to...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535769", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: SQL statement's placeholders that is not replaced leads to "Cannot update '@columnName'; field not updateable" I'm writing some code updating database with a SQL statement that has some placeholders . But it doesn't seem to update these placeholders. I got the following error: Cannot update '@columnName'; field not ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535777", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Date parsing problem with Jackson 1.8.5 Recently (in the last couple hours or so) I started getting this exception stack: org.codehaus.jackson.JsonParseException: Numeric value (1316835995324) out of range of int at [Source: java.io.StringReader@5b082d45; line: 1, column: 642] at org.codehaus.jackson.JsonParser...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535779", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Is there something incorrect with this code? I don't believe I should have to create a new instance of object to modify collection I am experiencing some weird behavior that disappears/reappears based on whether this dictionary is a new instance of the object, or the old instance of the object. Let me provide all th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535780", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: AVAudioPlayer setVoume:x, when x > 1.0 I have been working with AVAudioPlayer on the iPad (original version) running IOS 4.3.3 The documentation for the volume property states: "The playback gain for the audio player, ranging from 0.0 through 1.0." Curiously it seems to allow you to use a value > 1.0, with the expec...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535794", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Scala searches for an obscure Main class I have what should be a simple scala script that looks as follows: object SaveTaggedSenseTask { def main(args: Array[String]) { val reader:SenseEvalAllWordsDocumentReader = new SenseEvalAllWordsDocumentReader() re...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535798", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Android efficient storage of two images which are similar Application size on a phone needs to be as small as possible. If I have an image of a sword and then a very similar image of that same sword except that I've changed the color or added flames or changed the picture of the jewel or whatever, how do store thing...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535801", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Beanshell will not allow me to add jars to the "default" JRE classloader? I have a question about Beanshell that I can't find an answer to anywhere. I am only able to run Beanshell scripts in 1 of 2 ways: * *Where Classpath is defined before invoking Beanshell and Beanshell uses the JRE default classloader. *W...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535802", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do you add an external package to a GoClipse project for Google App Engine? I've compiled Goauth so that I can use OAuth in my Go Google App Engine project. Where do I put the goauth.a file so that I can both use it in the project, and have it available when deploying to the GAE servers? I can get it working l...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535803", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Latex, display a long image in multiple page? (Please don't move my post to Tex, I can't post image there.) I have a long UML diagram, I use the following code. The figure is about two and a half page long, but only the first page is showing, and the lower part of the figure is missing. How do I display the whole di...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535806", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: When to force LINQ query evaluation? What's the accepted practice on forcing evaluation of LINQ queries with methods like ToArray() and are there general heuristics for composing optimal chains of queries? I often try to do everything in a single pass because I've noticed in those instances that AsParallel() does a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535809", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Is code execution slower when called remotely? (.net remoting) I have a sub in my VB.NET (framework 2) program. This sub does not return any value, it just perform various checks on a local DB. The program calls the sub just after starts, and it takes about 6 seconds to complete. The program also acts as a net remot...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535810", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: C# LockBits perfomance (int[,] to byte[]) Graphics g; using (var bmp = new Bitmap(_frame, _height, PixelFormat.Format24bppRgb)) { var data = bmp.LockBits(new Rectangle(0, 0, _frame, _height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); var bmpWidth = data.Stride; var bytes = bmpWidth * _height;...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535812", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: BeautifulStoneSoup - how to unescape and add closing tags I'm editing the original post here to clarify and hopefully I have boiled it down into something more manageable. I have a string of xml that looks something like: <foo id="foo"> <row> &lt;img alt="jules.png" src="http://localhost/jules.png" heig...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535815", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Using if (!bool) vs if (bool == false) in C# Is there any sort of style consensus on the following two coding styles? I'm more curious if this is the sort of thing where one is generally preferred in good code in C#, or if this the sort of thing that gets decided when picking a style for a coding project. Style 1: U...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535818", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: I am trying to put tabs within an accordion I downloaded the accordion and tabs from the jQueryUI website. Pretty simple stuff - didn't really do any programming of my own, just nested the tabs within the accordion. Now, the tabs work just fine for the default accordion (the one that appears onload) but they will no...
{ "language": "la", "url": "https://stackoverflow.com/questions/7535829", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do I detect if the computer is playing any sound? I want to programmatically detect if a (local) computer (not mobile device) is playing any sound or music. Preferably via some high level api from Java or Python or a similar language. A: I have never done it, but as a first approach I would open (open as input,...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535832", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Hadoop java mapper -copyFromLocal heap size error As part of my Java mapper I have a command executes some code on the local node and copies a local output file to the hadoop fs. Unfortunately I'm getting the following output: Error occurred during initialization of VM Could not reserve enough space for object hea...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535833", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Avoiding SQL injection when saving user-agent using ASP.net I'm saving the browser user-agent of my users for stats purposes. As you already know, user-agent can be modified. I would like to know if I should do anything to protect against SQL Injection. I'm using Stored Procedures for inserting. Many thanks. A: Use...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535834", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: R idiom for %*% using xts I am working with some code that uses the %*% operator to apply vectors of weights to vectors representing time series. I would like to use xts for the time series, but the %*% operator is not understanding that it should ignore the xts index values. I know I can use coredata() to pull out ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535836", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I get a two column jquery autocomplete? I have two lists of things that I want to search through for an auto complete box on my site. One is a list of stores, and the other is a list of searches that other people have done for products. I would like autocomplete to display two columns, one column for the firs...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535845", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: SVN GIT local custom changes I'm in such situation: There is open source project still developed by 3rd party. I'm using it and have my custom source code changes on top of it. I don't want to commit anything back to 3rd party repository. Only get the newest updates. From the other side I want to re-distribute sourc...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535849", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Why doesn't this closure modify the variable in the enclosing scope? This bit of Python does not work: def make_incrementer(start): def closure(): # I know I could write 'x = start' and use x - that's not my point though (: while True: yield start start += 1 return clo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535857", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: vim bindkey-snipplet to shift a hole block of code around I've just made a little snipplet on my keybindings.vim to shift a hole block of code around. It works basically the same way I do it in the old fashioned manual way ( on normal mode, {V} to select the hole block on visual mode, then > and < to move through in...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535860", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: LINQ aggregating multiple IEnumerables into one? I have a Dictionary defined as <int, IEnumerable<char>>. Lets say the data is populated like: 1, a b c d e 2, f g h i j 3, k l m n o If I have an IEnumerable consisting of 1 & 3, what would the LINQ look like to return 'a b c d e k l m n o' (assuming space represent...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535863", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: MVC3 Export to File Design I have a strongly typed View that displays a Model using ASP.NET MVC3. I want to add a link so the user can download the model displayed in the view into a CSV file. I was thinking the link would point to another action on the controller that took the model as an argument. What's the b...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535873", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: JQuery callback and return to the first call? I for this function to load an external page. Page URL grab from DIV id. $(".contentArea").load($('.contentArea').attr('id'), function(){ The page loaded, got a datatable so I added it to the callback. $('.datatable').dataTable( { Inside the datatable, I got an editor ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535876", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Android button latency? I've been working on a drum machine app, and the latency between the time you press the button and the time the sound plays is unbearable. I have seen some people use multitouch and gridviews, and make several buttons able to be pressed at the same time, but I honestly have no knowledge of th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535882", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: load file on hover using jQuery I want to load an external file (using jQuery) when the user hovers a div. I tried loading it like a css file on hover but no luck. (Also, I can load a css file on hover, right? That code I tried for that is below.) $(document).ready(function () { $("#f1_container2").hover(functio...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535884", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Getting JSUnit, Ant & Hudson working I'm trying to get my JSUnit tests to run on Hudson. But the browser keeps timing out: [junit] INFO: Launching Internet Explorer on http://localhost/jsunit/testRunner.html?testPage=localhost/jsunit/tests/jsUnitOnLoadTests.html&autoRun=true&browserId=0&submitResults=localhost:8081/...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535885", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Python sort unique list of lists' items I can't seem to find a question on SO about my particular problem, so forgive me if this has been asked before! Anyway, I'm writing a script to loop through a set of URL's and give me a list of unique urls with unique parameters. The trouble I'm having is actually comparing th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535889", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Xcode: Why doesn't this code work for saving UITextField using NSUserDefaults? I have an UITextField inside an UITableViewCell. What I want't is for the app to save the text the user inputs. I've tried by making the UITextField call a action with this code: [TextField addTarget:self action:@selector(saveTextFiel...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535894", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Read binary file I need help with an issue that i have. I want to read a binary file. The content of the file are: 0000000010001100 I'm using the following code to reach my goal: InputStream is = new FileInputStream(new File("/test.bin")); DataInputStream din = new DataInputStream(is); System.out.println(din.readByt...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535895", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Unobtrusive Windows Notifications I'm looking for a simple solution to create an unobtrusive notification program for windows using c++/QT/WinAPI/SDL or any other quick library. I'm wondering what the fastest method (as far as development goes) to create a simple program that pops a quick window up with access to a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535899", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How To Signal End Of Data Without Closing NetworkStream in C# I have a client application that serializes a object and sends it to a server application. The server should deserialize the object, make changes to it, then serialize it and send it back. Server Code: TcpClient client = server.AcceptTcpClient(); using(N...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535901", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: timeout in MYSQL I have a java application that has long running processes and interact with db. It keeps getting the following: The last packet successfully received from the server was 3,601,168 milliseconds ago. The last packet sent successfully to the server was 3,601,166 milliseconds ago. The remote server ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535902", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Getting EF 4.1 Code First project working I am building a simple application with EF 4.1 Code First, but I am stuck. Here's an ERD of my application Domain Model: In Visual Studio 2010, I have a solution with two projects in it. One project is to house the Domain Model, the other is an MVC3 Web Application to house...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535904", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Android: soap primitive error I am having some issues with accessing a web service. Getting ClassCastException Error. Consider a scenario that I am trying to access a method of a web-service and the webservice is supposed to return two strings (Lets say String1 and String2). Moreover, I have to provide or pass two p...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535906", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Attaching JQuery Events to "on the fly created" controls I'm appending to an existing div in my page. The appended text contains html code in string. The problem is, events aren't working when I add click on them after appending to page. I guess Jquery loads control on page load and I have to do something to attack ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535911", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How statics are initialized in C# Ok, I have greatly changed the code to show the actual problem more clearly. I have tested this code, and it definitely fails. public class MyEnumBase { private int _val; private static Dictionary<int, MyEnumBase> ValueMap = new Dictionary<int, MyEnumBase>(); protected...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535912", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: -HD image file not found? Why am I getting cocos2d: CCFileUtils: Warning HD file not found: META-hd.png If I definitely have META-hd.png file in my project? What I am doing is running my .tmx tilemap. The map uses a tileset that searches for "META.png" (without -hd suffix since I am expecting cocos2d to automatica...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535920", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to pass a variable with $.post for javascript script? Here is my code in my jquery/javascript that is performing the ajax request... else { $.post("http://www.example.com", {email: val}, function(response){ finishAjax('email', response); }); } joinAjax('cemail'); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535922", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Setting MySQL SQL Modes to be stricter before migrating to SQL Server 2008 We're eventually migrating an application to SQL Server 2008, but before we do that, we're considering setting the MySQL SQL modes to be stricter so that we can test the "looseness" of the existing application before it's migrated to the stri...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535923", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to INSERT multiple rows when some might be DUPLICATES of an already-existing row? So I have a checkbox form where users can select multiple values. Then can then go back and select different values. Each value is stored as a row (UserID,value). How do you do that INSERT when some rows might be duplicates of an...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535927", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Using a Telerik control inside a repeater I am using the asp.net Repeater control. (My company is heavily invested in that, so I can't change it.) I need a way to create a poup edit window, specific to the row the user clicked on in the repeater, so the user can edit the data in that record. We have the Telerik con...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535930", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: using 'lighter' weight of a font I'm trying to use the "Helvetica Light" font, which comes bundled with Helvetica. To do this I read that I had to specify "Helvetica Light" AND font-weight: lighter. I've gotten this to work only by doing this (in SASS): p font: "Helvetica Light", Arial, sans-serif fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535934", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Creating a webservice inside a dll file? Can it be done? I would like to create a c# dll that handles requests. I would like the requests to come as webservice calls so that websites can quickly call the dll. Is there a way to integrate the two - to have the code for the webservice be placed inside of the dll? Or,...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535936", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: XCode 4 is hiding the results from Find operation Please take a look at this: It says 'Found 6 results in 3 files', but how can I see which files are those and the exact line, you know the usual way. I've haven't set any options or settings anywhere, its just all default settings. This is making me crazy! A: Thank...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535938", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I fetch rand records from a union query? SELECT a, b, c FROM ".TBL_A." WHERE [statement] **`ORDER BY RAND()`** LIMIT 1 UNION (SELECT a, b, c FROM ".TBL_A." WHERE [different statement] ORDER BY RAND() LIMIT 5)"; This query works fine without first ORDER BY RAND(), but what I need is to fetch first rec random...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535939", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: python subprocess.Popen vs shlex question my sub process command to search first off it only searches one directory that i wrote (s2) omits the first (s1). second i was doing some reading on python docs and got confused. my code def search_entry(self, widget): s1 = subprocess.Popen(['find', '/home/blud...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535940", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: jqGrid - How to set custom editoptions based on *initial* column values? I am using the open source jqGrid plugin with EF4 and ASP.NET Web Forms. I need to set an input element in an inline-editable grid row based on a column value from the DB. For example, the first row could contain a DDL, the second row could con...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535942", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: jQuery slider - change amount of next / last image shown I'm using the Nivo slider (http://nivo.dev7studios.com) which works perfectly fine for showing one image, but I'm trying to show half of the previous image and half of the next image. I'm open to using others like Slides or the Coin one. Does anyone have ANY i...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535944", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: die() but only within the tags? If I have code such as: <html> ... <?php .... die(); ?> .... </html> then the entire page execution stops, and the final html does not get shown. is there a way to only leave the php within the enclosing php tags? A: I guess this is based on same condition, otherwise it wouldn't ma...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535949", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Android WebView save Picture I have an application which loads pictures from the Web with WebView and a link. // (in fact an Ajax app with PHP and JavaSCript xmlHttpREquest in a webpage on the Web) So briefly there are images displayed in a WebView in this android app, a simple app. I would like the user to be able ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535958", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: File protection on remote server Here's the situation. I have a primary web server that needs to be able to access files on a remote web server with PHP. I also have a remote server. The files on the remote server are private. That is, I only want to access them through my PHP script on the primary server. How do I ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535964", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Detecting in PHP? I have a script that checks the source of another page, I'm having my code search for <span class="item-header"> in the source. When it finds it, I wan't to print everything that is in the span, but I am not sure how I would do that in PHP? How do I check when to stop printing everything after t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535967", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Control a C# application from a Public Webpage Possible Duplicate: Run a Method in a C# Application from a Webpage I would like to host a webpage with Buttons, txtbox, etc and when User Clicks a button, it runs a method on the C# application. Also the App can gather the Data from the webpage's txtbox. The Applica...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535972", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Issue with Like Box not pulling current data I have been using Like Box to show our company Facebook feeds on our company portal. The feeds stopped updating on March 24 but we have more current post. Everything seems to be working but current feeds stopped? Did something change with Like Box? Below the “Old Code” is...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535973", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Php: array function with fopen/fread I'm new to php so please bear with me here. Its a rough example but lets say I have a file (which obviously does't work :), say 1.php, there I have <?php function links1($l1, $l2){echo "<a href='". $l1 ."'><img src='". $l2 ."'/></a>";} $ext_file = '2.php'; $v1 = fopen($ext_file...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535975", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Reusing a jQuery function without causing an error on pages that do not utilize it I use this function to make a help box stay visible when a user scrolls down: var top = $('.help-box').offset().top - parseFloat($('.help-box').css('marginTop').replace(/auto/, 0)); $(window).scroll(function (event) { var y = $(th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535977", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: CakePHP 2: Html Helper in Email Template I'm having a tough time trying to figure out why I can't use $this->Html->url in the templates for my emails for CakePHP 2.0. The Helpers array is empty in the views. Is this by design or am I missing something? The docs and migration guide don't mention anything around this....
{ "language": "en", "url": "https://stackoverflow.com/questions/7535979", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: cannot making movie from UIImage Array with AVAssetWriter on iphone 3G I am working on an iOS app which make a movie using array of UIImages. Everything work well on iphone 3GS, iphone 4, but cannot on iphone 3, I got this in AVAssetWriterInput.h: Video output settings keys are defined in AVVideoSettings.h. Video ou...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535981", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to reset par(mfrow) in R I set par(mfrow =c(1,2)) and now everytime I plot it shows splits it into 2 plots. How can I reset this to only show one plot. Thanks so much. A: You can reset the plot by doing this: dev.off() A: You can reset the mfrow parameter par(mfrow=c(1,1))
{ "language": "en", "url": "https://stackoverflow.com/questions/7535982", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "75" }
Q: Indesign Scripting: If selected object is rectangle I'm trying to rewrite the CornerEffects.jsx script in Indesign CS5.5 to make it more user friendly in school, so people know exactly where the first point is and where the last point is etc. The Script has to work in CS3 as well. I need to the options to change onl...
{ "language": "en", "url": "https://stackoverflow.com/questions/7535988", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }