Search Results

Search found 18766 results on 751 pages for 'me again'.

Page 44/751 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • Unable to Update Sharepoint Document Properties : Required Fields are Empty.

    - by Pari
    Hi, I am updating Documents on Sharepoint using List.asmx web service. But problem i am facing is: Fields are not getting Updated as some of required fields are not added. But to fill required fields i have to again Update. "ID" field is compulsary at the time of Update. Which we get only after uploading Document.( we get this id by "ows_id" attriute value) Edit : As said by "Janis Veinbergs" We can't get this ID untill document is actualy saved. So how will i update document as ID field is must for Update. If i don't Put ID Field : Error : 0x8102000aInvalid URL Parameter The URL provided contains an invalid Command or Value. Please check the URL again. If i put Null Value to it: Error :0x81020016Item does not exist The page you selected contains an item that does not exist. It may have been deleted by another user. Is there any way to set document properties at the time of uploaidng files on Sharepoint. *Note : i am uploading file in Chunck.And Not using Microsoft.sharepoint.dll * Language : C# I tried this code But here again properties are being set after uploading file.

    Read the article

  • How load WebView with another URL when navigated through tab bar viewController

    - by TechFusion
    Hello, I have created window based application, root controller as Tab bar controller. WebView is being loaded in Tab bar interfaced ViewController's View.WebView is created using IB.WebView object declared in ViewController as per below. //ViewController.h @interface ViewController:UIViewController{ IBOutlet UIWebview *Webview; } @property(nonatomic,retain)IBOutlet UIWebview *Webview; @end I am calling [WebView loadrequest] method in -viewDidLoad method and stopLoading will be called in -viewWillDisappear method. I am again reload it in -viewWillAppear:animated method to load it again when tab bar is pressed. //ViewController.m @implementation viewcontroller @synthesize Webview; -(void)viewDidLoad{ [super viewDidLoad]; [self.Webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"www.apple.com"]]]; } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.Webview reload]; } -(void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; [self.Webview stopLoading]; } I am releasing WebView in -ViewDidUnload method -(void)viewDidUnload{ [super viewDidUnload]; [Webview release]; } -(void)dealloc{ [Webview release]; [super dealloc]; } Does Webview released correctly ? Here how to kill connection with URL when ViewWillDisappear method called ? How to load View with Different URL then it's loaded in -viewDidLoad method when ViewController interfaced tab is pressed ? Means if naviagated from one tab to another that ViewController interface tab which has WebView should load request with another URL. Does it correct to call [self.Webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"www.stackoverflow.com"]]]; this method again in -viewWillAppear:animated method to load with another URL ? Thanks,

    Read the article

  • Cast Graphics to Image in C#

    - by WebDevHobo
    I have a pictureBox on a Windows Form. I do the following to load a PNG file into it. Bitmap bm = (Bitmap)Image.FromFile("Image.PNG", true); Bitmap tmp; public Form1() { InitializeComponent(); this.tmp = new Bitmap(bm.Width, bm.Height); } private void pictureBox1_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawImage(this.bm, new Rectangle(0, 0, tmp.Width, tmp.Height), 0, 0, tmp.Width, tmp.Height, GraphicsUnit.Pixel); } However, I need to draw things on the image and then have the result displayed again. Drawing rectangles can only be done via the Graphics class. I'd need to draw the needed rectangles on the image, make it an instance of the Image class again and save that to this.bm I can add a button that executes this.pictureBox1.Refresh();, forcing the pictureBox to be painted again, but I can't cast Graphics to Image. Because of that, I can't save the edits to the this.bm bitmap. That's my problem, and I see no way out.

    Read the article

  • Ruby - Feedzirra and updates

    - by mplacona
    Hi, trying to get my head around Feedzirra here. I have it all setup and everything, and can even get results and updates, but something odd is going on. I came up with the following code: def initialize(feed_url) @feed_url = feed_url @rssObject = Feedzirra::Feed.fetch_and_parse(@feed_url) end def update_from_feed_continuously() @rssObject = Feedzirra::Feed.update(@rssObject) if @rssObject.updated? puts @rssObject.new_entries.count else puts "nil" end end Right, what I'm doing above, is starting with the big feed, and then only getting updates. I'm sure I must be doing something stupid, as even though I'm able to get the updates, and store them on the same instance variable, after the first time, I'm never able to get those again. Obviously this happens because I'm overwriting my instance variable with only updates, and lose the full feed object. I then thought about changing my code to this: def update_from_feed_continuously() feed = Feedzirra::Feed.update(@rssObject) if feed.updated? puts feed.new_entries.count else puts "nil" end end Well, I'm not overwriting anything and that should be the way to go right? WRONG, this means I'm doomed to always try to get updates to the same static feed object, as although I get the updates on a variable, I'm never actually updating my "static feed object", and newly added items will be appended to my "feed.new_entries" as they in theory are new. I'm sure I;m missing a step here, but I'd really appreciate if someone could shed me a light on it. I've been going through this code for hours, and can't get to grips with it. Obviously it should work fine, if I did something like: if feed.updated? puts feed.new_entries.count @rssObject = initialize(@feed_url) else Because that would reinitialize my instance variable with a brand new feed object, and the updates would come again. But that also means that any new update added on that exact moment would be lost, as well as massive overkill, as I'd have to load the thing again. Thanks in advance!

    Read the article

  • Is there a perfect algorithm for chess?

    - by Overflown
    Dear Stack Overflow community, I was recently in a discussion with a non-coder person on the possibilities of chess computers. I'm not well versed in theory, but think I know enough. I argued that there could not exist a deterministic Turing machine that always won or stalemated at chess. I think that, even if you search the entire space of all combinations of player1/2 moves, the single move that the computer decides upon at each step is based on a heuristic. Being based on a heuristic, it does not necessarily beat ALL of the moves that the opponent could do. My friend thought, to the contrary, that a computer would always win or tie if it never made a "mistake" move (however do you define that?). However, being a programmer who has taken CS, I know that even your good choices - given a wise opponent - can force you to make "mistake" moves in the end. Even if you know everything, your next move is greedy in matching a heuristic. Most chess computers try to match a possible end game to the game in progress, which is essentially a dynamic programming traceback. Again, the endgame in question is avoidable though. -- thanks, Allan Edit: Hmm... looks like I ruffled some feathers here. That's good. Thinking about it again, it seems like there is no theoretical problem with solving a finite game like chess. I would argue that chess is a bit more complicated than checkers in that a win is not necessarily by numerical exhaustion of pieces, but by a mate. My original assertion is probably wrong, but then again I think I've pointed out something that is not yet satisfactorily proven (formally). I guess my thought experiment was that whenever a branch in the tree is taken, then the algorithm (or memorized paths) must find a path to a mate (without getting mated) for any possible branch on the opponent moves. After the discussion, I will buy that given more memory than we can possibly dream of, all these paths could be found.

    Read the article

  • Problem with creation of scheduled task from IIS6 on SR2003

    - by Morten Louw Nielsen
    Hi, I am writing a webapplication using .NET. The webapp creates scheduled tasks using the System.Diagnostics.Process class, calling SCHTASKS.EXE with parameters. I have changed the identity on the app pool, to a specific domain user. The domain-user is local administrator on all the four webservers. From webserver01 I am creating tasks on webserver01 to webserver04. It works perfect for 3-5 days, but then it breaks. It gives me the following errormessage in a messagebox: "The application failed to initialize properly (0xc0000142). Click on OK to terminate the application." If I have the system in the broken state, and I change the identity of the app pool to Domain administrator, it works. As I change it back to my domain-user, it breaks again. If I reboot the server, it works again for the same amount of days, but will break again. It seems like a permission-related problem. I just don't understand why it works sometimes, and sometimes doesn't. I hope someone outthere has seen this problem! Looking forward to hear from you! Kind regards, Morten, Denmark

    Read the article

  • Eclipse RAP - Firefox doesn't forget session

    - by Fritz H
    We've got an Eclipse RAP application that's behaving a bit strangely in Firefox - two distinct problems. When you browse around, you can click on a button in one part of the system. This opens a popup window like so: IWorkbenchBrowserSupport bs; bs = PlatformUI.getWorkbench().getBrowserSupport(); int style = IWorkbenchBrowserSupport.AS_EXTERNAL; IWebBrowser b = bs.createBrowser(style, getRandomID(), "Hello world", ""); b.openURL(new URL(...)); where the URL is another servlet in the application. This servlet is in the same runtime, but has nothing to do with RAP - it takes a binary blob from in-memory storage and dumps it in the output stream. Problem 1: This causes the HTTP session to die in firefox, and shows the "session expired" RAP error page with a link to restart the session. Problem 2: Now, when you click on the link to restart the session, it shows the application's dialog again, but the session expired error is shown again the moment you do anything. This prevents the user from using the system again, unless Firefox is closed down completely and restarted. A quick peek with FireBug reveals that the JSESSIONID passed by Firefox does not change. Has anyone seen this before?

    Read the article

  • ASP.Net: Writing chunks of file..HTTP File upload with resume..

    - by Manish
    Please refer to question: http://stackoverflow.com/questions/2062852/resume-in-upload-file-control Now to find a solution for the above question, I want to work on it and develop a user control which can resume a HTTP File Upload process. For this, I'm going to create a temporary file on server until the upload is complete. Once the uploading is done completely then will just save it to the desired location. The procedure I have thought of is: Create a temporary file with a unique name (may be GUID) on the server. Read a chunk of file and append it to this temp file on the server. Continue step 1 to 3 until EOF is reached. Now if the connection is lost or user clicks on pause button, the writing of file is stopped and the temporary file is not deleted. Clicking on resume again or uploading the same file again will check on the server if the file exists and user whether to resume or to overwrite. (Not sure how to check if it's the same file. Also, how to step sending the chunks from client to server.) Clicking on resume will start from where it is required to be uploaded and will append that to the file on the server. (Again not sure how to do this.) Questions: Are these steps correct to achieve the goal? Or need some modifications? I'm not sure how to implement all these steps. :-( Need ideas, links... Any help appreciated...

    Read the article

  • no statement parsed and wrong number or types of arguments - cfstoredproc

    - by Travis
    I have an Oracle procedure - editBacklog which I'm calling from a CFM page via cfstoredproc. After several changes to the procedure I started getting ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'EDITBACKLOG'. I've gotten this before and found that if I changed the name of the procedure it starts working again. I changed the name to editBacklog2 and it worked as I expected it to. I changed the name back to editBacklog and got the same error. I changed the name back to editBacklog2 again and started getting ORA-01003: no statement parsed. NOTHING has changed at this point except for the names. I changed the name yet again to editBacklog3 and it works as expected. As of right now editBacklog = ORA-06550 editBacklog2 = ORA-01003 editBacklog3 = works (kinda) This whole thing started when I was trying to fix an ORA-01821: date format not recognized error. I fear when I start changing things I'll start getting the same lame behavior described above. Either Oracle or CF is messing with me and I'll end up liking one of them less because of it. I assume it's probably cfstoredproc caching metadata or something but neither google, livedocs, or OTN have much to say about my situation. I'm not the SA or DBA. Anyone have any ideas?

    Read the article

  • Reading a Serial Port - Ignore portion of data written to serial port for certain time

    - by farmerjoe
    I would like to read data coming and Arduino on a serial port on intervals. So essentially something like Take a reading Wait Take a reading Wait Take ... etc. The problem I am facing is that the port will buffer its information so as soon as I call a wait function the data on the serial port will start buffering. Once the wait function finishes I try and read the data again but I am reading from the beginning of the buffer and the data is not current anymore, but instead is the reading taken at roughly the time the wait function began. My question is whether there is a way that I am unaware of to ignore the portion of data read in during that wait period and only read what is currently being delivered on the serial port? I have this something analogous to this so far: import serial s = serial.Serial(path_to_my_serial_port,9600) while True: print s.readline() time.sleep(.5) For explanation purposes I have the Arduino outputting the time since it began its loop. By the python code, the time of each call should be a half second apart. By the serial output the time is incrementing in less than a millisecond. These values do not change regardless of the sleep timing. Sample output: 504 504 504 504 505 505 505 ... As an idea of my end goal, I would like to measure the value of the port, wait a time delay, see what the value is then, wait again, see what the value is then, wait again. I am currently using Python for this but am open to other languages.

    Read the article

  • lseek/write suddenly returns -1 with errno = 9 (Bad file descriptor)

    - by Ger Teunis
    My application uses lseek to seek the desired position to write data. The file is opened using open() command successfully and my application was able to use lseek and wite lots of times. At a given time, for some users and not easily reproducible the lseek returns -1 with an errno of 9. File is not closed before this and the filehandle (int) isn't reset. After this an other file is created open is okay again and lseek and write works again. To make it even worse, this user tried the complete sequence again and all was well. So my question is, can the OS close the file handle for me for some reason? What could cause this? A file indexer or file scanner of some sort? What is the best way to solve this; is this pseudo code the best solution? (never mind the code layout, will create functions for it) int fd=open(...); if (fd>-1) { long result = lseek(fd,....); if (result == -1 && errno==9) { close(fd..); //make sure we try to close nicely fd=open(...); result = lseek(fd,....); } } Anybody experience with something similar? Summary: file seek and write works okay for a given fd and suddenly gives back errno=9 without a reason.

    Read the article

  • Why does my Delphi program's memory continue to grow?

    - by lkessler
    I am using Delphi 2009 which has the FastMM4 memory manager built into it. My program reads in and processes a large dataset. All memory is freed correctly whenever I clear the dataset or exit the program. It has no memory leaks at all. Using the CurrentMemoryUsage routine given in spenwarr's answer to: http://stackoverflow.com/questions/437683/how-to-get-the-memory-used-by-a-delphi-program, I have displayed the memory used by FastMM4 during processing. What seems to be happening is that memory is use is growing after every process and release cycle. e.g.: 1,456 KB used after starting my program with no dataset. 218,455 KB used after loading a large dataset. 71,994 KB after clearing the dataset completely. If I exit at this point (or any point in my example), no memory leaks are reported. 271,905 KB used after loading the same dataset again. 125,443 KB after clearing the dataset completely. 325,519 KB used after loading the same dataset again. 179,059 KB after clearing the dataset completely. 378,752 KB used after loading the same dataset again. It seems that my program's memory use is growing by about 53,400 KB upon each load/clear cycle. Task Manager confirms that this is actually happening. I have heard that FastMM4 does not always release all of the program's memory back to the Operating system when objects are freed so that it can keep some memory around when it needs more. But this continual growing bothers me. Since no memory leaks are reported, I can't identify a problem. Does anyone know why this is happening, if it is bad, and if there is anything I can or should do about it?

    Read the article

  • How can I improve my real-time behavior in multi-threaded app using pthreads and condition variables

    - by WilliamKF
    I have a multi-threaded application that is using pthreads. I have a mutex() lock and condition variables(). There are two threads, one thread is producing data for the second thread, a worker, which is trying to process the produced data in a real time fashion such that one chuck is processed as close to the elapsing of a fixed time period as possible. This works pretty well, however, occasionally when the producer thread releases the condition upon which the worker is waiting, a delay of up to almost a whole second is seen before the worker thread gets control and executes again. I know this because right before the producer releases the condition upon which the worker is waiting, it does a chuck of processing for the worker if it is time to process another chuck, then immediately upon receiving the condition in the worker thread, it also does a chuck of processing if it is time to process another chuck. In this later case, I am seeing that I am late processing the chuck many times. I'd like to eliminate this lost efficiency and do what I can to keep the chucks ticking away as close to possible to the desired frequency. Is there anything I can do to reduce the delay between the release condition from the producer and the detection that that condition is released such that the worker resumes processing? For example, would it help for the producer to call something to force itself to be context switched out? Bottom line is the worker has to wait each time it asks the producer to create work for itself so that the producer can muck with the worker's data structures before telling the worker it is ready to run in parallel again. This period of exclusive access by the producer is meant to be short, but during this period, I am also checking for real-time work to be done by the producer on behalf of the worker while the producer has exclusive access. Somehow my hand off back to running in parallel again results in significant delay occasionally that I would like to avoid. Please suggest how this might be best accomplished.

    Read the article

  • Strange activity stack behavior when using MapActivity

    - by AndroidDev
    I have the following activity structure in my application A simple "splash screen" activity is started when the application is fired up (let's call it "Splash"). This activity starts the main activity when the user presses a button (I will call it "Main"). Main can in turn start two activities from the menu. The first activity presents a simple form (let's call this one "Form"), the second is a MapActivity that presents a map (it is called "Map"). Main, Form, and Map are declared exactly the same in the manifest: <activity android:name="fully qualified activity class" android:screenOrientation="landscape" android:configChanges="keyboard|keyboardHidden|orientation" > <intent-filter> <action android:name="android.intent.action.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> When Main is active and I start Form and press "back", Main comes up again. Pressing "back" again brings up "Splash". Nothing strange here. Now comes the strange part: when I am in Main, start Map, and press "back", Main comes up as expected. But pressing "back" again just restarts Main. A second press on "back" is needed to bring me back to Splash! So it seems that starting the Map activity somehow results in Main ending up on the activity stack twice while starting the Form activity does not! Both Form and Map are started like this: startActivity(new Intent(this, MyActivity.class)); I don not catch the back key in any activity. Any clues on what is going on or how to debug this?

    Read the article

  • SHLoadImageFile(L"\\Program Files\\TrainingApp\\background.png"); whats that L in the argument for?

    - by ashishsony
    Hi, ive been working on c++ on linux for the past 2 years,and switched to windows c++ programming recently. can anyone tell me what that L is there in the argument of the function: SHLoadImageFile(L"\\Program Files\\TrainingApp\\background.png"); and on viewing certain sample code in MSVS C++ i came across hundereds of typedefs like.. LPARAM// typedef LONG_PTR LPARAM... here LONG_PTR is again typedef as __w64 long WPARAM// typedef UINT_PTR WPARAM... so there is a lot of chained typedefs.. I never saw this much of typedef chaining on c++ programming on linux using gcc.. what i want to say is that it just creates more confusion in this way for windows application programming.. while ive seen application programming on linux using frameworks like Qt.. there such things are rarely used.. so is there specific purpose in typedefining again and again on MSVSC++?? for eg.. there are typdefs like typedef int BOOL; whats the use of this when normal bool is available already..?? there are hundred other cases ive come across where just to decide what data type to use becomes so difficult.. it becomes difficult to understand a pre written code in this fashion too.. Thanks.

    Read the article

  • Apache POI Comment Excel

    - by Marquinio
    I need to add a comment to an HSSF Cell in Excel. Everything works fine the very first time but if I open the same file and run the code again it corrupts the file. I've also noticed that I need to create a Drawing object on a Sheet only once: _sheet.createDrawingPatriarch(); If the line above gets executed more than once comments will not work. So has anyone tried adding comments to Cells, closing the file, opening the file again and trying to add more comments to different cells? The below code works but if I open the file again then comments are not added, plus the file gets corrupted!!! Is there a way to get the existing Drawing object from a Sheet? Any ideas appreciated. Thanks!! _drawing = (HSSFPatriarch) _sheet.createDrawingPatriarch(); Row row = _sheet.getRow(rowIndex_); Cell cell = row.getCell(0); CreationHelper factory = _workbook.getCreationHelper(); HSSFAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, (short)4, 2, (short)6, 5); org.apache.poi.ss.usermodel.Comment comment = _drawing.createComment(anchor); RichTextString str = factory.createRichTextString("Hello, World "+rowIndex_); comment.setString(str); cell.setCellComment(comment);

    Read the article

  • DDD: Persisting aggregates

    - by Mosh
    Hello, Let's consider the typical Order and OrderItem example. Assuming that OrderItem is part of the Order Aggregate, it an only be added via Order. So, to add a new OrderItem to an Order, we have to load the entire Aggregate via Repository, add a new item to the Order object and persist the entire Aggregate again. This seems to have a lot of overhead. What if our Order has 10 OrderItems? This way, just to add a new OrderItem, not only do we have to read 10 OrderItems, but we should also re-insert all these 10 OrderItems again. (This is the approach that Jimmy Nillson has taken in his DDD book. Everytime he wants to persists an Aggregate, he clears all the child objects, and then re-inserts them again. This can cause other issues as the ID of the children are changed everytime because of the IDENTITY column in database.) I know some people may suggest to apply Unit of Work pattern at the Aggregate Root so it keeps track of what has been changed and only commit those changes. But this violates Persistence Ignorance (PI) principle because persistence logic is leaking into the Domain Model. Has anyone thought about this before? Mosh

    Read the article

  • CorePlot linker errors after upgrading iOS SDK

    - by JustinXXVII
    This seems like it's happened before but somehow ended up working itself out. It's happened again and I can't seem to get this fixed. I use the CorePlot Cocoa Touch framework. Everything was fine until I upgraded to the new 4.3 beta. Now my project won't compile, and is giving me linker errors for unknown symbols having to do with CorePlot. I've become a pro at adding the framework to my project, and I've checked and rechecked the instructions trying to do it again. Is there a button I can click or anything to just make this work again? I've used these instructions to try to re-add the framework, to no avail EDIT: By the way, this compiles just fine for simulator and runs graphs no problem. Compiling for the device gives me the linker errors, as follows: "_OBJC_CLASS_$_CPPlotRange", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPXYGraph", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPTextStyle", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPLineStyle", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPScatterPlot", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPAxisLabel", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPPlotSymbol", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPColor", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_OBJC_CLASS_$_CPFill", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o "_CPDecimalFromFloat", referenced from: -[GraphStatsWindow setNewGraph] in GraphStatsWindow.o -[iPadGraphView viewDidLoad] in iPadGraphView.o -[GraphTrendView setNewGraph] in GraphTrendView.o "_kCPPlainWhiteTheme", referenced from: -[GraphStatsWindow setNewGraph] in GraphStatsWindow.o -[iPadGraphView viewDidLoad] in iPadGraphView.o -[GraphTrendView setNewGraph] in GraphTrendView.o "_OBJC_CLASS_$_CPTheme", referenced from: objc-class-ref in GraphStatsWindow.o objc-class-ref in iPadGraphView.o objc-class-ref in GraphTrendView.o ld: symbol(s) not found for architecture armv7

    Read the article

  • global variables in php not working as expected

    - by Josh Smeaton
    I'm having trouble with global variables in php. I have a $screen var set in one file, which requires another file that calls an initSession() defined in yet another file. The initSession() declares "global $screen" and then processes $screen further down using the value set in the very first script. How is this possible? To make things more confusing, if you try to set $screen again then call the initSession(), it uses the value first used once again. The following code will describe the process. Could someone have a go at explaining this? $screen = "list1.inc"; // From model.php require "controller.php"; // From model.php initSession(); // From controller.php global $screen; // From Include.Session.inc echo $screen; // prints "list1.inc" // From anywhere $screen = "delete1.inc"; // From model2.php require "controller2.php" initSession(); global $screen; echo $screen; // prints "list1.inc" Update: If I declare $screen global again just before requiring the second model, $screen is updated properly for the initSession() method. Strange.

    Read the article

  • Repeatedly execute a stored procedure

    - by manivineet
    I have a situation where I need to repeatedly execute a stored procedure Now this procedure (spMAIN) has a cursor inside which looks for a value from a table as T1,which has the following structure ID Status ---- -------- 1 New 2 New 3 success 4 Error now the cursor looks for all rows with a status of 'New' Now while processing , if that instance of the cursor encounters an error, another SP say spError needs to be called, the 'Status' column in T1 needs to be updated to 'Error' and spMAIN needs to be called again which again repeats the process, looking for rows with 'new' how do I do it? Also, also, while we are at it, what if an SP has other SPs inside it and if any of those SP raises an error, same thing needs to be done, the T1 table needs to be updated ('Error') and spMAIN needs to be called again. can you also recommend something ? here's some code ALTER PROC zzSpMain AS BEGIN DECLARE @id INT BEGIN TRY IF EXISTS ( SELECT * FROM dbo.zzTest WHERE istatus = 'new' ) BEGIN DECLARE c CURSOR FOR SELECT id FROM zztest WHERE istatus = 'new' OPEN c FETCH NEXT FROM c INTO @id WHILE @@FETCH_STATUS = 0 BEGIN PRINT @id IF @id = 2 BEGIN UPDATE zztest SET istatus = 'error' WHERE id = @id RAISERROR ( 'Error occured', 16, 1 ) END UPDATE zztest SET istatus = 'processed' WHERE id = @id FETCH NEXT FROM c INTO @id END CLOSE c DEALLOCATE c END END TRY begin CATCH EXEC zzSpError END CATCH END

    Read the article

  • C Programming Logic Error?

    - by mbpluvr64
    The following code compiles fine, but does not allow the user to choose whether or not the program is to run again. After giving the user the answer, the program automatically terminates. I placed the main code in a "do while" loop to have the ability to convert more than one time if I wanted too. I have tried to run the program in the command line (Mac and Ubuntu machines) and within XCode with the exact same results. Any assistance would be greatly appreciated. C Beginner P.S. Compiling on MacBookPro running Snow Leopard. #include <stdio.h> #include <stdlib.h> int main(void) { char anotherIteration = 'Y'; do { const float Centimeter = 2.54f; float inches = 0.0f; float result = 0.0f; // user prompt printf("\nEnter inches: "); scanf("%f", &inches); if (inches < 0) { printf("\nTry again. Enter a positive number.\n"); break; } else { // calculate result result = inches * Centimeter; } printf("%0.2f inches is %0.2f centimeters.\n", inches, result); // flush input fflush(stdin); // user prompt printf("\nWould you like to run the program again? (Y/N): "); scanf("%c", &anotherIteration); if ((anotherIteration != 'Y') || (anotherIteration != 'N')) { printf("\nEnter a Y or a N."); break; } } while(toupper(anotherIteration == 'Y')); printf("Program terminated.\n"); return 0; }

    Read the article

  • Hibernate overriding database modifications with detached object state

    - by EugeneP
    I'm gonna go with this design: create an object and keep it alive during all web-app session. And I need to synchronize its state with database state. What I want to achieve is that : IF between my db operations, that is, modifications that I persist to a db someone intentionally spoils table rows, then on next saving to a database all those changes WOULD BE OVERWRITTEN with the object state, that always contains valid data. What Hibernate methods do you recommend me to use to persist the modifications in a database? saveOrUpdate() is a possible solution, but maybe there's anything better? Again, I repeat how it looks. First I create an object without collections. Persist it (save()). Then user provides us with additional data. In a serviceLayer, again, we modify our object in memory (say, populate it with collections) and then, persist it again. So every serviceLayer operation of the next step must simply guarantee that database contains the exact persistent copy of this object that we have in memory. If data in a database differ, it MUST BE OVERRIDDEN with the object (kept in memory) state. What Session operations do you recommend?

    Read the article

  • Best strategy for synching data in iPhone app

    - by iamj4de
    I am working on a regular iPhone app which pulls data from a server (XML, JSON, etc...), and I'm wondering what is the best way to implement synching data. Criteria are speed (less network data exchange), robustness (data recovery in case update fails), offline access and flexibility (adaptable when the structure of the database changes slightly, like a new column). I know it varies from app to app, but can you guys share some of your strategy/experience? For me, I'm thinking of something like this: 1) Store Last Modified Date in iPhone 2) Upon launching, send a message like getNewData.php?lastModifiedDate=... 3) Server will process and send back only modified data from last time. 4) This data is formatted as so: <+><data id="..."></data></+> // add this to SQLite/CoreData <-><data id="..."></data></-> // remove this <%><data id="..."><attribute>newValue</attribute></data></%> // new modified value I don't want to make <+, <-, <%... for each attribute as well, because it would be too complicated, so probably when receive a <% field, I would just remove the data with the specified id and then add it again (assuming id here is not some automatically auto-incremented field). 5) Once everything is downloaded and updated, I will update the Last Modified Date field. The main problem with this strategy is: If the network goes down when I am updating something = the Last Modified Date is not yet updated = next time I relaunch the app, I will have to go through the same thing again. Not to mention potential inconsistent data. If I use a temporary table for update and make the whole thing atomic, it would work, but then again, if the update is too long (lots of data change), the user has to wait a long time until new data is available. Should I use Last-Modified-Date for each of the data field and update data gradually?

    Read the article

  • hibernate c3p0 broken pipe

    - by raven_arkadon
    Hi, I'm using hibernate 3 with c3p0 for a program which constantly extracts data from some source and writes it to a database. Now the problem is, that the database might become unavailable for some reasons (in the simplest case: i simply shut it down). If anything is about to be written to the database there should not be any exception - the query should wait for all eternity until the database becomes available again. If I'm not mistaken this is one of the things the connection pool could do for me: if there is a problem with the db, just retry to connect - in the worst case for infinity. But instead i get a broken pipe exception, sometimes followed by connection refused and then the exception is passed to my own code, which shouldn't happen. Even if I catch the exception, how could i cleanly reinitialize hibernate again? (So far without c3p0 i simply built the session factory again, but i wouldn't be surprised if that could leak connections (or is it ok to do so?)). The database is Virtuoso open source edition. My hibernate.xml.cfg c3p0 config: <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> <property name="hibernate.c3p0.breakAfterAcquireFailure">false</property> <property name="hibernate.c3p0.acquireRetryAttempts">-1</property> <property name="hibernate.c3p0.acquireRetryDelay">30000</property> <property name="hibernate.c3p0.automaticTestTable">my_test_table</property> <property name="hibernate.c3p0.initialPoolSize">3</property> <property name="hibernate.c3p0.minPoolSize">3</property> <property name="hibernate.c3p0.maxPoolSize">10</property> btw: The test table is created and i get tons of debug output- so it seems it actually reads the config.

    Read the article

  • How do i change this method to get strings instead of ints

    - by David
    here is the original code: public static int getInt () { Scanner in = new Scanner (System.in) ; if (in.hasNextInt()) { int a = in.nextInt() ; return a ; } else { System.out.println ("try again:") ; return getInt () ; } } This checks and sees if the input it receives is an int. If it is then it returns the int, if not it tells you to try again and re-runs. This is what i tried to do to change it: public static String getIns () { Scanner in = new Scanner (System.in) ; if (in.hasNextString()) { String a = in.nextString() ; return a ; } else { System.out.println ("try again:") ; return getIns () ; } } This doesn't work though. I looked through the documentation for the scanner class and i think the problem is that there is no such method as in.hasNextString or in.nextString What methods from the scanner class can i use to do what i intend these to do?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >