text stringlengths 74 309k |
|---|
{"title":"Detecting physical Menu key press in Android","tags":["android","button"],"question_text":"I am trying to detect when the physical Menu button on my Android phone has been pressed. I though the code below would work but it does not. Where am I going wrong please?\nThe error returned is 'Illegal modifier for p... |
{"title":"Why is the 'if' statement considered evil?","tags":["programming-languages","if-statement"],"question_text":"I just came from\nSimple Design and Testing Conference\n. In one of the session we were talking about evil keywords in programming languages.\nCorey Haines\n, who proposed the subject, was convinced th... |
{"title":"Generate an HTML Response in a Java Servlet","tags":["html","servlets"],"question_text":"How do I generate an HTML response in a Java servlet?","answer_text":"You normally forward the request to a JSP for display. JSP is a view technology which provides a template to write plain vanilla HTML\/CSS\/JS in and p... |
{"title":"Declaring a C function to return an array","tags":["c"],"question_text":"How can I make a function which returns an array? I tried this\n`const int WIDTH=11;\nconst int HEIGHT=11;\nint main() {\n char A[WIDTH][HEIGHT];\n A=rand_grid(WIDTH,HEIGHT);\n return 0;\n}\n\/\/ Initializes a random board.\nchar[][] ran... |
{"title":"How to make a Haskell cabal project with library+executables that still run with runhaskell\/ghci?","tags":["haskell","cabal","ghci","runhaskell"],"question_text":"If you\ndeclare a library + executable sections in a cabal file while avoiding double compilation of the library\nby putting the library into a\n`... |
{"title":"iOS app \"next\" key won't go to the next text field","tags":["iphone","objective-c","ios","xcode","first-responder"],"question_text":"I have a simple scene (using storyboard in IB) with a Username and Password text box. I've set the keyboard to close when you are on the Password text field but can't get the ... |
{"title":"How to make RatingBar to show five stars","tags":["android","xml","layout"],"question_text":"I am following the standard example of how to add a\n`RatingBar`\n. To control the number of stars I tried to use\n`android:numStars=\"5\"`\n. The problem is that the number of stars doesn't seem to do anything at all... |
{"title":"how to convert string Date to long millseconds","tags":["java","android","type-conversion"],"question_text":"I have a date inside a string something like \"12-December-2012\"\nHow can I convert this into milliseconds (long)?","answer_text":"Using\nSimpleDateFormat\n`String string_date = \"12-December-2012\";\... |
{"title":"Find html element which id starts with ","tags":["jquery"],"question_text":"I have HTML code in multiple pages, on each of them I used a JQgrid (jquery grid) for display some data. I knew that on each of those pages, the element that holds the JQgrid is named as \"LIST_xxx\". Now I need to make a javascript t... |
{"title":"jsoup posting and cookie","tags":["java","screen-scraping","jsoup"],"question_text":"I'm trying to use jsoup to login to a site and then scrape information, I am running into in a problem, I can login successfully and create a Document from index.php but I cannot get other pages on the site. I know I need to ... |
{"title":"Android Lollipop, add popup menu from title in toolbar","tags":["android","android-5.0-lollipop","android-toolbar"],"question_text":"I'm unable to see how adding a popup menu from the title is accomplished like is shown in many of the material design examples. Any help would be much appreciated.","answer_text... |
{"title":"Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column","tags":["sql","sql-server","csv"],"question_text":"I'm trying to insert a large CSV file (several gigs) into SQL Server, but once I go through the Import Wizard and finally try to import the file I get the following... |
{"title":"laravel 4 all routes except home result in 404 error","tags":["routing","http-status-code-404","laravel"],"question_text":"Just trying out laravel 4 which I installed using composer. Have setup a virtualhost. Only the root route is working:\n`Route::get('\/', function()\n{\n return View::make('hello');\n});`\... |
{"title":"How to add global ASP.Net Web Api Filters?","tags":["asp.net-mvc-4","asp.net-web-api"],"question_text":"I've created a Web Api filter (using\n`System.Web.Http.Filters.ActionFilterAttribute`\n) but I am unable to get it to work inside of ASP.Net MVC 4. I tried adding it to the\n`RegisterGlobalFilters()`\nmetho... |
{"title":"\"Who's Online\" using Devise in Rails","tags":["ruby-on-rails-3","devise"],"question_text":"Using Devise on Rails, is there some way to list all the users who currently have active sessions i.e. the users that are currently logged in?\nPs. I'm looking for a robust solution, not something simplistic like the ... |
{"title":"What Git branching models work for you?","tags":["git","merge","workflow","release","cherry-pick"],"question_text":"Our company is currently using a simple trunk\/release\/hotfixes branching model and would like advice on what branching models work best for your company or development process.\nWorkflows \/ b... |
{"title":"application loader stuck at the stage of \"Authenticating with the iTunes Store\"","tags":["iphone","ios","itunesconnect","itunes-store"],"question_text":"I was about to upload an app to iTunes connect,but the application loader has been stuck at the stage of \"Authenticating with the iTunes Store\" and pendi... |
{"title":"What is the use for IHttpHandler.IsReusable?","tags":["c#","asp.net","asp.net-mvc","ihttphandler","system.web"],"question_text":"I'm writing a\n`IHttpHandler`\nand I'll need to implement a\n`IsReusable`\nproperty. When I look at the\nMSDN documentation\nit says:\nGets a value indicating whether another reques... |
{"title":"How to refresh an IFrame using Javascript?","tags":["javascript","iframe"],"question_text":"I have a webpage with an IFrame and a Button, once the button is pressed I need the IFrame to be refreshed. Is this possible, if so how? I searched and could not find any answers.","answer_text":"This should help:\n`do... |
{"title":"View with low alpha - Subview with high alpha","tags":["objective-c","ios","uiview","alpha"],"question_text":"I have a\n`UIView`\nwith an alpha of .5\nI have added a subview with an alpha of 1.\nThe subview seems to inherit the alpha value of the parent. Is there a way to make the subview more opaque than its... |
{"title":"JSON vs. Serialized Array in database","tags":["php","mysql","serialization"],"question_text":"What are the advantages and disadvantages of storing JSON data in MySQL database vs. serialized array?","answer_text":"Pro JSON:\nThe JSON data can be used by many different languages, not just PHP\nJSON data is hum... |
{"title":"What to put in a python module docstring?","tags":["python","documentation","module"],"question_text":"Ok, so I've read both\nPEP 8\nand\nPEP 257\n, and I've written lots of docstrings for functions and classes, but I'm a little unsure about what should go in a module docstring. I figured, at a minimum, it sh... |
{"title":"Get each line from textarea","tags":["php","parsing","textarea","line"],"question_text":"`<textarea> put returns between paragraphs\nfor linebreak add 2 spaces at end\nindent code by 4 spaces\nquote by placing > at start of line\n<\/textarea>\n$text = value from this textarea;`\nHow to:\n1) Get each line from... |
{"title":"Does Robolectric support API level?","tags":["android","robolectric"],"question_text":"I have some Test which I would like to run with Robolectric, I use the 2.3-SNAPSHOT as my APP uses the ActionbarCompat i needed to use 2.3-SNAPSHOT Version as Robolectric could not find the AppCompat Themes before. So I set... |
{"title":"How to debug on a real device (using Eclipse\/ADT)","tags":["eclipse","debugging","device","adt"],"question_text":"I'm trying to figure out how to debug applications directly on my phone (HTC Desire).\nI've installed the USB driver that came with the phone and the phone is listed when using \"adb devices\".\n... |
{"title":"How to compare two Strings when both can be null?","tags":["java","equals","equality"],"question_text":"I am aware that it is better to call the\n`equals`\nmethod over using the\n`==`\noperator (see\nthis question\n). I want two strings to compare as equal if they are both null or if they represent the same s... |
{"title":"Injecting a service into another service in angularJS","tags":["angularjs","angularjs-service"],"question_text":"Is it possible to inject one service into another service in angularJS?","answer_text":"Yes. follow the regular injection rule in angularjs.\n`app.service('service1', function(){});\n\/\/Inject ser... |
{"title":"UIScrollView, reaching the bottom of the scroll view","tags":["iphone","uiscrollviewdelegate"],"question_text":"I know the Apple documentation has the following delegate method:\n`- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; \/\/ called when scroll view grinds to a halt`\nHowever, it doesn... |
{"title":"Uninstall of CodeRush and ReSharper - Intellisense Not Working","tags":[".net","resharper","intellisense","coderush"],"question_text":"Install order:\nVisual Studio 2008\nReSharper\nUninstall ReSharper\nCodeRush with Refactor Pro\nUninstall CodeRush with Refactor Pro\nNow my intellisense doesn't work. Any set... |
{"title":"Slow down scroll to top event by jQuery animate","tags":["javascript","jquery"],"question_text":"I'd like my page to go to the top when certain anchor is clicked.\nHere is how I tried to do it but it's not working, it's scrolling super fast.\n`$('a[href=#top]').click(function () {\n $('body').animate({\n scro... |
{"title":"Bottom borders on WPF Grid","tags":["c#","wpf","grid","border"],"question_text":"I've got a pretty simple question regarding the WPF Grid Control.\nI'd like to set a bottom border on each row in the grid, but can only find how to put all 4 borders around each cell.. my code is quite simple\n`<Grid Height=\"17... |
{"title":"Import PEM into Java Key Store","tags":["java","ssl","keystore","pem","apache-mina"],"question_text":"I am trying to connect to an SSL server which requires me to authenticate myself. In order to use SSL over Apache MINA I need a suitable JKS file. However, I have only been given a .PEM file.\nHow would I go ... |
{"title":"Is it possible to initialise a New System.Collections.Generic.Dictionary with String key\/value pairs?","tags":["vb.net","dictionary",".net-2.0","initialization"],"question_text":"Is it possible to create and initialise a\n`System.Collections.Generic.Dictionary`\nobject with String key\/value pairs in one sta... |
{"title":"Destructor called after throwing from a constructor","tags":["c++","exception","c++11"],"question_text":"I used to think that in C++, if a constructor throws an exception, the destructor of this \"partially constructed\" class is not called.\nBut it seems that it is not true anymore in C++11: I compiled the f... |
{"title":"How to get Duration from AVPlayer (Not AVAudioPlayer)?","tags":["iphone","objective-c","xcode","streaming"],"question_text":"I would like to make a UISlider(scrubber) for my AVPlayer. But since this is not an AVAudioPlayer, it doesn't have a built in duration. Any suggestion on how to create the Slider for fa... |
{"title":"What does this symbol mean in JavaScript?","tags":["javascript"],"question_text":"What is this?\nThis is a collection of questions that come up every now and then about syntax in JavaScript. This is also a Community Wiki,\nso everyone is invited to participate in maintaining this list.\nWhy is this?\nStack Ov... |
{"title":"Owin Twitter login - the remote certificate is invalid according to the validation procedure","tags":[".net","asp.net-mvc","twitter","twitter-oauth","owin"],"question_text":"I started getting this error recently when trying to login using twitter- any idea why?\n`Stack Trace: \n[AuthenticationException: The r... |
{"title":"Escape a dollar sign in string interpolation","tags":["scala","string-interpolation"],"question_text":"How do I escape a dollar sign in string interpolation?\n`def getCompanion(name: String) = Class.forName(s\"my.package.$name\\$\")\n\/\/ --> \"error: unclosed string literal\"`","answer_text":"Just double it\... |
{"title":"Non-type template parameters","tags":["c++","templates"],"question_text":"I understand that the non-type template parameter should be a constant integral expression. Can someone shed light why is it so ?\n`template <std::string temp>\nvoid foo()\n{\n \/\/ ...\n}`\nerror C2993: 'std::string' : illegal type for... |
{"title":"How to make UIView animation sequence repeat and autoreverse","tags":["ios","objective-c","uiview","uiviewanimation"],"question_text":"How to make this complex animation repeat and autoreverse?\nIs there any way to add options UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat to this animation se... |
{"title":"How to make iPhone vibrate using Swift?","tags":["iphone","swift","ios8","vibrate"],"question_text":"I need to make the iPhone vibrate, but I don't know how to do that in Swift. I know that in Objective-C, you just write:\n`import AudioToolbox\n AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);`\nBut that ... |
{"title":"Modifying variable inside while loop is not remembered","tags":["bash","while-loop"],"question_text":"In the following program, if I set the variable\n`$foo`\nto the value 1 inside the first\n`if`\nstatement, it works in the sense that its value is remembered after the if statement. However, when I set the sa... |
{"title":"Sort rows in data.table (R)","tags":["r","order","data.table"],"question_text":"Let's say I have the following\n`data.table`\nin\n`R`\n:\n`library(data.table)\n DT = data.table(x=rep(c(\"b\",\"a\",\"c\"),each=3), y=c(1,3,6), v=1:9)`\nI want to order it by two columns (say columns\n`x`\nand\n`v`\n). I used thi... |
{"title":"How can I back out a merge in Mercurial and later remerge with that branch?","tags":["version-control","mercurial","dvcs"],"question_text":"I have two branches, default and branch1. By mistake one person in our team merged branch1 with default. The content in branch1 is not yet ready to merge with default (it... |
{"title":"Is there OS written in Haskell?","tags":["haskell","operating-system"],"question_text":"Just learned Haskell for a month (and having superficial questions...). Knowing Haskell has many benefits, can serve as a safe language... is there someone trying to write an OS, or even simple one, supporting just process... |
{"title":"Flags to enable thorough and verbose g++ warnings","tags":["c++","g++","warnings"],"question_text":"Often in C under\n`gcc`\n, I will start with the following set of warning flags (painfully assembled from multiple sources):\n`-Wall -Wextra -Wformat-nonliteral -Wcast-align -Wpointer-arith -Wbad-function-cast ... |
{"title":"C# 'unsafe' function \u00e2\u0080\u0094 *(float*)(&result) vs. (float)(result)","tags":["c#","unsafe","type-punning"],"question_text":"Can anyone explain in a simple way the codes below:\n`public unsafe static float sample(){ \n int result = 154 + (153 << 8) + (25 << 16) + (64 << 24);\n return *(float*)(&resu... |
{"title":"iPhone - Replacing rootview in navigation controller","tags":["iphone","uinavigationcontroller","replace","root"],"question_text":"I have a project with a NavigationController, that contains into IB the first ViewController to show. That's just the default pattern when creating the project.\nIn that first vie... |
{"title":"How to delete only directories and leave files untouched","tags":["unix","directory","rm"],"question_text":"I have hundreds of directories and files in one directory.\nWhat is the best way deleting only directories (no matter if the directories have anything in it or not, just delete them all)\nCurrently I us... |
{"title":"How should I implement this schema in MongoDB?","tags":["database-design","mongodb"],"question_text":"I'm trying to write a tracking script and I'm having trouble with figuring out how the database should work.\nIn MySQL I'd create a table that looks similar to\n`User:\n username_name: string\nCampaign:\n tit... |
{"title":"What is const void?","tags":["c++","c++11","c++14"],"question_text":"The description of\n`std::is_void`\nstates that:\nProvides the member constant value that is equal to true, if T is the\ntype void, const void, volatile\n void,\nor const volatile void.\nThen what could be\n`const void`\n, or a\n`volatile vo... |
{"title":"Close window automatically after printing dialog closes","tags":["javascript","printing"],"question_text":"I have a tab open when the user clicks a button. On the\n`onload`\nI have it bring up the print dialog, but the user asked me whether it was possible that after it sends to the printer to print, if the t... |
{"title":"What is the use for Task.FromResult<TResult> in C#","tags":["c#",".net","task-parallel-library","task","async-await"],"question_text":"In C# and TPL (\nTask Parallel Library\n), the\n`Task`\nclass represents an ongoing work that produces a value of type T.\nI'd like to know what is the need for the\nTask.From... |
{"title":"C++ convert vector<int> to vector<double>","tags":["c++","stl","vector","type-conversion"],"question_text":"What is a good clean way to convert a\n`std::vector<int> intVec`\nto\n`std::vector<double> doubleVec`\n. Or, more generally, to convert two vectors of convertible types?","answer_text":"Use\n`std::vecto... |
{"title":"The source was not found, but some or all event logs could not be searched","tags":["c#",".net","windows-7","event-log","securityexception"],"question_text":"I am getting the following exception. I have given full control to Asp.net account on Eventlogs in Registry edit.\n[SecurityException: The source was no... |
{"title":"Are C++ enums slower to use than integers?","tags":["c++","enums","profiling","performance"],"question_text":"It's really a simple problem :\nI'm programming a Go program. Should I represent the board with a\n`QVector<int>`\nor a\n`QVector<Player>`\nwhere\n`enum Player\n{\n EMPTY = 0,\n BLACK = 1,\n WHITE = 2... |
{"title":"dyld: Library not loaded ... Reason: Image not loaded","tags":["osx","dylib","otool","install-name-tool"],"question_text":"When trying to run an executable I've been sent in Mac OS X, I get the following error\n`dyld: Library not loaded: libboost_atomic.dylib\n Referenced from: \/Users\/\"Directory my executa... |
{"title":"Why do I get an InvalidOperationException when I try to use attribute routing with Web API 2?","tags":["c#","asp.net-mvc","asp.net-mvc-4","asp.net-web-api"],"question_text":"I just updated my Web API packages in my MVC 4 application so that I can use attribute routing. When I add\n`config.MapHttpAttributeRout... |
{"title":"Android and displaying multi-lined text in a TextView in a TableRow","tags":["android","textview","multiline","tablelayout","tablerow"],"question_text":"I'm displaying a TableLayout with rows as follows:\n`<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TableRow\n xmlns:android=\"http:\/\/schemas.android.com\/ap... |
{"title":"JS Client-Side Exif Orientation: Rotate and Mirror JPEG Images","tags":["javascript","rotation","html5-canvas","exif"],"question_text":"Digital camera photos are often saved as JPEG with an EXIF \"orientation\" tag. To display correctly, images need to be rotated\/mirrored depending on which orientation is se... |
{"title":"Get Project or Relative Directory with T4","tags":["visual-studio","visual-studio-2008","file-io","code-generation","t4"],"question_text":"How can I get a reference to the directory of the visual studio project or solution or the directory of the t4 template from within a t4 template?\nI have a template that ... |
{"title":"How to get visitor's location (i.e. country) using javascript geolocation","tags":["javascript","geolocation"],"question_text":"I'm looking for a javascript library to extend the native geolocation function\n`if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var lat... |
{"title":"Rails 3 returning a HTTP 406 Not Acceptable?","tags":["ruby-on-rails","routing"],"question_text":"I have the following controller code:\n`def create\n @admin = Admin.new(params[:admin])\n respond_to do |format|\n if @admin.save\n redirect_to(@admin, :notice => 'Admin was successfully created.')\n else\n rende... |
{"title":"Correct way to get the CoreDispatcher in a Windows Store app","tags":["c#","windows-runtime","windows-store-apps","async-await","dispatcher"],"question_text":"I'm building a Windows Store app, and I have some code that needs to be posted to the UI thread.\nFor that, i'd like to retrieve the CoreDispatcher and... |
{"title":"Why was std::pow(double, int) removed from C++11?","tags":["c++","c++11","c++-standard-library"],"question_text":"While looking into\nEfficient way to compute p^q (exponentiation), where q is an integer\nand reviewing the C++98 and C++11 standards I noticed that apparently the\n`std::pow(double, int)`\noverlo... |
{"title":"php getting unique values of a multidimensional array","tags":["php","arrays"],"question_text":"Possible Duplicate:\nphp multi-dimensional array remove duplicate\nI have an array like this:\n`$a = array ( \n 0 => array ( 'value' => 'America', ), \n 1 => array ( 'value' => 'England', ), \n 2 => array ( 'value'... |
{"title":"UIStackView \"Unable to simultaneously satisfy constraints\" on \"squished\" hidden views","tags":["ios","autolayout","uikit","ios9","uistackview"],"question_text":"When my UIStackView \"rows\" are squished, they throw AutoLayout warnings. However, they display fine and nothing else is wrong besides these sor... |
{"title":"PL\/SQL, how to escape single quote in a string?","tags":["oracle","plsql"],"question_text":"In the Oracle PL\/SQL, how to escape single quote in a string ? I tried this way, it doesn't work.\n`declare\n stmt varchar2(2000);\nbegin\n for i in 1021 .. 6020\n loop\n stmt := 'insert into MY_TBL (Col) values(\\'E... |
{"title":"What is the interop dll?","tags":["asp.net","crystal-reports","interop"],"question_text":"I need some clarification. I have a Reportwriter dll that uses Crystal Reports. It is written in VB6. I have to add this dll to my asp.net project, where it creates an interop dll.\nTo my understanding, the interop dll i... |
{"title":"Backbone.js route optional parameter","tags":["javascript","backbone.js","routes"],"question_text":"Is it possible to have optional parameters in a Backbone.js route?\ne.g this:\n`routes:\n \"search\/[:query]\": \"searchIndex\"`\ninstead of:\n`routes:\n \"search\/\": \"searchIndex\"\n \"search\/:query\": \"se... |
{"title":"JavaScript dot notation","tags":["javascript","notation"],"question_text":"The following line is apparently written best in dot notation. I am trying to clean my JavaScript code to make it strict. What does it mean?\n`if (ie||ns6)\n{\n var tipobj=document.all? document.all[\"dhtmltooltip\"] : document.getElem... |
{"title":"How to set Id of dynamic created layout?","tags":["android"],"question_text":"I want to give ID to some views (textview ,imageview etc) in a layout that is programmetically created. \nSo what is the best way to set ID.","answer_text":"You create an ids.xml file and place all your required ids in it as below\n... |
{"title":"Stretching <a> tag to fill entire <li>","tags":["html","css","xhtml"],"question_text":"Here's a simple menu structure:\n`<ul id=\"menu\">\n <li><a href=\"javascript:;\">Home<\/a><\/li>\n <li><a href=\"javascript:;\">Test<\/a><\/li>\n<\/ul>`\nI want the\n`<a>`\nto be stretched so that it fills the entire\n`<li... |
{"title":"How to set a JavaFX Stage\/Frame to Maximized","tags":["frame","stage","javafx-2","maximize-window"],"question_text":"I'm using JavaFX 2. I want my frame to open maximized but I'm not seeing a way. I searched a bit on the internet without success. For the stage I see\n`setFullScreen()`\nand\n`setIconified()`\... |
{"title":"Maven plugin not using eclipse's proxy settings","tags":["java","eclipse","plugins","maven","proxy"],"question_text":"I am using springsource tool suite 2.7.2, based on eclipse 3.7. The maven plugin comes now out of the box with eclipse which is great, and this problem occured even with previous version of ec... |
{"title":"Multiple UIBarButtonItems in UINavigationBar","tags":["iphone","objective-c","ipad","uinavigationbar","uibarbuttonitem"],"question_text":"How to Create multiple bar button in navigation bar?","answer_text":"From iOS 5 onwards, you can now do it using\n`setLeftBarButtonItems:animated:`\nor\n`setRightBarButtonI... |
{"title":"How to install Ruby 2.1.4 on Ubuntu 14.04","tags":["ruby","ubuntu","ubuntu-14.04"],"question_text":"I dont know how to install the latest Ruby on Ubuntu.\nFirst I installed the default Ruby 1.9.3, using\n`sudo apt-get install ruby`\nThen I tried to install the 2.0 version using\n`sudo apt-get install ruby2.0`... |
{"title":"bash: replace an entire line in a text file","tags":["bash","text","replace","sed"],"question_text":"I have a situation where I want a bash script to replace an entire line in a file.\nThe line number is always the same, so that can be a hard-coded variable.\nI'm not trying to replace some sub-string in that ... |
{"title":"How to translate model in namespace?","tags":["ruby-on-rails","model","localization","namespaces","internationalization"],"question_text":"I have a model Products::Car. How can I translate its attributes?\nI have already tried this:\n`activerecord: \n models:\n products:\n car: \"\u00d0\u0090\u00d0\u00b2\u00d... |
{"title":"Setting ActionBarSherlock Theme for Android app","tags":["android","actionbarsherlock"],"question_text":"READ UPDATE 2 BELOW FOR THE ANSWER\nI'm trying to use ActionBarSherlock in my app. I checked out the 4.0.0 release from the\nproject github repo\n, built it in Netbeans, then copied the library-4.0.0.jar f... |
{"title":"What makes reference comparison (==) work for some strings in Java?","tags":["java","string","equals"],"question_text":"I have following lines of codes to compare String. str1 not equal to str2, which is understandable since it compares object reference. But then why s1 is equal to s2?\n`String s1 = \"abc\";\... |
{"title":"How can I get the count of line in a file in an efficient way?","tags":["java","file"],"question_text":"I have a big file. It includes approximately 3.000-20.000 lines. How can I get the total count of lines in the file using Java?","answer_text":"`BufferedReader reader = new BufferedReader(new FileReader(\"f... |
{"title":"NSString indexOf in Objective-C","tags":["objective-c","cocoa"],"question_text":"Are there anything similar to an\n`indexOf`\nfunction in the NSString objects?","answer_text":"Use\n`-[NSString rangeOfString:]`\n:\n`- (NSRange)rangeOfString:(NSString *)aString;`\nFinds and returns the range of the first occurr... |
{"title":"How can I unit test a Windows Service?","tags":["c#",".net","unit-testing","windows-services"],"question_text":".NET Framework: 2.0\nPreferred Language: C#\nI am new to TDD (Test Driven Development).\nFirst of all, is it even possible to unit test Windows Service?\nWindows service class is derived from Servic... |
{"title":"Why does swapping values with XOR fail when using this compound form?","tags":["c#","swap","xor"],"question_text":"I found this code to swap two numbers without using a third variable, using the XOR\n`^`\noperator.\nCode:\n`int i = 25;\nint j = 36;\nj ^= i; \ni ^= j;\nj ^= i;\nConsole.WriteLine(\"i:\" + i + \... |
{"title":"Remove leading and trailing spaces?","tags":["python"],"question_text":"I'm having a hard time trying to use .strip with the following line of code.\nThanks for the help.\n`f.write(re.split(\"Tech ID:|Name:|Account #:\",line)[-1])`","answer_text":"You can use the strip() to remove trailing and leading spaces.... |
{"title":"I want to explode a variable in a little different way","tags":["php"],"question_text":"I have this variable.\n`$var = \"A,B,C,D,'1,2,3,4,5,6',E,F\";`\nI want to explode it so that I get the following array.\n`array(\n[0] => A,\n[1] => B,\n[2] => C,\n[3] => D,\n[4] => 1,2,3,4,5,6,\n[5] => E,\n[6] => F\n);`\nI... |
{"title":"Can I mimic a C header that redefines bool in C++?","tags":["c++","c","typedef","mixing"],"question_text":"I am writing a program and I would really prefer to write in C++, however, I'm required to include a C header that redefines bool:\n`# define false 0\n# define true 1\ntypedef int bool;`\nThe obvious sol... |
{"title":"Decode gzipped web page retrieved via cURL in PHP","tags":["php","encoding","gzip","decoding"],"question_text":"I'm retrieving a gzipped web page via curl, but when I output the retrieved content to the browser I just get the raw gzipped data. How can I decode the data in PHP?\nOne method I found was to write... |
{"title":"Choose bower install directory","tags":["bower"],"question_text":"This is a follow-up to\nthis question\n. I'm using bower 0.7.1, and still cannot get the components to be installed anywhere else than in the\n`components`\nfolder.\nI tried adding the following line to my\n`component.json`\n, as per\nthis PR\n... |
{"title":"Add unique constraint to combination of two columns","tags":["sql","sql-server"],"question_text":"I have a table and, somehow, the same person got into my\n`Person`\ntable twice. Right now, the primary key is just an autonumber but there are two other fields that exist that I want to force to be unique.\nFor ... |
{"title":"How do you convert a PIL `Image` to a Django `File`?","tags":["python","django","python-imaging-library","django-file-upload","django-uploads"],"question_text":"I'm trying to convert an\n`UploadedFile`\nto a PIL\n`Image`\nobject to thumbnail it, and then convert the PIL\n`Image`\nobject that my thumbnail func... |
{"title":"When I run the rake:db migrate command I get an error \"Uninitialized constant CreateArticles\"","tags":["ruby-on-rails","rake","rails-migrations"],"question_text":"I created a model ruby script\/generate model Article (simple enuff)\nHere is the migration file create_articles.rb:\n`def self.up\n create_table... |
{"title":"What is the difference between the kernel space and the user space?","tags":["linux-kernel","operating-system","kernel","terminology"],"question_text":"What is the difference between the kernel space and the user space? Do kernel space, kernel threads, kernel processes and kernel stack mean the same thing? Al... |
{"title":"Convert existing project into Android project in Eclipse?","tags":["android","eclipse"],"question_text":"How do you convert an existing project into an Android project in Eclipse?\nIn particular, I want to convert a plain old Java project into an Android Library project.\nThanks.","answer_text":"You need to c... |
{"title":"Get user image from Facebook Graph-API","tags":["android","facebook","facebook-graph-api"],"question_text":"I want to show the users profile picture in a list view. \nWhen I try to call the graph-api from android to retrieve the image, I always get the following error.\n`java.io.IOException: Hostname <fbcdn-p... |
{"title":"I am getting the error certificate identity appears more than once in the key chain","tags":["iphone"],"question_text":"When i got this error I checked in my organizer window and found a duplicate identity in my nameI tried to delete the duplicate identity in my organizer window. But i am not able to select o... |
{"title":"WatiN System.IO.FileNotFoundException Interop.SHDocVw","tags":[".net","nunit","watin"],"question_text":"I have just started to receive the following error when running my WatIn tests.\nSystem.IO.FileNotFoundException : Could not load file or assembly\n 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral,\n Pub... |
{"title":"Could a Malicious Hacker Alter a Hidden Post Variable","tags":["php","html","validation","post"],"question_text":"I know that a POST can be spoofed in terms of originating domain, but what about being able to change the variables of the hidden POST variables in my HTML? I am concerned that someone could alter... |
{"title":"MVC Vs n-tier architecture","tags":["model-view-controller","n-tier"],"question_text":"I was wondering what exactly is the difference between MVC(which is an architectural pattern) and an n-tier architecture for an application. I searched for it but couldn't find a simple explanation. May be I am a bit naive ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.