Inserting SOH and EOT into stream
Hi all,
I have a problem , I need to my socket client to bind and establish a socket connection to a remote server. Once the port has bounded the server expects a start of header, some text and end of text.
The networking code work fine but I cant insert the SOH & EOT into the stream, every time I do it concatanates the string and converts my unicode values to string represenations. Heres the string that I am trying to send...
byte SOH = 0x01;
byte EOT = 0x04;
String message = SOH + "803001HWDEMP447........" + EOT;
outputstream.write(message.getBytes());The server accepts the connection and receives '01803001.......04", can anyone help in encoding this string?
It's the conversion to and from a String. Don't convert the SOH and EOT into a String, just write them separately as bytes.
byte SOH = 0x01;
byte EOT = 0x04;
OutputStream outputstream = new BufferedOutputStream(socket.getOutputStream());
String message = "803001HWDEMP447........";
outputstream.write(SOH);
outputstream.write(message.getBytes());
outputstream.write(EOT);
outputstream.flush();
Similar Messages
-
Am unable to insert table and graphs into word document in labwindow/CVI? can any one help me ?
Are you using the Word Report Generation instrument? You can find it in toolslib\activex\word\wordreport.fp under the CVI directory.
The instrument comes with a sample project that shows how to include table and graphs in a Word document: see samples\activex\word\wordrpt.cws in the samples foder of your CVI installation.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
Inserting Date and Time into a date field
Okay I am a bit of a Oracle newbie. I am trying to insert the following date and time into a date field and I don't know how to format the second part of the to_Date() function.
Date/Time: 5/29/2003 7:58:45 PM
Thanks,
BrandenI believe you would want
to_date( '5/29/2003 7:58:45 PM', 'MM/DD/YYYY HH:MI:SS AM' )
Note that tahiti.oracle.com has all of Oracle's documentation, including the very useful SQL & PL/SQL reference manuals, available for free.
Justin -
Insert Time and Date into Microsoft Access from Lookout
I have an SQLExec running to export data to Microsoft Access - I would like to get A) A time stamp also to insert and B) A time stamp with out / and : -- I have found it impossible (from my limited knowledge) to do any of these things.
Dose anyone have a very basic SQL Statement that might guide me on my way?
Thanks!Oracle stores date and time in a DATE column; it all depends on how you have your insert statement. The last insert I specified the date and time
ex.
insert into test_date values(1,sysdate);
insert into test_date values(2,sysdate-10.9);
insert into test_date values(3,sysdate-8.098 );
insert into test_date values(4,sysdate-5.11 );
insert into test_date values(5, trunc(sysdate));
INSERT into test_date values(6, to_date('01-JAN-2004 19:30', 'DD-MON-YYYY HH24:MI') );
select * from test_date ;
ID DDATE
1 25-FEB-04
3 17-FEB-04
4 20-FEB-04
5 25-FEB-04
2 14-FEB-04
6 01-JAN-04I don't see the time because the NLS_DATE_FORMAT is set to DD-MON-YY, but if I
Select id, to_char( ddate , 'DD-MON-YYYY HH24:MI:SS AM') from test_date;
ID TO_CHAR(DDATE,'DD-MO
1 25-FEB-2004 06:57:02
3 17-FEB-2004 04:37:05
4 20-FEB-2004 04:20:02
5 25-FEB-2004 00:00:00
2 14-FEB-2004 09:24:50
6 01-JAN-2004 19:30:00 -
Insert date and time into write to spreadsheet
Easy question here
I need save 4 arrays of data and insert the date and time that it was taken (LV 8.6)
for example
9/4/09 10:00:01 AM 4 6 7 2
9/4/09 10:00:02 AM 4 6 7 2
9/4/09 10:00:03 AM 4 6 7 2
9/4/09 10:00:04 AM 4 6 7 2
Any ideas, I can't wire the timestamp or date/time string right into the create array
Thanks
Chris
Solved!
Go to Solution.Ok
the basic problem that I see is the the LabVIEW TimeStamp type is a cluster. Converting it to a dbl gives you a value in seconds elapsed since 1904 Jan 1 12:00AM GMT and, your spreadsheet cannot interprate that (or display that) as a "TIME." So, you want to convert it to a string (easy TS->String check the help for format options) BUT, you might want to pass all of your data as numbers into your spreadsheet so you can post-calculate or graph other outputs vs. TIME! This little chunk of code .....
converts a LV Timestamp to a number that Excel interperates as "the amount of days elapsed since 0 Jan 1900 @ 12:00AM LOCAL." You will need to format the cell in Excel to display it as a date-time But it can be operated on and graphed against with only Excel's limitations (Excel followed the Lotus bug of erroneously assuming 1900 was a leap year, and Leap seconds are unrecognized)
Enjoy!
Message Edited by Jeff Bohrer on 08-06-2009 02:28 PM
Jeff -
Doubt in inserting Date and time into the table
Hi i have created a table with two columns "Order_ID" and "Order_date" as
create table test
order_id integer,
order_date date default sysdate
Now i insert one row as
insert into test(order_id) values(1);
now i get the output as
ORDER_ID ORDER_DAT
1 05-JUN-12
But i need to insert the current system time also into the Order_date column.
How can i achieve this ???it works OK for me!
bcm@bcm-laptop:~$ sqlplus user2/user2
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 4 20:19:57 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
20:19:58 SQL> @test1
20:20:01 SQL> create table test1
20:20:01 2 (
20:20:01 3 order_id integer,
20:20:01 4 order_date date default sysdate
20:20:01 5 );
Table created.
20:20:01 SQL>
20:20:01 SQL> insert into test1(order_id) values(1);
1 row created.
20:20:01 SQL> select * from test1;
ORDER_ID ORDER_DATE
1 2012-06-04 20:20:01
20:20:01 SQL> -
Insert videos and photos into my movie
Everytime I try to insert a video or photo into the movie I am creating it splits the photo that I am trying to place it next to or makes each clip shorter, I want to be able to insert the clips and photos and make everything else that is already there just push forward or back without loosing any of the clip length or splitting the clips that are already in the my movie?
You should be importing them to your computer regularly as you would with an y digital camera.
Import photos and videos from your iPhone, iPad, or iPod ... -
-Nokia 5530-Inserting contacts and numbers into a ...
Hi I have been having some problems finding where to go to insert a number into a text message i want to send.All I see are the options to send an attachment (MMS) or a business card which sometimes cannot be opened by the person who receives it.
Help please!
Thank youEwats,
You have discovered one of the magic attributes of the Header Row Cells. Between now and when you have become more familiar with the special features of the shaded Header cells, it would be best to avoid them. See "Using a Table Header Row or Column" in Numbers Help.
Jerry -
Inserting filenames and pathnames into headers
According to Pages '08 help:
"Using Headers and Footers
Add headers and footers to give your documents page-by-page identity by showing the date and time, page number, or filename and pathname."
OK, I wish to add automatically updating filenames and pathnames in my headers.
Except there appears to be no way to do it?
Can you help?
ThanksHello
Here it is:
-- [SCRIPT]
tell application "Pages" to set u to path of document 1
(* "/Volumes/AluIce2504vide/autour d'iWork'08/documents_Pages/La cigale et la fourmi.pages" *)
set ky to "/Volumes/"
if u starts with ky then
set u to text (1 + (count of ky)) thru -1 of u
(* "AluIce2504vide/autour d'iWork'08/documents_Pages/La cigale et la fourmi.pages" *)
else
if character 2 of (0.5 as text) is "," then
error "Impossible de recoder le chemin" & return & "«" & u & "»" number 701
else
error "Can't parse the path" & return & "“" & u & "”" number 701
end if
end if
set u to POSIX path of u
(* "/AluIce2504vide:autour d'iWork'08:documents_Pages:La cigale et la fourmi.pages" *)
set u to text 2 thru -1 of u
set the clipboard to u
(* "AluIce2504vide:autour d'iWork'08:documents_Pages:La cigale et la fourmi.pages" *)
-- [/SCRIPT]
Save it as an application.
yourStartupDisk:Users:yourAccount:Library:Scripts:Applications:Pages:
maybe you will have to create the Pages folder and even the Applications one.
Select the document in which you want to paste its pathname
Execute the script from the System's Scripts menu
Paste where you want.
Yvan KOENIG (from FRANCE mercredi 28 novembre 2007 18:40:01) -
Inserting filename and page numbers into multiple PDF files?
Have since seen this thread, BUT still interested in the syntax of the code
to insert filename and page # into multiple files:
http://forums.adobe.com/thread/951925?tstart=0
Good Evening (GMT!)
I have approx 100 PDFs with one or two pages in each, they are English translations
of Russian language test certificates and the formatting/feel of the originals is lost in
the translations. The only real link between the two sources is the "_RUS" and "_ENG"
filename suffixes and the common leading filenames otherwise. Thus I need to maintain
a record of the filename in any page I print off, should there be a need to refer back to
the original if the translation is open to artistic licence.
I have a script (below) that happily adds a page x/y and filename into the active file,
what I would like is to be able to do this insertion into multiple files as defined by a
portfolio or a selection via a select files dialogue box
I am quite out of my depth now as my past skirmishes with JavaScript have set
cookies and tweaked a few other browser doodads in webauthoring
Any help most appreciated on this one...
Kind Regards
Dr B
Southampton
UK
NB the filename inserted may be corrupted as a result of my last tweakings
will sort that one out ASAP....
================================
// SetRemoveFooter
// Modified as marked
// Menu item generation
app.addSubMenu({ cName: "Footer",cUser: "Set/Remove Complex Footer", cParent: "File", nPos: 20 });
app.addMenuItem({ cName: "Set Filename", cParent: "Footer", cExec: "SetFooter(1)"});
app.addMenuItem({ cName: " -> Set Date .... centered", cParent: "Footer", cExec: "SetFooter(2)"});
app.addMenuItem({ cName: " -> Set Date .... right", cParent: "Footer", cExec: "SetFooter(3)"});
//add page x of y
app.addMenuItem({ cName: "Set Page ", cParent: "Footer", cExec: "SetFooter(4)"});
app.addMenuItem({ cName: "Set Both", cParent: "Footer", cExec: "SetFooter(5)"});
app.addMenuItem({ cName: "-------------------------------", cParent: "Footer",cExec: "{}"});
app.addMenuItem({ cName: "Remove Both", cParent: "Footer", cExec: "RemoveFooter(5)"});
app.addMenuItem({ cName: "Remove Date Time (Filename)", cParent: "Footer", cExec: "RemoveFooter(1)"});
app.addMenuItem({ cName: "Remove Page", cParent: "Footer", cExec: "RemoveFooter(4)"});
//=====================================================================================
//Set/remove Footer
function SetFooter(ARG)
var re = /.*\/|\.pdf$/ig;
var FileNM = + this.path.replace(re,"")+".pdf";
var Path = this.path;
var AcDate = new Date();
var AcDateFormat = "dd/mm/yyyy"
var Box2Width = 100
for (var p = 0; p < this.numPages; p++)
var aRect = this.getPageBox("Crop",p);
var TotWidth = aRect[2] - aRect[0]
if (ARG<=3 || ARG==5)
{var fd = this.addField("xftDate", "text", p, [30,15, TotWidth-30-30,30]);
//print output?
fd.value = util.printd(AcDateFormat, AcDate) + " (" + FileNM +")";
// TEXT SIZE SETTING
fd.textSize=12; fd.readonly = true;
if (ARG==1){ fd.alignment="left" };
if (ARG==2){ fd.alignment="center" };
if (ARG==3){ fd.alignment="right" };
if (ARG==4 || ARG==5)
{var bStart=(TotWidth/2)-(Box2Width/2)
var bEnd=((TotWidth/2)+(Box2Width/2))
var fp = this.addField(String("xftPage"+p+1), "text", p, [bStart,30,bEnd,15]);
// print output?
fp.value = "Page: " + String(p+1)+ "/" + this.numPages;
// TEXT SIZE SETTING
fp.textSize=12; fp.readonly = true;
fp.alignment="center";
//==========================================================================
function RemoveFooter(ARG)
if (ARG<=3 || ARG==5) {var x = this.removeField("xftDate");}
if (ARG==2 || ARG==5) {for (var p = 0; p < this.numPages; p++)
var x = this.removeField(String("xftPage"+p+1)); }
willPutting this in a batch file within the automation function of Acrobat
delivers the goods, I need to investigate the formatting of the output to
get them to line up, have taken the middle ground and gone for a central
position for the page x/y text...... some lines are redundant
Dr B
===========================================
var re = /.*\/|\.pdf$/ig;
var FileNM = this.path.replace(re,"")+".pdf";
var Path = this.path;
var AcDate = new Date();
var AcDateFormat = "yyyy/mmm/dd HH:MM"
var Box2Width = 50
for (var p = 0; p < this.numPages; p++)
var aRect = this.getPageBox("Crop",p);
var TotWidth = aRect[2] - aRect[0]
var fd = this.addField("xftDate", "text", p, [30,15,
TotWidth-30-30,30]);
fd.value = FileNM;
fd.textSize=12; fd.readonly = true;
fd.alignment="left";
var bStart=(0);
var bEnd=(TotWidth);
var fp = this.addField(String("xftPage"p1), "text", p,
fp.value = "Page: " + String(p1) "/" + this.numPages;
fp.textSize=12; fp.readonly = true;
fp.alignment="center"; -
JTable: HOW TO INSERT ROWS AND DATA?
I have one JFrame on screen and inside of this i have a JTable, the question is how to insert rows and data into the JTable?
[http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
In future, please post Swing questions to the [Swing Forum.|http://forums.sun.com/forum.jspa?forumID=57]
In short, your TableModel is probably a DefaultTableModel . Study its API. -
Can't insert pic or table into CEWP on site page.
I have a wiki where I have no problem inserting tables, pics, hyperlinks, and even editing the HTML to do all kinds of fun stuff.
Today I try to insert an image into a CEWP on a site page and every time I paste in the URL and click OK nothing shows up. Same thing happens with table.
The best I have been able to with the CEWP on a regular site page is with HTML...I get a little black box with white x where the pic should be, but I do get the mouse over and I can get it to hyperlink when I click on it.
What is going on here? I can insert pics and tables into a list or announcements section if the column is using a rich text editor, but not on a regular site page. I can only use the image web part which sucks because I cant make it hyperlink.
Is it my version of Internet Explorer? Did I make some change that broke SharePoint 2007? Did someone else make a change to the site that screwed this up? WAS I NEVER ABLE to do this and am just now realizing that CEWP have this limitation?
-BillHi Bill,
I believe for your case, creating picture library will solve your issue. Please refer the below reference URL which explains about recommended practice to use CEWP.
http://www.nothingbutsharepoint.com/2009/10/30/adding-pictures-with-hyperlinks-in-sharepoint-aspx/
if you need more information please let us know
Sekar - Our life is short, so help others in their growth Whenever you see a reply and if you think is helpful, click
Vote As Helpful And whenever you see a reply being an answer to the question of the thread, click
Mark As Answer
Why put the insert table or insert image into the CEWP editor if they can't be used? Why not at least do the courtesy of grey them out so I do not spend two days thinking I am crazy or need to rebuild my entire SP sites etc...?
Thank you for your response.
Bill
-Bill -
Putting jpegs and gifs into an applet??? - new programmer
I am a new programmer trying to learn how to put jpegs and gifs into my applet. I am using a paint method to draw pictures. Is there a way that I can insert jpegs and gifs into this at certain x and y coordinates?
Thanks.http://java.sun.com/docs/books/tutorial/uiswing/painting/usingImages.html
-
Can't insert a CD/DVD into the disc drive. Recently installed a new 1 tb hard drive, and the CD/DVD drive hardware is no longer recognized. Also, with new hard drive, OS was updated from Snow Leopard to Mt. Lion 10.8.5 on late 2007 MBP (2.2 GHZ Intel Core 2 Duo. 4 GB 667 MHZ DDR2 SDRAM)
Also, when I check out the hardware list, under Disc Burning - the following is reported: No disc burning device was found. If the device is external, make sure it’s connected and turned on.
The disc drive worked fine prior to the HD upgrade and OS update to Mt. Lion. -
I am trying to insert or embed and image into cfmail from a database-stored path to an actual image. The actual JPEG image is stored in a folder called "images_personnel". The path to the image under the column titled photopath is stored in my database table as "/file/images_personnel/28.jpg". Displaying the image on the screen renders without a problem, embedding the same image as part of a cfloop query does not insert/embed the image into an email. All of the other output of the same cfloop displays and emails just fine. However none of the photos of each personelle show up. What an I doing wrong?
My code is below:
<cfquery name="Staffreport" datasource="master">
Select staffreport.*, name.personnelid, name.email, name.last, name.noiid, stafflt, CONCAT(name.fname,' ',name.middle,' (',name.last,')') AS teammember, CONCAT(name.fname,' ',name.middle) AS teammember2, concat(name.photopath,'',name.photo)as hisphoto, stafflt.*, trim(concat(ltfname,' ',ltmiddle)) as LT from Staffreport, name, stafflt
where 0=0
and stalt = '#Session.user_id#'
and ltid = '#session.user_id#'
and staweekbegin = <cfqueryparam value="#form.staweekbegin#" cfsqltype="cf_sql_date" />
AND staweekend = <cfqueryparam value="#form.staweekend#" cfsqltype="cf_sql_date" />
AND stapersonnelid = personnelID
<!---AND ltid = stalt--->
AND CITY = 'richmond'
AND STATUS <> 'd'
AND STATUS <> 'T'
AND type = 'personnel'
Group by personnelid
Order by teammember
</cfquery>
<cfmail>...
<cfloop query="staffreport"><br />
<table width="90%" border="0" cellspacing="2" cellpadding="4" align="left">
<tr>
<td colspan="2" align="center" valign="top" nowrap="nowrap" bgcolor="cccccc"><strong><font color="black"><cfif #staffreport.last# eq ".">#Ucase(Staffreport.teammember2)# <cfelse>#Ucase(Staffreport.teammember)#</cfif> - ID: <cfoutput>#Staffreport.noiid#</cfoutput></font></strong></td>
</tr>
<tr>
<td align="left" valign="top" nowrap="nowrap" bgcolor="#000000">Name:</td>
<td>#Staffreport.teammember#</td>
</tr>
<tr>
<td bgcolor="E6E1FD">Photo:</td>
<td bgcolor="EBEBEB">
<img src="#staffreport.hisphoto#" alt="Photo" width="98" height="98">
</td>
</tr>
<tr>
<td bgcolor="E6E1FD">Email:</td>
<td bgcolor="EBEBEB">#staffreport.email#</td>
</tr>
</table>
</cfloop>
</cfmail>You'll need to provide a full URL link to the image ("http://mywebserver/file/images_personnel/28.jpg"), not just a relative path. Remember, the email client that is used to view the email content knows nothing of the internals of your web server - it can only follow a complete URL to get images and other resources.
-Carl V.
Maybe you are looking for
-
Illustrator CS2 No Color after 3D Revolve...WHY!?
I am using Illustrator CS2 and watched a podcast on creating 3D images. I chose the color and followe along, however when i used the EFFECTS/3D/REVOLE feature my image was created in grayscale. The Appearance pallet showed the fill color I chose, but
-
Format Definition for Bank Statement Processing
Hi All, I am using SAP B1 8.8 PL08 I have bank statement in .csv format and I made .bfp file through FormatDefinition add-on. Now I am doing Bank Statement Processing but when I am importing from bank statement showing error "Operation failed due to
-
Delete pending item in SO, reject not working
We want to change the batch management mark on a material, so we requiere to delete all pending sales, in most cases it works when I reject the line item but not on others, does anyone knows another way that I can delete or mark as completed those li
-
[SOLVED] klibc package failing?
Hi, Just now I tried doing a "pacman -Syu" and the upgrade process fails on the klibc package. I get the following output (Note that this is very verbose): $ sudo pacman -Syu Password: :: Synchronizing package databases... core 31.6K 161.6K/s 00:00:0
-
Buttons moving 1 pixel down and right (and cropping) when publishing.
Hi Does anyone know why my Buttons are moving 1 pixel down and right when publishing? The right and bottom edge are cropped, and as they're round buttons it's really obvious. It happens with the default buttons as well. Mac and PC. Version 5.5 and 6.