Search Results

Search found 10693 results on 428 pages for 'reading'.

Page 28/428 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Reading bmp file for encrypting and decrypting txt file into it

    - by Shantanu Gupta
    I am trying to read a bmp file in C++(Turbo). But i m not able to print binary stream. I want to encode txt file into it and decrypt it. How can i do this. I read that bmp file header is of 54 byte. But how and where should i append txt file in bmp file. ? I know only Turbo C++, so it would be helpfull for me if u provide solution or suggestion related to topic for the same. int main() { ifstream fr; //reads ofstream fw; // wrrites to file char c; int random; clrscr(); char file[2][100]={"s.bmp","s.txt"}; fr.open(file[0],ios::binary);//file name, mode of open, here input mode i.e. read only if(!fr) cout<<"File can not be opened."; fw.open(file[1],ios::app);//file will be appended if(!fw) cout<<"File can not be opened"; while(!fr) cout<<fr.get(); // error should be here. but not able to find out what error is it fr.close(); fw.close(); getch(); } This code is running fine when i pass txt file in binary mode

    Read the article

  • error while reading Excel sheet

    - by Lalit
    Hi, I have code to read Excel from c3 language : DataTable dtChildrenData = new DataTable(); OdbcConnection oConn = null; try { if (File.Exists(strSheetPath)) { oConn = new OdbcConnection(); oConn.ConnectionString = @"DSN=Excel Files;DBQ=" + strSheetPath + @";DriverId=1046;FIL=excel 12.0;MaxBufferSize=2048;PageTimeout=5;"; OdbcCommand oComm = new OdbcCommand(); oComm.Connection = oConn; oComm.CommandText = "Select * From [Sheet1$]"; DataSet ds = new DataSet(); OdbcDataAdapter oAdapter = new OdbcDataAdapter(oComm); oConn.Open(); oAdapter.Fill(ds); dtChildrenData = ds.Tables[0]; } } finally { oConn.Close(); } return dtChildrenData; But getting this error when i deploy the web application on IIS. Wherere as it is running fine locally. ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified How to solve this. Please let me know if any information required to answer this question (about configuration)

    Read the article

  • reading a text file in java

    - by aks
    I want to read a text file containing a space sepearted vlaues.Values are integers. How can i read it and put it in a array list?? eg of contents of texx file 1 62 4 55 5 6 77 now i want a arraylist as [1, 62,4,55,5,6,77]. How do i do it in java?

    Read the article

  • Reading data from xml file

    - by Joy
    I have a currency converter application for iphone which uses web service. The web service is returning result in the following format:- <Date>4/5/2010</Date> <Time>7:18:09 AM</Time> <Amount>20</Amount> <ExchangeRate>44.7336419443466</ExchangeRate> <Result>894.672839</Result> I'm storing the whole xml file in an NSString variable called theXML. I want to show the value inside the result tag.How can i read the data from the xml file or from the string.. Thanks in advance..

    Read the article

  • Reading an embedded file from an ASP.NET Custom Server Control an rendering it

    - by Andreas Grech
    I currently have a file "abc.htm" in my Custom Server Control Project and it's Build Action is set to Embedded Resource. Now in the RenderContents(HtmlTextWriter output) method, I need to read that file and render it on the website. I am trying the following but it's to no avail: protected override void RenderContents(HtmlTextWriter output) { var providersURL = Page.ClientScript.GetWebResourceUrl(typeof (OpenIDSel), "OpenIDSelector.Providers.htm"); var fi = new FileInfo(providersURL); // <- exception here //the remaining code is to possibly render the file } This is an example of how the providersURL is: /WebResource.axd?d=kyU2OiYu6lwshLH4pRUCUmG-pzI4xDC1ii9u032IPWwUzMsFzFHzL3veInwslz8Y0&t=634056587753507131 FileInfo is throwing System.ArgumentException: Illegal characters in path.

    Read the article

  • Reading a binary file in perl: Bad File Descriptor

    - by Magicked
    I'm trying to read a binary file 40 bytes at a time, then check to see if all those bytes are 0x00, and if so ignore them. If not, it will write them back out to another file (basically just cutting out large blocks of null bytes). This may not be the most efficient way to do this, but I'm not worried about that. However, right now I'm getting a "Bad File Descriptor" error and I cannot figure out why. my $comp = "\x00" * 40; my $byte_count = 0; my $infile = "/home/magicked/image1"; my $outfile = "/home/magicked/image1_short"; open IN, "<$infile"; open OUT, ">$outfile"; binmode IN; binmode OUT; my ($buf, $data, $n); while (read (IN, $buf, 40)) { ### Problem is here ### $boo = 1; for ($i = 0; $i < 40; $i++) { if ($comp[$i] != $buf[$i]) { $i = 40; print OUT $buf; $byte_count += 40; } } } die "Problems! $!\n" if $!; close OUT; close IN; I marked with a comment where it is breaking. Thanks for any help!

    Read the article

  • Console class in java Exception in reading password

    - by satheesh
    Hi, i am trying to use Console class in java. with this code import java.io.Console; public class ConsoleClass { public static void main(String[] args){ Console c=System.console(); char[] pw; pw=c.readPassword("%s","pw :"); for(char ch:pw){ c.format("%c",ch); } c.format("\n"); MyUtility mu =new MyUtility(); while(true){ String name=c.readLine("%s", "input?: "); c.format("output: %s \n",mu.doStuff(name)); } } } class MyUtility{ String doStuff(String arg1){ return "result is " +arg1; } } here i am getting NullPointerException when i tried to run in netbeans but i am not getting any Exception when tried to run in cmd with out netbeans IDE.Why?

    Read the article

  • having trouble with jpa, looks to be reading from cache when told to ignore

    - by jeff
    i'm using jpa and eclipselink. it says version 2.0.2.v20100323-r6872 for eclipselink. it's an SE application, small. local persistence unit. i am using a postgres database. i have some code the wakes up once per second and does a jpa query on a table. it's polling to see whether some fields on a given record change. but when i update a field in sql, it keeps showing the same value each time i query it. and this is after waiting, creating a new entitymanager, and giving a query hint. when i query the table from sql or python, i can see the changed field. but from within my jpa query, once i've read the value, it never changes in later executions of the query -- even though the entity manager has been recreated. i've tried telling it to not look in the cache. but it seems to ignore that. very puzzling, can you help please? here is the method. i call this once every 3 seconds. the tgt.getTrlDlrs() println shows me i get the same value for this field on every call of the method ("value won't change"). even if i change the field in the database. when i query the record from outside java, i see the change right away. also, if i stop the java program and restart it, i see the new value printed out immediately: public void exitChk(EntityManagerFactory emf, Main_1 mn){ // this will be a list of the trade close targets that are active List<Pairs01Tradeclosetgt> mn_res = new ArrayList<Pairs01Tradeclosetgt>(); //this is a list of the place number in the array list above //of positions to close ArrayList<Integer> idxsToCl = new ArrayList<Integer>(); EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.clear(); String qryTxt = "SELECT p FROM Pairs01Tradeclosetgt p WHERE p.isClosed = :isClosed AND p.isFilled = :isFilled"; Query qMn = em.createQuery(qryTxt); qMn.setHint(QueryHints.CACHE_USAGE, CacheUsage.DoNotCheckCache); qMn.setParameter("isClosed", false); qMn.setParameter("isFilled", true); mn_res = (List<Pairs01Tradeclosetgt>) qMn.getResultList(); // are there any trade close targets we need to check for closing? if (mn_res!=null){ //if yes, see whether they've hit their target for (int i=0;i<mn_res.size();i++){ Pairs01Tradeclosetgt tgt = new Pairs01Tradeclosetgt(); tgt = mn_res.get(i); System.out.println("value won't change:" + tgt.getTrlDlrs()); here is my entity class (partial): @Entity @Table(name = "pairs01_tradeclosetgt", catalog = "blah", schema = "public") @NamedQueries({ @NamedQuery(name = "Pairs01Tradeclosetgt.findAll", query = "SELECT p FROM Pairs01Tradeclosetgt p"), @NamedQuery(name = "Pairs01Tradeclosetgt.findByClseRatio", query = "SELECT p FROM Pairs01Tradeclosetgt p WHERE p.clseRatio = :clseRatio")}) public class Pairs01Tradeclosetgt implements Serializable { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) @Column(name = "id") @SequenceGenerator(name="pairs01_tradeclosetgt_id_seq", allocationSize=1) @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "pairs01_tradeclosetgt_id_seq") private Integer id; and my persitence unit: <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="testpu" transaction-type="RESOURCE_LOCAL"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <class>mourv02.Pairs01Quotes</class> <class>mourv02.Pairs01Pair</class> <class>mourv02.Pairs01Trderrs</class> <class>mourv02.Pairs01Tradereq</class> <class>mourv02.Pairs01Tradeclosetgt</class> <class>mourv02.Pairs01Orderstatus</class> <properties> <property name="javax.persistence.jdbc.url" value="jdbc:postgresql://192.168.1.80:5432/blah"/> <property name="javax.persistence.jdbc.password" value="secret"/> <property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/> <property name="javax.persistence.jdbc.user" value="noone"/> </properties> </persistence-unit> </persistence>

    Read the article

  • Reading PGP key information

    - by calccrypto
    can someone show a description of the information of what a pgp looks like if only the descriptions were there but not the actual information? something like (i dont remember if the values are correct): packet-type[4 bits], total length in bytes[16 bits], packet version type [4 bits], creation-time[32 bits], encryption-algorithm[8 bits], ...,etc,etc ive tried to understand rfc4880, but its tedious and confusing. so far, i am think i have extracted the 4 i wrote above, but i cant seem to get the rest of the information out. can anyone help? i know i can just find some pgp program, but the whole point of this is to allow me to learn how those programs work in the first place

    Read the article

  • C# Reading the registry and Wow6432Node key

    - by Jade M
    Hi all, I have come code that reads the registry and looks for a value in HKEY_LOCAL_MACHINE\Software\App\ but when running on 64bit versions of Windows the value is under HKEY_LOCAL_MACHINE\Software\Wow6432Node\App. How should I best approach this? Do I need a 64bit installer or should I rewrite my code to detect both places? Thanks

    Read the article

  • Reading a file used by another process

    - by Tophe
    I know this has been up for discussion but I can't find an answer to my specific problem. I am monitoring a text file that is being written to by a server program. Every time the file is changed the content will be outputted to a window in my program. The problem is of course, that I can't use the Streamreader on the file as it is being "used by another process". Also setting up a Filestream with ReadWrite won't do any good since I cannot control the process that is using the file. However... You CAN open the file in notepad, so somehow it must be possible to access it even though the server is using it. Is there a good way around this? Should I monitor the file, make a temp copy of it when it changes, read the temp copy and the delete the temp copy. I need to get hold of the text in the file whenever the server changes it.

    Read the article

  • Reading web-service information from assembly app.config file

    - by Benjamin Ortuzar
    I have a plugin architecture solution written in .NET C# 3.5, where each plug-in is an assembly loaded by the main project. Each plug-in connects to a different web-service, so I would like to have the configuration of that plugin in its own plugin.dll.config file instead of having it in the app.config of the main project. I have been looking around and I saw that i could load from each class its own config file: // Get the application configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap,userLevel) I see how that would help me get the basic settings from the appSettings section, but I cant see a way to read the web-service information stored in the plugin.dll.config file. Any help on how to approach this situation is very welcome.

    Read the article

  • Reading POM's with it's children

    - by khmarbaise
    Based on the post it is mentioned (By Brett Porter) that a POM can be read. What i need is to read not only a single pom. I need to read the whole tree of pom's in a multimodule build. Starting with the root pom and it should read automatically the child pom's if it's possible? I need to do this in separate Java Code not in relationship with Maven itself.

    Read the article

  • Reading data from text file in C

    - by themake
    I have a text file which contains words separated by space. I want to take each word from the file and store it. So i have opened the file but am unsure how to assign the word to a char. FILE *fp; fp = fopen("file.txt", "r"); //then i want char one = the first word in the file char two = the second word in the file

    Read the article

  • International JRE6 or JDK6 or reading a file in "cp037" encoding scheme

    - by Reddy
    I have been trying to read a file in "cp037" encoding scheme using JAVA. I able to read a file in basic encoding schemes like UTF-8, UTF16 etc...After a bit of research on the internet i came to know that we need charset.jar or international version of JRE be installed to support extended encoding schemes. Can anyone send me a link for international version of JRE6 or JDK6. or is there any better way that i could read a file in cp037 encoding scheme. P.S: cp037 is a character encoding scheme supported by IBM Mainframes. All i need is to display a file in windows, which is being generated on IBM Mainframes machine, using a java program. Thanks in advance for your help... :-)

    Read the article

  • Reading a line backwards

    - by Jimmy
    Hi, I'm using regular expression to count the total spaces in a line (first occurrence). match(/^\s*/)[0].length; However this reads it from the start to end, How can I read it from end to start. Thanks

    Read the article

  • Integration Services Throws an Error Reading Access 2007 Table

    - by Eric Flamm
    [Participant Table [1994]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "I:\My Documents\Flamm Consulting\Migrations.accdb" failed with error code 0xC0209303. There may be error messages posted before this with more information on why the AcquireConnection method call failed. Frankly, I'm confused about how SSIS should connect to Access 2007 - the UI just isn't very friendly - there's no file browser, for example. I'm wondering if there's something wrong with my install - missing drivers, etc.

    Read the article

  • problem in reading textbox value in li

    - by user269431
    I have a ul as follows: It can`t read the text values neither with val() nor text(). Can anyone help please <ul id="mylist"> <li id="1"><input type = "text" value= "aaaaa" /></li> <li id="2"><input type = "text" value= "bbbb" /></li> <li id="3"><input type = "text" value= "ccc" /></li> <li id="5"><input type = "text" value= "dddd" /></li> </ul><button id="Button1">Add Another2</button> var values = []; $(document).ready(function() { $("#Button1").click(function() { $( "#mylist li text").each(function() { alert($(this).text()); values.push($(this).text()); }); }); });

    Read the article

  • Reading and writing to SysV shared memory without synchronization (use of semaphores, C/C++, Linux)

    - by user363778
    Hi, I use SysV shared memory to let two processes communicate with each other. I do not want the code to become to complex so I wondered if I really had to use semaphores to synchronize the access to the shared memory. In my C/C++ program the parent process reads from the shared memory and the child process writes to the shared memory. I wrote two test applications to see if I could produce some kind of error like a segmentation fault, but I couldn't (Ubuntu 10.04 64bit). Even two processes writing non stop in a while loop to the same shared memory did not produce any error. I hope someone has experience concerning this matter and can tell me if I really must use semaphores to synchronize the access or if I am OK without synchronization. Thanks

    Read the article

  • Reading a C/C++ data structure in C# from a byte array

    - by Chris Miller
    What would be the best way to fill a C# struct from a byte[] array where the data was from a C/C++ struct? The C struct would look something like this (my C is very rusty): typedef OldStuff { CHAR Name[8]; UInt32 User; CHAR Location[8]; UInt32 TimeStamp; UInt32 Sequence; CHAR Tracking[16]; CHAR Filler[12];} And would fill something like this: [StructLayout(LayoutKind.Explicit, Size = 56, Pack = 1)]public struct NewStuff{ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(0)] public string Name; [MarshalAs(UnmanagedType.U4)] [FieldOffset(8)] public uint User; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(12)] public string Location; [MarshalAs(UnmanagedType.U4)] [FieldOffset(20)] public uint TimeStamp; [MarshalAs(UnmanagedType.U4)] [FieldOffset(24)] public uint Sequence; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] [FieldOffset(28)] public string Tracking;} What is best way to copy OldStuff to NewStuff, if OldStuff was passed as byte[] array? I'm currently doing something like the following, but it feels kind of clunky. GCHandle handle;NewStuff MyStuff;int BufferSize = Marshal.SizeOf(typeof(NewStuff));byte[] buff = new byte[BufferSize];Array.Copy(SomeByteArray, 0, buff, 0, BufferSize);handle = GCHandle.Alloc(buff, GCHandleType.Pinned);MyStuff = (NewStuff)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(NewStuff));handle.Free(); Is there better way to accomplish this?

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >