text stringlengths 74 309k |
|---|
{"title":"keyPressEvent.getCharCode() returning 0 for all special keys like enter, tab, escape, etc","tags":["gwt","onkeypress"],"question_text":"My code:\n`@Override\npublic void onKeyPress(KeyPressEvent event)\n{\n if (event.getCharCode() == KeyCodes.KEY_ENTER)\n {\n registerButton.click();\n }\n}`\nThis is attached ... |
{"title":"Return object from CursorAdapter.get()","tags":["android","android-cursoradapter"],"question_text":"I'm overriding CursorAdapter and I need to get the last item, problem is that CursorAdapter has actually a get() method...but source is a db and it returns a plain object!! (I don't even know what is it, I'd ex... |
{"title":"Convert string to binary in python","tags":["python","string","binary"],"question_text":"I am in need of a way to get the binary representation of a string in python. e.g.\n`st = \"hello world\"\ntoBinary(st)`\nIs there a module of some neat way of doing this?","answer_text":"Something like this?\n`>>> st = \... |
{"title":"How to handle HTTP authentication using HttpURLConnection?","tags":["java","authentication","httpurlconnection"],"question_text":"I'm writing a Java client that POSTs to a HTTP server that requires\nauthentication\n.\nI have to support at least the following three authentication methods: Basic, Digest or Nego... |
{"title":"Adding author name in Eclipse automatically to existing files","tags":["java","eclipse","header","javadoc"],"question_text":"Is there a real easy to use tool (no monster tool) that I can plug into Eclipse, and press a \"generate header\" button and then the authors name appears in every file in that project?"... |
{"title":"Is Jackson really unable to deserialize json into a generic type?","tags":["java","generics","jackson","deserialization"],"question_text":"This is a duplicate question because the following questions are either messy or they are not answered at all:\ndeserializing-a-generic-type-with-jackson\njackson-deserial... |
{"title":"How to pass 2D array (matrix) in a function in C?","tags":["c","multidimensional-array","parameter-passing"],"question_text":"I need to do this to persist operations on the matrix as well. Does that mean that it needs to be passed by reference?\nWill this suffice?\n`void operate_on_matrix(char matrix[][20]);`... |
{"title":"MissingSchemaError: Schema hasn't been registered for model","tags":["javascript","node.js","mongodb","express","mongoose"],"question_text":"I have a typical Project with Node.js - Express 3 - MongoDB\nI'm trying to make a query to my model 'Tweet' in my \/routes\/index.js and when I run my app crashed\n`24 A... |
{"title":"How to group a 3x3 grid of radio buttons?","tags":["xml","android"],"question_text":"As the title describes, I'm trying to group up a grid of 3x3 radio buttons into a single radio group. In a previous question asked I learned that for radio buttons to correspond to a single group they had to be the immediate ... |
{"title":"Convert relative path to absolute using JavaScript","tags":["javascript","html","path"],"question_text":"There's a function, which gives me urls like:\n`.\/some.css\n.\/extra\/some.css\n..\/..\/lib\/slider\/slider.css`\nIt's always a relative path.\nLet's think we know current path of the page, like\n`http:\/... |
{"title":"jQuery dollar sign ($) as function argument?","tags":["jquery","closures","dollar-sign"],"question_text":"I understand JavaScript closures, and I've seen this done in native JS:\n`(function () {\n \/\/ all JS code here\n})();`\nBut, what does adding the jQuery spice do?\n`(function ($) {\n \/\/ all JS code he... |
{"title":"Get product flavor or build variant in an android app","tags":["android","gradle"],"question_text":"I have an android app with a number of different product flavors configured in my build.gradle file eg\n`productFlavors {\n someFlavor {}\n anotherFlavor {}\n}`\nIn my application code, I want to be able to get... |
{"title":"How to make app fully working correctly for autorotation in iOS 6?","tags":["ios","uiviewcontroller","ios6","autorotate"],"question_text":"In iOS6,\n`shouldAutorotateToInterfaceOrientation`\nis deprecated. I tried to use\n`supportedInterfaceOrientations`\nand\n`shouldAutorotate`\nto make app working correctly... |
{"title":"avoiding \"expression result unused\" warning in a block","tags":["warnings","clang","objective-c-blocks"],"question_text":"The following code is returning an expression unused warning on the assignment operation in the block. The code isn't very practical, but there is a lot more code in the excluded section... |
{"title":"Model Binding to a List MVC 4","tags":["c#","asp.net-mvc-4"],"question_text":"Is there a pattern to bind an IList of items to the view. I seem to be having issues with the HttpPost. I know Phil Haack wrote a nice article but it is dated and he said they might have a fix with MVC 4.","answer_text":"This is how... |
{"title":"iOS - import vs forward declaration regarding setAlpha","tags":["ios","xcode","class","import","forward-declaration"],"question_text":"I'm trying to do some animations on an object that I have setup via IB. I'm adding a forward declaration to my .h like so:\n`@class MySpecialClass;`\nand then setup a property... |
{"title":"Why isn't a qualified static final variable allowed in a static initialization block?","tags":["java","static","final","static-initialization","qualified-name"],"question_text":"Case 1\n`class Program {\n static final int var;\n static {\n Program.var = 8; \/\/ Compilation error\n }\n public static void main(... |
{"title":"TortoiseSVN - Ignoring files within a folder already in the repository","tags":["svn","tortoisesvn","ignorelist"],"question_text":"How do I ignore all files within a folder under source control?\n`\/project\/published\/`\nis a folder I want to keep\n`\/project\/published\/some_file(s)`\nare files\/folders I d... |
{"title":"What is the jdbc driver \"org.gjt.mm.mysql.Driver\" for?","tags":["mysql","jdbc","drivers"],"question_text":"After taking over a coworker's project I noticed he was using \"org.gjt.mm.mysql.Driver\" as the jdbc driver for MySQL 5 instead of the more common one \"com.mysql.jdbc.Driver\". They both are containe... |
{"title":"jQuery if found in string","tags":["jquery","if-statement"],"question_text":"How can I have jQuery check to see if the content of a variable contains a specific word and have it execute an alert if matched?","answer_text":"`if( str.indexOf( \"your word\" ) !== -1 )`\nor\n`if( str.search( \/your regex\/ig ) )`... |
{"title":"Overriding a default option(...) value in CMake from a parent CMakeLists.txt","tags":["c++","build","build-process","cmake"],"question_text":"I am trying to include several third-party libraries in my source tree with minimal changes to their build system for ease of upgrading. They all use CMake, as do I, so... |
{"title":"JNI folder in Android Studio","tags":["android","android-studio"],"question_text":"I am trying make helloy-jni app in Android Studio and I have exception\n`06-27 13:17:19.099 12714-12714\/com.example.testjni2 E\/AndroidRuntime: FATAL EXCEPTION: main\n java.lang.ExceptionInInitializerError\n at java.lang.Class... |
{"title":"Jboss AS7 Deployment warning : does not point to a valid jar for a Class-Path reference","tags":["jboss7.x"],"question_text":"Im getting the below warning when deploy the .war in the jboss AS7. Any idea?\n(MSC service thread 1-4) Class Path entry commons-beanutils.jar in \"\/content\/test-1.0.0.war\/WEB-INF\/... |
{"title":"How to draw line of ten thousands of points with WPF within 0.5 second?","tags":["c#","wpf","performance","templates","itemscontrol"],"question_text":"I am writing\nWPF\ncode to show a real-time plot which is a connected line containing about\n10,000 points. It takes about 5 seconds to show a picture in my co... |
{"title":"Convert 2:1 equirectangular panorama to cube map","tags":["javascript","math","three.js"],"question_text":"I'm currently working on a simple 3D panorama viewer for a website. For mobile performance reasons I'm using the\n`three.js`\nCSS3 renderer\n. This requires a cube map, split up into 6 single images.\nI'... |
{"title":"How to initialize properties that depend on each other","tags":["xcode","swift","frame","cgrectmake"],"question_text":"I want a picture to move to the bottom. If I press a button the pic should move down by 1.\nI added the picture and a button:\n`var corX = 0\nvar corY = 0\nvar runter: UIButton = UIButton.but... |
{"title":"How to strip the basedir from an absolute path to get a relative path?","tags":["ant","relative-path"],"question_text":"In the build.xml of my project I have a property defined:\n`<property name=\"somedir.dir\" location=\"my_project\/some_dir\"\/>`\nThe value of\n`${somedir.dir}`\nwill be an absolute path:\n`... |
{"title":"How to prevent \"This program might not have installed correctly\" messages on Vista","tags":["installer","windows-installer","uac","appcompat"],"question_text":"I have a product setup executable that copies some files to the user's hard drive. It's not a typical installer in the normal sense (it doesn't add ... |
{"title":"Printing variable from within Makefile","tags":["makefile"],"question_text":"I have the following code in my makefile:\n`S_RES=$(shell cat output)\necho -e \"Serial result = \\t\" $(S_RES)`\nBasically, I want to store the output of the shell command\n`cat output`\nin the S_RES variable, and then echo that var... |
{"title":"JavaScript to Active Twitter Bootstrap Tooltips","tags":["javascript","jquery","twitter-bootstrap"],"question_text":"I'm playing around with Twitter Bootstrap's\nTooltips\n, but am having problems since they moved away from Twipsy. The correect JavaScript is included in the page.\nLet's say I have the followi... |
{"title":"What is the equivalent of protected in TypeScript?","tags":["typescript"],"question_text":"What is the equivalent of\nprotected\nin\nTypeScript\n?\nI need to add some member variables in the\nbase class\nto be used only in\nderived classes\n.","answer_text":"Updates\nNovember 12th, 2014. Version 1.3 of TypeSc... |
{"title":"Xcode gives Apple Mach-O linker error","tags":["ios","objective-c","linker-error","mach-o","undefined-symbol"],"question_text":"I just compiled a project and Xcode returns these two errors which don't seem to be my code's fault. How do I fix them?\n`Undefined symbols for architecture i386:\n \"_vImageBoxConvo... |
{"title":"iPhone etc: how to tell if the device has a camera?","tags":["iphone"],"question_text":"Version 3.1.3 if its relevant.\nThere is this suggestion which may work now, but in the future?\n`NSString *device = [UIDevice currentDevice].model;\nif([device isEqualToString:@\"iPhone\"])`","answer_text":"`#define SOURC... |
{"title":"Can MySQL replace multiple characters?","tags":["sql","mysql","replace"],"question_text":"I'm trying to replace a bunch of characters in a MySQL field. I know the REPLACE function but that only replaces one string at a time. I can't see any appropriate functions\nin the manual\n.\nCan I replace or delete mult... |
{"title":"Why doesn't the C++ default destructor destroy my objects?","tags":["c++","default","destructor"],"question_text":"The C++ specification says the default destructor deletes all non-static members. Nevertheless, I can't manage to achieve that.\nI have this:\n`class N {\npublic:\n ~N() {\n std::cout << \"Destro... |
{"title":"Heroku run console get \"Timeout awaiting process\"","tags":["console","heroku"],"question_text":"No way to have console wired with Heroku lately:\n`lsoave@ubuntu:~\/rails\/github\/gitwatcher$ heroku run console\nRunning console attached to terminal... \nTimeout awaiting process\nlsoave@ubuntu:~\/rails\/githu... |
{"title":"Does a c\/c++ compiler optimize constant divisions by power-of-two value into shifts?","tags":["c++","c","optimization","gcc"],"question_text":"Question says it all. Does anyone know if the following...\n`size_t div(size_t value) {\n const size_t x = 64;\n return value \/ x;\n}`\n...is optimized into?\n`size_... |
{"title":"Concrete Code Example of MVP","tags":["java","design-patterns","mvp"],"question_text":"Can someone provide a concrete (actual Java code) example of MVP in action? This would include the following 3 types of classes and how they call each other's methods to achieve the pattern and process\/respond to a client-... |
{"title":"Unrecognized configuration section log4net","tags":["c#","asp.net","log4net"],"question_text":"I have this code in web.config:\n`<log4net>\n <root>\n <level value=\"ALL\" \/>\n <appender-ref ref=\"LogFileAppender\" \/>\n <\/root>\n <appender name=\"LogFileAppender\" type=\"log4net.Appender.RollingFileAppender... |
{"title":"Set bufferedimage to be a color in Java","tags":["java","image","graphics","bufferedimage","graphics2d"],"question_text":"I need to create a rectangular BufferedImage with specified color as a background, draw some pattern on the background and save it to file. My problem comes from how to create the backgrou... |
{"title":"Add ScriptManager to Page Programmatically?","tags":["c#","sharepoint-2007","web-parts","scriptmanager"],"question_text":"I am developing a WebPart (it will be used in a SharePoint environment, although it does not use the Object Model) that I want to expose AJAX functionality in. Because of the nature of the... |
{"title":"NSData and Uploading Images via POST in iOS","tags":["iphone","ios","post","nsdata","nsurlrequest"],"question_text":"I have been combing through the many many posts about uploading images via POST in iOS. Despite the wealth of information on this topic, I cannot manage to correctly upload JPEG data taken from... |
{"title":"How to programmatically detect debug mode in nodejs?","tags":["debugging","node.js"],"question_text":"I've seen this question asked of other platform\/languages - any ideas? I'd like to do something like:\n`if (detectDebug())\n{\n require('tty').setRawMode(true); \n var stdin = process.openStdin();\n stdin.on... |
{"title":"Populate List<string> with the same value with LINQ","tags":["c#","linq","list"],"question_text":"I want to populate a\n`List<string>`\nwith the same string value for a specified number of times.\nIn straight C# it is:\n`List<string> myList = new List<string>();\nfor (int i = 0; i < 50; ++i)\n{\n myList.Add(\... |
{"title":"PDO error message?","tags":["php","pdo"],"question_text":"Here is a snippet of my code:\n`$qry = '\n INSERT INTO non-existant-table (id, score) \n SELECT id, 40 \n FROM another-non-existant-table\n WHERE description LIKE \"%:search_string%\"\n AND available = \"yes\"\n ON DUPLICATE KEY UPDATE score = score + ... |
{"title":"Programmatically change product attribute at store view level","tags":["magento"],"question_text":"I'm sorry if this question is trivial but I've been struggling to find what I am doing wrong here. I am trying to change the value of an attribute on a store view level but the default is also changed whereas it... |
{"title":"Is it considered bad practice to use InternalsVisibleTo for Unit Test Code?","tags":["c#",".net"],"question_text":"Sample code in framework's\n`AssemblyInfo.cs`\n:\n`[assembly: System.Runtime.CompilerServices.InternalsVisibleTo\n (\"Test.Company.Department.Core\")]`\nIs this a bad practice?","answer_text":"No... |
{"title":"How do I play an mp3 in the res\/raw folder of my android app?","tags":["android","media-player"],"question_text":"I have a small (200kb) mp3 in the res\/raw folder of my android app. I am trying to run it in an emulator from Eclipse. It is recognized as a resource in the R file but when I try to prepare\/sta... |
{"title":"Saving ArrayLists in SQLite databases","tags":["android","database","sqlite"],"question_text":"So I want to save an ordered set of double values, and I want to be able to insert, retrieve or delete any value from this easily. As of such, I'm using a an ArrayList, where I define a class called Doubles to store... |
{"title":"extract text from pdf in Javascript","tags":["javascript","pdf","text"],"question_text":"I wonder if is possible to get the text inside of a PDF file by using only Javascript?\nIf yes, can anyone show me how?\nI know there are some server-side java, c#, etc libraries but I would prefer not using a server. \nt... |
{"title":"How can PublishSubject and BehaviorSubject be unsubscribed from?","tags":["java","rx-java","subject-observer"],"question_text":"Under the\n`subjects`\npackage you have classes like\n`PublishSubject`\nand\n`BehaviorSubject`\nwhich I suppose can be described as some usable sample\n`Observables`\n.\nHow can thes... |
{"title":"\"Register\" an .exe so you can run it from any command line in Windows","tags":["windows"],"question_text":"How can you make a .exe file accessible from any location in the Windows command window? Is there some registry entry that has to be entered?","answer_text":"You need to make sure that the exe is in a ... |
{"title":"How Do You Secure database.yml?","tags":["ruby-on-rails","security","deployment"],"question_text":"Within Ruby on Rails applications database.yml is a plain text file that stores database credentials.\nWhen I deploy my Rails applications I have an after deploy callback in my Capistrano \nrecipe that creates a... |
{"title":"Programmatically generate video or animated GIF in Python?","tags":["python","video","wxpython","animated-gif"],"question_text":"I have a series of images that I want to create a video from. Ideally I could specify a frame duration for each frame but a fixed frame rate would be fine too. I'm doing this in wxP... |
{"title":"How to get size and location of a control placed on a dialog in MFC?","tags":["c++","mfc"],"question_text":"I've got the pointer to the control with function\n`CWnd* CWnd::GetDlgItem(int ITEM_ID)`\nso i've got\n`CWnd*`\npointer which points to the control, \nbut simply can't find any method within\n`CWnd`\ncl... |
{"title":"Django admin - change ForeignKey display text","tags":["django","django-admin"],"question_text":"How can I change the display text in select while selecting a field which is as ForeignKey?\nI need to display not only the name of FK, but also name of it's parent.\nAnybody can give a clue?","answer_text":"Well ... |
{"title":"Facebook iframe tab signed request always empty","tags":["facebook","facebook-authentication","facebook-canvas"],"question_text":"I'm working on a Facebook app tab and would like to use the signed request bundle as documented here:\nhttp:\/\/developers.facebook.com\/blog\/post\/462\/\nI'm trying to use\ntheir... |
{"title":"Scaling SVG (Raphael.js) like an SWF","tags":["javascript","flash","svg","raphael","vml"],"question_text":"I started using Raphael.js a few days ago and I'm really enjoying it. The only thing I haven't been able to figure out is how to get the \"paper\" or svg\/vml tag to fill the browser window like an swf.\... |
{"title":"Can apple push notifications send more parameters than alert and sound?","tags":["ios","push-notification"],"question_text":"I have several pieces of metadata that I need to associate with a push notification.\nFor example user no, message id.\nCan I send more parameters than what apple supports:\n`{aps = {\n... |
{"title":"PHP: add seconds to a date","tags":["php","date","add","duration","seconds"],"question_text":"I have\n`$adate;`\nwhich contains:\n`Tue Jan 4 07:59:59 2011`\nI want to add to this date the following:\n`$duration=674165; \/\/ in seconds`\nOnce the seconds are added I need the result back into date format.\nI do... |
{"title":"Matplotlib: linewidth is added to the length of a line","tags":["python","matplotlib"],"question_text":"When I draw a line segment in matplotlib the linewidth seems to be added to the length of the line. Below my code (not the most pythonic code, but it should do the trick). Am I doing something wrong or is t... |
{"title":"why is xrange able to go back to beginning in Python?","tags":["python","iterator","xrange"],"question_text":"I've encountered this code from\nMost pythonic way of counting matching elements in something iterable\n`r = xrange(1, 10)\nprint sum(1 for v in r if v % 2 == 0) # 4\nprint sum(1 for v in r if v % 3 =... |
{"title":"Creating animation on ImageView while changing image resource","tags":["android"],"question_text":"I have only one\n`ImageView`\nin my layout and I am changing its resource when a gasture event detected. I just want to show an animation while changing resource of ImageView. Can I use\n`ViewFlipper`\nwith\n`on... |
{"title":"Am I implementing IDisposable correctly?","tags":["c#","idisposable"],"question_text":"This class uses a\n`StreamWriter`\nand therefore implements\n`IDisposable`\n.\n`public class Foo : IDisposable\n{\n private StreamWriter _Writer;\n public Foo (String path)\n {\n \/\/ here happens something along the lines ... |
{"title":"How to get the references of all already opened child windows","tags":["javascript","window.open"],"question_text":"I want to get the references of all already opened child windows. is there any way? I am not using\n`child = window.open(....)`\njust using\n`window.open(....)`\nand opening multiple child windo... |
{"title":"Why is my Spring 3 Validator Validating Everything on the Model?","tags":["spring","validation","spring-mvc"],"question_text":"I have a spring 3 controller with a validator for one of the methods. It insists on validating every object on the model. Would anyone be able to explain to me why it does this or if ... |
{"title":"PHP Session data not being saved","tags":["php","session"],"question_text":"I have one of those \"I swear I didn't touch the server\" situations. I honestly didn't touch any of the php scripts. The problem I am having is that php data is not being saved across different pages or page refreshes. I know a new s... |
{"title":"Does string interpolation evaluate duplicated usage?","tags":["c#","c#-6.0"],"question_text":"If I have a format string that utilizes the same place holder multiple times, like:\n`emailBody = $\"Good morning {person.GetFullName()}, blah blah blah, {person.GetFullName()} would you like to play a game?\";`\ndoe... |
{"title":"Why does this regular expression kill the Java regex engine?","tags":["java","regex"],"question_text":"I have this naive regex \"<([\\s]|[^<])+?>\" (excluding the quotation marks). It seems so\nstraightforward but it is indeed evil when it works against the below HTML text. It sends the Java regular expressio... |
{"title":"Where are Magento's log files located?","tags":["php","magento","error-log"],"question_text":"I am new to Magento. I can't find log files in Magento. I googled it, but the\nMagento Commerce\nsite returns closed and some other sites explain how to create custom log files. I want to know the location of built-i... |
{"title":"Why is chart.js canvas not respecting the padding of the container element?","tags":["javascript","html","css","canvas","chart.js"],"question_text":"I am using Chart.js with a simple line chart but the width and height properties calculated by Chart.js seem to be based on the total width and height of the par... |
{"title":"how does one set a program's command line arguments, for ghci?","tags":["haskell","ghci"],"question_text":"Suppose some Haskell file is executed with\n`runghc Queens.hs gecode_compile`\nNow, this fails, and I want to debug it with\n`ghci`\n. How do I pass the option\n`gecode_compile`\ninto the program, so\n`g... |
{"title":"How to style WPF tooltip like a speech bubble?","tags":["wpf","xaml","styles","tooltip"],"question_text":"I want to shape my WPF tooltip like the image below:\nHow do I achieve this?","answer_text":"Use this Code:\n`<Window x:Class=\"WpfApplication2.MainWindow\"\n xmlns=\"http:\/\/schemas.microsoft.com\/winfx... |
{"title":"Handling ExecuteScalar() when no results are returned","tags":["c#","oracle","ado.net"],"question_text":"I am using the following SQL query and the ExecuteScalar() method to fetch data from an Oracle database:\n`sql = \"select username from usermst where userid=2\"\nstring getusername = command.ExecuteScalar(... |
{"title":"Ruby\/Rails - Properly Display\/Format Text From The Text Area Form Control","tags":["ruby-on-rails","forms","textarea","form-helpers"],"question_text":"I have a interesting problem. I have a :text field in my model with displays a large chunk of data, usually about three paragraphs.\nWhen I enter the text in... |
{"title":"How do I find the orthogonal projection of a point onto a plane","tags":["math","3d"],"question_text":"Lets say I have point (x,y,z) and plane with point (a,b,c) and normal (d,e,f). I want to find the point that is the result of the orthogonal projection of the first point onto the plane. I am using this in 3... |
{"title":"Thoughts on using express.js instead of Ruby on Sinatra?","tags":["javascript","ruby","node.js","sinatra","express"],"question_text":"I'm working on a social app and considering using express.js\/nodejs instead of my original choice, Sinatra\/Ruby.\nI'm mostly worried about the # of open source projects avail... |
{"title":"Best practice for reusing python code","tags":["python","dry","pythonpath"],"question_text":"I have write a python library app(which contains several *.py files). And several of my python projects need to reuse the code in the library app. What's the recommended best practice for reusing python code? Currentl... |
{"title":"StaticExtension value cannot be resolved","tags":["wpf","xaml","data-binding","static","xamlparseexception"],"question_text":"I'm facing some issues with a WPF binding to a static property. In my application there is a class called\nGlobals\nwhich contains a\nstatic\nproperty to\nThisAddIn\n. This object allo... |
{"title":"downto vs. to in VHDL","tags":["vhdl"],"question_text":"I'm not sure I understand the difference between 'downto' vs. 'to' in vhdl.\nI've seen some online explanations, but I still don't think I understand. Can anyone lay it out for me?","answer_text":"If you take a processor, for Little endian systems we can... |
{"title":"How to escape literal percent sign when NO_BACKSLASH_ESCAPES option is enabled?","tags":["mysql","escaping","special-characters"],"question_text":"My company runs MySQL in NO_BACKSLASH_ESCAPES mode. How can I escape a literal\n`%`\nor\n`_`\nin a LIKE query in this mode? The standard way is\n`\\%`\n, but that ... |
{"title":"What's the difference between backtracking and depth first search?","tags":["algorithm"],"question_text":"What's the difference between backtracking and depth first search?","answer_text":"Backtracking\nis a more general purpose algorithm.\nDepth-First search\nis a specific form of backtracking related to sea... |
{"title":"Django - remove duplicate objects where there is more than one field to compare","tags":["django","django-models"],"question_text":"I have a model that has four fields. How do I remove duplicate objects from my database?\nDaniel Roseman's answer to\nthis question\nseems appropriate, but I'm not sure how to ex... |
{"title":"How properly inject HttpContext in MVC6","tags":["c#","asp.net-core","asp.net-core-mvc"],"question_text":"My data service layer in my API required information that are of the request in the httpcontext, I read this\nquestion\nand they said that I should used the ActionContext instead of HttpContext.Current (d... |
{"title":"Integrating notebooks to Mathematica's documentation center","tags":["wolfram-mathematica","mathematica-8"],"question_text":"If you have been using\nMathematica\nfor a while you probably have grown attached to the documentation center. There is always something new that you find in those pages. Let it be opti... |
{"title":"\"RuntimeException: native typeface cannot be made\" when loading font","tags":["java","android","runtimeexception","android-fonts"],"question_text":"I am attempting to use a custom font for a TextView on Android, following the guide\nhere\nand\nhere\n. Using the same font, same code, same everything, I get t... |
{"title":"How to reuse existing C# class definitions in TypeScript projects","tags":["javascript","typescript"],"question_text":"I am just going to start use\n`TypeScript`\nin my HTML client project which belongs to a MVC project with a entity framework domain model already there. I want my two projects (client side an... |
{"title":"How to JSON decode array elements in JavaScript?","tags":["javascript","json"],"question_text":"I have a JavaScript array that, among others, contains a URL. If I try to simply put the URL in the page (the array is in a project involving the Yahoo! Maps API) it shows the URL as it should be.\nBut if I try to ... |
{"title":"Signals and interrupts a comparison","tags":["linux","signals","posix","interrupt","isr"],"question_text":"Based on various references, my subjective definition of\nsignals in Linux is \"The triggers that are used to notify the processes about an occurrence of a specific event.Event here may refer to a softwa... |
{"title":"How to reverse lines of a text file?","tags":["shell","command-line","filter","reverse"],"question_text":"I'm writing a small shell script that needs to reverse the lines of a text file. Is there a standard filter command to do this sort of thing?\nMy specific application is that I'm getting a list of Git com... |
{"title":"resizing a ImageIcon in a JButton","tags":["java","swing","jbutton"],"question_text":"I am creating a JButton which includes a specific ImageIcon. The main issue is that the original icon size is much bigger than the button size. As result when the button is displayed, only part of the icon can be seen. What ... |
{"title":"Multiple overloaded methods: Does null equal NullPointerException?","tags":["java","reference","nullpointerexception",null,"method-overloading"],"question_text":"`public class TestMain {\n public static void methodTest(Exception e) {\n System.out.println(\"Exception method called\");\n }\n public static void ... |
{"title":"NSTimeZone: what is the difference between localTimeZone and systemTimeZone?","tags":["objective-c","iphone","cocoa"],"question_text":"Under NSTimeZone class, there is both +localTimeZone and +systemTimeZone. I did a test on iphone simulator, both return NSTimeZone object indicating the same timezone. What is... |
{"title":"Passing multiple parameters in an MVC Ajax.ActionLink","tags":["asp.net-mvc","parameters"],"question_text":"I am using an Ajax.ActionLink to call an Action in a Controller, nothing special there. I want to pass two parameters to the Action. Is this possible using an Ajax.ActionLink? I thought that it would ju... |
{"title":"How can I convert BitArray to single int?","tags":["c#","asp.net"],"question_text":"How can I convert BitArray to single int? The fastest way pls...","answer_text":"`private int getIntFromBitArray(BitArray bitArray)\n{\n if (bitArray.Length > 32)\n throw new ArgumentException(\"Argument length shall be at mos... |
{"title":"How do you use get_context_data with TemplateView in Django","tags":["django","django-templates","django-views","django-class-based-views"],"question_text":"I'm trying to do something like this:\n`class AboutView(TemplateView):\n template_name = 'about.html'\n def get_context_data(self, **kwargs):\n context =... |
{"title":"node.js cannot find module 'mongodb'","tags":["node.js","mongodb"],"question_text":"I am going through my first node.js project. I've installed mongodb, have a server.js file, and when I try to run it I get this error\n`module.js:340\n throw err;\n ^\nError: Cannot find module 'mongodb'\n at Function.Module._... |
{"title":"What's the best way to loop through a set of elements in JavaScript?","tags":["javascript","arrays","loops","elements"],"question_text":"In the past and with most my current projects I tend to use a for loop like this:\n`var elements = document.getElementsByTagName('div');\nfor (var i=0; i<elements.length; i+... |
{"title":"Formatting numbers with thousands separator Smarty PHP","tags":["smarty"],"question_text":"Im trying to format numbers with thousands separator Smarty.\nSo for example 1000 becomes 1,000.\nThanks.","answer_text":"or you can use php function inside smarty, this is for number_format, you can use other php funct... |
{"title":"Can't open excel file generated with excelLibrary","tags":["c#","excel","excellibrary"],"question_text":"I'm using\nexcelLibrary\nto programatically create excel files but I get a file format error when I try to open the generated files in Microsoft Office Excel.\nI've seen\nthis has been reported\nbut there'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.