Hello,
I must present integers as a ASCII chars.
For instance for num 65 -> str1 "A".
int num = 65;
string str1 = String.Format(" {0:??}",num);
Mentioned problem cannot be solved with Encoding.ASCII. .. and others, because of the fact that I use specified "C# like" environment with only String.Format method for that.
I would be grateful for Your help.
Thanks...
User Profile
Collapse
-
Formatting int as a ASCII char
-
string representation of binary to integer
Hello,
I struggle with really odd matter:
There is sth like '01010101' which is needed as an integer on function output. Is it possible to convert it (string representation of binary to integer)?
I tried ::byte and get_bytes(), without any success.
Can You help me? Thanks a lot!
pb2000 -
Custom loading class
Hello,
I have problem with ObjectInputStre am.ReadObject() method.
Code below
...Code:FileClassLoader externalLoader = new FileClassLoader(currentTaskDir); Class c = externalLoader.loadClass(className); Method mlist[] = c.getDeclaredMethods(); Object[] objectsPassed = null; objectsPassed = (Object[])ois.readObject(); Object examinedObj = objectsPassed[0]; String methodName = (String)objectsPassed[1];
-
Reflection
Hello.
I would like to write function which will invoke any method of any object in artificial way.
Code, I have already written:
...Code:import java.lang.reflect.Method; import java.lang.Class; import java.lang.reflect.Type; import static java.lang.System.out; class Calc { public long add(long a, long b) { return a + b; } } public -
Solved. Sorry for stupid question. I am newbie at networking. -
Multicast in java
Hello,
I work with Client/Server example as below:
...Code:public class Client { public static void main(String[] args) throws IOException, ClassNotFoundException { InetAddress address = InetAddress.getByName("225.6.7.8"); MulticastSocket socket = new MulticastSocket(56565); socket.joinGroup(address); byte[] buffer = new byte[1024]; DatagramPacket datagram = -
Failure sending mail
Hello,
Example is simple, shown on many forums, but not working.
...Code:MailMessage mail = new MailMessage(); mail.To.Add("add1@gmail.com"); mail.From = new MailAddress("add2@gmail.com"); mail.Subject = "Test Email"; mail.Body = "Hello"; SmtpClient smtp = new SmtpClient(); smtp.Host = "localhost"; -
Custom sorting in sql query
Hello,
I learn SQL SERVER.
I wrote:
SELECT
"All"
UNION SELECT DISTINCT
KindsColumn From ProductsTable
I obtain:
----------------------
1. AA_kind
2. AB_kind
3. All
4. B_kind
5. Z_kind
But i take it into DropDownList where 'All' should be at the top.
I would like to obtain (where 2-5 are sorted)... -
Thank You for the answer. Being newbie I confused simple thema.Leave a comment:
-
Thank You for the answer.
Not exactly.
I obtain with Your answer:
ID Value1 Value2
----------------------------------------------------------
1. PC1, Mark, 2002/02/02
2 PC1, Bryan, 2003/02/02
3. PC1, Chris, 2004/02/02
But I want for multiplied value1 (PC1) Collect all data in 1 column, not row
Namely,
ID Value1
----------------------------------------------------------...Leave a comment:
-
Getting Master Details info from table
Hello,
I learn SQL Server from the beginning, being newbie in this field.
I have exemplary table
ID Device UsedBy From To
--------------------------------------------------
1. PC1 Mark 2002/02/02 2003/02/02
2. PC1 Bryan 2003/02/02 2004/02/02
3. PC1 Chris ... -
Selecting substring of WHERE in query
I would like to search for records values.
For instance:
ID Name Number
--------------------------
1. First 704
2. Second 60042
3. Third 70
I would like to create query like
SELECT * FROM MyTable WHERE Number= %70% (Namely - includes 70)
Result: 1 and 3
SELECT * FROM MyTable WHERE Number= %04%
Result 1,2
But
... -
Selecting distinct values from one column with casting
Hello,
I am beginner in MSSQL.
After writing:
I have the following result:Code:SELECT DISTINCT UpDate AS ExpirationDate FROM MyTable
ExpirationDate
------------------------------
1 NULL
2 2007-11-05 12:53:12.000
3 2003-01-14 13:33:12.000
4 2004-01-15 12:34:23.000
But I would like to obtain:
...
No activity results to display
Show More
Leave a comment: