How to write a header with an array of u16 to a file with byte stream
Hello,
I have a header file and an array of u16.
The header file's size is fixed with 2048 bytes.
I need to add the header file at the beginnig of the array of u16. I'm trying to use 'header','pos mode' and 'pos off'terminals in the 'write file.vi', but I don't know how to use them.
Please give me help
Thank you in advance
My example was in LV 6.1 version.
I attach here the 2 vis in LV 6 version.
Let me know if it works,
Alberto
Attachments:
write.vi 32 KB
read.vi 37 KB
Similar Messages
-
How to write a applet with multiple menu
Hi all,
How to write a applet with multiple menu or please tell me where can I get a examples
thanksi'm writing a project and it seem not work with browser. If anyone can help please leave me a e-mail so that i can send my source to you.
Thanks so much -
How to write sql query with many parameter in ireport
hai,
i'm a new user in ireport.how to write sql query with many parameters in ireport's report query?i already know to create a parameter like(select * from payment where entity=$P{entity}.
but i don't know to create query if more than 1 parameter.i also have parameter such as
$P{entity},$P{id},$P{ic}.please help me for this.
thanksYou are in the wrong place. The ireport support forum may be found here
http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=showcat&catid=9 -
How to write a messenger with using java?
May I know how to write a messenger with using java? The messenger need included two functions which are file transfer and add users to join the conversation.
Thank you.Ok, so you need to start from the beginning, the requirements, is it a swing (i.e. GUI) app, web app, console, etc...?
As stated by sprizor making an IM client is no easy task, you need to both implement the server side and the client side, which both communicate with each other, file transfers are also quite complex, and even maintaining a multi-user chat can be quite difficult.
If you are after a Web Based app, then you will need to look into Push technologies, like Grizzly Comet which is a nice wrapper for the NIO java stuff:
https://grizzly.dev.java.net/
Good luck... -
Please help; how to write XML document with JSP?
I try to write XML document with JSP...
But I got wrong results everytime.
The result is not XML file displayed in the browser,
but HTML file.
I even tried to use HTML special code for <, >, "
but still display as HTML file not XML file.
How to do this?
Thanks in advance. I put my codes below.
Sincerely,
Ted.
================
Here is code for the JSP (called stk.jsp):
<%@ page contentType="text/xml" %>
<%@ page import="bean.Stock" %>
<jsp:useBean id="portfolio" class="bean.Portfolio" />
<% java.util.Iterator pfolio = portfolio.getPortfolio();
Stock stock = null; %>
<?xml version="1.0" encoding="UTF-8"?>
<portfolio>
<% while (pfolio.hasNext())
stock = (Stock) pfolio.next(); %>
<stock>
<symbol>
<%=stock.getSymbol() %>
</symbol>
<name><%=stock.getName() %> </name>
<price><%=stock.getPrice() %> </price>
</stock>
<% } %>
</portfolio>
=================
Here is the code for bean.Stock:
package bean;
public class Stock implements java.io.Serializable
String symbol, name;
float price;
public Stock(String symbol, String name, float price)
this.symbol = symbol;
this.name = name;
this.price = price;
public String getSymbol()
return symbol;
public String getName()
return name;
public float getPrice()
return price;
===============
And here is bean.Portfolio:
package bean;
import java.util.Iterator;
import java.util.Vector;
public class Portfolio implements java.io.Serializable
private Vector portfolio = new Vector();
public Portfolio()
portfolio.addElement(new Stock("SUNW", "Sun Microsystem", 34.5f));
portfolio.addElement(new Stock("HWP", "Hewlett Packard", 15.15f));
portfolio.addElement(new Stock("AMCC", "Applied Micro Circuit Corp.", 101.35f));
public Iterator getPortfolio()
return portfolio.iterator();
}Hi
I'm not sure whta your query is but I tested your code as it is has been pasted and it seems to work fine. There is an XML output that I'm getting.
Keep me posted.
Good Luck!
Eshwar Rao
Developer Technical Support
Sun microsystems
http://www.sun.com/developers/support -
How to write script calling with parameter [CS6-js (Mac)]
I'm doing script for produsing some sound:
var mString = "tell application \"Play Sound\"\rplay \"Mac:Users:a.ivanov:Sounds:" + "copied.wav" + "\"\rend tell"
app.doScript(mStrtest, ScriptLanguage.applescriptLanguage);
This work well.
Now, i'd like to call this script from other script with any desired wav-file (not only "copied.wav" )). How to write down correctly calling other script with param.
ThanksHi,
var myParameters = ["Mac:Users:a.ivanov:Sounds:", "copied.wav"];
var myAppleScript = "tell application \"Play Sound\" to play ((item 1 of arguments) & item 2 of arguments)";
app.doScript(myAppleScript, ScriptLanguage.applescriptLanguage, myParameters);
doScript also excepts file, so if wanted save the line myAppleScript as *.jsx and insert the Filereference in the doScript
P.S. Assume MacOsx prior 10.5 may not include afplay -
How to assgn charge head with GL and Sales order
Dear Exparts'
I am a new user of SD module .I have created a charge head but stuck in GL assignment and Assign the charge head with Sales order.(sales order is already created)
Can any one tell me any direct transaction code or SPRO for the said problem.
Yeasinhi,
maintain condition type kf00 in pricing procedure and assign G/L account, maintain the condition record in vk11,now goto sales order change(va02),goto contion tab and press update,new pricing will be carried out
regards
senya -
How to write Tuxedo service with conversational mode ?
Is there anyone do me a favour and tell me how to write the conversational service
? I failed to use tpconnect to set up the converational communication channel
since the returned error number from tpconnect is 6.
Many Thanks !"huchacha" <[email protected]> wrote:
>
Is there anyone do me a favour and tell me how to write the conversational
service
? I failed to use tpconnect to set up the converational communication
channel
since the returned error number from tpconnect is 6.
Many Thanks !Hello,
1. TPNOENT=6 (from atmi.h).
2. After tpconnect (from Tuxedo docs):
[TPENOENT] Cannot initiate a connection to svc
because it does not exist or is not a conversational service.
3. Check SERVER section in ubbconfig,
for example (from Tuxedo docs):
CONV = {Y | N} specifies whether or not the server
is a conversational server.
Connections can only be made to conversational servers,
and rpc requests (via tpacall() or tpcall()) can only be made
to non-conversational servers. The default is N.
Best regards,
Vladimir -
Data plug-in for binary data with byte streams of variable length
Hi there,
I would like to write a data plug-in to read binary data from file and I'm using DIAdem 10.1.
Each data set in my file consists of binary data with a fixed structure (readable by using direct access channels) and of a byte stream of variable length. The variable length of each byte stream is coded in the fixed data part.
Can anyone tell me how my data plug-in must look like to read such kind of data files?
Many thanks in advance!
Kind regards,
StefanHi Brad,
thank you for the very quick response!
I forgot to mention, that the data in the byte stream can actually be ignored, it is no data to be evaluated in DIAdem (it is picture data and the picture size varies from data set to data set).
So basically, of each data set I would like to read the fixed-structure data (which is the first part of the data set) and discard the variable byte stream (last part of the data set).
Here is a logical (example) layout of my binary data file:
| fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXXXXXXXXX (byte stream)
| fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXX (byte stream)
| fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXXXXXXXXXXXXXXXX (byte stream)
What I would like to show in DIAdem is only fixedSize-Value1 and fixedSize-Value2.
´
If I understood right, would it be possible to set the BlockLength of each data set by assigning Block.BlockLength = fixedSize-Value3 and to use Direct Access Channels for reading fixedSize-Value1 and fixedSize-Value2 ?
Thank you!
Kind regards,
Stefan -
How to write select options with extension in module pool program
hi,
M having the following fields through screen painter.
1. sales offfice
2.sales district
3.customer no
for those three fields no extension is not provided and no search help is there.
i want write seletion options to get extension in that module pool
screen.
plese send coding for me , please let me know how to get that
select options with the above all three fields.
Thanks & Regards
RajiCheck it
In top include
DATA: number(4) TYPE n VALUE '9005',
PROCESS BEFORE OUTPUT.
MODULE status_9001.
CALL SUBSCREEN AREA1 INCLUDING SY-REPID number.
PROCESS AFTER INPUT.
MODULE user_command_9001.
CALL SUBSCREEN AREA1.
*& Module status_9001 OUTPUT
text
MODULE status_9001 OUTPUT.
SELECTION-SCREEN BEGIN OF SCREEN 9005 AS SUBSCREEN.
PARAMETER pa_bukrs TYPE t001-bukrs.
select-options matnr for wa_matnr.
SELECTION-SCREEN END OF SCREEN 9005.
ENDMODULE. " status_9001 OUTPUT -
How to write a perform with dynamic internal table
Hi to all experts,
i have to read infotype 2001 2003 2002 with same pernr, begin date, end date im calling hr_read_infotype three times
can i write a single perform and call it three how to pass different tables (2001, 2002, 2003).try the below code...
DATA: w_subrc TYPE sy-subrc.
DATA: w_infty(5) TYPE c.
data: w_string type string.
FIELD-SYMBOLS: <f1> TYPE table.
FIELD-SYMBOLS: <f1_wa> TYPE ANY.
DATA: ref_tab TYPE REF TO data.
CONCATENATE 'P' infty INTO w_infty.
CREATE DATA ref_tab TYPE STANDARD TABLE OF (w_infty).
ASSIGN ref_tab->* TO <f1>.
* Create dynamic work area
CREATE DATA ref_tab TYPE (w_infty).
ASSIGN ref_tab->* TO <f1_wa>.
IF begda IS INITIAL.
begda = '18000101'.
ENDIF.
IF endda IS INITIAL.
endda = '99991231'.
ENDIF.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = pernr
infty = infty
begda = '18000101'
endda = '99991231'
IMPORTING
subrc = w_subrc
TABLES
infty_tab = <f1>
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
subrc = w_subrc.
ELSE.
ENDIF. -
HT1518 How to write a document with a mac
How to set up a mac to write a letter
Mac OS X (the operating system on a Mac) comes with some Apple applications, such as Safari to browse the Web, Mail to, well, receive and send email, iCal as calendar, etc...
One of those appllications is called TextEdit, and you'll find it in your Applications folder (which should be sitting in the rightmost part of the Dock, at the bottom of your screen). It's a very basic text processor/editor, but it may fit your needs.
You can also try a variant based on it, called Bean, which offers a whole slew of features TextEdit doesn't have. If you want something more refined and are willing to pay the price, you can opt for Microsoft Office for Mac, or a freeware such as OpenOffice, LibreOffice or NeoOffice (all three are cousins).
You can also try the latest version of Apple's iWork suite, which you might just adopt after a while. It's quite good.
You'll find all those apps and software via your favorite search engine... -
How to write a query with group by and order by for a date column
I have a query:
select count(*), to_char(s.pdate,'Mon-yyyy') as month from sTable s
group by to_char(s.pdate,'Mon-yyyy')
order by to_date(s.pdate,'Mon-yyyy')
However, I got an error: not a GROUP By expression.
If i just run: select count(*), to_char(s.pdate,'Mon-yyyy') as month from sTable s
group by to_char(s.pdate,'Mon-yyyy')
it is work fine.
How to solve the problem.
Thanks,
JenJen,
You can use this code
with sTable as (select to_date('01/01/2009', 'dd/mm/yyyy') pdate, 1 code from dual union all
select to_date('02/02/2009', 'dd/mm/yyyy') a, 2 code from dual union all
select to_date('01/03/2009', 'dd/mm/yyyy') d, 3 code from dual union all
select to_date('05/04/2009', 'dd/mm/yyyy') g, 4 code from dual union all
select to_date('05/05/2009', 'dd/mm/yyyy') g, 4 code from dual union all
select to_date('05/06/2009', 'dd/mm/yyyy') g, 4 code from dual union all
select to_date('05/07/2009', 'dd/mm/yyyy') g, 4 code from dual union all
select to_date('05/08/2009', 'dd/mm/yyyy') g, 4 code from dual union all
select to_date('05/09/2009', 'dd/mm/yyyy') g, 4 code from dual union all
select to_date('05/10/2009', 'dd/mm/yyyy') g, 4 code from dual union all
select to_date('05/11/2009', 'dd/mm/yyyy') g, 4 code from dual union all
select to_date('05/12/2009', 'dd/mm/yyyy') h, 5 code from dual)
select cnt, to_char(to_date(mnt||'01', 'yyyymmdd'), 'Mon-yyyy')
from (select count(*) cnt, to_char(s.pdate,'yyyymm') as mnt
from sTable s
group by to_char(s.pdate,'yyyymm')
order by to_char(s.pdate,'yyyymm')
CNT MONTH
1 Jan-2009
1 Feb-2009
1 Mar-2009
1 Apr-2009
1 May-2009
1 Jun-2009
1 Jul-2009
1 Aug-2009
1 Sep-2009
1 Oct-2009
1 Nov-2009
1 Dec-2009
12 rows selectedyour problem was that you are using a expresión in the order by (to_date...) that is distinct to the query results (to_char...).
Regards,
Mike -
How to write complex query with jpa criteria builder.
Hello,
I want to write a query in jpa criteriaquery. Here is the query:
SELECT node.category_name, (COUNT(parent.category_name) - 1) AS depth
FROM category_subcategories AS node,
category_subcategories AS parent
WHERE node.lft BETWEEN parent.lft AND parent.rgt
AND node.category_name = 'PORTABLE ELECTRONICS'
GROUP BY node.category_name
ORDER BY node.lft
Here is the code I come up with:
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<CategorySubcategories> cq = cb.createQuery( CategorySubcategories.class );
Root<CategorySubcategories> node = cq.from( CategorySubcategories.class );
Root<CategorySubcategories> parent = cq.from( CategorySubcategories.class );
Predicate p1 = cb.equal(node.get("categoryName"), categoryName);
Predicate p2 = cb.between(node.get("lft").as(Integer.class), parent.get("lft").as(Integer.class), parent.get("rgt").as(Integer.class));
Order nodeLft = cb.asc(node.get("lft"));
cq.multiselect(node.get("categoryName"), cb.count(parent.get("categoryName")))
.where(p1, p2)
.groupBy(node.get("categoryName"))
.orderBy(nodeLft);
return em.createQuery(cq).getResultList();
When I execue the test, it shown the following error:
Testcase: testDepthOfSubtree(au.com.houseware.server.ejb.entity.facade.CategorySubcategoriesFacadeTest): Caused an ERROR
org.hibernate.hql.ast.QuerySyntaxException: Unable to locate appropriate constructor on class [au.com.houseware.server.ejb.entity.CategorySubcategories] [select new au.com.houseware.server.ejb.entity.CategorySubcategories(generatedAlias0.categoryName, count(generatedAlias1.categoryName)) from au.com.houseware.server.ejb.entity.CategorySubcategories as generatedAlias0, au.com.houseware.server.ejb.entity.CategorySubcategories as generatedAlias1 where ( generatedAlias0.categoryName=:param0 ) and ( generatedAlias0.lft between generatedAlias1.lft and generatedAlias1.rgt ) group by generatedAlias0.categoryName]
java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: Unable to locate appropriate constructor on class [au.com.houseware.server.ejb.entity.CategorySubcategories] [select new au.com.houseware.server.ejb.entity.CategorySubcategories(generatedAlias0.categoryName, count(generatedAlias1.categoryName)) from au.com.houseware.server.ejb.entity.CategorySubcategories as generatedAlias0, au.com.houseware.server.ejb.entity.CategorySubcategories as generatedAlias1 where ( generatedAlias0.categoryName=:param0 ) and ( generatedAlias0.lft between generatedAlias1.lft and generatedAlias1.rgt ) group by generatedAlias0.categoryName]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1201)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:324)
at org.hibernate.ejb.criteria.CriteriaQueryCompiler.compile(CriteriaQueryCompiler.java:227)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:441)
at au.com.houseware.server.ejb.entity.facade.CategorySubcategoriesFacadeMock.findDepthOfSubtreeBy_categoryName(CategorySubcategoriesFacadeMock.java:228)
at au.com.houseware.server.ejb.entity.facade.CategorySubcategoriesFacadeTest.testDepthOfSubtree(CategorySubcategoriesFacadeTest.java:44)
Caused by: org.hibernate.hql.ast.QuerySyntaxException: Unable to locate appropriate constructor on class [au.com.houseware.server.ejb.entity.CategorySubcategories] [select new au.com.houseware.server.ejb.entity.CategorySubcategories(generatedAlias0.categoryName, count(generatedAlias1.categoryName)) from au.com.houseware.server.ejb.entity.CategorySubcategories as generatedAlias0, au.com.houseware.server.ejb.entity.CategorySubcategories as generatedAlias1 where ( generatedAlias0.categoryName=:param0 ) and ( generatedAlias0.lft between generatedAlias1.lft and generatedAlias1.rgt ) group by generatedAlias0.categoryName]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:261)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:306)
What is wrong with my criteriaQuery?
Any suggestion is very much appreciated.
Thanks
Sam
Edited by: 785102 on Mar 26, 2011 7:44 PMHello,
Thank you for your response.
If I remove CategorySubcateogires, netbeans complained:
incompatible types
required: javax.persistence.criteria.CriteriaQuery<au.com.houseware.server.ejb.entity.CategorySubcategories>
found: javax.persistence.criteria.CriteriaQuery<java.lang.Object>
When I removed all CategorySubcategories type and replaced it with Object like this:
public Collection<Object> findDepthOfSubtreeBy_categoryName(String categoryName) {
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Object> c = cb.createQuery();
Root<CategorySubcategories> node = c.from( CategorySubcategories.class );
Root<CategorySubcategories> parent = c.from( CategorySubcategories.class );
Predicate p1 = cb.equal(node.get("categoryName"), categoryName);
Order nodeLft = cb.asc(node.get("lft"));
c.multiselect(node.get("categoryName"), cb.count(parent.get("categoryName")))
.where(p1)
.groupBy(node.get("categoryName"))
.orderBy(nodeLft);
return em.createQuery(c).getResultList();
test main():
Collection<Object> list = ccFacade.findDepthOfSubtreeBy_categoryName("Houseware");
for (Iterator<Object> iter = list.iterator(); iter.hasNext();) {
CategorySubcategories cc = (CategorySubcategories) iter.next();
System.out.println(" name : "+cc.getCategoryName());
On execution, it thrown exception:
[Ljava.lang.Object; cannot be cast to au.com.houseware.server.ejb.entity.CategorySubcategories
Thanks a lot
Sam -
How to write a function with table name as parameter
I created a function like this:
create or replace function "GETNAME"
(did in NUMBER, dtable in VARCHAR2)
return VARCHAR2
is
dname varchar2(200);
begin
select lastname || ' ' || firstname
into dname from dtable
where id = did;
return dname;
end;
i got an error: table or view does not exist.
Could somebody tell me how to fix it?
Thanks,
Jenor by using a reference cursor: create or replace function dynamic_cursor (pTab varchar2)
return sys_refcursor as
c sys_refcursor;
begin
open c for 'select * from '|| pTab;
return c;
end;
SQL> exec :c := dnamic_cursor('emp');
SQL> exec :c := dynamic_cursor('emp');
PL/SQL procedure successfully completed.
SQL> print c;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7566 JONES MANAGER 7839 02-APR-81 2975 1000 20
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7788 SCOTT ANALYST 7566 09-DEC-82 3000 20
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 12-JAN-83 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7934 MILLER CLERK 7782 23-JAN-82 1300 10
7945 CINDY SALESMAN 7698 16-JAN-83 1800 30
7950 TINA SALESMAN 7698 18-JAN-83 1850 30
16 rows selected.
SQL>
Maybe you are looking for
-
IPod touch generation 4 8GB (iOS 7?)
Is iOS 7 compatible with iPod touch generation 4 8GB? I just want to know. Thanks, Adrienne
-
We are currently using mod_jk for load balancing our ATG Commerce Page Servers running on JBoss. There are many nice things about mod_jk: ajp support, jkstatus adminstration ability, performance, etc. However, there is a deficiency with mod_jk: It ca
-
Generating transport stream for dectek card - testing purposes
Hi I'm going to buy the recently released dectek card: DTA-110TSP in order to make MHP testing. Before getting it I asked about the possibility to use this card in order to make mhp testing... they assured me it is possible, but that I have to provid
-
Cacade Sharepoint List Web Part
hi, I created a custom view and insert 2 SP List Filter to filter the list content. The 2 SP List Filters are related, for example: Filter #1 - list of companies. Filter #2 - list of employees. I would like the Filter #2 to display only the list of e
-
Dear all, I am trying to make a sphere and cube on the same graph. I try to modify the code from http://www.vrupl.evl.uic.edu/LabAccidents/java3d if you run the following code, you can see only a cube. However, if you change the size of sphere from 0