Search Results

Search found 89549 results on 3582 pages for 'large file support'.

Page 87/3582 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • Reading data in from file

    - by user667430
    Hi Here is link if you want to download application: Simple banking app Text file with data to read I am trying to create a simple banking application that reads in data from a text file. So far i have managed to read in all the customers which there are 20 of them. However when reading in the accounts and transactions stuff it only reads in 20 but there is alot more in the text file. Here is what i have so far. I think it has something to do with the nested for loop in the getNextCustomer method. using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; namespace e_SOFT_Banking { public partial class Form1 : Form { public static ArrayList bankDetails = new ArrayList(); public static ArrayList accDetails = new ArrayList(); public static ArrayList tranDetails = new ArrayList(); string inputDataFile = @"C:\e-SOFT_v1.txt"; const int numCustItems = 14; const int numAccItems = 7; const int numTransItems = 5; public Form1() { InitializeComponent(); setUpBank(); } private void btnShowData_Click_1(object sender, EventArgs e) { showListsOfCust(); } private void setUpBank() { readData(); } private void showListsOfCust() { listBox1.Items.Clear(); foreach (Customer c in bankDetails) listBox1.Items.Add(c.getCustomerNumber() + " " + c.getCustomerTitle() + " " + c.getFirstName() + " " + c.getInitials() + " " + c.getSurname() + " " + c.getDateOfBirth() + " " + c.getHouseNameNumber() + " " + c.getStreetName() + " " + c.getArea() + " " + c.getCityTown() + " " + c.getCounty() + " " + c.getPostcode() + " " + c.getPassword() + " " + c.getNumberAccounts()); foreach (Account a in accDetails) listBox1.Items.Add(a.getAccSort() + " " + a.getAccNumber() + " " + a.getAccNick() + " " + a.getAccDate() + " " + a.getAccCurBal() + " " + a.getAccOverDraft() + " " + a.getAccNumTrans()); foreach (Transaction t in tranDetails) listBox1.Items.Add(t.getDate() + " " + t.getType() + " " + t.getDescription() + " " + t.getAmount() + " " + t.getBalAfter()); } private void readData() { StreamReader readerIn = null; Transaction curTrans; Account curAcc; Customer curCust; bool anyMoreData; string[] customerData = new string[numCustItems]; string[] accountData = new string[numAccItems]; string[] transactionData = new string[numTransItems]; if (readOK(inputDataFile, ref readerIn)) { anyMoreData = getNextCustomer(readerIn, customerData, accountData, transactionData); while (anyMoreData == true) { curCust = new Customer(customerData[0], customerData[1], customerData[2], customerData[3], customerData[4], customerData[5], customerData[6], customerData[7], customerData[8], customerData[9], customerData[10], customerData[11], customerData[12], customerData[13]); curAcc = new Account(accountData[0], accountData[1], accountData[2], accountData[3], accountData[4], accountData[5], accountData[6]); curTrans = new Transaction(transactionData[0], transactionData[1], transactionData[2], transactionData[3], transactionData[4]); bankDetails.Add(curCust); accDetails.Add(curAcc); tranDetails.Add(curTrans); anyMoreData = getNextCustomer(readerIn, customerData, accountData, transactionData); } if (readerIn != null) readerIn.Close(); } } private bool getNextCustomer(StreamReader inNext, string[] nextCustomerData, string[] nextAccountData, string[] nextTransactionData) { string nextLine; int numCItems = nextCustomerData.Count(); int numAItems = nextAccountData.Count(); int numTItems = nextTransactionData.Count(); for (int i = 0; i < numCItems; i++) { nextLine = inNext.ReadLine(); if (nextLine != null) { nextCustomerData[i] = nextLine; if (i == 13) { int cItems = Convert.ToInt32(nextCustomerData[13]); for (int q = 0; q < cItems; q++) { for (int a = 0; a < numAItems; a++) { nextLine = inNext.ReadLine(); nextAccountData[a] = nextLine; if (a == 6) { int aItems = Convert.ToInt32(nextAccountData[6]); for (int w = 0; w < aItems; w++) { for (int t = 0; t < numTItems; t++) { nextLine = inNext.ReadLine(); nextTransactionData[t] = nextLine; } } } } } } } else return false; } return true; } private bool readOK(string readFile, ref StreamReader readerIn) { try { readerIn = new StreamReader(readFile); return true; } catch (FileNotFoundException notFound) { MessageBox.Show("ERROR Opening file (when reading data in)" + " - File could not be found.\n" + notFound.Message); return false; } catch (Exception e) { MessageBox.Show("ERROR Opening File (when reading data in)" + "- Operation failed.\n" + e.Message); return false; } } } } I also have three classes one for customers, one for accounts and one for transactions, which follow in that order. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace e_SOFT_Banking { class Customer { private string customerNumber; private string customerTitle; private string firstName; private string initials; //not required - defaults to null private string surname; private string dateOfBirth; private string houseNameNumber; private string streetName; private string area; //not required - defaults to null private string cityTown; private string county; private string postcode; private string password; private int numberAccounts; public Customer(string theCustomerNumber, string theCustomerTitle, string theFirstName, string theInitials, string theSurname, string theDateOfBirth, string theHouseNameNumber, string theStreetName, string theArea, string theCityTown, string theCounty, string thePostcode, string thePassword, string theNumberAccounts) { customerNumber = theCustomerNumber; customerTitle = theCustomerTitle; firstName = theFirstName; initials = theInitials; surname = theSurname; dateOfBirth = theDateOfBirth; houseNameNumber = theHouseNameNumber; streetName = theStreetName; area = theArea; cityTown = theCityTown; county = theCounty; postcode = thePostcode; password = thePassword; setNumberAccounts(theNumberAccounts); } public string getCustomerNumber() { return customerNumber; } public string getCustomerTitle() { return customerTitle; } public string getFirstName() { return firstName; } public string getInitials() { return initials; } public string getSurname() { return surname; } public string getDateOfBirth() { return dateOfBirth; } public string getHouseNameNumber() { return houseNameNumber; } public string getStreetName() { return streetName; } public string getArea() { return area; } public string getCityTown() { return cityTown; } public string getCounty() { return county; } public string getPostcode() { return postcode; } public string getPassword() { return password; } public int getNumberAccounts() { return numberAccounts; } public void setCustomerNumber(string inCustomerNumber) { customerNumber = inCustomerNumber; } public void setCustomerTitle(string inCustomerTitle) { customerTitle = inCustomerTitle; } public void setFirstName(string inFirstName) { firstName = inFirstName; } public void setInitials(string inInitials) { initials = inInitials; } public void setSurname(string inSurname) { surname = inSurname; } public void setDateOfBirth(string inDateOfBirth) { dateOfBirth = inDateOfBirth; } public void setHouseNameNumber(string inHouseNameNumber) { houseNameNumber = inHouseNameNumber; } public void setStreetName(string inStreetName) { streetName = inStreetName; } public void setArea(string inArea) { area = inArea; } public void setCityTown(string inCityTown) { cityTown = inCityTown; } public void setCounty(string inCounty) { county = inCounty; } public void setPostcode(string inPostcode) { postcode = inPostcode; } public void setPassword(string inPassword) { password = inPassword; } public void setNumberAccounts(string inNumberAccounts) { try { numberAccounts = Convert.ToInt32(inNumberAccounts); } catch (FormatException invalidInput) { System.Windows.Forms.MessageBox.Show("ERROR" + invalidInput.Message + "Please enter a valid number"); } } } } Accounts: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace e_SOFT_Banking { class Account { private string accSort; private Int64 accNumber; private string accNick; private string accDate; //not required - defaults to null private double accCurBal; private double accOverDraft; private int accNumTrans; public Account(string theAccSort, string theAccNumber, string theAccNick, string theAccDate, string theAccCurBal, string theAccOverDraft, string theAccNumTrans) { accSort = theAccSort; setAccNumber(theAccNumber); accNick = theAccNick; accDate = theAccDate; setAccCurBal(theAccCurBal); setAccOverDraft(theAccOverDraft); setAccNumTrans(theAccNumTrans); } public string getAccSort() { return accSort; } public long getAccNumber() { return accNumber; } public string getAccNick() { return accNick; } public string getAccDate() { return accDate; } public double getAccCurBal() { return accCurBal; } public double getAccOverDraft() { return accOverDraft; } public int getAccNumTrans() { return accNumTrans; } public void setAccSort(string inAccSort) { accSort = inAccSort; } public void setAccNumber(string inAccNumber) { try { accNumber = Convert.ToInt64(inAccNumber); } catch (FormatException invalidInput) { System.Windows.Forms.MessageBox.Show("ERROR" + invalidInput.Message + "Please enter a valid number"); } } public void setAccNick(string inAccNick) { accNick = inAccNick; } public void setAccDate(string inAccDate) { accDate = inAccDate; } public void setAccCurBal(string inAccCurBal) { try { accCurBal = Convert.ToDouble(inAccCurBal); } catch (FormatException invalidInput) { System.Windows.Forms.MessageBox.Show("ERROR" + invalidInput.Message + "Please enter a valid number"); } } public void setAccOverDraft(string inAccOverDraft) { try { accOverDraft = Convert.ToDouble(inAccOverDraft); } catch (FormatException invalidInput) { System.Windows.Forms.MessageBox.Show("ERROR" + invalidInput.Message + "Please enter a valid number"); } } public void setAccNumTrans(string inAccNumTrans) { try { accNumTrans = Convert.ToInt32(inAccNumTrans); } catch (FormatException invalidInput) { System.Windows.Forms.MessageBox.Show("ERROR" + invalidInput.Message + "Please enter a valid number"); } } } } Transactions: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace e_SOFT_Banking { class Transaction { private string date; private string type; private string description; private double amount; //not required - defaults to null private double balAfter; public Transaction(string theDate, string theType, string theDescription, string theAmount, string theBalAfter) { date = theDate; type = theType; description = theDescription; setAmount(theAmount); setBalAfter(theBalAfter); } public string getDate() { return date; } public string getType() { return type; } public string getDescription() { return description; } public double getAmount() { return amount; } public double getBalAfter() { return balAfter; } public void setDate(string inDate) { date = inDate; } public void setType(string inType) { type = inType; } public void setDescription(string inDescription) { description = inDescription; } public void setAmount(string inAmount) { try { amount = Convert.ToDouble(inAmount); } catch (FormatException invalidInput) { System.Windows.Forms.MessageBox.Show("ERROR" + invalidInput.Message + "Please enter a valid number"); } } public void setBalAfter(string inBalAfter) { try { balAfter = Convert.ToDouble(inBalAfter); } catch (FormatException invalidInput) { System.Windows.Forms.MessageBox.Show("ERROR" + invalidInput.Message + "Please enter a valid number"); } } } } Any help greatly appreciated.

    Read the article

  • Transfer file over ssh

    - by datasunny
    Hi all, In ssh protocol, is there a mechanism for file transfer? Im working on a existing code base which already has ssh facilities code. Now i need to transfer files over ssh connection. If ssh protocol already support it, i don't have to integrate scp stuff into it. Thanks.

    Read the article

  • Enhanced REST Support in Oracle Service Bus 11gR1

    - by jeff.x.davies
    In a previous entry on REST and Oracle Service Bus (see http://blogs.oracle.com/jeffdavies/2009/06/restful_services_with_oracle_s_1.html) I encoded the REST query string really as part of the relative URL. For example, consider the following URI: http://localhost:7001/SimpleREST/Products/id=1234 Now, technically there is nothing wrong with this approach. However, it is generally more common to encode the search parameters into the query string. Take a look at the following URI that shows this principle http://localhost:7001/SimpleREST/Products?id=1234 At first blush this appears to be a trivial change. However, this approach is more intuitive, especially if you are passing in multiple parameters. For example: http://localhost:7001/SimpleREST/Products?cat=electronics&subcat=television&mfg=sony The above URI is obviously used to retrieve a list of televisions made by Sony. In prior versions of OSB (before 11gR1PS3), parsing the query string of a URI was more difficult than in the current release. In 11gR1PS3 it is now much easier to parse the query strings, which in turn makes developing REST services in OSB even easier. In this blog entry, we will re-implement the REST-ful Products services using query strings for passing parameter information. Lets begin with the implementation of the Products REST service. This service is implemented in the Products.proxy file of the project. Lets begin with the overall structure of the service, as shown in the following screenshot. This is a common pattern for REST services in the Oracle Service Bus. You implement different flows for each of the HTTP verbs that you want your service to support. Lets take a look at how the GET verb is implemented. This is the path that is taken of you were to point your browser to: http://localhost:7001/SimpleREST/Products/id=1234 There is an Assign action in the request pipeline that shows how to extract a query parameter. Here is the expression that is used to extract the id parameter: $inbound/ctx:transport/ctx:request/http:query-parameters/http:parameter[@name="id"]/@value The Assign action that stores the value into an OSB variable named id. Using this type of XPath statement you can query for any variables by name, without regard to their order in the parameter list. The Log statement is there simply to provided some debugging info in the OSB server console. The response pipeline contains a Replace action that constructs the response document for our rest service. Most of the response data is static, but the ID field that is returned is set based upon the query-parameter that was passed into the REST proxy. Testing the REST service with a browser is very simple. Just point it to the URL I showed you earlier. However, the browser is really only good for testing simple GET services. The OSB Test Console provides a much more robust environment for testing REST services, no matter which HTTP verb is used. Lets see how to use the Test Console to test this GET service. Open the OSB we console (http://localhost:7001/sbconsole) and log in as the administrator. Click on the Test Console icon (the little "bug") next to the Products proxy service in the SimpleREST project. This will bring up the Test Console browser window. Unlike SOAP services, we don't need to do much work in the request document because all of our request information will be encoded into the URI of the service itself. Belore the Request Document section of the Test Console is the Transport section. Expand that section and modify the query-parameters and http-method fields as shown in the next screenshot. By default, the query-parameters field will have the tags already defined. You just need to add a tag for each parameter you want to pass into the service. For out purposes with this particular call, you'd set the quer-parameters field as follows: <tp:parameter name="id" value="1234" /> </tp:query-parameters> Now you are ready to push the Execute button to see the results of the call. That covers the process for parsing query parameters using OSB. However, what if you have an OSB proxy service that needs to consume a REST-ful service? How do you tell OSB to pass the query parameters to the external service? In the sample code you will see a 2nd proxy service called CallREST. It invokes the Products proxy service in exactly the same way it would invoke any REST service. Our CallREST proxy service is defined as a SOAP service. This help to demonstrate OSBs ability to mediate between service consumers and service providers, decreasing the level of coupling between them. If you examine the message flow for the CallREST proxy service, you'll see that it uses an Operational branch to isolate processing logic for each operation that is defined by the SOAP service. We will focus on the getProductDetail branch, that calls the Products REST service using the HTTP GET verb. Expand the getProduct pipeline and the stage node that it contains. There is a single Assign statement that simply extracts the productID from the SOA request and stores it in a local OSB variable. Nothing suprising here. The real work (and the real learning) occurs in the Route node below the pipeline. The first thing to learn is that you need to use a route node when calling REST services, not a Service Callout or a Publish action. That's because only the Routing action has access to the $oubound variable, especially when invoking a business service. The Routing action contains 3 Insert actions. The first Insert action shows how to specify the HTTP verb as a GET. The second insert action simply inserts the XML node into the request. This element does not exist in the request by default, so we need to add it manually. Now that we have the element defined in our outbound request, we can fill it with the parameters that we want to send to the REST service. In the following screenshot you can see how we define the id parameter based on the productID value we extracted earlier from the SOAP request document. That expression will look for the parameter that has the name id and extract its value. That's all there is to it. You now know how to take full advantage of the query parameter parsing capability of the Oracle Service Bus 11gR1PS2. Download the sample source code here: rest2_sbconfig.jar Ubuntu and the OSB Test Console You will get an error when you try to use the Test Console with the Oracle Service Bus, using Ubuntu (or likely a number of other Linux distros also). The error (shown below) will state that the Test Console service is not running. The fix for this problem is quite simple. Open up the WebLogic Server administrator console (usually running at http://localhost:7001/console). In the Domain Structure window on the left side of the console, select the Servers entry under the Environment heading. The select the Admin Server entry in the main window of the console. By default, you should be viewing the Configuration tabe and the General sub tab in the main window. Look for the Listen Address field. By default it is blank, which means it is listening on all interfaces. For some reason Ubuntu doesn't like this. So enter a value like localhost or the specific IP address or DNS name for your server (usually its just localhost in development envirionments). Save your changes and restart the server. Your Test Console will now work correctly.

    Read the article

  • Handling Indirection and keeping layers of method calls, objects, and even xml files straight

    - by Cervo
    How do you keep everything straight as you trace deeply into a piece of software through multiple method calls, object constructors, object factories, and even spring wiring. I find that 4 or 5 method calls are easy to keep in my head, but once you are going to 8 or 9 calls deep it gets hard to keep track of everything. Are there strategies for keeping everything straight? In particular, I might be looking for how to do task x, but then as I trace down (or up) I lose track of that goal, or I find multiple layers need changes, but then I lose track of which changes as I trace all the way down. Or I have tentative plans that I find out are not valid but then during the tracing I forget that the plan is invalid and try to consider the same plan all over again killing time.... Is there software that might be able to help out? grep and even eclipse can help me to do the actual tracing from a call to the definition but I'm more worried about keeping track of everything including the de-facto plan for what has to change (which might vary as you go down/up and realize the prior plan was poor). In the past I have dealt with a few big methods that you trace and pretty much can figure out what is going on within a few calls. But now there are dozens of really tiny methods, many just a single call to another method/constructor and it is hard to keep track of them all.

    Read the article

  • At what visitor share do you stop supporting a given browser?

    - by adam
    I'm lead dev for a large website which has a higher than average percentage of IE6 users - about 4.4% of our audience. Our new version is going to make use of progressive enhancement - including transitions and effects as well as rounded corners, gradients, web fonts and other CSS techniques. Obviously there are cross-browser ways to achieve most of these things which require various amounts of work to implement. What I'm currently looking into - and what I'd like your experiences of - is how to decide at what point we draw the line between providing an enhanced experience vs just supporting the functionality. FYI, I believe that this question meets the six guidelines for great subjective questions as defined in the FAQ. I'm after answers detailing why and how, not too short, with constructive comments, experiences, facts and references. Thanks! Adam

    Read the article

  • How is architectural design done in an agile environment?

    - by B?????
    I have read Principles for the Agile Architect, where they defined next principles : Principle #1 The teams that code the system design the system. Principle #2 Build the simplest architecture that can possibly work. Principle #3 When in doubt, code it out. Principle #4 They build it, they test it. Principle #5 The bigger the system, the longer the runway. Principle #6 System architecture is a role collaboration. Principle #7 There is no monopoly on innovation. The paper says that most of the architecture design is done during the coding phase, and only system design before that. That is fine. So, how is the system design done? Using UML? Or a document that defines interfaces and major blocks? Maybe something else?

    Read the article

  • Excel 2007 file writer in C# results in a corrupt file

    - by Martin
    Hi, I am using a BinaryReader to read an Excel 2007 file from an Exchange mailbox using a OWA, the file is then written to disk using a BinaryWriter. My problem is that the two files don't match when the writer finishes. Worse still Excel 2007 won't open the writen file. Previously Excel 2003 has had no problem with the solution below. And Excel 2007 doesn't have an issue if the file is an Excel 2003 format file, only if the file format is Excel 2007 (*.xlsx). BinaryReader: using(System.IO.Stream stream = resource.GetInputStream(attachedFiles[k].Address)) { using(System.IO.BinaryReader br = new System.IO.BinaryReader(stream)) { attachment.Data = new byte[attachedFiles[k].Size]; int bufPosn=0, len=0; while ((len = br.Read( attachment.Data, bufPosn, attachment.Data.Length-bufPosn )) > 0) { bufPosn += len; } br.Close(); } } BinaryWriter: FileStream fs = new FileStream(fileName, FileMode.Create); BinaryWriter binWriter = new BinaryWriter(fs); binWriter.Write( content, 0, content.Length ); binWriter.Close(); fs.Close(); Suggestions gratfully received.

    Read the article

  • batch file to merge .js files from subfolders into one combined file

    - by Andrew Johns
    I'm struggling to get this to work. Plenty of examples on the web, but they all do something just slightly different to what I'm aiming to do, and every time I think I can solve it, I get hit by an error that means nothing to me. After giving up on the JSLint.VS plugin, I'm attempting to create a batch file that I can call from a Visual Studio build event, or perhaps from cruise control, which will generate JSLint warnings for a project. The final goal is to get a combined js file that I can pass to jslint, using: cscript jslint.js < tmp.js which would validate that my scripts are ready to be combined into one file for use in a js minifier, or output a bunch of errors using standard output. but the js files that would make up tmp.js are likely to be in multiple subfolders in the project, e.g: D:\_projects\trunk\web\projectname\js\somefile.debug.js D:\_projects\trunk\web\projectname\js\jquery\plugins\jquery.plugin.js The ideal solution would be to be able to call a batch file along the lines of: jslint.bat %ProjectPath% and this would then combine all the js files within the project into one temp js file. This way I would have flexibility in which project was being passed to the batch file. I've been trying to make this work with copy, xcopy, type, and echo, and using a for do loop, with dir /s etc, to make it do what I want, but whatever I try I get an error.

    Read the article

  • Accessing an excel file throws OleDbException but keeps handle on file

    - by Jonn
    Really odd that I'd get an oledbexception but turns out that the file's handle is still with the original file. I've been searching through google and keep finding the same problem but no solutions. Connection String: "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filePath + ";" + "Extended Properties=Excel 8.0;"; Note that it works on every other file except a particular excel file. Exception: System.Data.OleDb.OleDbException: No error information available: E_UNEXPECTED(0x8000FFFF). And then I have exception handling like this: try { IEnumerable<string> worksheetNames = GetWorkbookWorksheetNames(connString); DataSet ds; foreach (string worksheetName in worksheetNames) { OleDbDataAdapter dataAdapter = new OleDbDataAdapter("SELECT * FROM [" + worksheetName + "]", connString); ds = new DataSet(); dataAdapter.Fill(ds, "ExcelInfo"); DataTable dt = ds.Tables["ExcelInfo"]; entityList.AddRange(GetDataFromDataTable(dt, worksheetName)); } } catch (OleDbException ex) { File.Move(filePath, filePath + ".invalidFormat.xls"); } Has anyone else encountered this behavior? And I'm not sure how to handle an error that keeps the handle on the file I'm supposed to process. It sort of freezes everything in place.

    Read the article

  • Pass a variable from the source file to an included file in PHP

    - by Alpha1
    For my website I want to store the general format of the site in a single PHP file in a single location, and each of the different pages content in the local location of the page. I then want to pass the title and content address to the included file via a variable. However I can't get the included format file to read the variables storing the title and content data. AKA, the called file for the individual page would be: <?php $title = 'Some Title'; $source_file = 'content.php'; readfile('http:...../format.php'); ?> The format file would be: <html> ... <title> <?php echo $title; ?> </title> ... <?php include($source_file); ?> ... I recall reading somewhere I need to include something to get the variables at the start of the format file, however I can't remember what it is or find where I found that information.

    Read the article

  • Android File Picker

    - by GuyNoir
    Is there a good solution for picking a file in an android application? I need the user to be able to browse their SD card for a file they would like to load. However, it cannot use an outside application (like andExplorer). It must stay contained inside my application. I saw one a while ago that's hosted on google code and used by the Gameboid, SNESoid and other similar emulators to pick roms. If any one can point me to that one that'd be just as great. Thanks!

    Read the article

  • SQLite file locking and DropBox

    - by Alex Jenter
    I'm developing an app in Visual C++ that uses an SQLite3 DB for storing data. Usually it sits in the tray most of the time. I also would like to enable putting my app in a DropBox folder to share it across several PCs. It worked really well up until DropBox has recently updated itself. And now it says that it "can't sync the file in use". The SQLite file is open in my app, but the lock is shared. There are some prepared statements, but all are reset immediately after using step. Is there any way to enable synchronizing of an open SQLite database file? Thanks! Here is the simple wrapper that I use just for testing (no error handling), in case this helps: class Statement { private: Statement(sqlite3* db, const std::wstring& sql) : db(db) { sqlite3_prepare16_v2(db, sql.c_str(), sql.length() * sizeof(wchar_t), &stmt, NULL); } public: ~Statement() { sqlite3_finalize(stmt); } public: void reset() { sqlite3_reset(stmt); } int step() { return sqlite3_step(stmt); } int getInt(int i) const { return sqlite3_column_int(stmt, i); } tstring getText(int i) const { const wchar_t* v = (const wchar_t*)sqlite3_column_text16(stmt, i); int sz = sqlite3_column_bytes16(stmt, i) / sizeof(wchar_t); return std::wstring(v, v + sz); } private: friend class Database; sqlite3* db; sqlite3_stmt* stmt; }; class Database { public: Database(const std::wstring& filename = L"")) : db(NULL) { sqlite3_open16(filename.c_str(), &db); } ~Database() { sqlite3_close(db); } void exec(const std::wstring& sql) { auto_ptr<Statement> st(prepare(sql)); st->step(); } auto_ptr<Statement> prepare(const tstring& sql) const { return auto_ptr<Statement>(new Statement(db, sql)); } private: sqlite3* db; };

    Read the article

  • SSIS parsing of an irregular flat file?

    - by ElHaix
    I'm pretty familiar with SSIS parsing of regular delimited text data files, however, I'm looking for some advice on an approach to tackle a file that looks like this test file: ISA*00* *00* *01*220220220 *ZZ*RL CODE 01*060327*1212*U*00300*000008859*0*P*:~ GS*RA*CPA-BPT*LOCALUTILITY*060319*1212*970819003*X*003030~ ST*820*000000001~ BPR*C*321.91*C*X12*CBC*04*000300488**9918939***04*000300002**1598564*070319~ TRN*1*00075319970819105029~ REF*RR*0003199708190000174858~ DTM*097*070318~ DTM*107*070318~ N1*PR*DIRECT PAYMENT~ N1*PE*ABC CORPORATE BILLER*ZZ*90005836~ ENT*1~ N1*PR*BILLING - TEST - NATTRASS~ RMR*CR*0009381082105011**142.15~ REF*TN*000303965~ DTM*109*070316~ ENT*2~ N1*PR*BILL FREID TEST~ RMR*CR*0011010451800011**179.76~ REF*TN*000304189~ The 321.91 is the total of the transaction. I would prefer to do this with SSIS, but could also do create a C# parser. Suggestions would be appreciated. Thank you.

    Read the article

  • PHP file download header

    - by skidding
    I have developed a small download system in PHP, where files are downloaded through a proxy file. When I had to do this before, I just redirected by changing the location header; which is not what I want to do now. So, obviously, the first issue that appeared is what kind of header must I set. First of all, Content-Disposition is set as "attachment", so this is good, but I can't seem to get around Content-Type. I need to set it to fit all possible files that might be downloaded through this system. I don't know how to detect the file header automatically, and I'm trying to aviod a GIANT switch. What are my options? Thanks!

    Read the article

  • Broke NetBeans file associations in Windows XP how do I get them back?

    - by Serhiy
    I broke my file association in XP... Does anyone have any clue how to fix it? When I right click and select Open With... the application I want to use (NetBeans) to open the file is not on the list... and when I browse for it it won't let me select it (well it does but then won't add it to the list). The way I broke it is by installing 6.7 and then uninstalling 6.5.... since then my file associations have all been broken. I even tried uninstalling NetBeans and reinstalling it again... no luck... I even went as far as adding my own action called "OpenIt" to the file types I wanted... and that works... but only if the file/folders that contain in don't have any spaces... otherwise NetBeans throws a ".....does not exist, or is not a plain file". Thus nothing off the desktop can be opened... Does anyone know of how I can fix this problem? Thanks.

    Read the article

  • Starting point for learning CAD/CAE file formats?

    - by Escader
    We are developing some stress and strain analysis software at university. Now it's time to move from rectangles and boxes and spheres to some real models. But I still have little idea where to start. In our software we are going to build mesh and then make calculations, but how do I import solid bodies from CAD/CAE software? 1) How CAD/CAE models are organised? How solid bodies are represented? What are the possibilities of DWG, DXF, IGES, STEP formats? There is e.g. a complete DXF reference, but it's too difficult for me to understand without knowing basic concepts. 2) Are there C++ libraries to import solid bodies from CAD/CAE file formats? Won't it be too difficult to build a complete model to be able to import comprehensive file?

    Read the article

  • VBA: Read file from clipboard

    - by ReturningTarzan
    I'm trying to load a file in a VBA macro that has been copied from, say, an Explorer window. I can easily get the data from the clipboard using DataObject::GetFromClipboard, but the VBA interface to DataObject doesn't seem to have methods for working with any other formats than plain text. There are only GetText and SetText methods. If I can't get a file stream directly from the DataObject, the filename(s) would also do, so maybe GetText could be forced to return the name of a file placed on the clipboard? There is very little documentation to be found for VBA anywhere. :( Maybe someone could point me to an API wrapper class for VBA that has this sort of functionality?

    Read the article

  • How to pass a very long string/file into RESTWebservice JAX-RS Jersey

    - by Sashikiran Challa
    Hello All, I am trying to write a webservice that takes in an XML string, does parsing of it using DOM and extract particular things I want. My XML string happens to be very long so I do not want to pass it as a @QueryParam or @PathParam. Say If I write that XML string into a file, How do I go about writing a RESTful service that takes in this file, extracts whatever I want and return the results. I am actually trying to extract some number of strings, so my output should probably be an ArrayList having all these strings. Could somebody please shed some light on how I should go about doing this. Thanks in advance

    Read the article

  • Windows hosts file and IIS binding question

    - by bmw0128
    I'm building a few SharePoint sites, and I want to make use of zones so I may set security different in the various zones. My workstation has a local SharePoint, and I use it for development. My workstation has a static IP, and is connected to the internet. When I make a SharePoint site, I want to add a host header, for instance, devbox.com. I do not own this name, nor do I want to. I then add an entry in my hosts file, but when I surf to http://devbox.com:8080, it does not resolve. Do I need to register the name I want to use, or should this work, i.e., have my hosts file resolve names/IPs first?

    Read the article

  • [SOLVED] Store files in C# EXE file

    - by sublay
    It is actually useful for me to store some files in EXE to copy to selected location. I'm generating HTML and JS files and need to copy some CSS, JS and GIFs. Snippet System.IO.File.WriteAllBytes(@"C:\MyFile.bin", ProjectNamespace.Properties.Resources.MyFile); doesn't work for me! On "WriteAllBytes" it says: "cannot convert from 'System.Drawing.Bitmap' to 'byte[]'" for image and "cannot convert from 'string' to 'byte[]'" for text file. Help! UPDATE: Solved below.

    Read the article

  • PHP File Exists Always False

    - by Joe
    I have a case where file_exists() is always returning false. My latest attempt was to just test to see if it would return true for $_SERVER["SCRIPT_FILENAME"] and then return the value of the path if it couldn't find the file which it does. The path while not necessarily relevant to solving the problem is: /Users/joe/Workspace/720/app/webroot/index.php I have obviously verified that the file is there, and am not even sure how it couldn't be there since php is serving it up. I should mention this is on an install of OS X Snow Leopard running PHP 5.3.0. Any ideas would be fantastic. CODE SAMPLE: if (!file_exists($_SERVER["SCRIPT_FILENAME"])) $errors[] = 'Cant find:'. $_SERVER["SCRIPT_FILENAME"];

    Read the article

  • Enumerating all open file handles and/or registry handles in Windows Mobile / Windows CE 5.x

    - by jdstroy
    Hi all, Is there a way to enumerate all open file handles and/or registry handles in Windows Mobile 5 / Windows CE 5.x? In particular, I'd like to get the handles for all processes in the system, and not just the ones for my application. This would be similar to the list of handles in Sysinternals's Process Explorer for Win32 or Sysinternals's handle.exe I anticipate that someone will ask "Is this absolutely necessary for your application?" My answer to that would be "I think so, unless there's a better way to get a list of all open file names and registry key names." The goal is to provide diagnostic information about an application that crashes and fails to uninstall properly, but that worked properly at one time on the same device. (I do not have debugging information for the buggy application.)

    Read the article

  • feof() in C file handling

    - by Neeraj
    I am reading a binary file byte-by-byte,i need determine that whether or not eof has reached. feof() doesn't works as "eof is set only when a read request for non-existent byte is made". So, I can have my custom check_eof like: if ( fread(&byte,sizeof(byte),1,fp) != 1) { if(feof()) return true; } return false; But the problem is, in case when eof is not reached, my file pointer is moved a byte ahead. So a solution might be to use ftell() and then fseek() to get it to correct position. Another solution might be to buffer the byte ahead in some temporary storage. Any better solutions?

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >