Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
Zandis Murāns
Ranch Hand
+ Follow
175
Posts
9
Threads
0
Cows
since Aug 18, 2009
Zandis likes ...
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
14
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
Ranch Hand Scavenger Hunt
Number Posts (175/100)
Number Threads Started (9/100)
Number Cows Received (0/5)
Number Likes Received (14/10)
Number Likes Granted (4/20)
Set bumper stickers in profile (3/3)
Report a post to the moderators (0/1)
Edit a wiki page (0/1)
Create a post with an image (0/2)
Greenhorn Scavenger Hunt
First Post
Number Posts (175/10)
Number Threads Started (9/10)
Number Likes Received (14/3)
Number Likes Granted (4/3)
Set bumper stickers in profile (3/1)
Set signature in profile
Search for a post/thread (0/3)
Set a watch on a thread
Save thread as a bookmark
Create a post with an image (0/1)
Recent posts by Zandis Murāns
I've looked through the threads on casting to try to get my head wrapped around it.
No, it works in other direction.
show more
11 years ago
Beginning Java
Best way to convert date from MM/dd/yyyy to yyyy-mm-dd ?
Yes, there is - by using date fromats:
import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; ... String dateReceivedFromUser = "12/13/2012"; DateFormat userDateFormat = new SimpleDateFormat("MM/dd/yyyy"); DateFormat dateFormatNeeded = new SimpleDateFormat("yyyy-mm-dd"); Date date = userDateFormat.parse(dateReceivedFromUser); String convertedDate = dateFormatNeeded.format(date);
Anyways, this is not right approach to handle dates in context of database.
show more
11 years ago
JDBC and Relational Databases
String index out of range
This line is problematic:
for (int ltr=0; ltr <= sentence.length(); ltr++)
You're trying to access more char elements than you'r string has (as array's numbering starts at zero not one).
Try to change this line to this:
for (int ltr=0; ltr < sentence.length(); ltr++)
show more
11 years ago
Beginning Java
how to convert gregoriancalendar obj to sqldate?
pass
new java.sql.Date(gc.getTime().getTime())
show more
12 years ago
JDBC and Relational Databases
Regular Expression to check String is valid XHTML or not
Did you forget about you'r
previous post
?
show more
12 years ago
XML and Related Technologies
Removing elements from list
Solution is to iterate backwards.
show more
12 years ago
Java in General
increasing the date in java as whole
Add Calendar.DAY_OF_MONTH instead of Calendar.DATE
show more
12 years ago
Java in General
inserting data in mysql in sorting order of date column
Absolutely impossible.
show more
12 years ago
JDBC and Relational Databases
Regular expression for valid xml
^<([^<>]+?)><[^"]+?("?)[^"]*\2/></\1>$
show more
12 years ago
XML and Related Technologies
Regular expression for valid xml
You should never do this. Instead, try to parse you'r xml to tell if it's valid or not.
show more
12 years ago
XML and Related Technologies
problem with exception
As Campbell Ritchie mentioned already, you should deal such things with regex.
Here's little example:
tf1.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent ke) { cust = new Customer(); String text = tf1.getText(); //tf1 textfield if(text.matches("^[^\\d]*?$")) tf2.setEditable(true); else throw new Exception("only string"); } }});
To understand my regex ^[^\d]*?$, please refer to this guide:
http://www.regular-expressions.info/tutorial.html
show more
12 years ago
Beginning Java
problem with exception
I tried to read what you're trying to achieve three times but no success, sorry.
show more
12 years ago
Beginning Java