~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

However, I do get extra points if I can do it one line of code. Just to be clear I would have to replace two different words with two different new words that are in one long line of text.

Is using regex a requirement here? You can do this simply by chaining replace or replaceAll calls since the return the updated result string. Also, when you say single line, does it mean just one regex (and the supporting helper code) or literally a single line?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Try replacing the backslashes with forward slashes or double backslashes.

Also, you need to specify the appender names in the rootlogger. Something like:

log4j.rootLogger=DEBUG, default.out, default.file

Take a look at this post.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

It's branch prediction indeed; read this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Also something which others haven't mentioned; you can't earn rep in any sub-forum which falls under the "Community Center" category.

iConqueror commented: thankyou even though i know this wont up my rep :) cheers +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Just for the clarification of the readers; the output posted using the background decorator is not always guaranteed and depends on how your OS schedules the Python threads. So another possible output can be:

Frank counts 1
Doris counts 1
Frank counts 2
Doris counts 2
Doris counts 3
Frank counts 3
Doris counts 4
Frank counts 4
Doris counts 5
Frank counts 5

(in case you haven't noticed, Doris and Frank changed places after the 2nd count)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

C++ uses pointers and have memory leaks

Just because C++ uses pointers doesn't mean it has to leak memory. It's just that you have to be careful with allocations, sharing and ownership. Modern pointer types like unique_ptr and shared_ptr provide a limited form of garbage collection if used correctly.

In C++ the programmer needs to worry about freeing the allocated memory , where in Java the Garbage Collector (with all its algorithms , I can think of at least 3 algorithms) takes care of the the unneeded / unused variables .

Java still has the problem wherein you can create unncessary garbage which never gets collected. The classic example of this is the naive implmenetation of an array backed linked/array list.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The encoding is UTF-8. Also as already mentioned, use the codecs.open function call to open and read the hindi text file. Something like:

import codecs
with codecs.open('hindi.txt', encoding='utf-8') as f:
    txt = f.read()

>>> txt.count('सूची')
2
>>> parts = txt.split(' ')
>>> len(parts)
48
>>> print(parts)
['इस', 'पृष्ठ', 'पर', 'इन्टरनेट', 'पर', 'उपलब्ध', 'विभिन्न', 'हिन्दी', 'एवं', 'देवनागरी', 'सम्बंधित', 'साधनों', 'की', 'कड़ियों', 'की', 'सूची', 'है।', 'इसमें', 'ऑनलाइन', 'एवं', 'ऑफ़लाइन', 'उपकरण', 'शामिल', 'हैं।', 'इस', 'पृष्ठ', 'पर', 'इन्टरनेट', 'पर', 'उपलब्ध', 'विभिन्न', 'हिन्दी', 'एवं', 'देवनागरी', 'सम्बंधित', 'साधनों', 'की', 'कड़ियों', 'की', 'सूची', 'है।', 'इसमें', 'ऑनलाइन', 'एवं', 'ऑफ़लाइन', 'उपकरण', 'शामिल', 'हैं।\n']
>>> import sys; print(sys.stdout.encoding)
UTF-8

One thing to keep in mind is that the above output is from Ubuntu. Windows sucks in this department by forcing you to use the default encoding cp850 (at least on my Win8) which results in an error when you try to print out the Hindi text.

>>> print(txt)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python34\lib\encodings\cp850.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-1: character maps to <undefined>

The contents of hindi.txt are as follows:

इस पृष्ठ पर इन्टरनेट पर उपलब्ध विभिन्न हिन्दी एवं देवनागरी सम्बंधित साधनों की कड़ियों की सूची है। इसमें ऑनलाइन एवं ऑफ़लाइन उपकरण शामिल हैं। इस पृष्ठ पर इन्टरनेट पर उपलब्ध विभिन्न हिन्दी एवं देवनागरी सम्बंधित साधनों की कड़ियों की सूची है। इसमें ऑनलाइन एवं ऑफ़लाइन उपकरण शामिल हैं।

Also ensure that when you are saving the text …

Gribouillis commented: good help +14
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Sanjay, I did a couple of dry runs! It worked then!

Not sure I understand. You ran with dry run mode over all the threads in your db, printed out the tags against each thread and still went with the actual run? :) I'm talking about something like this:

def addTags(thread, dryRun=False):
    for thread in threads:
        tags = getTags(thread)
        if dryRun:
            print 'Would have persisted tags: %s for thread: %s' % (tags, thread)
        else:
            persistTags(thread, tags)
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

obviously there was a bug I didn't catch and now I'm trying to figure out a way to fix the situation.

Dry run mode; always!

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

While griswolf's advice is spot on, I would like to add few more details to help you out.

Broadly speaking, there are two types of "web services"; RESTful services and SOAP based ones. I would recommend skipping over SOAP services because they are enterprisey, complicated and "not so hot" these days. ;)

A lot of online services these days offer REST API which makes it a perfect choice if you want to play around. Depending on the platform you are on, I would recommend you to install the "requests" module for Python, which makes it dead easy to play with HTTP on the REPL (read-eval-print loop i.e. your Python interactive prompt).

Also give these slides a read (and the ones which appear in suggestions if you have some more time). The simplest example of a REST api in action using requests module is:

import requests
res = requests.get('https://github.com/timeline.json')
status, headers = res.status_code, res.headers
# print them out to view the headers and the HTTP response status code
# Also, inspect the object attributes to find out what more details you can get from the response object
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

This GFF library is most probably loading the entire file in memory which is a big "no-no" when dealing with large files. Assuming you are using this library, give that page a read and if the suggestions there don't work, join the GFF forums and ask them a way to stream the file on fly instead of loading it all in memory.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You will have to use a recursive algorithm to compute the size of a folder including all the files and sub-directories (and again all the files in that sub-directory). Use suggestions from this thread for that recursive function. Also, don't use string concatenation for path creation, use os.path.join for that.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I see the following in your profile right now so you should be good:

tapananand has contributed enough for us to gauge topics of interest. However, no one has endorsed any skills yet. Why don't you be the first?

Very strange that it was showing "hasn't contributed enough" a couple of days back...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Any other suggestions? My biggest quandry right now is how to determine who should win the bounty.

Just let the one paying the money decide who gets the bounty; I think that would be a fair enough implementation.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Also, consider cases where the OP is wishy-washy. Let's say the OP selects some answer which gets the bounty but later realizes that it's not the complete solution. Should the OP expect the follow-up solution from the bounty-winner. You might want to shown an alert box saying that once the answer is selected, OP can't go back otherwise I can imagine quite a bit of havoc that might cause.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Howdy folks, Winter 2014 anime is stale news now with Spring 2014 lineup just around the corner (time sure flies fast!). You can view the preview chart here and follow the discussion on MAL here.

Things look pretty grim this season. All my favorite anime series are coming to an end (Strike the Blood, Golden Time, Magi S2, Log Horizon, Silver Spoon S2, Tokyo Ravens. Oh my...) and there doesn't seem to be anything worthwhile to replace it! Anyways, the few anime which I'm looking forward to are:

  1. Fairy Tail 2014 - I always had a soft spot for Fairy Tail so won't be missing this
  2. Baby Steps -- Recommended by our resident anime expert decepti-kun so would be definitely giving it a shot :P
  3. Blade and Soul -- I have heard a lot of good things about this MMO so yeah, will give it a try
  4. Bokura wa Minna Kawaisou -- Comedy, Romance and School? I'm in
  5. Dragon Ball Kai -- Oh the nostalgia...
  6. Mahouka Koukou no Rettousei -- The manga has a good rating so will check this out

As for the rest, I'll watch them on a case by case basis and pick up a few more titles to follow.

So, what do you folks think? Is this line up good enough or is it time to pull out the old titles you have added to your "Plan to Watch" …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The simplest (in terms of effort) solution would be to use the CacheBuilder class provided by Guava (also known as Google collections)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hmm, I've never heard of moderators giving other moderators infractions!

Well, I can, but I swear that thought never crossed my mind. ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I'm really looking forward to continuing working with, debating with, and learning from all you guys.

Congratulations James and thanks for your kind words. I honestly feel that this Java forum/community owes a lot to your love for Daniweb, Java and desire to help folks! :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Your code won't work because Local is a inner class. You can't create instances of inner classes without an instance of parent/enclosing class. Make Local a nested class (by adding static) to make the error go away.

http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I have heard good things about Veerotech on webhosting forums. They also have a plan that starts at $7, not exactly cheap but much better reputation + they have servers in UK. You can get in touch with these guys to talk about speed, migration help and so on.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

When you say hosting, are you talking about shared hosting, a VPS or dedicated hosting? Also, how much are you paying right now per month/what kind of plans?

AFAIK, Dreamhost has been going downhill for the past few months/years(?)...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Just a quick note for those concerned about privacy issues after getting featured as "member of the month": you have every right to not disclose your age, the organization you work at etc. As long as the interview turns out to be interesting, everyone is happy.

Of course, if you feel that sharing what you like, dislike and your interests/hobbies is not your cup of tea, I can understand. But if you are just concerned about your identity getting disclosed, don't be; I'm pretty sure Davey can take care of that! :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I would recommend http://www.daniweb.com/members/377908/Gribouillis

He is a moderator but still not featured?!

Also the following good chaps in no particular order because of their good contributions, active participation and helpful nature:

  1. http://www.daniweb.com/members/432133/ddanbe
  2. http://www.daniweb.com/members/838005/Schol-R-LEA
  3. http://www.daniweb.com/members/137377/woooee
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You have 4 loops in your algorithm which means if we do a naive Big-O analysis the time complexity becomes O(n^3)/O(n^4) which doesn't scale well as the input size keeps growing.

Not sure why the algorithm has to be so complicated. How about something like:

  1. Accept user input and generate all permutations
  2. Create a set of dictionary entries
  3. Check if the given permutation is in the set and you are done...

The problem with your code is that it's doing a "linear" search for finding a word which is going to be painfully slow, especially given your algorithm. If you don't want to revise your algorithm (i.e. want to keep using the alphabet to word list mapping), go with a Set instead of a linked list and you should see visible speedup.

A few generic comments:

for(int r=0; r<Scrabbulous.scrab.combos.getSize(); r++){

This will basically recompute the size every iteration, not something you want. Instead use:

for(int r=0, len = Scrabbulous.scrab.combos.getSize(); r < len; r++){

Also, this piece of code:

for(int k=0; k<Scrabbulous.scrab.combos.Head.getWord().length(); k++){
    if(currDictionWordList.getNode(j).getWord().charAt(k) != Scrabbulous.scrab.combos.getNode(r).getWord().charAt(k)){
        isSame = false;
    }
}

is basically re-implementing equals method of the String class.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

In addition, you can run both 32/64 bit Java on 64 bit OS.

The most important property of 64-bit JVM's is that it allows you to have large heaps (4+ GB's) which is not possible with 32-bit JVMs. There are a lot of articles floating around which say that 64 bit apps are faster on 64 bit CPU/OS but at the same time you would find articles saying that running a 32bit JVM on a 64bit OS is much faster.

To conclude, I would rather look at my requirements, do some performance testing and then decide whether the move to 64 bit JVM is justified or not rather than asking strangers on the internet. ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

At leat it gives you an easy way to read content and, you might not be able to evaluate long code snippets, but you can still consume the majority of content and follow along

Assuming you have set aside a separate email account for Daniweb because given the rate at which new threads/replies are posted, you might end up missing other emails (given the limited screen estate for a mobile device). :)

That being said, the concept of a "mail digest" i.e. collating all the events which have occurred for the past 15 mins and sending them across in a single email would help reduce the mail noise and ensure that Daniweb mails don't end up consuming the entire inbox. Right now this looks like a personal email notification system set up by you to avoid missing Daniweb action rather than something built for end user. ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

There was story in IS2?? o.O

Hah, you gotta cut those guys some slack. ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You need to create a "Dynamic Web Project". This is assuming you have downloaded Eclipse for Java EE.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

IS2 is...abysmal.

IS2 was a disaster, I really didn't see that coming.

Given that this season is pretty much done, here are my thoughts:

  1. Magi S2 -- The gem of this season; comedy/action/drama/great story all in a single anime. This season surpasses S1 and I am really happy with the way the story is unfolding.
  2. Strike the Blood and Tokyo Ravens -- These two are pretty good mix of action/fantasy theme with a bit of romance sprinked in; just the way I like it the most (99% harem/ecchi and 1% story is a terrible idea; IS2 I'm looking at you)
  3. Yozakura Quartet -- This was a pretty good retelling and clarified a lot of things for me given that I have seen the original series + the OVAs
  4. Golden Time -- This anime is a pretty unique take on drama/comedy/romance theme.
  5. White Album 2, Noukome, Walkure Romanze, Yuushibu, Kyoukai no Kanata, Freezing Vibration, Unbreakable Machine Doll, Nagi No Asakura -- These anime are "fine" for casual viewing but nothing special here.
  6. Outbreak Company, Ace Of Diamond, Samurai Flamenco, Valvrave S2 -- These were the better anime of Fall 2013; not mind blowing but a good way to pass time.

Let's see how Winter 2014 turns out to be! :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Howdy-ho folks!

It's that time of the year again; Winter 2014 anime starts airing in a few days. The latest chart can be found at ATX Pieces site.

Fall 2013 looked really promising but turned out to be not so good. The good thing is that all the "better" fall anime (Kuroko/Magi/Golden Time) are 20+ eps long so I'm insured against looked-good-but-turned-out-to-be-dud 2014 anime. ;)

Here is a list of things I would be keeping my eye on:

  1. Silver Spoon S2 (slice of life/comedy done right; first priority on my list)
  2. Chuunibyou S2 (comedy/romance; must watch for those who liked S1)
  3. Nisekoi (Harem/comedy/romance; manga has pretty good rating so I will watch this one. Hope they don't screw up the adaptation)
  4. Pupa (horror; have heard a lot about this one, need to check for sure)
  5. D-Frag (comedy/school; the trailer was pretty good so will check this out)
  6. Hamatora (action/super-powers; the action in the promo looked pretty cool. I have high expectations of this action series)
  7. Norigami (action/fantasy; gives off a Ao No Exorcist feel)

Of course, as always, I'll try to sample everything just to ensure I'm not missing out on anything which looks boring but is actually pretty good (e.g. Silver Spoon, Natsume Youjinchou etc.). All in all, I see that we have a lot of harem/romance series making their way for 2014 winter list which is always "a good thing". ;)

As always, thoughts/discussion on the new season is more than welcome.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

@sciwizeh, i don't know if it is me, but i think "a" is trying to make a game like tetris?

Did you see the screenshot? It specifically says "mines"...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Any corrections and how to make decimal point show only 2 digits after?

I believe there are a few replies made to your previous thread which should provide you hints on how to do this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

No, you need to change your inputs, line 3-4...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

the proper answer the program is expecting is 514.03. What did i miss?

You missed gathering the correct co-ordinates. sqrt(2^2 + 2^2) is indeed sqrt(8) => 2.828427 ...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Use the printf method of the PrintStream class. For e.g. something like:

double yourNum = 5192.237545685454687;
System.out.printf("%.2f", yourNum); // 5192.24

Notice that it has automatically done the rounding for you (.24 instead of .23). If you need to control the rounding, use the DecimalFormat class.

DecimalFormat df = new DecimalFormat("#.##");
df.setRoundingMode(RoundingMode.DOWN);
System.out.println(df.format(yourNum)); // 5192.23
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

At the bottom of every forum/sub-forum page there is a button which says "Mark Forum Read" (right next to Start New Discussion). That should do the trick.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Currently, I am writing it to a .TXT file for ease and convenience. Ideally, I would like to output some of the information so that it is formatted with Italics. I'm thinking that using a RTF file would be simplest but i'm not entirely sure as I have never bothered with this problem.

There are other simpler/lightweight formats out there. For e.g. Markdown, which this site uses for posting is good format if you have modest formatting requirements (italics, underline, bold). Plus it has the advantage of being a format which can be read/viewed without any special viewer (as opposed to RTF files). And if for some reason the users need to view a visual report, there are loads of Markdown to HTML/PDF/XXX converters out there.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

No tab for News/Tutorials on the main page? Also, do you maintain a list of "popular" threads (based on view count, upvotes etc.). I think those threads with a lot of info which the community likes would be a good candidate for home page.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

How to decide what is non-live objects?

You don't need to decide, that's why you run jmap with histo:live so that non-live objects are not shown.

But why do all the rest of the socket instances for instances like this one is from my real live system is keeep growing

Because you still haven't made the .close call related changes. I would recommend close inputstream, outputstream and sockets in your actual code, redeploying and restarting your application and then collecting the numbers again.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

That's because non-live objects tend to stick around till a GC cycle. Running jmap with histo:live option forces a GC and hence you see around 8 instances. Now you just need to make the .close call related changes your existing code and try out the entire thing again.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

OK, let me be a bit more explicit. The 8 instances, were they on the server? If yes, did you do the jmap after running the 50 connection test i.e. were they after running the test or before?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I'm not sure I understand. Your above post shows that the jmap prints 8 lie SocketInputStream instances. Why do you say the results are the same?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

So basically now you don't have 50 open sockets on the server? Correct? Or do you still have a query/question?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I believe this is the serverside dump. How are you simulating the test code? Have you writtent a multithreaded client which does this? Are you doing proper cleanup in the client code?

Also, run the following command for jmap: jmap -histo:live pid to force a GC. Also, DON'T immediately run jmap. Start up the server, take jmap, start banging it with requests, wait for 5 mins, take jmap.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I actually followed this link http://stackoverflow.com/questions/3428127/what-is-the-difference-between-closing-input-outputstream-and-closing-socket-dir which says just close the writeBuffer will be enough.

Just to try out something else, close all 3: first the output stream, then the input stream and then the socket. This is in line with what the official tutorial says (scroll to the bottom).

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I can't do any meaningful analysis sitting here but I would recommend you approach this problem in a organized way. From your post, if seems that you have multiple issues: open sockets, timeout exceptions, Socket objects in memory and GC issues.

Tackle them one at a time. Refactor your code so that the reading records from database part is a separate method/class so that you can simplify the resource cleanup. Also from the code above, I don't see you closing readBuffer. It's also quite possible that the resource/memory leak is in some other part of the code.

Also, are you looking at the right data? You posted:

48536        5436032  java.net.SocksSocketImpl
48533        2329584  java.net.SocketInputStream
48535        1553120  java.net.Socket

whereas I see:

52 5824  java.net.SocksSocketImpl
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

There are many sockets running so I cant decide on when the exactly the socket is closed. Normally what is the time gap between for the teardown time?

Don't use jmap for finding open sockets in your system; use an OS specific utility like netstat or something else to find open sockets for a given process. Run the command when your app starts and run it the second time after you have send across a bunch of requests. Conntinue this process and if you see monotonically increasing open socket count, there is definitely a resource leak in your code.

Yes there are times this exception "java.net.SocketTimeoutException: Read timed out" but still it should be handled by the finally section right?

The question you need to ask is "why did the read time out"? Because the answer might have a strong correlation with the sockets hanging around. Also, I don't know whether things are actually getting closed. To be honest, your code is very convoluted and complicated. I think you would have better luck simplifying it. Also, are you using Java 7? If yes, considering using the try with resources block.

Another thing which is that after the full GC the Old Generation does not become 0?

A full GC cycle doesn't clean up Old generation; it just removes unused objects. If there are still objects in the old generation which are live, they would hang around irrespective of the type of GC …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yup that was a really bad mistake, good job spotting that! :)

Anyways, I have finally got the OAuth API functions working in a console script. There are a few problems with some API calls which I have tried to mention inline in comments. The code is in Python and assumes you have the "requests" module installed.

This code can be easily adapted to any language; just make sure that you fill in the appropriate slots which start with "put_in_your" in the below code extract.

Here is goes:

import requests, webbrowser

# send user to the app specific URL asking for code
url1 = 'http://www.daniweb.com/api/oauth?response_type=code&client_id=put_in_your_client_id&redirect_uri=oob'
webbrowser.open_new(url1)

# Use the code from the above response to send POST request
code = 'put_in_your_code_from_above'
client_secret = 'put_in_your_apps_client_secret'
url2 = 'http://www.daniweb.com/api/access_token'
post_data = { 'code': code, 'client_id': 'put_in_your_client_id, 'client_secret': client_secret, 'redirect_uri': 'oob', 'grant_type': 'authorization_code' }
res2 = requests.post(url2, data=post_data)

access_token = res2.json()['access_token']
url3 = 'http://www.daniweb.com/api/me?access_token=%s' % access_token
res3 = requests.get(url3)
res3.text

url4 = 'http://www.daniweb.com/api/me/inbox?access_token=%s' % access_token
res4 = requests.get(url4)
res4.text

# TODO: I can start watching but can't stop watching articles when POSTing
# TODO: Is there a reason why the response text of the below 4 API calls is always the LCD v/s CRT thread?!
url5 = 'http://www.daniweb.com/api/articles/watch'
aid = 468648
res5 = requests.post(url5, data={'id': aid, remove: 'false', 'access_token': access_token})
res5.text

# TODO: I can stop watching but can't start watching article when GETing
url6 = 'http://www.daniweb.com/api/articles/%s/watch?access_token=%s&remove=true' % (aid, access_token)
res6 …
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yes, that URL worked fine. OAuth for standalone app has two parts: getting the code by asking the user to allow access and then using that code to get the access token. The first part (i.e. the URL which you posted) works fine for me and gives me a text box with the code string.

Now what isn't working is the second step; the step wherein I use the code to retrieve the access_token.