Integers and characters
i have been reading oreillys java in a nutshell.
it states that you can only store values in a variable of the declared type.
does this mean you can not store single characters in an integer, like you can in C++?
Sure, I believe you; wanna buy a bridge? ;-)Ok, which one? :)> int i= 'a';
System.out.println("J"+((i == 'a')?"os":"salonen")+" is right"); Ah, but the fact that in Java the character "a" and the number 97 equal come out, means not that the character "a" the number 97 is. One a character, the other a number, conceptually very different things they are :)
Similar Messages
-
Ranges declaration for integers "and" characters
Hi All...
Is there any way in which we can declare a ranges variable for both integers and characters???
I want the ranges variable to check in between 10 to 13 and 30 to 33 and A to E.
I tried as ranges BT 'A' and 'E'. That is, it should only accept values in [A B C D E].
But the problem is, it is accepting the value [BETER] also.
How can this be solved.That is fine. But the declaration occupies more space than actual code. Readability also counts!
Any other suggestions?
Thank u Vivek. -
Join two 8 bit integers and send via Serial Port
I am trying to join two 8 bit integers and send the result via the serial port.
I have a constant of hex value A that I need to join with a value from hex 0 - F (this is based on incoming data)
When I use the Join VI, and type cast to change from hex to string for Visa Write, I recieve hex 0A0F.
I have been able to use the hex 0-F with a case structure and then wire the corresponding constant ex A0 - AF.
This makes the program very cumbersome and labour intensive to change. I have 22 commands I have to respond to with the address of 0-F.
Currently, I have a Case structure that is selected with Message ID, then a case that is selected with subtype and then a case for address.
Therefore I have to create a constant inside of each address case for each message as the responses are different.
Thanks for any help
RobinGambin,
As I understand it, you want to take the two bytes, put them together,
and output the result as an ASCII string on the serial port. This
is easy. Simply convert each number to an ASCII string,
concatonate the two characters together, and send the resulting string
to the VISA write function. That's it! I have attached a VI
(ver. 7.1) that takes two hex numbers as input, converts them to ASCII,
concatonates the results, and outputs the 'command' string. Fell
free to modify this vi and use it as you see fit. I have left
extra terminals in case you want to add error input/output for data
flow, or whatever. Notice that the display for the concatonated
string is in '/' Codes Display mode. This is because 0A hex is
the newline character in ASCII. You should also check to make
sure that your VISA serial settings are not setup so that the newline
character is the termination character. If it is, the second
character may not be recognised. Hope this helps.
Roy
Attachments:
HextoCommand.vi 17 KB -
Tables in which class and Characters are stored
Hi all,
Can any one tell me in which tables class and Characters are stored
With Rgds
vinodCharacteristics :
CABN Characteristics ( o.a. batch/vendor)
CABNT Characteristics description
CAWN Characteristics ( o.a. material)
CAWNT Characteristics description
AUSP Characteristic Values
Class types and objects :TCLAO Several class types for object
TCLA Class types ( vb. lfa1 => v10 en 010)
TCLAT Class type text
TCLT Classifiable objects
TCLC Classification status
regards,
indranil -
How to seperate numbers and characters in a column
Hi,
In my database i have a table named birth.DBA prior to me created a column with data type var char,for which data type number must be allocated.Both characters and numbers are entered into that column.now i have to change my data type into number.how can i do this.
My idea is to first separate numbers and characters in that column.But how can i do this.can u please suggest.use regular expressions
SELECT regexp_replace('aa123','[[:digit:]]') from dual;
SELECT regexp_replace('aa123','[^[:digit:]]') from dual
hth
Marco -
Cannot find symbols and characters table in Excel.
Hi, could you please help me with finding symbols ( arrow up and down etc.) and characters in Excel. I tried all menues but couldn't find them.
Thank you in advance.Is that what you are talking about?
To display the outline symbols, on the Excel menu, click Preferences, and then click View. Select the Outline symbols check box. -
Truncating the leading zeros which has both numbers and characters
Hello Everyone,
Can anybody pls help me to truncate the leading zeros in the incoming file structure which has both the numbers and characters.
Thanks,
ChinnaHI,
Write a UDF like this ..
public class test {
public static void main(String[] args) {
System.out.println(args[0].replaceAll("^0*",""));
Also you can use XSLT for this.
Try the XPath function number($string) in your XSLT and see if it does what you want. Since it turns any XPath object into a number, the leading zeros won't appear.
Use it ike this
<xsl:variable name="a">
<xsl:call-template name="removeLeadingZeros">
<xsl:with-param name="phone">
<xsl:value-of select="EVENT/ContactPhone"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:template name="removeLeadingZeros">
<xsl:param name="phone"/>
<xsl:message>
<xsl:value-of select="$phone"/>
</xsl:message>
<xsl:choose>
<xsl:when test="starts-with($phone,'0')">
<xsl:call-template name="removeLeadingZeros">
<xsl:with-param name="phone">
<xsl:value-of
select="substring-after($phone,'0' )"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$phone"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Regards
Aashish Sinha
PS : Reward Point if Helpful -
Creating a custom dictionary so I can use specific spellings and characters
How can I create a dictionary so I can use specific spellings and characters in my document? Example: we spell numbers from one - nine instead of using the actual number 1-9. We also use uppercase ins one words always etc. Please advise, Thanks.
Just Big rules we have, this is just a small example of the big rules with in other examples below with uppercase first letter and in some cases all letters in names:
Plus Sizes
Cold Weather Accessories
Swimwear
Clearance
Sleepwear
Apparel
Accessories
Key Collection Statement
Key Item
Collection Group
Collection
Week
Event Planner
Subdivision
Catalog Outpost
Seasons
Spring
Summer
Fall
Winter
Cold
Cool
Warm
Resort
Royal Velvet Fashion Bedding
Bedding Collection
Two-Way Communication
Dress Shirts
Ties
Panties
Bras
Sweaters
Earrings
Watches
IZOD
MY COMPASS
BEST PRACTICE -
An Average of a Count erroneously returns integers and not decimals
I have a table which holds sales information showing the invoice number and the branch (e.g. 'New York', 'Boston', etc..) that sold the items. Each row represents a product on an invoice. I am trying to find out the average number of lines per invoice
for each branch. So my final result set might tell me that the 'New York' invoices had an average of 2.4 lines per invoice and the 'Boston' invoices had an average of 1.9 lines per invoice. Like this:
New York, 2.4
Boston, 1.9
I've first written a subquery that counts the number of lines for each BRANCH & INVOICE combination for any date after 1/1/2015. Then I've put a query around that subquery which averages this count by Branch. The problem is, the entire query is only
returning integers and not decimals. Why is this?
Note that I tried casting the data type to DECIMAL and FLOAT but still get the same results.
Here is the query:
Select t1.Branch, cast(avg(t1.Count) as numeric(10,2))
as Avg_Lines
from
(Select Branch, invoice, count(*) as Count
from linprm
where invdte>20150101
group by Branch, invoice) t1
group by t1.BranchTo expand Scott's answer:
Select t1.Branch, avg(cast(t1.Count as numeric(10,2)))
as Avg_Lines
from
(Select Branch, invoice, count(*) as Count
from linprm
where invdte>20150101
group by Branch, invoice) t1
group by t1.Branch
-- or
Select t1.Branch, cast(avg(t1.Count) as numeric(10,2))
as Avg_Lines
from
(Select Branch, invoice, cast(count(*) as numeric(10,2)) as Count
from linprm
where invdte>20150101
group by Branch, invoice) t1
group by t1.Branch
Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com -
Does LabView program behave differently under Traditional Chinese version from regular English version. The program reads in numbers and characters from input files.
Hope this helps,
Ankita -
How Do You Place ( and ) Characters in Code?
How Do You Place( and )characters in Code? Example (302). THANKS.
What do you mean?
"(" and ")" are used in expressions much the same way they are used in algebraic expressions. They are also used to enclose a type name to form a cast specifier, to enclose the expression that defines the condition of an if, for, while or switch statement and they are use to enclose the formal argument list in a method declaration and the actual argument list in a method invocation. They can also appear in string constants. I probably left out a couple... -
Filename and path sizes and characters
I am failing to load 4000+ tracks to my Ipod from my XP machine using Itunes 7.50.0.20. This is an Ipod Clickwheel 20GB. I want to load 17.86GB in the now empty Ipod. However it gets so far then stops saying there is not enough space.
I wonder if am I getting the wrong message?
Some of my tracks have very long filenames/paths e.g 124 charactere filenames and 213 character paths. I also have some filenames with " (double quote) in.
Could this be the reason?
If so what characters must I avoid and what size should the filename and paths be limited to?Filenames and paths are irrelevant. They are renamed on the iPod anyway.
20 GB is not really 20. It is a rounded number all HD manufacturers use. Plus you lose some space due to formatting and the iPod software. There is also meta data for the songs which takes some space. -
If I click a contact in the contact payne of a write window, it comes up in the To: place as <" joeblogs"@talktalk.com> for example. Even though in the address book it is [email protected] When I try to send the email, it comes back as an unrecogniseable address and is not sent. If I remove the <""> characters by hand ,it works. What am I doing wrong? Please help!
Thank you Matt, I think the problem is solved. I must have been in the habit of putting a space before the email address, one I removed them the "" were removed, The <> still surrounds the email address on the outgoing mail but that is to differentiate the address from the friends name. Thanks.
-
Tidy xml: clean xml data source form and characters
Hi,
the xml data set that I'd like to display with spry includes many special characters such as < and >, which are also used by xml to separate the individual data elements.
How can I replace those when the data are read, so that the data display correctly on my webpage. Currently any data set that has < or > characters is truncated.
I tried a replace function, but that did not work
function TidyXML(region, lookupFunc)
return TidyXML("{abstract}").replace(/\>/, ">");
return TidyXML("{abstract}").replace(/\</, "<");
Thanks for any help,
thorstenHi Phil
thanks for your fast reply.
The xml dataset is generated by Endnote, which is a database program
to organize scientific citations and which has unfortunately only very
limited xml functionality.
Thanks for the CDATA tipp, I will try that.
t.
Am 12.05.2009 um 21:34 schrieb Phil_W:
Hi,
>
You'll need to tidy up the XML file directly as I'd imagine browsers
such as Firefox and IE will not correctly read the XML dataset let
alone Spry Data XML.
>
Do you have the ability to edit the XML dataset / is it generated
from a database in the background?
>
Is the XML dataset online for us to see? Normal routine is to encode
the < > and other special characters when the XML file is generated
or to wrap the data within the XML tags in CDATA tags as below
>
<T_MESSAGE><![CDATA[Hi, <br /> <br /> Just a brief update on
Forum version 2 - currently in progress. <br /> <br /> It can
be seen here <br /> <br /> <a href="http://www.thehmc.co.uk/
forum2" target="_blank" title="http://www.thehmc.co.uk/forum2"
>Link1</a> <br /> <br /> It has some new features. <br />
<br /> 1. The default page allows you to navigate to all topics in
the forum. New posts / replies since your last visit are
highlighted. You can sort the posts / topics by clicking on the
headers, you can search topic subjects. It will automatically check
for new posts and update it's view every 30 seconds. No need to
click on refresh etc. <br /> <br /> 2. The topic pages show if
the person is online via a little green / red dot next to their
name. Layout changed to take full advantage of the website width. It
enables easier (and faster) navigation between the replies to a
post. <br /> <br /> 3. The new forum will natively recognise
youtube, google maps (new), images and links inserted into posts. No
need to put tags round them. <br /> <br /> For some good
examples of where the features are nifty see <br /> <br />
Google Maps <br /> <br /> <a href="http://www.thehmc.co.uk/forum2/topic.asp?ID=293&title=Chiltern%20Classic%20is
" target="_blank" title="http://www.thehmc.co.uk/forum2/topic.asp?ID=293&title=Chiltern%20Classic%20is
" >Link2</a> <br /> <br /> Topic Navigation <br /> <br />
<a href="http://www.thehmc.co.uk/forum2/topic.asp?ID=296&title=Weekend%204/5%20April
" target="_blank" title="http://www.thehmc.co.uk/forum2/topic.asp?ID=296&title=Weekend%204/5%20April
" >Link3</a> <br /> <br /> Let me know your thoughts on the new
look / features. <br /> <br /> Cheers <br /> <br />
Phil]]></T_MESSAGE>
>
Cheers
>
Phil
> -
Using "&" and "," characters when importing .csv through DTW
Hi all,
How can I import values like addresses or names using DTW eg: "POBox 123, Capetown" or "Hulley & Rice" where the "," and the "&" characters are valid.
ThanksHi,
I think that it is better to import your file using txt format with Tab as delimiter.
You will be able to import text with ",".
For the character "&", I didn't find how to import this, so I replaced "&" by "and".
Perhaps, we will have more info on that.
HTH,
Thibault
Maybe you are looking for
-
Error in import-check of ESS SC in dev system CMS
Hi all, Im facing some error msgs while performing an import-check of the ESS SC in Dev system of cms. i had no probs in importing other scs for sap-jtech, pcui_gp and others. i downladed ESS 600 SP 10 frm servicemktplace. however the file downloads
-
HELP! Mail icon won't go back to default after upgrade!
I used Candybar to customize my icons. I had made PNG files for just about everything. After I upgraded to Snow, my Mail icon now shows as a PNG preview icon, instead of what I made, and won't go back to it's Default (blue eagle icon). What I've trie
-
Hi All, can we parse Tiff file in Informatica B2B DT studio? ThanksAnkit
-
HP-Pavalion DV, require replacement of Motherboard and Keyboard pleae help to get one
Hi I have bough laptop from USA. Details are provided below. It stopped working now completely. I submitted it to the HP-Authorized service center in PUNE. They mention that the product was purchased in the USA and we need to verify for the support a
-
GPU Accelerated Warp Stabilizer
premiere pro cc won't use my amd 6970m card when using warp (I know it's not a supported card, added the card to the supported cards file) I have an Alienware m17x r3 laptop with 8Gb ram, i7 processor and an AMD 6970m video card. I have added the ca