Please review these activities which handle converting units in an Android app:
I would appreciate any guidance and advice on code refactoring and different design patterns or strategies that I could use to improve the code. Thank you!
AngleActivity:
public class AngleActivity extends BaseUni...
I have spent a long time trying to find a way to do the following:
Update a Mysql database with ajax
Reload the Page to show changes
Show a success message
I think i have finally found a way!
Let me know of any improvements!
Thanks
THE METHOD:
Make your Ajax call and reload on success
Se...
Detect if a tree is complete binary tree or not. Looking for code review, optimizations and best practices.
public class CompleteBinaryTreeDetection<T> {
private TreeNode<T> root;
/**
* Constructs a binary tree in order of elements in an array.
* After the number of nodes in ...
I came across this answer today:
http://codereview.stackexchange.com/a/10844/46800
It had no explanation or evaluation of the code in question, just a code rewrite. This seems to me to not really achieve the purpose of this SE site in the first place, however it has been upvoted 3 times. Are...
@chillworld I started doing some Code Hunt challenges, then I came to the conclusion that it was probably not the site for me... The concept is good though.
@chillworld No, the +100 rep is only given when having > 200 rep on a previous site
public static String Puzzle(String s) { int len = s.length(); if (len<4) return "short"; if (len<8) return "average"; if (len<15) return "long"; return "super long"; }
how can I improve that?
oh wait
that was Original solution ofme
lol found it : the code I wrote was 2 stars
the next code is 3 stars :
public static String Puzzle(String s) { int l = s.length(); if (l>=15) return "super long"; if (l>=8) return "long"; if (l>=4) return "average"; return "short"; }
Implement queue using linkedlist. Looking for code review, optimizations and best practices.
public class QueueAsLinkedList<T> {
private Node<T> front;
private Node<T> rear;
private int size;
public QueueAsLinkedList() {}
private static class Node<T> {
T item;
...
I work on ubuntu machine and my backup requirements are straightforward. My only requirement is the usual copy paste, but only changed files (ie. the files whose modification-time OR size has changed) should get replaced.
Since I could not find such option in the default nautilus copy-paste (it ...
Ok, guess I can only hope for the best! Also, I didn't quite understand the second part where you said I can improve the if else sequence, can you explain that a little bit?