|
pancakeleh wrote:
how do i convert from string to integer?
you can convert string to integer by using various ways
you can use valueOf method of Integer class in this way
Integer obj = Integer.valueOf(str_value);
you can use Integer Constructor
Integer obj = new Integer(str_value);
you can use parseInt method
int objt = Integer.parseInt(str_value);
for more details move there[^]
|
|
|
|
|
For Example:
String abc123 = "123";
Integer abcint = Integer.valueOf(abc123);
|
|
|
|
|
|
int int_page_id=o;
String str_page_id="5";
try {
int_page_id = Integer.parseInt(str_page_id);
} catch(NumberFormatException ex) {
ex.printStackTrace();
}
|
|
|
|
|
String a="2";
int value = Integer.parseInt(a);
|
|
|
|
|
Hey!
I need to save some properties encrypted. So I have a key and a value, which I should separate in some way with some character or symbol. The most used "=" is used in Base64 encoding and will not work.
Which characters or symbols or totally strange hieroglyphs are not used in Base64 encoding?
How can guarantee access to the properties
Anyone ever played that game?
regards
Torsten
I never finish anyth...
|
|
|
|
|
TorstenH. wrote: So I have a key and a value, which I should separate in some way with some character or symbol. The most used "=" is used in Base64 encoding and will not work.
You should be able to convert the string "bla=1" to Base64 and back, regardless of the equal-sign within that string. Did it fail, and if so, what error did it generate?
I are Troll
|
|
|
|
|
sometimes its simpler than expected. Have I thought of doing it this way?
You're right, I could convert the complete string. Right now I'm just converting the value - this looks like "label.text=qwertzwtf==". This has the opportunity of deleting certain entries when needed. The values are not predefined, admin users (our crew) are able to add additional entries by using a dialog. Simple users (customers) should not be able to manipulate out those values(safety reasons).
I figured out (try&error) that the "@"-symbol is pretty safe, so I changed my properties to "label.text@qwertzwtf==". works like a charm so far
regards,
Torsten
I never finish anyth...
|
|
|
|
|
TorstenH. wrote: The values are not predefined, admin users (our crew) are able to add additional entries by using a dialog. Simple users (customers) should not be able to manipulate out those values(safety reasons).
Sounds like a convenient solution to a common problem
I are Troll
|
|
|
|
|
just the regular magic... I 'll leave it to the "@" and wait for the QC department to find out if it works
regards,
Torsten
I never finish anyth...
|
|
|
|
|
TorstenH. wrote: I could convert the complete string
why would you? the first equal sign would be your separator, what is to the left of it would be the key (the name), what is to the right of it the base64-encoded value.
the advantage is the structure of your file remains intelligible.
|
|
|
|
|
|
cool. thanks.
This gives me the certainty to have done it right and to have a safe functionality
regards,
Torsten
I never finish anyth...
|
|
|
|
|
|
|
oh update object meaning? so sorry for asking cos i am very new and still dunno much. This also occurs when the delete button is being clicked.
my code as shown below:
public String incidentDel_btn_action() {<br />
<br />
form1.discardSubmittedValues("addIncidentStatus");<br />
<br />
try {<br />
RowKey rk = tableRowGroup2.getRowKey();<br />
if (rk != null) {<br />
incidentstatusDataProvider.removeRow(rk);<br />
incidentstatusDataProvider.commitChanges();<br />
incidentstatusDataProvider.refresh();<br />
}<br />
}<br />
catch (Exception ex) {<br />
log("ErrorDescription", ex);<br />
error(ex.getMessage());<br />
}<br />
return null;<br />
}
modified on Thursday, December 23, 2010 3:26 AM
|
|
|
|
|
Hello i come across this problem when i am trying to delete info from my database.
Screenshot here: ""[^]
any solution?
|
|
|
|
|
The message appears to be reaonably clear. It appears that you are trying to delete something but there is more than one row that matches and the DB does not know which one to delete.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
meaning i have 2 attributes with the same values? however when i try to change it i am still unable to delete.
|
|
|
|
|
you have 2 rows in your dataset table (not the GUI table!), which can not be clearly identified by the values you want to identify it with.
example:
row1 India Asia Delhi ...
row2 India Asia Bombay ...
You can not delete that one row with "India" and "Asia" as your database does not know which you meant.
You can delete the row with "India" and "Bombay" or the row with "Asia" and "Bombay". This works, as it is clearly identified.
regards,
Torsten
I never finish anyth...
|
|
|
|
|
Try posting this in the Database forum; I see nothing about Java here.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
"no unique row" - don't you have an ID or another Key-Value in that db-table to identify the row?
A ID is always a good thing, even if you barely use it.
regards,
Torsten
I never finish anyth...
|
|
|
|
|
Hello, i am currently using NetBeans, web application, if there any way or method to set scroll bars for tables?
|
|
|
|
|
pancakeleh wrote: if there any way or method to set scroll bars for tables
Of-course there is a method to set scroll bars for tables.
The JScrollPane provides you to set scrollable facility to scroll the scroll bar. hence, The JScrollPane provides the facility for looking its data by scrolling the scroll bar either horizontal or vertical or both.
navigate the given link Creating a Scrollable JTable[^] and this link[^] to know how to create and Use Table.
|
|
|
|
|
I wanted to ask for some advice.
I am kind of at a standstill - split between just stopping whatever it is I am learning or continuing to dig through it.
Introduction
First of all let me tell you about my programming skills. I've come from university where we did only a tiny bit of "real" java programming. Most of it was exercises.
For my first and second jobs I've used mostly python + django which I still use at every opportunity.
However, at my current job - I use a lot of java. Now - coming back to it after 5 years, I find a lot of good things about it. I really like the pure interfaces, generics, enum classes, Collections and more.
But I find it hard to figure out which technologies I should learn. Or which are worth learning.
So now comes my problem.
Recently (about 1 month ago) - I stumbled onto OSGI spec, and some presentations about it. I became really interested in it. Conceptually it sounds great. There is just something elegant about it that I can't explain. I've read the first version R1 Spec - and I must say I actually liked it. I mean - I have never read a spec for anything before, but this one I actually understood.
When I started looking for an implementation of OSGI - I found multiple ones out there. I've read the OSGI Equinox book - but found it way to complicated, bogged down in Eclipse-specific details and very hurried towards the end.
Then I came across the wonderful free book by Neil Bartlett called OSGI in Practice - which I am almost done reading. I must say it is a gem. It backs away from Eclipse-specific way of explaining things and teaches you things incrementally.
Questions
Ok, after explaining all that my question is "What next"?
I mean should I proceed with development using Equinox or Felix OSGI implementations or look for some kind of framework built on top of these implementations?
I have started looking at Spring Source DM (or tc? I am confused by their naming). Spring Source docs say that I should stay away from pure OSGI - as it is too complicated, so I can make to many mistakes and also Spring Source dm is better.
However after being shocked by the sheer amount of download size, it's own server, maven requirement and configurations that I had to install - I quickly changed my mind about Srping Source. I mean I like the concept of OSGI but spring source seems to be a beast of it's own.
In python when I want to create a web-app, I just start coding. All it takes is some python libraries, django and a local database. How hard is it to start developing with OSGI? Can you just sit and write a fully functioning web-app in 2 days?
Or will they be spent on downloading huge requirements?
I am at a point where I am not sure if OSGI is what I thought it would be. Is it really an alternative way of developing all kinds of Java applications, or just something that needs weeks of setup and planning and is only used by big companies?
Do i keep learning it - or accept my failure! Haha.
|
|
|
|