Hot answers tagged

22

Some funny ones from Stack Overflow: a good IDE can then write a Java file that a common cause of segfaults is harder to monitor/troubleshoot Use Java's resource loader to load the image file between processes by passing around the code from the SVN repo. This setup also helps out API consumers, and is a code smell in the Sun/Oracle JRE Sounds like I hate ...


20

Mine: The fix is a programming language: CSS becomes a fully bloated format with stuff I wrote in a recent project because realplayer uses DoPlay() instead of Play(). Instead, I've experimented until I've come up what to fix. At least it's better than hammering F5. You should warn the user before he begins using the system. I'm very happy to confirm the ...


17

Oh, hilarious! Here are some of mine from AskUbuntu: there is just a relatively small amount of apps that may or may not include a cartoon. From my experience it shouldn't be aware that it is a pretty advanced tool. You always trust Amazon. (Yeah sure..) Ok, In the window that pops up, copy and paste the following: [Desktop Entry] Type=Application Name=...


16

This thing is so hilarious. I love it. Here are some generations from AskUbuntu: Open the Software Sources application. Go to the Additional Drivers tab. Choose the closed source driver for your hard-drive, the chance of possibility you need it for some reason, but it's not that easy to install instead of Windows (WARNING: THE LATTER WILL DELETE ALL YOUR ...


15

I realize this is rather old, but I thought someone might get a laugh out of some of these: Ask Ubuntu: A Happier Update The problem now seems to lie with the new kernel. You should (according to what I find) be considered closed, methinks. Was there any special reason you wanted to use this site? Hahaha. the meaning is the opposite. What is ...


15

This example uses C operators, but they are also used for WinNT/2000/XP/Vista/7 Additionally, new ImageIcon("image.png").getImage() can be used to load a C++ header file with functions that it is not. However, the value returned by Distance() will be truncated to an ImageIcon(byte[]) constructor, and compare the number to the minimum and maximum values for ...


14

Here are some of the best snippets I've seen so far. From Stack Overflow, You should be downloaded. Me.load. the given URL actually points to a coincidence. Dolby also specifies that the conversion may say your password is being over amp'd by 41.4%. The server/client then downloads the author. leave out advanced features like this until you find your ...


10

Explanation of the uppercase and lowercase letters (specifically [, \, ], ^, _, `). innerHTML is not a regex like this: \D(\d{4}\s\d{3}\s\d{3})\D \D will be automatically escaped for you. You use this method, the text will be 2 as well. If you use this is the case, try a regex for this: String yourString = "<210>; On to say that $result is false ...


10

Arqade has a lot of potential for this, here are some of mine: Dead is especially fun to use. The process requires a lot of Monuments after you buy EotN for the player who got the final hit, and only if it was gathered from rather than destroying it, so it needs to be done at time of activation. For example, I currently have a streetpass team that is strong ...


10

Some of my own "quotes" from Stack Overflow: I know, there is no way to explain the way Python treats variables and parameters. This will remove all characters on Earth. I modified the function and now it's just "Hello World!". So yes, it's neither a xls file nor a text editor is like opening a SMTP server through a HTTP proxy.


9

These are my favorites on Meta Stack Exchange: the bounty will be the best advice and you may find yourself in rough seas. Not? Then you have uploaded your image to delete incorrect answers Meta Stack Overflow is self-promotion, and it doesn't add any value to the answer. And on Code Golf: the byte array actually have NO idea how it works Then, you prompt ...


6

In .NET 2.0, and you'll benefit a file is changed, that's not possible to do this using JavaScript and a font that isn't fixed-width... it doesn't have special rules in terms of what expressions you can pass the result to setTimeout, you want to get only the minutes and constrain the generic type to those types that implement IComparable, then use a switch ...


5

I am trying to use the Search option to get the list of results from SO. I have tried using pagesize=50 and I still get large number of titles returned. Is there another option to limit that search? Sorry if I am posting this the wrong way or in the wrong area but I am new to Stack Overflow and to programming as well :) This is the part of the code I am ...


5

Total results vary with page size The idea of producing a transparent iterator (getting the next page as needed) is cool, but it just isn't working; the page size affects the total number of results returned (apparently to a multiple of the page size)...:-( My code needs to look at all Qs asked for a given tag in a given month: def qstats(site, tag, month,...


5

I think Py-StackExchange is your best bet. There's a wiki page on updating to v2 API.


4

status-completedI asked this as a question, but apparently the convention is to report bugs/feature requests in the announcement thread. It appears, that the MathJax extension mhchem is currently not enabled in the StackPrinter app. This is rather inconvenient for most of the chemistry.se questions and answers. It would therefore be nice if this feature ...


4

Here are some from my answers on SuperUser: Remedies Here are some actual reasons why an application developer felt that Dalvik was released (or maybe the race condition still exists, and you're just really!) In theory, you could write C/C++ or even assembly code if your page file is heavily utilized due to RAM pressure. The default behavior of Windows is ...


4

The \r\n issue was solved when I changed to a POST request. But, since I was retagging questions (didn't really need to change the body, just resend it), I ended up using the body_markdown, encoded with HTMLParser.HTMLParser().unescape() body_markdown = str(HTMLParser.HTMLParser().unescape(question_data['items'][0]['body_markdown'])) And then sending it ...


3

Great design and great idea. I don't know whether many people still look at this, but I discovered it today and if it was advertized and used more. Some suggestions for Stackathlons: Quantitive Finance and Economics. This one has suprisingly few, while the disciplines are quite closely related. I tried to add another one, but then it gives probably zero ...


3

These all come from my mechanics.stackexchange profile. There's a post here: whatconsumer.co.uk whose top post seems to be burning an over-rich fuel mixture. Hmm, I wonder what they're running their servers on. Use a sponge with some water in it to disconnect the battery, it doesn't harm on the engine or the transmission Well, I hope not! Great ...


3

Stack.PY George Edison has announced Stack.PY, with support for 2.1.


3

When I try running the code with python 3.4 I always get this error: AttributeError: 'HTTPMessage' object has no attribute 'getheader' Here is the full traceback. I'd be very happy if any of you could tell me what the problem is. Is it the fact that I'm using python3? I converted the example files using 2to3 and it seems to me that it should work fine... ...


3

Well, my bad - I forgot to set the Content-Type header. Fixed code snippet: def oauth_explicit_two(client_id, client_secret, code, redirect_uri): params = {'client_id': client_id, 'client_secret': client_secret, 'code': code, 'redirect_uri': redirect_uri} headers = {'Content-Type': 'application/x-www-form-urlencoded'} # <--- ...


3

Example of Explicit Authentication: Explicit authentication is relatively straightforward with Stack.PY. Assuming you have already registered your application, the instructions look something like this: Visit your application's page to obtain the following information: key client ID client secret Provide Stack.PY with the above information: from stackpy ...


2

import stackexchange so = stackexchange.Site(stackexchange.StackOverflow) comment = so.comment(valid_comment_id) the above code returns the following error in init.py: --->166 self.post_type = PostType.from_string(json.post_type) 167 168 def _get_post(self): AttributeError: DictObject instance has no attribute '...


2

I am running py-stackexchange v1.1-4 and I'm hitting a strange issue after not touching this library for perhaps eight months or so... My queries used to be relatively fast... I could get results in 30 seconds. Now my queries literally take hours with the same code... example query: def filtered_question_dict(sesite, mytags, pagesize=100, ...


2

Based on the demo *recent_questions.py* example, I am using the following code to retrieve the 10 most recent questions at the command line: so = stackexchange.Site(stackexchange.StackOverflow) questions = so.recent_questions(pagesize=10) for q in questions: print "question retrieved:", q.title.encode('ascii', 'ignore'), "\t", q.id ... As you can ...


2

Here is a small script (stackprinter) which uses Stack Printer from the command-line: #!/bin/sh type wkhtmltopdf || { echo >&2 "wkhtmltopdf command is required. Aborting."; exit 1; } : ${1?"Usage: $0 (url)"} URL=$1 && shift HOST=$(echo $URL | egrep -o "([.[:alnum:]]*?)\.(com|net|org)" | head -c-5) QID=$(echo $URL | grep -o "\d.*/" | head -c-2)...


2

The API was working but now I receive an error when I try to run the demo examples. Sample error dump: /usr/bin/python2.7 /home/donbeo/PycharmProjects/stack_overflow/experience.py StackOverflow user 41981's experience: Traceback (most recent call last): File "/home/donbeo/PycharmProjects/stack_overflow/experience.py", line 13, in <module> user = ...


2

The token does not appear because of the way urllib2 handles the redirect. I am not familiar with the details so I won't elaborate here. The solution is to catch the 302 before urllib2 handles the redirect. This can be done by sub-classing the urllib2.HTTPRedirectHandler to get the redirect with its hash and token. Here is a short example of subclassing the ...


Only top voted, non community-wiki answers of a minimum length are eligible