text
stringlengths
8
267k
meta
dict
Q: Optional stdin in Python with argparse I found the very useful syntax parser.add_argument('-i', '--input-file', type=argparse.FileType('r'), default='-') for specifying an input file or using stdin—both of which I want in my program. However, the input file is not always required. If I'm not using -i or redirecting...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576525", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "79" }
Q: Online Anti-Virus service How would it be possible to design an online-antivirus service. I was thinking about creating an online version of some open-source antivirus. Would it be possible to upload something like a binary image of the selected folders, and then pass that as an argument to the antivirus service ins...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576528", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Android java stop a animation after completed How can i stop a animation after it has completed? My animation is the image fades in code: Java: super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView imageView= (ImageView)findViewById(R.id.tCat); Animation fadeInAnimation =...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576534", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Optimal way to fill std::vector buffer This buffer should contain slots (three in this example) of equal length ( 20 in this example) The buffer has to have contiguous memory so that it can be passed to a C function in non-const fashion. const int slot_size = 20; std::vector<char> vbuffer; This function takes a st...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576537", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Help with c++ logic? Something::methodname() { (unsigned char*) ptr = (unsigned char*) m_pptr; while ((*ptr || *(ptr+1)) && (((unsigned char*)m_pptr+BUFSIZE)<ptr)) ptr++; if(ptr == m_pptr) return ptr; return ptr + 1; } m_pptr is a protected member of a class. ptr is local to th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576541", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I take a text query, and get a location in Android? I was wondering how I can channel or simulate Google Maps just in the sense of a user types in a location in text, such as a restaurant name and a city name. Then Google suggests 5 or so places they have indexed, and presumably they know the GPS coordinates...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576543", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Display in iOS Browser using without the use of the Tag Is it possible to display <svg> content inside an <html> in an iOS browser without the use of the <embed> or <img> tags which require me to store the <svg> content in a separate file? The embedding of <svg> content inside <html> seems to work on all other m...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576548", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Why does calling 'delete' in a specific way on a dynamic array not work? I'm wondering why this code doesn't work: void KeyValueList::Release() { //(m_ppKeyValueList is a dynamic array of pointers to objects on the heap) if (m_ppKeyValueList) { for (int i = 0; i < m_iCapacity; ++i) { if (m_pp...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576554", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Get scala-library.jar location How can I get the full path of scala-library.jar from file system with Scala code? I've tried ways like scala.Console.getClass.getProtectionDomain.getCodeSource.getLocation.getPath but it seemed don't work (returned a null pointer). A: We use this to adjust the classpath for caliper: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576555", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Trying to learn about the new async features in c# I copied this example from here I have seen many similar examples. Most of them say they're using the Async CTP. I'm using Visual Studio 11 on Windows 8 though so that does not apply. As shown, the error says TaskEx doesn't exist. I assume I'm missing a referenc...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576556", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Share data between users in metro application I would like to create a Metro application that allows a group of people to interact. One person would create data and serve as the owner, and multiple others would be invited in and be allow to modify that data. I heard from Build talks that each Metro application wil...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576560", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to mount WebDAV share programmatically on Windows 7/Vista without assigning drive letter? I need to mount WebDAV share programmatically on Windows 7/Vista without assigning drive letter. I know net use and WScript.CreateObject('WScript.Network').MapNetworkDrive('E:', 'http://server/'); can mount WebDAV but t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576565", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Convert a raster image into a polygon using QGis (or another method) I want to convert several images into polygon shp files using QGis (Quantum GIS 1.6). I need to do edge detection AND differentiate between several different colors of lines (red, green, yellow and black). I need good edge detection as my images ar...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576569", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: Comparing two arrays and showing the difference according to each one So I know there's an easy way to see the difference between two arrays using array_diff. Take a look at why I need something a bit more specific though: Let's say we have these 2 arrays $array1 $array2 1 1 2 ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576577", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Best practices for a stationary frame at the top of an ASP.NET page? What is the best practice for creating a hovering "frame" in ASP.NET which will remain stationary at the top of a web page regardless of how the user scrolls vertically? For example, if I create a textbox to contain search criteria, I might want th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576578", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Filter output of adb logcat based on thread id I am using adb logcat -v threadtime to get the output in a format that includes time and thread id. I was wondering if there is a way to filter output based on the thread id (tid). I want to get output from certain threads only, now i can get the thread id but not th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576579", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: session variable set by checkbox not being stored/shared from page to page I have a listview that's showing a long list. Each item has the ability to be 'hidden' or not. I want a checkbox to either show all the list, or not to show the hidden ones. The idea is that users will hide the older items they don't want t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576584", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: iPhone is there a way to set the type of animation when going from one view to another? I'm using presentModalViewController to go from view controller to view controller. Right now the animations are up and down when it goes from one view to another. Can I change it to right and left? I did not see any settings fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576588", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Balancing performance heavy procedures with real-time mouse input To put this question succinctly, is there any way to offer a real-time web application that requires processing to be done at every coordinate that a user moves their mouse to without dropping any mouse events? With JS, if we want to keep track of the...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576589", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: problem with finishing/exiting an activity in android app I am trying to exit an activity using the code myClass.this.finish(); However, the code keeps on executing the lines after this. Any idea why ? A: This code just informs runtime that activity is finished so appropriate actions could be taken and activity is...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576591", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Simple and concise desktop Cocoa NSXMLParser example? I would like to look through the elements of a file and when one specific element comes out, output the contents in between the tag. I tried to follow the example in the Mac Dev entitled Event Driven XML Programming, but it just doesn't finish very clearly. It sa...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576593", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do you run multiple instance of gud in emacs I want to debug C++ and and php in the same emacs instance (using gdb and a php debugging mode that uses gud-common-init). When I fire both up everything just gets messed up. My guess is that gud.el doesn't support this. Does anybody know if a way to do this exists? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576601", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Drawing gets slow I am develop my writing application on my phone. I need to draw the stroke on the canvas. I need to save all the points in order to redraw. I found that as the number of points grow. It gets slow. How ever i need all the points to redraw. Is there a way to save the previous drawing and restore the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576602", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Parsing a comma seperated string of paired numbers with CRLF between data pairs I am using C#. I have scoured the examples, and tried for hours. This situation is different. I can't find a solution. I have a long string captured from a device on a serial port. The string's format is: integer,integerCRLFinteger,inte...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576607", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: JAXB Annotations and SuperClass I'm trying to use JAXB annotations in a parent class so that all the sub classes can inherit them but I'm running into a marshaling error. I don't get the below error when I include @XmlRootElement and @XmlAccessorType(XmlAccessType.FIELD) in the sub class error: HTTP Status 500 - Co...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576613", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Running a .bat in the background So I have this in my coding: vb Code: file = My.Computer.FileSystem.OpenTextFileWriter("c:\command.bat", False) file.WriteLine("@echo off") file.WriteLine("cd " & TextBox2.Text) file.WriteLine("adb shell dumpsys meminfo " & TextBox1.Text & " > C:\Sample.txt") ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576615", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can specify multiple paths on LinkerBaseInputPaths Wix Property? The PropertyGroup MSBUILD Task on WIX lets you set the LinkerBaseInputPaths property, its essentially the -b parameter for light.exe. The property is named plural for multiple paths (which light.exe supports by multiple -b arguments), however how d...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576625", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to "genericize" an XML-to-XML XSL transform to work with files having different tags but same basic structure I have a set of XML files similar to this: Example Input File: <a-list> <a-item key_field="unique1" other="foo"/> <a-item key_field="unique2" other="foo"/> ... </a-list> and I have a transform ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576626", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: var bounds not working on my google maps I am having an issue getting bounds to work with my google map. All markers are pointing to the correct coordinates, but when they appear on the map, the auto zoom does not adjust properly. Can someone please help me with my var bounds please. var companyLocale = new googl...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576632", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is CSS lone * selector good for? There is one CSS selector I cannot figure good use for. * { /* Some styles */ } I know it is used to set styles on every element on a page. Some people use it to reset every padding and margin to 0. Other ideas? I don't ask about hacks. I don't ask about combination like so...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576635", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Custom ADO.Net Data Provider - How To? Is there any good How-To document on developing Custom ADO.Net data provider? I looked at the MSDN and all I could find is an article published on this subject in 2003 and could not find any update for later versions. Thanks in Advance A: That's still all there is to it if yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576636", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Ruby gem extend class with methods defined in a block I am creating a gem and wanted to be able to modify an ActiveRecord object by creating attribute getters and setters dynamically to a serialized attribute. For example: class User has_serialized :setting do |config| config.define :notify_by_email, default: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576637", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Git repo for framework inside local git project in Xcode 4 I have an iOS project in Xcode 4, that is using Git. Now I want to add the MKStoreKit framework to my project. It is already under version control using Git and a public repo. I'd like to include it in my project, and allow my project's git version control t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576640", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: mobile detection between 2 different platforms I am in the process of wrapping up a mobile site and I need to give the user the option to switch from the mobile(jQuery mobile) site to the desktop version of the site. I am planning on using the code below for detection on both sides and then setting a cookie if the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576642", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Best way to store (and retrieve!) dom-element-specific data using javascript I've got a matrix of drop down lists, and I'd like to be able to show the user when they have edited a setting visually (for example by setting the background of the table cell to red). If they switch it back to the original value, it will ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576643", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Sizing panels in an ItemsControl I have a parent view model, that contains a collection of other view models (of same type) (children). On Initialization the number of children will be decided (varying). The child View consists of a button and a list box. Initially the listbox is hidden. On click of button the list ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576644", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Building a Silverlight application upload utility? This post is really more of a discussion if this is even possible. There are numerous examples all over the web, but all of those are using asp.net applications and unfortunately I can't go that route. So my goal is to build an upload utility in Silverlight that ca...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576651", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: HTML+CSS : how to move not close divs to create a right column? I have a problem that I thought was pretty simple but that is taking me a lot of time to solve it. If there is a simple solution (and I don't know CSS enough), please point me there and I'll close this question immediately. My problem is the following. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576652", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Service running AsyncTask over and over in onCreate() method I have a Service that i run when a alarm is sent. The problem is the service runs ever couple of hours automatically. I only want it to run once when the alarm is executed. Here is the code i am using: @Override public IBinder onBind(Intent intent) { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576653", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Downsample image below size limit before upload There's a 2MB limit on the server where I need to upload an image. I'm using this method to downsample a Bitmap Strange out of memory issue while loading an image to a Bitmap object within this method public InputStream getPhotoStream(int imageSizeBytes) throws IOExce...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576656", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: android non unique view id I have a LinearLayout that contains a ViewStub which points to a ViewFlipper. The ViewStub is *statically assigned its layout reference values on startup (currently, next version will be dynamic). Located within the ViewFlipper are 10 RelativeLayouts each with its own assortment of buttons...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576661", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: FetchXML Greater Than I am using FetxhXML and I want the condition to be greater than a certain number of hours. This is what I have: string groupby1 = "<fetch distinct='false' mapping='logical' aggregate='true'>" + "<entity name='opportunity'>" + "<attribute name='opportunityid' alias='opportunity_count...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576662", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Best practices for drawing dynamic UITableView row height Possibly a duplicate but I couldn't find a specific question on SO, so here it is. I'm curious about dynamically changing heights for all rows, typically, because you don't know the length of an NSString that's used for a label. I know you must use this deleg...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576663", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: onfocus, type, outfocus, count, deactive after time period I would like to have such a jQuery when a user can click in a text input box, where they type it appears in 'real-time' in a div [this part, I have no problem with] - however, I would like to offer the user to outfocus from the text input box for upto, say, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576664", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Adding a Time/Date stamp to photos I have a bunch of photos at home that I'd like to add a time and date stamp to based on the file properties. I'll be writing this as a WPF application but does anyone have sample c# code on how to add text to a .jpg file in the bottom right hand corner of the photo? I know there ar...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576666", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How does a program know how much memory to release? I suspect the answer to my question is language specific, so I'd like to know about C and C++. When I call free() on a buffer or use delete[], how does the program know how much memory to free? Where is the size of the buffer or of the dynamically allocated array s...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576672", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: JavaScript works in WordPress preview, not in the published post I have a JavaScript, which draws some stuff based on user input. I've put the link to the .js file in WordPress header, and I should put <div id="drawstuff"></div> where I want it to show up. So if I put it into a post, it works fine in the preview, bu...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576677", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Fadein on hover then fade out to orginal state but stay on hover state when onclicked What I have to create is a fade in/out of an image to show the image behind it which has text on it, the user can stay on that button by clicking it. Then it will go back to its orginal state when an other button is clicked on. But...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576678", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-3" }
Q: UIPickerView as inputView gets messed up on orientation change I'm using a standard UIPicker view as an inputView for a textField in an iPhone application. When the view is loaded in either landscape or portrait, the picker is sized the same as the appropriate keyboard. However, when you rotate the device once insid...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576679", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Summing with a column but potentially use another column I have this table campaignArchive id campaignID bannerID poolID limitImpressions actualImpressions ----------------------------------------------------------------------------- 1 496 10367 7 12500 205 2 4...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576686", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is a change required only in the code of a web application to support HSTS? If I want a client to always use a HTTPs connection, do I only need to include the headers in the code of the application or do I also need to make a change on the server? Also how is this different to simply redirecting a user to a HTTPs pa...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576687", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Rails: adding additional methods to a model for cache retrieval When adding caching to a model in Rails, there is the repetitive nature that looks like the following: class Team < ActiveRecord::Base attr_accessible :name end Before caching, to retrieve a name, everything was trivial, team = Team.new(:name => "Th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576690", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: java.lang.NoClassDefFoundError: com/jogamp/common/type/WriteCloneable jogl 2 in eclipse I am on windows 7 64 bit and using eclipse indigo. I downloaded the latest version of jogl 2 and i have created an eclipse project following this link https://sites.google.com/site/justinscsstuff/jogl-tutorial-2 this tutorial is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576691", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What exactly is a content level merge? What is exactly is a content level merge? I've heard this term used a couple times in git discussions. A: A merge between two branches where a different set of files has been changed in each branch is a simple (or "trivial") merge. Git doesn't need to look inside the files t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576692", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Respond y(es) to psftp host key prompt I am creating a script file programmatically and call psftp.exe as follows: psftp user@hostname.com -pw password -b psftpscript.txt but it prompts for user input The server's host key is not cached in the registry. You have no guarantee that the server is the computer you t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576700", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: style attribute ignored on deployed page The following markup (cleaned up to keep it brief) is generated the same in my VS2010 dev environment and from IIS on my test server (identical text when I right-click and view source from the browser). The IE browser in VS2010 looks as expected with a yellow border. IE run...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576708", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Type inference from right to left I created following code snippet: class PimpToRight[A](f: A => Boolean) { def <| (a: A) = f(a) } implicit def f2pimp[A](f: A => Boolean) = new PimpToRight(f) class PimpToLeft[A](a: A) { def <|: (f: A => Boolean) = f(a) def |> (f: A => Boolean) = f(a) } implicit def a2pimp[A](...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576716", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: What's wrong with this enum lookup map? I have an enum where the reverse-lookup table I created for it returns null for all values. I added an assert after the lookup table is created, and sure enough, it's empty. I feel like this is something simple and obvious that I'm overlooking because I use this exact same str...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576721", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: problem using django's User authentication model. Uncomprehensible error I want to register users. So I made a: class RegisterForm(ModelForm): class Meta: model=User #(from django.auth.contrib.User) now i display that form in a template for the users to fill it and to submit it. When i do form.is_valid(...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576725", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I include an XML Schema Declaration inside of the same file as the XML data? How do you do it? Here's my attempt for reference, but I don't think I'm doing it correctly: <?xml version="1.0" encoding="UTF-8" ?> <X:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://x.iaesr.com"> <X...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576729", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: HTML Textbox Input Tooltip? Possible Duplicate: How do I make an HTML text box show a hint when empty? A very simple question. I would like to place a tooltip within a Textbox similar to the StackOverflow log in. I want the word discount on the textbox value and when the user enters a new value, the word "discoun...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576733", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: rmysql match numbers in a list I'm trying to do a query in rmysql to get data from a db. I have a list of idNumbers in a column that I want to match and pull records for from a database. R data frame: df1 idNumColumnInR saleAmt 345 22.34 456 44.53 678 ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576736", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Storing Undo and Redo information to the database? I've been wondering about this for a while and I haven't yet come up with a solution for it. On MySQL, I'd create a TRIGGER to automate saving revisions when changes happen and persist change values to the database to track revisions. The question I have now is: ho...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576738", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: sql script to drop old versions of stored procedures and functions I am looking to write a sql server script to achieve the following in a sql server 2008 database. I have a number of functions and stored procedures with the following names: * *prSP_GetItem.1.0.0 *prSP_GetItem.1.1.0 *prSp_GetItem.1.2.0 As yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576739", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Get string from url example: domain.com/THESTRING Please some one explain to me how it works and how to do it. A: PHP has a function just for this: parse_url(). $parts = parse_url('domain.com/THESTRING'); $path = $parts['path']; That wil get the part that you want A: Yet another way: echo strstr(str_replace('://'...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576740", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-2" }
Q: Paypal orders not going through to Magento We have noticed that some customer orders never made it through to magento, but they did go through Paypal. This used to happen when an order would go through a payment review, the payment would be cleared by Paypal after the review was completed, but Magento would never cl...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576743", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Exception handling continue on error and then rethrow //Assume list1 and list2 are populated with states as 2 foo (List<Class1> list1, List <Class1> list2) { boolean error = false; try { operate on list1 } catch (Exception e) { error = true; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576744", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Number of words preceding a particular word While indexOf(the) in java gives me number of characters preceding "the" in the sentence One day I saw the beautiful bird, I would like to know the way of getting the number of words preceding it. For example, the output for the given sentence would be 4! Thank you. A: Th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576747", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Installing mapnik on Windows XP fails with the message "ImportError: DLL load failed: The specified procedure could not be found." I'm trying to install mapnik on Windows XP. After diligently following the instructions on their website (http://trac.mapnik.org/wiki/WindowsInstallation), it fails with the message: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576751", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Simple Vimeo Regex: How to identify valid video urls but ignore user urls? This link is good: http://vimeo.com/22669590 This link is bad: http://vimeo.com/gopro or http://vimeo.com/user1234 Here's my current Regex: /vimeo\.com\/([^&]*)/i How can I catch the good (which this regex does) but avoid the bad (which this ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576752", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to undraw, hide, remove, or delete an image from an html canvas? this.context.drawImage(myimage, 0, 0); Putting the image on the canvas is pretty well covered all over the web. But how do I remove it after it's there? A: Option 1: Draw a rectangle over it of the same color as the background. Option 2 (works fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576755", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How to trace what is causing WordPress error 500? Internal error 500 is such a general error and nothing shows up in the logs under /wordpress/error_log. Is there a way to get a stack trace of where the crash is occurring? In ASP.NET it is so easy because a stack trace, code snippet, and line number all show up in t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576759", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Error using ChromeDriver when kicked off from teamcity I was having trouble with firefox for my watir-webdriver tests and decided to move over to CHROME. This runs fine local dev box, however when kicked off from team city on our qa server I get the following error: This is using the same chromedriver as on dev box...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576760", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to create objects using a static factory method? I know Unity can be configured to use a class' constructor to create an instance of a class (like below) but that's not what I want. container.RegisterType<IAuthoringRepository, AuthoringRepository>(); I would like to configure Unity to use a factory method with ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576761", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "33" }
Q: Accessing property of returned object causes EXC_BAD_ACCESS I have a class defined where the top two properties are accessible without issue. Only the UIColor* is a problem. I imagine something isn't being alloc'd, init'd, retained, or released properly and have been changing various things without success. Any help...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576766", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is the difference between stream.end and stream.destroySoon for files in Node.js? I'm writing to a file (a writable steam) and I need to close the file once I'm done. I'm not sure of the difference between these two functions or if I need to call them both. Here's what the documentation says: stream.end() Termi...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576779", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: prevent updates, deletes and truncates on database table I am in the process of creating a sql server 2008 database table for auditing users actions. Is it possible to create a database table which can only inserted in to - no truncates, deletes or updates allowed on the data in the table. One option I know of is to...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576783", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: what is the benefit in using a wrapper for CURL in php vs using it directly? I can use straight forward `curl $url -H $headers -d $data` Or I can use the cURL wrapper functionality and some more wrappers like the ones Zend Framework gives. I find it easy to use the straight forward approach, am I missing a benefit ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576801", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: Simplify PHP Script for SQL Query I'm a self-taught, beginner programmer. Recently I've been working on a PHP script to query a database with user-entered keywords. What I've come up with seems much more complicated than it needs to be, so I was wondering if there was a way I could simplify what I wrote. Please let ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576804", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to detect Alt + left key in ToolStripTextBox In C# - WinForms, how to detect Alt + left key when it is pressed in ToolStripTextBox? A: protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (this.ActiveControl == toolStripTextBox1.Control && keyData == (Keys.Alt | Keys.Left)) { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576805", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Multidimentional Array Foreach - Display in different tables I currently have the following array: Array ( [group] => Array { [5] => group1-title [6] => group2-title } [treatment] => Array ( [5] => Array ( [16] =>...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576806", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is it possible to develop for the browser, android, and iphone with the core logic written in C++? With some Googling it appears this is possible in iOS, Android using the NDK, and in a browser using Java Web Start or a Java Applet. I understand the GUI for iOS and Android will have to be done using Objective-C and...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576809", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to curve fit data in Excel to a multi variable polynomial? I have a simple set of data, 10 values that increase. I want to fit them to a polynomial of the form: Z = A1 + A2*X + A3*Y + A4*X^2 + A5*X*Y+ A6*Y^2 Where Z the output is the set of data above, A1 - A6 are the coefficients I am looking for, X is the rang...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576810", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is it OK to close JDBC connection from another thread on timeout? Because none of the JDBC operations have a concept of timeout, is it advisable to try to close JDBC connection of the overdue operation from the other thread if timeout is exceeded? I am aware of Statement.cancel method, however it does not seem to wo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576811", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is it possible to get gateway/router ip in java Possible Duplicate: How can I determine the IP of my router/gateway in Java? I would like to get router/gateway ip in java. I need some thing which is more standard like any libraries i can use. I do not want to curl any site and get the ip. Thank you Balaji A: Thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576815", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Facebook Comment not picking right URL I am using facebook comments and providing the url of the page to distinguish. here is the code I am using <?php $commenturl="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];?> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576817", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to Extend IOS SimpleURLConnections HTTP POST to Send Description Decodable by CGI Perl I would like to extend the sample ios code called SimpleURLConnections. This sample code can upload a file using HTTP POST. I have enabled my apache web server with a cgi script written in Perl to receive the HTTP POST that ad...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576820", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: initializing static array problem I am making a server-client and the client repeatedly calls the server files. I am supposed to save the message the client sent in a char array. In the server files, each time the client sends something the char array (static variable) gets overwritten with what it is assigned to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576823", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do you allow a webapp to add users to the system? In my app, i have something called "groups" which any user can create. The user can then add members to this group. Now this member could be already registered in the system or is a totally new to the system. For "in the system" users, it is easy but for "not yet...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576830", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Multicast message on same host using boost::asio I'm implementing sender/receiver applications to talk multicast on the same host. In my constructor, I have the following code to setup the socket. boost::asio::ip::udp::endpoint listenEndpoint(listenAddr, mcastPort); m_socket.open(listenEndpoint.protocol()); m_sock...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576832", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Remotipart with Rails 3.1 - forms always submitted as HTML instead of JS In Rails 3.1 I'm submitting forms with attachments via paperclip and remotipart. I want my forms to submit via ajax but they are submitting via html. It was working right in 3.0 but seems to have broken in 3.1. Note that by broken I simply mea...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576833", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is the right way to use geolocation for desktop PCs? Different geolocation demos show very different results when it comes to detecting my location. I'm from France, Bordeaux, and expecting at least the city to be shown. Unfortunately, in most cases the city is wrong, and corresponding probably to the location ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576834", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Disconnecting Sparse SVN Updates From Eclipse I have previously written an eclipse feature that works with eclipse to * *sparsely update directories from svn, and *delete directories from the working copy without deleting them from the repository. In this way you can pick and chose which subsystems you wish to...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576837", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: MergeAdapter layout issue in a fragment I'm trying to make a layout in Android with Fragments. I started to use Commonsware's MergeAdapter but I'm having a weird bit of trouble. The layout worked fine before, but now I get this: http://img856.imageshack.us/img856/2796/layoutbug.png There are a couple problems: The w...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576840", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Can you use pattern matching to bind the last element of a list? Since there is a way to bind the head and tail of a list via pattern matching, I'm wondering if you can use pattern matching to bind the last element of a list? A: The other answers explain the ViewPatterns-based solutions. If you want to make it more...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576843", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Forward link in HTML email I need to create a "forward to friend" link in a HTML email that will mimic the forward button on the mail client (ie launch a new window with a pre-filled body), is this possible? ie: <a href="forward-action">Forward this email to a friend</a> If not, what's a simple approach to achieve a...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576844", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Issue with formatting dates in XML file when validating against XSD schema Here is a sample of code for formatting dates for an XML in C#: Datatable dt = Data.GetMyDataTable(); foreach(DataRow row in dt.Rows) { //Create XElement with date XElement element = new XElement("MyElement", Convert.ToDateTime(row["...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576851", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Simple Php String Matching Pattern I have two strings I need to compare. Let's say for example that the strings are as follows: $A = "A fox jumped over the log"; $B = "A fox jumped"; Now how would I compare these two strings in PHP in order to return a percentage of character matching. So I would like my algorithm...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576852", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Animate a CALayer's bounds w/redraws I am wondering how one might animate a CALayer's bounds so, on each bounds change, the layer calls drawInContext:. I've tried the 2 following methods on my CALayer subclass: * *Setting needsDisplayOnBoundsChange to YES *Returning YES for the + (BOOL)needsDisplayForKey:(NSStr...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576853", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Detecting mouse clicks when another program has focus This program works well when the left mouse button is pressed in the window of application, but what i need is that the program also registers when the button is pressed out of the application. I am running under windows 7. #include <windows.h> cons...
{ "language": "en", "url": "https://stackoverflow.com/questions/7576854", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }