text stringlengths 74 309k |
|---|
{"title":"mvc 5 check user role","tags":["c#","authentication","asp.net-mvc-5","asp.net-identity"],"question_text":"How in mvc 5 I can found out role of logged user?\nI made the user by this code\n`private bool AddUserAndRole()\n {\n IdentityResult ir;\n var rm = new RoleManager<IdentityRole>\n (new RoleStore<IdentityR... |
{"title":"Change Jenkins default view","tags":["view","jenkins"],"question_text":"I have been trying to follow the instructions on how to change the default view in Jenkins\nhere\n.\nI've created another view that I would like to be the default, but when I go looking for the\n`Default View`\nsetting in\n`Manage Jenkins... |
{"title":"Jade: Change active menu item in parent template","tags":["html","jade"],"question_text":"I have a navigation bar in my parent jade template and I'd like to highlight the item which is currently in view. So if I'm on the blog page,\n`ul\n li Home\n li.active Blog\n li Contact Us\n li About`\nWithout copying t... |
{"title":"Getting \"bytes.Buffer does not implement io.Writer\" error message","tags":["go"],"question_text":"I'm trying to have some Go object implement io.Writer, but writes to a string instead of a file or file-like object. I thought\n`bytes.Buffer`\nwould work since it implements\n`Write(p []byte)`\n. However when ... |
{"title":"Python: Get the first character of a the first string in a list?","tags":["python","string","list","character"],"question_text":"How would I get the first character from the first string in a list in Python?\nIt seems that I could use\n`mylist[0][1:]`\nbut that does not give me the first character.\n`>>> myli... |
{"title":"Android Unit Testing: Bundle\/Parcelable","tags":["android","unit-testing","bundle","parcelable"],"question_text":"How do you unit test Parcelable? I created a Parcelable class, and wrote this unit test\n`TestClass test = new TestClass();\nBundle bundle = new Bundle();\nbundle.putParcelable(\"test\", test);\n... |
{"title":"Android: Difference between getCount() and getChildCount() in ListView","tags":["java","android","android-listview"],"question_text":"What is difference between\n`getCount()`\nand\n`getChildCount()`\nin\n`ListView`\n?","answer_text":"`getCount()`\nreturns you a count of items in Adapter (total in list),\n`get... |
{"title":"Simple statistics - Java packages for calculating mean, standard deviation, etc","tags":["java","math","statistics","packages"],"question_text":"Could you please suggest any simple Java statistics packages?\nI don't necessarily need any of the advanced stuff. I was quite surprised that there does not appear t... |
{"title":"shared_ptr magic :)","tags":["c++","destructor","smart-pointers"],"question_text":"Mr. Lidstr\u00c3\u00b6m and me had an argument\n:)\nMr. Lidstr\u00c3\u00b6m's claim is that a construct\n`shared_ptr<Base> p(new Derived);`\ndoesn't require Base to have a virtual destructor:\nArmen Tsirunyan\n: \"Really? Will ... |
{"title":"Can I have an incrementing count variable in LINQ?","tags":["linq","linqpad"],"question_text":"I want to do something like this:\n`from a in stuff\nlet counter = 0\nselect new { count = counter++, a.Name };`\nBut I get a error telling me that counter is read only. Is there a way to do something similar to thi... |
{"title":"ZIP Code (US Postal Code) validation","tags":["javascript","validation"],"question_text":"I thought people would be working on little code projects together, but I don't see them, so here's an easy one:\nCode that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are stil... |
{"title":"OVER clause in Oracle","tags":["sql","oracle","window-functions"],"question_text":"What is the meaning of the OVER clause in Oracle?","answer_text":"The OVER clause specifies the partitioning, ordering & window \"over which\" the analytic function operates.\nFor example, this calculates a moving average:\n`AV... |
{"title":"How do I get first element rather than using [0] in jQuery?","tags":["javascript","jquery"],"question_text":"I'm new to jQuery, apologies if this is a silly question.\nWhen I use it find an element using the id, I know theres always one match and in order to access it I would use the index [0]. Is there a bet... |
{"title":"In Java,Using switch statement with a range of value in each case?","tags":["java","if-statement","switch-statement"],"question_text":"In Java is it possible to write a switch statement where each case contains more than one value? For example (though clearly the following code won't work):\n`switch (num) {\n... |
{"title":"How to pass selected, named arguments to Jinja2's include context?","tags":["templates","jinja2"],"question_text":"Using Django templating engine I can include another partial template while setting a custom context using named arguments, like this:\n`{% include \"list.html\" with articles=articles_list1 only... |
{"title":"Monitor vs lock","tags":["c#",".net","multithreading","locking","monitor"],"question_text":"When is it appropriate to use either the\n`Monitor`\nclass or the\n`lock`\nkeyword for thread safety in C#?\nEDIT:\nIt seems from the answers so far that\n`lock`\nis short hand for a series of calls to the\n`Monitor`\n... |
{"title":"Logging Method signature using swift","tags":["ios","cmd","swift","ios8"],"question_text":"I am trying to rewrite my logging class and I would like to know how to substitute\nPRETTY_FUNCTION\nor NSStringFromSelector(_cmd) in a swift file in order to track the method calls?","answer_text":"Special literals in ... |
{"title":"PuTTY Serial Communication","tags":["serial-port","putty","virtual-serial-port"],"question_text":"I am trying to use PuTTY to communicate over my computer's serial line. I have configured the correct serial line, baud rate, number of data bits, stop bits, parity, and flow control, and established the connecti... |
{"title":"Why is (void) 0 a no operation in C and C++?","tags":["c++","c","compiler-construction","language-details"],"question_text":"I have seen debug printfs in\nglibc\nwhich internally is defined as\n`(void) 0`\n, if\nNDEBUG\nis defined. Likewise the\n`__noop`\nfor Visual C++ compiler is there too. The former works... |
{"title":"POSTing Form Fields with same Name Attribute","tags":["php","post"],"question_text":"If you have a form containing text inputs with duplicate\n`name`\nattributes, and the form is posted, will you still be able to obtain the values of all fields from the\n`$_POST`\narray in PHP?","answer_text":"No. Only the la... |
{"title":"How to get the \"dnu\" command working on OS X?","tags":[".net","osx","asp.net-core","dnx"],"question_text":"Just downloaded and installed\nVisual Studio Code\non OS X 10.10.3.\nI've managed to partially follow the\ninstallation instructions for ASP.NET 5\n.\nWhat I fail with is when the instruction tells me ... |
{"title":"Type to use to represent a byte in ANSI (C89\/90) C?","tags":["c","types","c89"],"question_text":"Is there a standards-complaint method to represent a byte in ANSI (C89\/90) C? I know that, most often, a char happens to be a byte, but my understanding is that this is not guaranteed to be the case. Also, there... |
{"title":"TypeError: ObjectId('') is not JSON serializable","tags":["python","mongodb","json"],"question_text":"My response back from MongoDB after querying an aggregated function on document using Python, It returns valid response and i can print it but can not return it.\nError:\n`TypeError: ObjectId('51948e86c25f4b1... |
{"title":"Confusing Template error","tags":["c++","templates","llvm","clang"],"question_text":"I've been playing with clang a while, and I stumbled upon \"test\/SemaTemplate\/dependent-template-recover.cpp\" (in the clang distribution) which is supposed to provide hints to recover from a template error.\nThe whole thin... |
{"title":"Why doesn't delete destroy anything?","tags":["c++","memory","new-operator","delete-operator"],"question_text":"I'm playing a little with memory dynamic allocation, but I don't get a point. When allocating some memory with the\n`new`\nstatement, I'm supposed to be able to destroy the memory the pointer points... |
{"title":"Can I do Android Programming in C++, C?","tags":["c++","android"],"question_text":"Can I do Android programming in C++, C? If the answer is \"yes\" then please tell how? And what's the procedure to set up?\nI don't know Obj-C, Java, but well-versed in C, C++, Flash AS3, SDK released by Google.\nPlease do not ... |
{"title":"Run java jar file on a server as background process","tags":["shell","unix","executable-jar"],"question_text":"I need to run a java jar in server in order to communicate between two application,i have written to shell script to run it ,but once i startup that script i can't shutdown \/ terminate the process,i... |
{"title":"What's wrong with const?","tags":["c++","c++11"],"question_text":"What are the known shortfalls of\n`const`\nin C++ and C++0x?","answer_text":"The only thing wrong with\n`const`\nis that it is\nseriously underrated\nby to many developers. It's one of the best tools in C++'s toolbox, very sharp, and yet not da... |
{"title":"AngularJS checkbox ng-repeat and selected objects?","tags":["javascript","angularjs","checkbox","repeat"],"question_text":"I am trying to do it in proper way with less pain, but i can't figure out how to deal with ng-model and binding it to the selected list etc and moreover i need to populate that list in la... |
{"title":"Return value from thread","tags":["python","multithreading","python-multithreading","exit-code"],"question_text":"How do I get a thread to return a tuple or any value of my choice back to the parent in Python?","answer_text":"I suggest you instantiate a\nQueue.Queue\nbefore starting the thread, and pass it as... |
{"title":"How to remove trailing white spaces using a regular expression without removing empty lines (code cleaning)","tags":["regex"],"question_text":"I'm trying to remove trailing white spaces and tabs from my code, and I don't know how to do it without removing empty lines.\nI tried:\n`\\s+$`\nand:\n`([^\\n]*)\\s+\... |
{"title":"MATLAB-style find() function in Python","tags":["python","matlab","find"],"question_text":"In MATLAB it is easy to find the indices of values that meet a particular condition:\n`>> a = [1,2,3,1,2,3,1,2,3];\n>> find(a > 2) % find the indecies where this condition is true\n[3, 6, 9] % (MATLAB uses 1-based index... |
{"title":"dot dot dot in Golang. interface with empty braces","tags":["go"],"question_text":"This is a Golang code piece I have question about:\nwhat is \"a\" in this function?\n`func DPrintf(format string, a ...interface{}) (n int, err error) {\n if Debug > 0 {\n n, err = fmt.Printf(format, a...)\n }\n return`\nCould ... |
{"title":"How can I use OCMock to verify that a method is never called?","tags":["objective-c","cocoa","mocking","mockito","ocmock"],"question_text":"At my day job I've been spoiled with\nMockito's\n`never()`\nverification\n, which can confirm that a mock method is never called.\nIs there some way to accomplish the sam... |
{"title":"Get and Set Screen Resolution","tags":["c#","screen","screen-resolution"],"question_text":"How can I collect and change screen resolution using Visual C#?","answer_text":"For\nretrieving\nthe screen resolution, you're going to want to use the\n`System.Windows.Forms.Screen`\nclass. The\n`Screen.AllScreens`\npr... |
{"title":"Checking multiple columns for one value","tags":["mysql","sql","select","query-optimization"],"question_text":"I have a table that has columns like this for example:\n`id,col1,col2,col3,col4`\nNow, I want to check if\n`ANY`\nof\n`col1, col2, col3, col4`\nhave the passed in value.\nThe long way to do nit would... |
{"title":"Editing the git commit message in GitHub","tags":["git","github","commit","post-commit"],"question_text":"Is there any way of online editing the commit message in\n`GitHub.com`\n, after submission?\nFrom the command line, one can do\n`git commit --amend -m \"New commit message\"`\nas correctly suggested in\na... |
{"title":"Where is the visual studio HTML Designer?","tags":["html","visual-studio-2015","designer"],"question_text":"Where is the Visual Studio HTML Designer? I see that there are options for the HTML Designer but I can't open it.\nSo I just want to ask why I can't find the designer and how do I open it. When I create... |
{"title":"Rails Browser Detection Methods","tags":["ruby-on-rails","ruby","user-agent","browser-detection"],"question_text":"Hey Everyone, I was wondering what methods are standard within the industry to do browser detection in Rails? Is there a gem, library or sample code somewhere that can help determine the browser ... |
{"title":"Python vs. Java performance (runtime speed)","tags":["java","python","performance"],"question_text":"Possible Duplicate:\nis python slower than java\/C#?\nIgnoring all the characteristics of each languages and focusing SOLELY on speed, which language is better performance-wise?\nYou'd think this would be a ra... |
{"title":"How do I get a model from a Backbone.js collection by its id?","tags":["javascript","backbone.js"],"question_text":"In my app, everything I do with data is based on the primary key as the data is stored in the database. I would like to grab a model from a collection based on this key.\nUsing Collection.at() r... |
{"title":"How to change XML Attribute","tags":["c#","xml","linq-to-xml","xmldocument"],"question_text":"How can I change an attribute of an element in an XML file, using C#?","answer_text":"Mike;\n Everytime I need to modify an XML document I work it this way:\n`\/\/Here is the variable with which you assign a new valu... |
{"title":"Python dump dict to json file","tags":["python","json","dictionary","d3.js","treemap"],"question_text":"I have a dict like this:\n`sample = {'ObjectInterpolator': 1629, 'PointInterpolator': 1675, 'RectangleInterpolator': 2042}`\nI can't figure out how to dump the dict to a\n`json`\nfile as showed below:\n`{ \... |
{"title":"How does true\/false work in PHP?","tags":["php"],"question_text":"I wonder how PHP handles true\/false comparison internally. I understand that true is defined as 1 and false is defined as 0. When I do if(\"a\"){ echo \"true\";} it echos \"true\". How does PHP recognize \"a\" as 1 ?","answer_text":"This is c... |
{"title":"What is the main difference between require() and define() function in dojo and when would we use either?","tags":["javascript","dojo","js-amd","ibm-mobilefirst"],"question_text":"I am new to learning dojo and I have come across the\n`require()`\nand\n`define()`\nfunctions and I can not get my head around eit... |
{"title":"How to simulate Windows shutdown for debugging?","tags":["c#",".net","winforms","shutdown"],"question_text":"I have an issue with my application when Windows shuts down - my app isn't exiting nicely, resulting in the End Task window being displayed. How can I use the debugger to see what's going on?\nIs there... |
{"title":"ADO.NET DbContext Generator vs. ADO.NET Poco Entity Generator (ObjectContext)","tags":["entity-framework","entity-framework-4","entity-framework-4.1"],"question_text":"I am about to start implementing the data access infrastructure of a project that was architected with an approach to DDD (\nit's my first att... |
{"title":"SFTP Libraries for .NET","tags":["c#",".net","sftp"],"question_text":"Can anyone recommend a good SFTP library to use? Right now I'm looking at products such as SecureBlackbox, IPWorks SSH, WodSFTP, and Rebex SFTP. However, I have never used any SFTP library before so I'm not sure what I'm looking for.\nIf an... |
{"title":"Viewport argument value \"device-width;\" for key \"width\" is invalid, and has been ignored. Note that","tags":["javascript","html","css"],"question_text":"I am getting this error in JavaScript:\nViewport argument value \"device-width;\" for key \"width\" is invalid, and has been ignored. Note that ';' is no... |
{"title":"The entity or complex type ' ' cannot be constructed in a LINQ to Entities query","tags":["c#","linq-to-entities"],"question_text":"Possible Duplicate:\nThe entity cannot be constructed in a LINQ to Entities query\n`var tasks = from i in data.Incidents\n join a in data.Accounts on i.CustomerID equals a.Acct_C... |
{"title":"context to use call and apply in Javascript?","tags":["javascript"],"question_text":"Guys can any one explain context to use call and apply methods in Javascript?\nWhy to use call and apply instead of calling a function directly ?","answer_text":"You use\n`call`\nor\n`apply`\nwhen you want to pass a different... |
{"title":"rails link_to :remote","tags":["javascript","ruby-on-rails","ajax","link-to"],"question_text":"I have the following:\n`<%= link_to my_path, method: :delete, confirm: 'Delete?', class: 'link-delete', 'data-message' => 'Are you sure?', 'data-severity' => 'danger', :remote => true do %>\n <i class=\"icon-trash\"... |
{"title":"How can I hide series from a HighCharts legend?","tags":["javascript","highcharts"],"question_text":"I have 4 series in my chart. 2 are visible when the chart loads. 2 are hidden.\nWhen the user zooms in, the visibility switches.\nHow can I have a legend that only displays the 2 visible series?","answer_text"... |
{"title":"How to add custom parameters to an URL query string with Python?","tags":["python"],"question_text":"I need to add custom parameters to an URL query string using Python\nExample:\nThis is the URL that the browser is fetching (GET):\n`\/scr.cgi?q=1&ln=0`\nthen some python commands are executed, and as a result... |
{"title":"ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL's are there","tags":["python","opencv","dll","path"],"question_text":"I have a situation very much like the one at\nImportError: DLL load failed: %1 is not a valid Win32 application\n, but the answer there isn't working for me.\nMy... |
{"title":"how to remove sub views","tags":["objective-c","uiview","addsubview"],"question_text":"I have added UIButton,UITextView as subview to my view, programatically.\n`notesDescriptionView = [[UIView alloc]initWithFrame:CGRectMake(0,0,320,460)];\nnotesDescriptionView.backgroundColor=[UIColor redColor];\n[self.view ... |
{"title":"Remove project .jars from project explorer view in Eclipse","tags":["java","eclipse","ide","jar","classpath"],"question_text":"The list of jars just takes up too much space. Can I collapse it or hide it?","answer_text":"Another solution would be using the Package Explorer view.","question_code":[],"answer_cod... |
{"title":"How do I write a custom JSON deserializer for Gson?","tags":["java","json","gson","deserialization"],"question_text":"I have a Java class, User:\n`public class User\n{\n int id;\n String name;\n Timestamp updateDate;\n}`\nAnd I receive a JSON list containing user objects from a webservice:\n`[{\"id\":1,\"name... |
{"title":"What are \"_vti_cnf\", \"_vti_pvt\", \"_vti_script\" and \"_vti_txt\" folders?","tags":["asp.net","frontpage"],"question_text":"These folders appear in my .NET Web project. Why do they appear? Are they useful?","answer_text":"They are used as part of the FrontPage server side extensions which do\nchange track... |
{"title":"why should one prefer call_user_func_array over regular calling of function?","tags":["php","function","callback"],"question_text":"`function foobar($arg, $arg2) {\n echo __FUNCTION__, \" got $arg and $arg2\\n\";\n}\nfoobar('one','two'); \/\/ OUTPUTS : foobar got one and two \ncall_user_func_array(\"foobar\",... |
{"title":"node-request - Getting error \"SSL23_GET_SERVER_HELLO:unknown protocol\"","tags":["node.js","ssl","request"],"question_text":"I'm using the\nnode-request\nmodule, regularly sending GET requests to a set of URLs and, sometimes, getting the error below on some sites.\n`Error: 29472:error:140770FC:SSL routines:S... |
{"title":"bootstrap-sass: Undefined variable: \"$baseLineHeight\"","tags":["ruby-on-rails","twitter-bootstrap","bootstrap-sass"],"question_text":"I've integrated bootstrap into my app using bootstrap-sass. The app works fine on my local machine, but when I go to deploy via capistrano, I get this error:\n`Undefined vari... |
{"title":"Default text for empty Repeater control","tags":["asp.net","repeater"],"question_text":"Using VS 2008, I have a Repeater control:\n`<asp:Repeater runat=\"server\" ID=\"storesRep\" DataSourceID=\"storeSqlDataSource\" \n OnItemDataBound=\"StoresRep_ItemDataBound\">\n <ItemTemplate>\n <table style=\"padding:0px\... |
{"title":"Fragments, DialogFragment, and Screen Rotation","tags":["android","android-fragments"],"question_text":"I have an Activity that calls setContentView with this XML:\n`<LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\... |
{"title":"Maximum number of files\/folders on Linux?","tags":["linux","folders","folder-structure"],"question_text":"I'm developing a LAMP online store, which will allow admin to upload multiple images for each item.\nMy concern is - right off the bat there will be 20000 items meaning roughly 60000 images.\nQUESTIONS:\... |
{"title":"Regex to check if a number is even","tags":["java","regex"],"question_text":"Can we have a regex to detect if a number is even ?\nI was wondering if we can have a regex to do this instead of usual\n`%`\nor bit operations.\nThanks for replies :)","answer_text":"You can try:\n`^-?\\d*[02468]$`\nExplanation:\n`^... |
{"title":"Is there a concept of global ignores in svn?","tags":["svn","svnignore"],"question_text":"Is there a way to setup a global list of Ignores for a SVN Repository or for the SVN Client on the PC?\nThe only reason I'm using tools like Tortoise\/Ankh\/VisualSVN is because I want to only check in the files I need w... |
{"title":"How to use D3 in Node.js properly?","tags":["node.js","jade","d3.js"],"question_text":"I've been trying to invoke D3 within Node.js. I tried firstly to import d3.v2.js from D3's website with the script tag, but then read this thread:\nWanna run d3 from a Cakefile\nWhere D3's author advises one should 'npm ins... |
{"title":"How to set value to variable using 'execute' in t-sql?","tags":["sql-server","tsql"],"question_text":"`DECLARE @dbName nvarchar(128) = 'myDb'\nDECLARE @siteId int \nexec ('SELECT TOP 1 @siteId = Id FROM ' + @dbName + '..myTbl') \nselect @siteId`\nWhen I run the script above I get the following error\n`Msg 137... |
{"title":"How to configure 'git log' to show 'commit date'","tags":["git","git-log"],"question_text":"How can I configure\n`git log`\nto show\n`commit date`\ninstead of\n`author date`\n?","answer_text":"There are several options. Probably the easiest is to just use one of the pre-baked\n`--pretty`\nformats, like\n`git ... |
{"title":"Multiple Files communication with coffeescript","tags":["javascript","coffeescript"],"question_text":"When I create a new coffeescript file, I cannot access the code in the compiled code from another file because it gets wrapped in some function scope. For example:\nCoffeeScript:\n`class ChatService\n constru... |
{"title":"Regexp recognition of email address hard?","tags":["regex","email","validation","textmatching"],"question_text":"I recently read somewhere that writing a regexp to match an email address, taking into account all the variations and possibilities of the standard is extremely hard and is significantly more compl... |
{"title":"Difference between code signing target and project","tags":["iphone","xcode","code-signing","ios-provisioning"],"question_text":"I noticed that in Xcode I can set the Entitlements and Code signing settings both on:\nthe Project (double click on the top item in Groups & File, which has the name of the project)... |
{"title":"Moving connections and instances between two computers","tags":["mysql","mysql-workbench","workbench"],"question_text":"I\u00c2\u00b4ve got a mysql-server that I\u00c2\u00b4m administrate remotely with MySQL Workbench.\nNow I\u00c2\u00b4ve got a new computer and I cant find any solution to move my connections... |
{"title":"Is it possible to have custom attributes in AndroidManifest.xml tags?","tags":["android","android-manifest"],"question_text":"I would like to add a custom attribute to the application tag of my AndroidManifest.xml file. Is this possible in the Android environment?","answer_text":"Yes. Here's an example. The c... |
{"title":"Golang iterating through map in template","tags":["go","go-templates"],"question_text":"I am trying to display a list gym classes (Yoga, Pilates etc). For each class type there are several classes, so I want to group all the Yoga classes, and all the Pilates classes and so on.\nI made this function to take a ... |
{"title":"Unit testing with django-celery?","tags":["python","django","unit-testing","celery"],"question_text":"I am trying to come up with a testing methodology for our\ndjango-celery\nproject. I have read the notes in the\ndocumentation\n, but it didn't give me a good idea of what to actually do. I am not worried abo... |
{"title":"Regular expression to remove a file's extension","tags":["javascript","regex","filenames"],"question_text":"I am in need of a regular expression that can remove the extension of a filename, returning only the name of the file.\nHere are some examples of inputs and outputs:\n`myfile.png -> myfile\nmyfile.png.j... |
{"title":"Ruby: How to make a public static method?","tags":["ruby-on-rails","ruby"],"question_text":"In Java i might do:\n`public static void doSomething();`\nAnd then i can access the method statically without making an instance:\n`className.doSomething();`\nHow can i do that in Ruby? this is my class and from my und... |
{"title":"Android Studio: Error:\/android-studio\/gradle\/gradle-2.4\/lib\/plugins\/gradle-diagnostics-2.4.jar (No such file or directory)","tags":["java","android","android-studio"],"question_text":"I've just installed Android Studio 1.3 into my Ubuntu 14.04 (64bit). I created a new project and after finishing the pro... |
{"title":"BroadcastReceiver trying to return result during a non-ordered broadcast - PACKAGE_ADDED in Android","tags":["android","android-intent","broadcastreceiver","android-service","intentfilter"],"question_text":"I am getting this exception in my below given code. i don't have any idea what is wrong with this code.... |
{"title":"How does fork() know when to return 0?","tags":["c","unix","process","fork","internals"],"question_text":"Take the following example:\n`int main(void)\n{\n pid_t pid;\n pid = fork();\n if (pid == 0) \n ChildProcess();\n else \n ParentProcess();\n}`\nSo correct me if I am wrong, once fork() executes a child pr... |
{"title":"How do CursorLoader automatically updates the view even if the app is inactive?","tags":["android","android-loadermanager","android-cursorloader"],"question_text":"I have been working on a small To-Do list app. I used CursorLoader to update the ToDolistview from a content provider. I have a written a function... |
{"title":"Why FolderBrowserDialog dialog does not scroll to selected folder?","tags":["c#","folderbrowserdialog"],"question_text":"As show in this screen shot, the selected folder is not in the view. It needs to be scrolled down to view the selected folder.\nSame dialog shows selected folder visible on different comput... |
{"title":"How to make a UIView that can cover the navigation bar?","tags":["iphone","ios","objective-c","iphone-sdk-3.0"],"question_text":"I want to show the\n`UIView`\nin full screen, but show the status bar, other things, like the navigation bar need to cover by the\n`UIView`\n.\nHow can I do that ?","answer_text":"I... |
{"title":"Dynamically arrange some elements around a circle","tags":["javascript","jquery"],"question_text":"I'm looking for a function to arrange some elements around a circle.\nresult should be something like :","answer_text":"Here's some code that should help you:\n`var numElements = 4,\n angle = 0\n step = (2*Math.... |
{"title":"Is default no-args constructor mandatory for Gson?","tags":["java","json","gson","default-constructor"],"question_text":"Gson user guide\nstates that we should define default no-args constructor for any class to work with Gson properly. Even more, in the\njavadoc\non Gson's\n`InstanceCreator`\nclass said that... |
{"title":"Looking for a copy set command (or alternative) in Redis","tags":["redis"],"question_text":"I'm a newcomer to Redis and I'm looking for some specific help around sets. To give some background: I'm building a web-app which consists of a large number of card decks which each have a set of individual cards with ... |
{"title":"Mocking database in node.js?","tags":["database","unit-testing","node.js","mongodb","mocking"],"question_text":"How would I mock out the database in my node.js application, which in this case uses\n`mongodb`\nas the backend for a blog REST API ?\nSure, I could set the database to a specific\n`testing`\n-datab... |
{"title":"Is there a way to check if there are symbolic links pointing to a directory?","tags":["linux","symlink"],"question_text":"I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I... |
{"title":"Two inline-block elements, each 50% wide, do not fit side by side in a single row","tags":["html","css"],"question_text":"`<!DOCTYPE html>\n<html>\n<head>\n<title>Width issue<\/title>\n<style type=\"text\/css\">\nbody {\n margin: 0;\n}\n#left {\n width: 50%;\n background: lightblue;\n display: inline-block;\n... |
{"title":"Declare function at end of file in Python","tags":["python","function","formatting"],"question_text":"Is it possible to call a function without first fully defining it? When attempting this I get the error: \"\nfunction_name\nis not defined\". I am coming from a C++ background so this issue stumps me.\nDeclar... |
{"title":"iPhone NSDateFormatter Timezone Conversion","tags":["iphone","nsdateformatter"],"question_text":"I am trying to create a formatter that will convert the date format shown to an NSDate object:\n`NSString *dateStr = @\"2010-06-21T19:00:00-05:00\";\nNSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];\n... |
{"title":"AFNetworking 2.0 track file upload progress","tags":["ios","afnetworking-2"],"question_text":"I am relatively new to AFNetworking 2.0. Using the code snippet below, I've been able to successfully upload a photo to my url. I would like to track the incremental upload progress, but I cannot find an example of d... |
{"title":"Find the location of my application's executable in WPF (C# or vb.net)?","tags":["c#","wpf","vb.net"],"question_text":"How can I find the location of my application's executable in WPF (C# or VB.Net)?\nI've used this code with windows forms:\n`Application.ExecutablePath.ToString();`\nBut with WPF I received t... |
{"title":"How to write to the Output window in Visual Studio?","tags":["c++","visual-c++"],"question_text":"Which function should I use to output text to the \"Output\" window in Visual Studio?\nI tried\n`printf()`\nbut it doesn't show up.","answer_text":"OutputDebugString\nfunction will do it.\nexample code\n`void CCl... |
{"title":"How to find method name from within that method in Java?","tags":["java","methods"],"question_text":"I was wondering if there is a way to know the method name being executed at run time?\nFor instance, inside a\n`private void doSomething (String s)`\nmethod, I'd like to know that I am executing the\n`doSometh... |
{"title":"Is there a way to ignore the 'Unreachable statement' error?","tags":["java"],"question_text":"Is it possible to somehow ignore this error? I find it much easier to just put\n`return`\nin front of the code I don't want to run than to comment it (when the comments overlap and behave badly)...","answer_text":"No... |
{"title":"Eclipse: change name of existing package with classes inside","tags":["java","eclipse"],"question_text":"In Eclipse, is it possible to change name of the package if it has name\n`(default package)`\nand has classes inside it?","answer_text":"In the version of Eclipse I'm using (Indigo service release 1), the ... |
{"title":"How to remove round corners in jQuery Mobile? ","tags":["jquery","css","jquery-mobile"],"question_text":"How to remove the round edges (border-radius) from the particular element or from div tag that is using jQuery Mobile?","answer_text":"Talking about buttons, you can apply following option to a button.\n`d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.