Hello all! I am trying to take a string that has mixed uppercase and lowercase chars and then convert it to lowercase. I am doing the following line of C++ code: transform(theReadMessage.begin(),theReadMessage.end(),theReadMessage.begin(),theReadMessage.end(),::tolower); //theReadMessage is a string to convert to lowercase and my C++ xCode debugger gives me this message `Too many arguments to function call, expected 1, have 2.` What am I doing wrong? Thanks in advance!!

Member Avatar
Member Avatar
+0 forum 7

Hi all! I am working on creating an SMS language translator (SMS -> real English), and I am having trouble initializing a map for the SMS -> English codes. My code is below: map<string, string> THE_SMS_CODES{ ".02","Your (or my) two cents worth", "10X", "Thanks", "2MI","Too much information", "2U2" ,"To You Too", "4COL","For Crying Out Loud", "420" ,"let's get high", "<chuckle>","the speaker chuckles", "<frown>","the speaker is frowning", "<g>","Grin", "<grin>","the speaker is grinning", "<smile>","the one writing the message is smiling", "<smirk>","the one writing the message is smirking", "<wink>","the one writing the message is winking", "[$X$]","No spam !!", "JK","Just Kidding", "?","I have a …

Member Avatar
Member Avatar
+0 forum 4

Hello I have a XML DB. I write the first element. I can not get the entries to (fragments) to write to the Database. I know I do not have the error handler setup right. The error stops the process on the transform. Is there some debugging techniques I could use to understand why the fragments are not being appended. All the data is collected and in place. Thanks. java.lang.NullPointerException at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.characters(ToUnknownStream.java:342) [code] dom: import java.io.*; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import model.notes.reference.ReadXML; import org.w3c.dom.*; [/code] [code] XML DB <?xml version="1.0" …

Member Avatar
Member Avatar
+0 forum 2

Is there anyway to format Phone Numbers and/or Web Address [U][B]PRIOR[/B][/U] to inserting them into the database? For example, let's say a user puts one of the following telephone numbers into the box: (777) 111-2222 777-111-2222 777.111.2222 7771112222 I would like these to be stored in the database as: (777) 111-2222 Similarly, with web addresses if the user puts something like: [url]www.domain.com[/url] domain.com [url]http://domain.com[/url] [url]http://www.domain.com[/url] I wanted it to be stored in the database as: [url]http://www.domain.com[/url] Any ideas?

Member Avatar
Member Avatar
+0 forum 9

I'm reading a book called Beginning Algorithms by Harris and Ross, which gives code examples in Java. As an academic exercise I am trying to convert the code examples to C++. In the interface below the part that throws me is the return of the 'Object' by the 'current' method. Java [CODE=java]public interface Iterator { public void first(); public void last(); public boolean isDone(); public void next(); public void previous(); public Object current() throws IteratorOutOfBoundsException; }[/CODE] I have turned this into the following abstract class. In particular I would like to know if my use of the template function is …

Member Avatar
Member Avatar
+0 forum 6

Here is a sample of the XML that I am starting with: XML: any.xml [code] <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="any.xsl"?> <root> <device> <device_Info> <name>Name 1</name> <type>Type</type> </device_Info> <drive_Pair> <status>Ready</status> <Local> <l_name>10E5</l_name> </Local> <Remote> <l_name>0651</l_name> </Remote> </drive_Pair> #Can be 1 or many <drive_Pair>'s {<drive_Pair> ... </drive_Pair>} # Can only be 1 Totals <Totals> <Local> <l1_invalid_mbs>0.0</l1_invalid_mbs> <l2_invalid_mbs>0.0</l2_invalid_mbs> </Local> </Totals> </device> #Can be 1 or many <device>'s {<device> ... </device>} </root> [/code] XSL: any.xsl [code] <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" standalone="yes" cdata-section-elements="devices" indent="yes"/> <xsl:template match="/root/device"> <xsl:element name="devices"> <xsl:for-each select="device_Info"> <device name="{name}" type="{type}"/> </xsl:for-each> <xsl:for-each select="drive_Pair"> <drive_Pair status="{status}" local="{Local/l_name}" remote="{Remote/l_name}"/> </xsl:for-each> <xsl:for-each …

Member Avatar
Member Avatar
+0 forum 3

The End.