Search Results

Search found 2696 results on 108 pages for 'michael snyder'.

Page 5/108 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Convert Decimal to ASCII

    - by Dan Snyder
    I'm having difficulty using reinterpret_cast. Before I show you my code I'll let you know what I'm trying to do. I'm trying to get a filename from a vector full of data being used by a MIPS I processor I designed. Basically what I do is compile a binary from a test program for my processor, dump all the hex's from the binary into a vector in my c++ program, convert all of those hex's to decimal integers and store them in a DataMemory vector which is the data memory unit for my processor. I also have instruction memory. So When my processor runs a SYSCALL instruction such as "Open File" my C++ operating system emulator receives a pointer to the beginning of the filename in my data memory. So keep in mind that data memory is full of ints, strings, globals, locals, all sorts of stuff. When I'm told where the filename starts I do the following: Convert the whole decimal integer element that is being pointed to to its ASCII character representation, and then search from left to right to see if the string terminates, if not then just load each character consecutively into a "filename" string. Do this until termination of the string in memory and then store filename in a table. My difficulty is generating filename from my memory. Here is an example of what I'm trying to do: C++ Syntax (Toggle Plain Text) 1.Index Vector NewVector ASCII filename 2.0 240faef0 128123792 'abc7' 'a' 3.0 240faef0 128123792 'abc7' 'ab' 4.0 240faef0 128123792 'abc7' 'abc' 5.0 240faef0 128123792 'abc7' 'abc7' 6.1 1234567a 243225 'k2s0' 'abc7k' 7.1 1234567a 243225 'k2s0' 'abc7k2' 8.1 1234567a 243225 'k2s0' 'abc7k2s' 9. //EXIT LOOP// 10.1 1234567a 243225 'k2s0' 'abc7k2s' Index Vector NewVector ASCII filename 0 240faef0 128123792 'abc7' 'a' 0 240faef0 128123792 'abc7' 'ab' 0 240faef0 128123792 'abc7' 'abc' 0 240faef0 128123792 'abc7' 'abc7' 1 1234567a 243225 'k2s0' 'abc7k' 1 1234567a 243225 'k2s0' 'abc7k2' 1 1234567a 243225 'k2s0' 'abc7k2s' //EXIT LOOP// 1 1234567a 243225 'k2s0' 'abc7k2s' Here is the code that I've written so far to get filename (I'm just applying this to element 1000 of my DataMemory vector to test functionality. 1000 is arbitrary.): C++ Syntax (Toggle Plain Text) 1.int i = 0; 2.int step = 1000;//top->a0; 3.string filename; 4.char *temp = reinterpret_cast<char*>( DataMemory[1000] );//convert to char 5.cout << "a0:" << top->a0 << endl;//pointer supplied 6.cout << "Data:" << DataMemory[top->a0] << endl;//my vector at pointed to location 7.cout << "Data(1000):" << DataMemory[1000] << endl;//the element I'm testing 8.cout << "Characters:" << &temp << endl;//my temporary char array 9. 10.while(&temp[i]!=0) 11.{ 12. filename+=temp[i];//add most recent non-terminated character to string 13. i++; 14. if(i==4)//when 4 chatacters have been added.. 15. { 16. i=0; 17. step+=1;//restart loop at the next element in DataMemory 18. temp = reinterpret_cast<char*>( DataMemory[step] ); 19. } 20. } 21. cout << "Filename:" << filename << endl; int i = 0; int step = 1000;//top-a0; string filename; char *temp = reinterpret_cast( DataMemory[1000] );//convert to char cout << "a0:" << top-a0 << endl;//pointer supplied cout << "Data:" << DataMemory[top-a0] << endl;//my vector at pointed to location cout << "Data(1000):" << DataMemory[1000] << endl;//the element I'm testing cout << "Characters:" << &temp << endl;//my temporary char array while(&temp[i]!=0) { filename+=temp[i];//add most recent non-terminated character to string i++; if(i==3)//when 4 chatacters have been added.. { i=0; step+=1;//restart loop at the next element in DataMemory temp = reinterpret_cast( DataMemory[step] ); } } cout << "Filename:" << filename << endl; So the issue is that when I do the conversion of my decimal element to a char array I assume that 8 hex #'s will give me 4 characters. Why isn't this this case? Here is my output: C++ Syntax (Toggle Plain Text) 1.a0:0 2.Data:0 3.Data(1000):4428576 4.Characters:0x7fff5fbff128 5.Segmentation fault

    Read the article

  • Capture String from Array, C#

    - by Dan Snyder
    I'm trying to figure out how to get a string from an array starting at some given position. Say we have an array that's arbitrarily long and my string starts at location 1000. If I wanted to get a string from a file I would simply use something like getc or scanf or something. How do I carry out these same functions on an array instead of a file? *oh, keep in mind that the array is of type int and is full of numerical representations of ASCII characters.

    Read the article

  • Getting mysql row that doesn't conflict with another row

    - by user939951
    I have two tables that link together through an id one is "submit_moderate" and one is "submit_post" The "submit_moderate" table looks like this id moderated_by post 1 James 60 2 Alice 32 3 Tim 18 4 Michael 60 Im using a simple query to get data from the "submit_post" table according to the "submit_moderate" table. $get_posts = mysql_query("SELECT * FROM submit_moderate WHERE moderated_by!='$user'"); $user is the person who is signed in. Now my problem is when I run this query, with the user 'Michael' it will retrieve this 1 James 60 2 Alice 32 3 Tim 18 Now technically this is correct however I don't want to retrieve the first row because 60 is associated with Michael as well as James. Basically I don't want to retrieve that value '60'. I know why this is happening however I can't figure out how to do this. I appreciate any hints or advice I can get.

    Read the article

  • Mapping Vectors

    - by Dan Snyder
    Is there a good way to map vectors? Here's an example of what I mean: vec0 = [0,0,0,0,0,0,0,0,0,0,0] vec1 = [1,4,2,7,3,2] vec2 = [0,0,0,0,0,0,0,0,0] vec2 = [7,2,7,9,9,6,1,0,4] vec4 = [0,0,0,0,0,0] mainvec = [0,0,0,0,0,0,0,0,0,0,0,1,4,2,7,3,2,0,0,0,0,0,0,0,0,0,7,2,7,9,9,6,1,0,4,0,0,0,0,0,0] Lets say mainvec doesn't exist (I'm just showing it to you so you can see the general data structure in mind. Now say I want mainvec(12) which would be 4. Is there a good way to map the call of these vectors without just stitching them together into a mainvec? I realize I could make a bunch of if statements that test the index of mainvec and I can then offset each call depending on where the call is within one of the vectors, so for instance: mainvec(12) = vec1(1) which I could do by: mainvec(index) if (index >=13) vect1(index-11); I wonder if there's a concise way of doing this without if statements. Any Ideas?

    Read the article

  • Instantiate dynamic array Magento

    - by Tegan Snyder
    Kick me if I'm being silly but some some reason I'm having a heck of time building a dynamic array in magento. Example: $data = array(); $data[0] = 'test'; $data[1] = 'what'; I keep getting an ERROR: Notice: Undefined offset: 0 Any ideas? Do I need to handle these arrays differently since they are in a class?

    Read the article

  • Ideas Needed for a Base Code System

    - by Tegan Snyder
    I've developed a PHP web application that is currently in need of a strategic restructuring. Currently when we setup new clients we give them the entire code base on a subdomain of our main domain and create a new table for them in the database. This results in each client having the entire codebase, meaning when we make bug changes, fixes we have to go back and apply them independently across all clients and this is a pain. What I'd like to create is a base code server that holds all the core PHP files. base.domain.com Then all of our clients (client.domain.com) will only need a few files: config.php would have the database connection information. index.php - displays the login box if session non-existant, otherwise it loads baseline code via remote includes to base.domain.com. My question is does my logic seem feasible? How do other people handle similar situations by having a base code? Also.... Is it even possbile to remotely include PHP files from base.domain.com and include them in client.domain.com? Thanks, Tegan

    Read the article

  • Update Store Logo Programmatically Magento

    - by Tegan Snyder
    I've noticed that magento keeps the URL to the logo it uses for each store you setup in the "core_config_data" table. If I run this SQL: SELECT * FROM `core_config_data` WHERE path = 'design/header/logo_src' I get a list of stores and their associated logo. I also get a config_id and a scope_id. I'd like to be able to update these logo's programmatically behind the scenes but I can't figure out how to relate this table's data back to a store name. config_id and store_id got to somehow link back to another table that sets up the relationship. Magento's EAV model, ugh :) Any ideas?

    Read the article

  • Javascript Replace text in string

    - by Tegan Snyder
    I'm having some troubles getting regex to replace all occurances of a string within a string. **What to replace:** href="/newsroom **Replace with this:** href="http://intranet/newsroom This isn't working: str.replace(/href="/newsroom/g, 'href="http://intranet/newsroom"'); Any ideas? Thanks, Tegan

    Read the article

  • how to protect telnet access to smtp port 25?

    - by Michael Mao
    Hi all: Please consider the following: 192-168-1-106:~ michael$ telnet <remote_server_ip> 25 Trying <remote_server_ip>... Connected to li*****.linode.com. Escape character is '^]'. 220 mindinscription.net ESMTP Postfix (Ubuntu) quit 221 2.0.0 Bye Connection closed by foreign host. Is this very bad? how to protect port 25 from malicious attackers? I've already set up a firewall, but not very sure what to do in this case. Basically I'd like to use this server to only send emails as alert messages, not receiving any external emails. Many thanks to the help in advance.

    Read the article

  • What do you use to loadbalance IPv6 services?

    - by Michael Renner
    Hi, the current Linux software environment for IPv6 load balancing looks a bit grim. IPVS has rudimentary support for IPv6 but it's far from complete. NAT for IPv6 seems to be a no-go. Are there any other projects which aim for this goal? Does the IPv6 support in other OS look better? Are there any commercial products which have been successfully used in production environments with non-trivial load patterns? Or is it just that the time for IPv6 hasn't come... yet? ;) best regards, Michael

    Read the article

  • Windows 7 Locking up Randomly

    - by Michael Moore
    I've got a Windows 7 machine that is locking up randomly. It can be in the first thirty seconds, or it can be hours later. There is nothing specific I can find that is running when it happens. When it locks, the screen doesn't change, but nothing moves. The waiting icon stops, the mouse stops, keyboard doesn't work, etc. I've even tried the crash on ctrl-scrl registry hack, and it won't even dump the kernel. I've run hardware diagnostics on the RAM and it doesn't find any problems. I would think it is a hardware issue, but on this exact same machine, I can run 64 Bit Ubuntu and it has zero problems. I've even tried reinstalling Windows7 from scratch, and it still happens. Anyone have any ideas? Any good diagnostic tools to recommend? Thanks! Michael

    Read the article

  • Secure copy in Linux

    - by Michael
    Hi all, I wanna simpy exchange 3 directories to a collegue's home directory (I dont have write access to that one) from my home directory, probably using secure copy if possible. I am not good with Linux command line, so I am not sure how to do that and I would very much appreciate it if somebody could help me a bit out with this. I guess it should look something like that scp -r /home/user1/directoy1 /home/user2/directoy1 scp -r /home/user1/directoy2 /home/user2/directoy2 scp -r /home/user1/directoy3 /home/user2/directoy3 Do I need to specify the login name of my collegue so that the files can be copied when he enters his password? Thanks for your help, Michael

    Read the article

  • USB Flash drive corrupt files - Help needed

    - by Michael
    I have a 16gb usb flash drive with 8gb worth of data that I can't afford to lose. When I inserted it into my pc, inside the folder that I was storing the data I saw unintelligible characters and nothing in there would open. I ran, windows scandisk and the files (unfortunately) disappeared. I can see that the drive's space still appears to be taken up with data, about 8gb. What should I do to recover it? Is it possible? Thanks in advance... Michael

    Read the article

  • Virtual hosting in Varnish with individual vcl files for configuration

    - by Michael Sørensen
    I wish to use varnish to put in front of an apache and a tomcat on the same server. Depending on the ip requested, it goes to a different backend. This works. Now for most of the sites the default varnish logic will work just fine. However for some specific sites I wish to use custom VCL code. I can test for host name and include config files for the specific domains, but this only works inside the individual methods recv etc. Is there a way to include a complete set of instructions, in one file, per domain, without having to manage separate files for subdomain_recv, subdomain_fetch etc? And preferably without running seperate instances of varnish. When I try to include a file on the "root level" of default.vcl, I get a compilation error. Best regards, Michael

    Read the article

  • Passing a custom variable to the PayPal API

    - by Michael
    Gday All, I am developing a site that uses PayPal to take online payments. I need to be able to send my client an email with the link to PayPal in order to pay. In this link I need a way to set a unique value (for example bookingId) that I can use to add the receipt number to the correct booking via PayPal's payment notification feature. Does anyone know what custom value I can set in order to achieve this? Cheers, Michael

    Read the article

  • Appcelerator Titanium: Android SDK doesn't load

    - by Michael Gajda
    Hello! I started developing with Titanium and now I really stuck on one part. I downloaded the Adroid SDK and added the path to Titanium: /Users/michael/Downloads/android-sdk-mac_86/ I can open e.g. Kitchen Sink in the iPhone Simulator without problems, but when I want to open it in Android then my screen looks like this: Screenshot Why is down there all the time, even after 2 hours of waiting, the label "loading..." ?

    Read the article

  • jQuery jFlow plugin. How can I have more than one on a single page?

    - by Michael
    Hi, I'm using a very lovely and simple plugin called jFlow that gives me a basic content slider etc. However, I can see no documentation or help on how to get two (or more) on one page at the same time working seperately from one another. At the moment, if I set two up, they almost combine as one, despite having a different configuration from one another. Any help would be great, thanks. Michael.

    Read the article

  • How can I add one Target (Foundation Tool) to Copy Bundle Resources of another Target in XCode

    - by Michael Ruepp
    Hy everybody, I have two targets in one Project in Xcode. One is a foundation tool which i need in the resources Bin of the other Target, which is a Bundle App. I am not able to add the Target one into the Copy Bundle Resources Build Phase of the Bundle App. Do I need to use a Copy Files Build phase and put the File out of the build/Release Folder into it? Thank you, Michael

    Read the article

  • simple yet secure encrypt / decrypt asp to asp.net

    - by Michael
    First post here. I have a asp/vb6 web app that logs in a user I want to encrypt the users identity field and pass(querystring) it to a asp.net app and then decrypt it to do a db lookup. I've google'd it of course and found rot13, not secure enough. I've also found some hits on MD5 / RC4 but did not find any good examples of encrypt / decrypt. Thanks, Michael

    Read the article

  • Sample code for image upload

    - by Michael
    Hi, In would like to write a simple Android application that takes a picture from the camera and uploads it to a webserver. Additionaly, I would like it to print in the screen the response from the server wich is a simple text string. Do you know if there is any sample code that does something like that? Thank you, Michael

    Read the article

  • php mysql array - insert array info into mysql

    - by Michael
    I need to insert mutiple data in the field and then to retrieve it as an array. For example I need to insert "99999" into table item_details , field item_number, and the following data into field bidders associated with item_number : userx usery userz Can you please let me know what sql query should I use to insert the info and what query to retrieve it ? I know that this may be a silly question but I just can't figure it out . thank you in advance, Michael .

    Read the article

  • Determine the urban district from coordinates

    - by Michael Kowhan
    Hi, I am looking for a database that allows to find the name of an urban district from the coordinates. I have tried to use Google Maps or Open Street Map to find that information, but they do not seem to be able to deliver this data. I'm especially looking for a database for Germany Cheers, Michael

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >