Codetracer - Have Your Code Peer Reviewed
Codetracer - Have Your Code Peer Reviewed
Written by Nikos Vaggalis   
Monday, 15 May 2017

Codetracer is a new free service for coders who seek wisdom through brainstorming when stuck in writing their code.

 

codetracerbanner

Here's how it works - you post the snippet of code that puzzles you on the forum, annotate with inline comments the specific lines that give you the trouble, provide a general description of the problem and wait for help from the hosts or any peers, i.e. any interested member subscribed to the service.

Let's see an example. The member a.osman had the following issue:

"What i want to do is to create static method in a class that convert any json type to any HashMap. More details on lines comments."

The code in question was :

with the inline comments shifting the focus to the troublesome line 17:

HashMap<String, String> map = new HashMap<keyClass, valueClass>();

which has been annotated with "keyClass and valueClass : gives error(Unknown Class Type)"

Any number of peers can join the brainstorming and post observations:

a.adel

can you give an example of how you call the method, as an implementation i see that its fine ...

a.osman

I get error at HashMap<String, String> map = new HashMap<keyClass, valueClass>(); The error is that KeyClass and value class are unidentified classes.

check the comment on line 17.

ahmed_hassan

What if the type of the value is not string I suggest that you replace String in the HashMap value with Object and replace this jObject.getString(key); with this jObject.get(key);

a.osman

It isn't about the type of String ... if I managed to acquire the type as a parameter then I will be able to change this String to anything

ahmed_hassan

But what if the json object have different types of values like: { "name":"ahmed", "age":55 } you are sending one type in the parameters Secondly the key is always String, isn't it?

a.osman

I want to get the model class type like User, Calendar, Categories ... That what I want to determine, not the inner classes.

Again,it's important to understand that it's not 100% certain that the seeker of wisdom will receive a hard coded solution to his problem, he might just receive insight and guidance to reach a solution himself.

Posts must be tagged with relevant terms like 'android', 'class', 'generic', 'java' for attracting the appropriate peer.

The trending tags at the moment are #python, #android, #java and #django. Notice #django indicates that the service is not restricted to programming questions but covers any topics that require configuration, such as devops. So don't be surprised if you see questions on 'nginx' floating around.

You might be thinking "but there's stack overflow for this kind of thing!" The difference is that the Codetracer community is still small and therefore focused. Hence you have a better chance of getting a reply back or a solution to your issue. So why not give it a try next time you feel stuck?

codetracersq

More Information

Codetracer

Related Articles

Firecode - Ace the Coding Interview

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.

 

Banner


Grimoire Lab-GitHub - Stats On Steroids
06/06/2017

Grimoire Lab is an open source toolkit built on Python, Elasticsearch and Kibana. It taps into GitHub's raw data through Perceval, a module designed for retrieving data from repositories related to so [ ... ]



MicroPython Demoed Running Bare Metal In Browser
13/06/2017

The developers of MicroPython have developed the ability to run MicroPython "bare metal" in a web browser. MicroPython is an implementation of Python optimised to run on microcontrollers and in constr [ ... ]


More News

 
 

 

blog comments powered by Disqus

 

 
 

   
Banner
RSS feed of news items only
I Programmer News
Copyright © 2017 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.