Search Results

Search found 357 results on 15 pages for 'recieve'.

Page 10/15 | < Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • c# creating a file from input stream

    - by daemonkid
    My component will recieve a pdf file as a filestream from which I will need to create a file. For testing purposes I am trying to read a file using the filestream object and recreate it at a different location. But the recreated file is created blank. the recreated file has the same number of pages though... This is the code StreamReader sr = new StreamReader(_filePath); str = sr.ReadToEnd(); File.WriteAllText(@"C:\recreated.pdf", str); what am I doing wrong? Thanks for your time.

    Read the article

  • Post serialized to xml object to mvc action

    - by Maxim
    Hello! i have 2 projects. First project send to 2-nd via http-post requests, as serialized to XML class instances. Ex: <?xml version="1.0" encoding="utf-16"?> <MyObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <UserId>test user</UserId> ... How can i recieve it in action of 2-nd project? [HttpPost] public ActionResult Index(MyObject id) { ... or like string, and deserialize after? Thanx.

    Read the article

  • R get rid of rows with duplicate attribute

    - by CatholicEvangelist
    hi there I have a big dataframe with columns such as: ID, time, OS, IP Each row of that dataframe corresponds to one entry. Within that dataframe for some IDs serveral entries (rows) exist. I would like to get rid of those multiple rows (obviously the other attributes will differ for the same ID). Or put different: I only want one single entry (row) for each ID. Could anyone be so kind and help me out on this one? When I use unique, on the ID column, I only recieve the levels (or each unique ID), but I want to keep the other attributes as well... I have tried to use apply(x,2,unique(data$ID)), but this does not work either... Any help is highly appreciated!

    Read the article

  • How can I resolve naming conflict in given precompiled libraries?

    - by asm
    I'm linking two different libraries that have functions with exactly same name (it's opengl32.lib and libgles_cm.lib - OpenGL ES emulation under Win32 platform), and I want to be able to specify, which version I'm calling. I'm porting a game to OpenGL ES, and what I want to achieve, is a split-screen rendering, where left side is an OpenGL version, and right side is a ES version. To produce the same result, they will recieve slightly different calls, and I'll be able to visually compare them, effectively finding visual artifacts. It worked perfectly with OpenGL/DirectX at the same window, but now the problem is that both versions imports the functions with the same name, like glDrawArrays, and only one version is imported. Unfortunately, I don't have sources of any of that libraries. Is there a way to... I dont' know, wrap one library into additional namespace before linking (with calls like ES::glDrawArrays), somehow rename some of functions or do anything else? I'm using microsoft compiler now, but if there will be solution with another one (GCC/ICC), I'll switch to it.

    Read the article

  • WPF InotifyPropertyChanged and view models

    - by Joel Barsotti
    So I think I'm doing something pretty basic. I know why this doesn't work, but it seems like there should be a straight foward way to make it work. code: private string fooImageRoot; // .... public BitmapImage FooImage { get { URI imageURI = new URI(Path.Combine(fooImageRoot, CurrentFooTypes.FooObject.FooImageName)); return imageURI; } } So CurrentFOoTypes and FooObject also supports INotifyPropertyChanged. So If I bind a TextBlock to CurrentFooTypes.FooObject.FooImageName, if either fooObject or FooImageName change the textblock updates. How can I subscribe my viewmodel object to recieve updates in a similiar fasion.

    Read the article

  • sql server 2008 express. cannot create mdf databse.

    - by yair
    Hi, I'm working with visual studio 2008 express and sql 2008 express. I'm trying to create mdf database (Add new Item ...)and I recieve the following error message: "a network-related or instance-specific error occured while establishing a connection to SQL Server. The server was not found or was not accessible. Verfy that instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named pipes Provider:40 - could not open connection to SQL)" Why ? Is it possible to create mdf database with SQL 2008 Express ? If it is then what to do ?

    Read the article

  • DataContractAttribute with Shared Assembly

    - by Sanju
    Hi All, Is it necessary to decorate custom objects with [DataContract] and [DataMember] when using shared assemblies (as opposed to auto proxy generation)? The reason I ask is that I have encountered the following scenario: Suppose the following object is implemented in my service: public class baseClass { Guid _guid; public baseClass() { _guid = Guid.NewGuid() } public Guid ReturnGuid { get {return _guid;}} } public class newClass : baseClass { int _someValue; public newClass {} public int SomeValue { get {return _someValue;} set {_someValue = value;} } } [ServiceContract] public IService { [OperationContract] newClass SomeOperation(); } In my client (with shared assemblie) I can happily recieve and use a serialized newClass when SomeOperation is called - even though I have not marked it as a DataContract. However, as soon as I do mark it with DataContract and use DataMember then it complains that set is not implemented on ReturnGuid in the base class. Could somebody explain why it works fine when I do not decorate with DataContract and DataMember. Many thanks.

    Read the article

  • terminated value of Eclipse

    - by helloWorld
    I have some function: void addNormalLine(int id, LineNumber number, Rate smsRate, Rate callRate) { list<Account>::iterator iAccounts; findAccount(iAccounts, id); if(iAccounts == listOfAccounts.end()){ throw "AccountDoesNotExist"; } if(lineExists(number)){ throw "LineExists"; } else{ iAccounts->increaseNumLines(); shared_ptr<Line> currentLine(new Line(id, number, smsRate, callRate)); //here I have some problems listOfLines.push_back(currentLine); //without these two rows it works, but didn't add lines to my list } } Account, Rate, LineNumber - some classes but It always add only one or two numbers, if I add 3 it always terminates and and I recieve terminated, exit value: 3, I tried google it, but didn't find, what is than supposed to mean, thanks in advance

    Read the article

  • MySQL ON DUPLICATE KEY UPDATE issue

    - by user644347
    Hi could some one look at this and tell me where I am going wrong. I have an SQL statement that when I echo using php I get this to screen INSERT INTO 'moviedb'.'genre' SET 'GenreID' = '18' , 'GenreName' = 'Drama' ON DUPLICATE KEY UPDATE 'GenreName' = 'Drama' WHERE 'GenreID' = '18' INSERT INTO 'moviedb'.'genre' SET 'GenreID' = '16' , 'GenreName' = 'Animation' ON DUPLICATE KEY UPDATE 'GenreName' = 'Animation' WHERE 'GenreID' = '16' And here is the statement $sql="INSERT INTO 'moviedb'.'genre' SET 'GenreID' = '{$genresID[$i]}' , 'GenreName' = '{$genreName[$i]}' ON DUPLICATE KEY UPDATE 'GenreName' = '{$genreName[$i]}' WHERE 'GenreID' = '{$genresID[$i]}'"; This is the error I recieve: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''moviedb'.'genre' SET 'GenreID' = '18' , 'GenreName' = 'Drama' ON DUPLICATE KEY ' at line 1 Any help would be greatly appreciated, thanks in advance.

    Read the article

  • int[] to string c#

    - by Robin Webdev
    Hi I'm developing an client application in C# and the server is written in c++ the server uses: inline void StrToInts(int *pInts, int Num, const char *pStr) { int Index = 0; while(Num) { char aBuf[4] = {0,0,0,0}; for(int c = 0; c < 4 && pStr[Index]; c++, Index++) aBuf[c] = pStr[Index]; *pInts = ((aBuf[0]+128)<<24)|((aBuf[1]+128)<<16)|((aBuf[2]+128)<<8)|(aBuf[3]+128); pInts++; Num--; } // null terminate pInts[-1] &= 0xffffff00; } to convert an string to int[] in my c# client i recieve: int[4] { -14240, -12938, -16988, -8832 } How do I convert the array back to an string? I don't want to use unsafe code (e.g. pointers) Any of my tries resulted in unreadable strings.

    Read the article

  • deleting a file in java while uploading it in other thread

    - by user369507
    i'm trying to build a semi file sharing program, when each computer acts both as a server and as a client. I give multiple threads the option to DL the file from my system. also, i've got a user interface that can recieve a delete message. my problem is that i want that the minute a delete message receieved, i wait for all the threads that are DL the file to finish DL, and ONLY than excute file.delete(). what is the best way to do it? I thought about some database that holds and iterate and check if the thread is active, but it seems clumsy. is there a better way? thanks

    Read the article

  • ASP.NET web service architecture/structure

    - by Murugesan
    Hi All, I am going to create a new asp.net web service (.NET framework 2.0), the functionality of the web service is to recieve xml input, perform the relevant operation (add/modify/delete) based on the input and return codes which indicates the status of the operation. I am planning to implement two layer architecture (Business layer and database layer) for this web service, could anyone advise whether this is the right structure or any other structure would perform well than this. Basically I need some inputs on designing the web service. Thanks in advance. Thanks, Muru

    Read the article

  • handle an arrray posted with $.ajax (jquery) to a webservice

    - by burktelefon
    I'm trying to post data to a webservice (asp.net 3.5), like below (two variants, one commented): var array = [3, 2, 5, 1, 7]; var jsonString = JSON.stringify(array); //var jsonString = '{ "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021" }, "phoneNumber": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ] }' $.ajax({ type: "POST", url: "WebService2.asmx/AddRoute", data: jsonString, contentType: "application/json; charset=utf-8", dataType: "json", processData: "false", error: function(msg) { alert('error' + msg.toString); } }); So I need a matching webmethod to recieve it. Something like this: [WebMethod] public string AddRoute(/* xxx */) { //handle data } Could someone please elaborate on how I can fetch the data, where I've typed "xxx"? I would have thought "int[] array" would do the trick, but it's not working. Any help would be greatly appreciated :)

    Read the article

  • Not found in protocol

    - by Alex
    I've subclassed MKAnnotation so that i can assign objects to annotations and then assign this object to a view controller like so: - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { PlaceDetailView *detailView = [[PlaceDetailView alloc] initWithStyle:UITableViewStyleGrouped]; detailView.place = [view.annotation place]; [self.navigationController pushViewController:detailView animated:YES]; [detailView release]; } This is working great but i'm having the following issues: If i try and access the place getter method like so view.annotation.place i recieve an error: Accessing unknown place getter method If i acces the place getter method like so [view.annotation place] i receive a warning: place not found in protocol From my understanding this is because the place object is not defined in the MKAnnotation protocol, although i'm aware of this i'm not sure how to tell the complier that place does exist and it's not calling it blind.

    Read the article

  • Event handling C# / Registering a callback

    - by Jeff Dahmer
    Events can only return void and recieve object sender/eventargs right? If so then craptastic.... how can I pass a function pointer to another obj, like: public bool ACallBackFunc(int n) { return n > 0; } public void RegisterCallback(Something s) { s.GiveCallBack(this.ACallBackFunc); } Something::GiveCallBack(Action? funcPtr) I tried using Action, but I need it to return some value and Actions can only return void. Also, we do not know what kind of a callback we will be recieving; it could return anything and have any params! Reflection will have to be used somehow I reckon.

    Read the article

  • Process AJAX response with long runing tasks

    - by mpz
    I have long time task in controller action. I use delayed job for it. (Also in heroku it is good practice for perfomance - dyno must work for small time in each request) But my client need result of it work and users can wait on that task. It is more clear: no any addition models or records in it, simple view and js... I think about such way: On client run AJAX with very long timeout (5 min for example) Client make request to server as usual On controller in action1 def start_work (with delay work setup) i need NO any response to client After work performs (delay job finished) i need run new action2 with response to client Client recieve response after about 1-5 min It is possible?

    Read the article

  • Value of variable changing before function is finished running

    - by Patrick
    I have an image uploading script in which i use the following setup to assign names to uploaded images; $saltdate = date( 'U' ); $saltuser = $_SERVER[REMOTE_ADDR]; $saltname = md5($saltdate.$saltuser); // Recieve, Process, Save uploaded image // Update database with image name The problem that i encounter is that after processing/saving the image, when its time to add this file name to the database, the value of $saltdate seems to have changed and i will get a file name in the database that doesnt exist. How can i make sure that the value doesn't change once i establish it?

    Read the article

  • 2 IP are stored for a visitor : PROXY ?

    - by Tristan
    Hello, on my database i've decided to store IP of the visitors who answoers to polls. It's all working, but there is only 2 cases where not only 1 IP is stored, but there is 2 SAME ip for the same visitor MySQLL output (i replaced 2 numbers by XX) 10.188.XX.129, 10.188.XX.129 Here's the script to recieve the IP of the visitor : <?php function realip() { if (isset($_SERVER)) { if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) { $realip = $_SERVER["HTTP_X_FORWARDED_FOR"]; } elseif (isset($_SERVER["HTTP_CLIENT_IP"])) { $realip = $_SERVER["HTTP_CLIENT_IP"]; } else { $realip = $_SERVER["REMOTE_ADDR"]; } } else { if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) { $realip = getenv( 'HTTP_X_FORWARDED_FOR' ); } elseif ( getenv( 'HTTP_CLIENT_IP' ) ) { $realip = getenv( 'HTTP_CLIENT_IP' ); } else { $realip = getenv( 'REMOTE_ADDR' ); } } return $realip; } ? Thanks

    Read the article

  • Increase a recive buffer in UDP socket

    - by unresolved_external
    I'wm writing an app, which transmits video and obviously uses UDP protocol fot this purpose. So I am wondering how can I increase a size of send/recieve buffer, cause currently the maximal size of data, which I can send is 65000 bytes. I already tried to do it in following way: int option = 262144; if(setsockopt(m_SocketHandle,SOL_SOCKET,SO_RCVBUF ,(char*)&option,sizeof(option)) < 0) { printf("setsockopt failed\n"); } But it did not work. So how can I do it?

    Read the article

  • Sending an anonymous email to my own address

    - by N3HL
    I want to send an anonymous email to my own gmail/hotmail/yahoo/any other mail service address (Im not trying to spam or something like that). Why? I have a .NET application and I want to add a "Send log to the developer" feature (attaching the log) using SmtpClient. The fact is I've read like 30+ pages, and found out, i.e. gmail's smtp client doesn't allow anonymous connections, and many other things. The idea is to receive a mail message like this: From: [email protected] (non-existent email really) To: [email protected] (this would be my real address which will recieve the logs attachments) Subject: Issue report nºX (auto-generated) Body: From a textbox Attachments: logs attached Is this possible? If so, how do I achieve it?

    Read the article

  • fetching savedInstanceState values, nullpointerexception

    - by Johan
    @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main2); savedInstanceState.putString("foo", "bar"); } @Override public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); String myString = savedInstanceState.getString("foo"); Log.i("debug", "saved data: " + myString); } Im trying to preserve some values in an activity, but i recieve the following error: 06-23 23:09:44.038: E/AndroidRuntime(17584): java.lang.RuntimeException: Unable to start activity ComponentInfo{se.johanberntsson.activitytest/se.johanberntsson.activitytest.TestActivity}: java.lang.NullPointerException What did I miss here? Thanks

    Read the article

  • Java: Anyone know of a library that detects the quality of an internet connection?

    - by Zombies
    I know a simple URLConnection to google can detect if I am connected to the internet, after all I am confident that the internet is all well and fine If I cant connect to google. But what I am looking for at this juncture is a library that can measure how effective my connection to the internet is in terms of BOTH responsiveness and bandwidth available. BUT, I do not want to measure how much bandwidth is potentially available as that is too resource intensive. I really just need to be able to test wether or not I can recieve something like X kB's in Y amount of time. Does such a library already exist?

    Read the article

  • Mercurial - Files nog showing on server (ls command)

    - by Bumbolt
    I'm trying to setup a java buildserver with jenkins,maven and mercurial. Now my mercurial server is working i can push, pull and commit. Running the command 'hg serve' on the server allows me to see commits from my clients. But when i go manually into the repository (cd in server-terminal) and do an 'ls' command i can't see any file. When i clone the repository onto a new client i DO recieve the files pushed by the other clients. This is somewhat strange behaviour. Does anyone recognize this? What should i do to fix this?

    Read the article

  • How to know if a MySQL UPDATE query fails because information being supplied matches data already in

    - by Mike
    I have a query where the user types a block of text in a textarea field. They are able to save this information in a database. The problem is that if they have not changed the information or if the information matches the data already in the database, I recieve a '0' for affected rows. Usually I display an error that says the query failed when there are no affected rows. How would I 'know' that the 0 affected rows is because the data already exists, so that I can display a more specific error?

    Read the article

  • Very basic database theory.

    - by John R
    I have a set of tables to show the relationship between organziations and supporters below. Although I have done some basic mySQL querries, I know very little about database 'design'. I plan to querry the database for: -a list of contributors to a specific organization... or, -a list of organizations that a specific suporter supports. The database tables for organiations and contributors may have other columns in the future and recieve a lesser amount of querries based on that information. A | X A | Y A | Z B | X B | Y C | X C | Z How should the tables be set up? I assume that there should be a third table, but there is still redundent information in the third table. Is there a better way of setting up the tables? +----+-------+ +-------------+----------+ +----+-------+ | id | org | | org | contr | | id | contr.| +----+-------+ +-------------+----------+ +----+-------+ | 1 | A | | 1 | 1 | | 1 | X | | 2 | B | | 1 | 2 | | 2 | Y | | 3 | C | | 1 | 3 | | 3 | Z | +----+-------+ | 2 | 1 | +----+-------+ | 2 | 2 | | 3 | 1 | | 3 | 3 | +-------------+----------+

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >