Search Results

Search found 3459 results on 139 pages for 'if modified since'.

Page 108/139 | < Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >

  • How to get a checkout-able revision info from subversion?

    - by zhongshu
    I want to check a svn url and to get the latest revision, then checkout it, I don't want to use HEAD because I will compare the latest revision to others. so I use "svn info" to get the "Last Changed Rev" for the url like this: D:\Project>svn info svn://.../branches/.../path Path: ... URL: svn://.../branches/.../path Repository Root: svn://yt-file-srv/ Repository UUID: 9ed5ffd7-7585-a14e-96b2-4aab7121bb21 Revision: 2400 Node Kind: directory Last Changed Author: xxx Last Changed Rev: 2396 Last Changed Date: 2010-03-12 09:31:52 +0800 but, I found the 2396 revision is not checkout-able, because this path is in a branch copied from trunk, and the 2396 is the revision modified in the trunk. so when I use svn checkout -r 2396, I will get a workcopy for the path in the trunk, then I can not do checkin for the branch. D:\Project>svn checkout svn://.../branches/.../path -r 2396 workcopy ..... ..... D:\Project>svn info workcopy Path: workcopy URL: svn://.../trunk/.../path Repository Root: svn://yt-file-srv/ Repository UUID: 9ed5ffd7-7585-a14e-96b2-4aab7121bb21 Revision: 2396 Node Kind: directory Schedule: normal Last Changed Author: xxx Last Changed Rev: 2396 Last Changed Date: 2010-03-12 09:31:52 +0800 So, my question is how to get a checkout-able revision for the branch path, for this example, I want to get 2397 (because 2397 is the revision which copy occur). And I know "svn log" can get the info, but "svn log" output maybe very long and parse it will be difficult than "svn info". I just want know which revision is the latest checkout-able revision for the path.

    Read the article

  • Creating new image in a loop using OpenCV

    - by user565415
    I am programing some image conversion code with OpenCV and I don't know how can I create image memory buffer to load image on every iteration. I have number of iteration (maxImNumber) and I have an input image. In every loop program must create image that is resized and modified input image. Here is some basic code (concept). for (int imageIndex = 0; imageIndex < maxImNumber; imageIndex++){ cvCopy(inputImage, images[imageIndex], 0); cvReleaseImage(&inputImage); images[imageIndex+1] = cvCreateImage(cvSize((image[imageIndex]->width)/2, image[imageIndex]->height), IPL_DEPTH_8U, 1); for (i=1; i < image[imageIndex]->height; i++) { index = 0; // for(j=0; j < image[imageIndex]->width ; j=j+2){ // doing some basic matematical operation on image content and store it to new image images[imageIndex+1][i][index] = (image[imageIndex][i][j] + image[imageIndex][i][j+2])/2; index++ } } inputImage = cvCreateImage(cvSize((image[imageIndex+1]->width), image[imageIndex]->height), IPL_DEPTH_8U, 1); cvCopy(images[imageIndex+1], inputImage, 0); } Can somebody, please, explain how can I create this image buffer (images[]) and allocate memory for it. Also how can I access any image in this buffer? Thank you very much in advance!

    Read the article

  • Sending information between JavaScript and Web Services using AJAX

    - by COB-CSU-AM
    Alright so I'm using Microsoft's Web Services and AJAX to get information from a SQL database for use with java script on the client side. And I'm wondering what the best method is. Before I started working on the project, the web services were setup to return a C# List filled with some objects. Those objects variables (ints, strings, etc.) contain the data I want to use. Of course, java script can't do much with this, to the best of my knowledge. I then modified the web service to return a 2D Array, but java script got confused, and to the best of my knowledge can't handle 2D array's returned from C#. I then tried to use a regular array, but then a found the length property of an array in JS doesn't carry over, so I couldn't preform a for loop through all the items, because there wasn't anyway of knowing how many elements there were. The only other thing I can thing of is returning a string with special char's to separate the data, but this seems way too convoluted. Any suggestions? Thanks in advance!

    Read the article

  • Reordering fields in Django model

    - by Alex Lebedev
    I want to add few fields to every model in my django application. This time it's created_at, updated_at and notes. Duplicating code for every of 20+ models seems dumb. So, I decided to use abstract base class which would add these fields. The problem is that fields inherited from abstract base class come first in the field list in admin. Declaring field order for every ModelAdmin class is not an option, it's even more duplicate code than with manual field declaration. In my final solution, I modified model constructor to reorder fields in _meta before creating new instance: class MyModel(models.Model): # Service fields notes = my_fields.NotesField() created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class Meta: abstract = True last_fields = ("notes", "created_at", "updated_at") def __init__(self, *args, **kwargs): new_order = [f.name for f in self._meta.fields] for field in self.last_fields: new_order.remove(field) new_order.append(field) self._meta._field_name_cache.sort(key=lambda x: new_order.index(x.name)) super(TwangooModel, self).__init__(*args, **kwargs) class ModelA(MyModel): field1 = models.CharField() field2 = models.CharField() #etc ... It works as intended, but I'm wondering, is there a better way to acheive my goal?

    Read the article

  • iphone: memory problems after refactor

    - by agilpwc
    I had a NIB with several view controllers in it. I modified the code and used Interface Builder decomose interface to get all the view controllers in their own Nib. But now with empty core data database, I'm getting "message sent to deallocated instance" errors. Here is the code flow: From the RootViewController this is called: if (self.dogController == nil) { DogViewController *controller = [[DogViewController alloc] initWithNibName:@"DogViewController" bundle:nil]; self.dogController = controller; [controller release]; } self.dogController.managedObjectContext = self.managedObjectContext; [self.navigationController pushViewController:self.dogController animated:YES]; Then in a dogController a button is pressed to insert a new object and the following code is excuted and the error hits on the save, according to the trace NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; // If appropriate, configure the new managed object. [newManagedObject setValue:[NSDate date] forKey:@"birthDate"]; [newManagedObject setValue:@"-" forKey:@"callName"]; // Save the context. NSError *error = nil; if (![context save:&error]) { Then the error produced in the console is * -[JudgeViewController numberOfSectionsInTableView:]: message sent to deallocated instance 0x598e580 I'm racking my brain for hours and I can't figure out where my minor changes made something messed up. Any ideas?

    Read the article

  • Show/hide rows with jquery

    - by Mike
    Hi I am using some modified code from another post. Basically I want to switch between showing 10 rows of a table to showing all rows (50 for example). I have got it to show from 10 rows to all, however what I need to do now is code it so that if I click the div again it toggles or resets back to showing 10 rows. <script type="text/javascript"> var numShown = 10; // Initial rows shown & index var numRows = $('tbody').find('tr').length; var numLeft = numRows - numShown; $(document).ready(function(){ // Hide rows and add clickable div $('tbody') .find('tr:gt(' + (numShown - 1) + ')').hide().end() $('#table_wrapper').after('<div id="more">Show all offers <span>(' + numLeft + ' more)</span></div>'); $('#more').click(function(){ numShown = numShown + numRows; // 7 + 1 = 8 $('tbody').find('tr:lt('+numShown+')').show(); $("#more").html("Show top 10 offers"); }) }) </script>

    Read the article

  • Adding to page control collection from inside a user control

    - by Zarigani
    I have an asp.net usercontrol which represents a "popup" dialog. Basically, it's a wrapper for the jQuery UI dialog which can be subclassed to easily make dialogs. As part of this control, I need to inject a div into the page the control is used on, either at the very top or very bottom of the form so that when the popup is instantiated, it's parent is changed to this div. This allows "nested" popups without the child popup being trapped inside the parent popup. The trouble is, I can't find a safe way to inject this div into the page. A usercontrol doesn't have a preinit event, so I can't do it there, and calling Page.Form.Controls.Add(...) in Init, Load or PreRender causes the standard exception "The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases." I thought I had found a solution by using... ScriptManager.RegisterClientScriptBlock(Page, Me.GetType, UniqueID + "_Dialog_Div", containerDiv, False) ... which seemed to work well normally, but recently a coworker tried putting an UpdatePanel inside the dialog and now she's getting the error "The script tag registered for type 'ASP.controls_order_viewzips_ascx' and key 'ctl00$ContentBody$OViewZips_Dialog_Div' has invalid characters outside of the script tags: . Only properly formatted script tags can be registered." How are you supposed to add controls to the pages control collection from inside a user control?

    Read the article

  • Entity Framework Decorator Pattern

    - by Anthony Compton
    In my line of business we have Products. These products can be modified by a user by adding Modifications to them. Modifications can do things such as alter the price and alter properties of the Product. This, to me, seems to fit the Decorator pattern perfectly. Now, envision a database in which Products exist in one table and Modifications exist in another table and the database is hooked up to my app through the Entity Framework. How would I go about getting the Product objects and the Modification objects to implement the same interface so that I could use them interchangeably? For instance, the kind of things I would like to be able to do: Given a Modification object, call .GetNumThings(), which would then return the number of things in the original object, plus or minus the number of things added by the modification. This question may be stemming from a pretty serious lack of exposure to the nitty-gritty of EF (all of my experience so far has been pretty straight-forward LOB Silverlight apps), and if that's the case, please feel free to tell me to RTFM. Thanks in advance!

    Read the article

  • MSI File/Registry failures on Windows Server 2008/Windows 7 (x64)

    - by Luca
    I'm trying to deploy an application on Windows Server 2008 (SP2 x64) and Windows 7 (x64), using VS2005 Installer Project. The MSI version (I think) it the 2.0. Everything works fine, except that some registry keys and some files are not copied on the install machine. The MSI system doesn't notify about nothing (and I don't know whether MSI logs its operations). Are there incompatibilities between my MSI installer project and these new OSes? It seems to me that the OS protect itself for being modified in some part. For example, I'm trying to set the registry keys: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\WinLogon\SpecialAccounts\UserList\User but it is not created. In the same installer there are many other keys, which are created like expected (as they always did before on Windows XP and Windows Server 2003). To provide another example, I'm trying to install the file %SystemFolder%\oobe\info\backgrounds\backgroundDefault.jpg (where %SystemFolder% is typically "C:\Windows\System32"), but the file is not copied at all!!! What's going on? I've found the backgroundDefault.jpg file is located in another directory: %SystemRoot%\SysWOW64\oobe\info. But I've not specified nothing about a System (64 bit) folder. How can I copy the file in the right place?

    Read the article

  • Algorithm to determine if array contains n...n+m?

    - by Kyle Cronin
    I saw this question on Reddit, and there were no positive solutions presented, and I thought it would be a perfect question to ask here. This was in a thread about interview questions: Write a method that takes an int array of size m, and returns (True/False) if the array consists of the numbers n...n+m-1, all numbers in that range and only numbers in that range. The array is not guaranteed to be sorted. (For instance, {2,3,4} would return true. {1,3,1} would return false, {1,2,4} would return false. The problem I had with this one is that my interviewer kept asking me to optimize (faster O(n), less memory, etc), to the point where he claimed you could do it in one pass of the array using a constant amount of memory. Never figured that one out. Along with your solutions please indicate if they assume that the array contains unique items. Also indicate if your solution assumes the sequence starts at 1. (I've modified the question slightly to allow cases where it goes 2, 3, 4...) edit: I am now of the opinion that there does not exist a linear in time and constant in space algorithm that handles duplicates. Can anyone verify this? The duplicate problem boils down to testing to see if the array contains duplicates in O(n) time, O(1) space. If this can be done you can simply test first and if there are no duplicates run the algorithms posted. So can you test for dupes in O(n) time O(1) space?

    Read the article

  • How to get attribute value using SelectSingleNode in C#?

    - by Nano HE
    Hello. I am parsing a xml document, I need find out the gid (an attribute) value (3810). Based on SelectSingleNode(). I found it is not easy to find the attribute name and it's value. Can I use this method or I must switch to other way. Attached my code. How can I use book obj to get the attribute value3810 for gid. Thank you. My test.xml file as below <?xml version="1.0"?> <root> <VersionInfo date="2007-11-28" version="1.0.0.2"/> <Attributes> <AttrDir name="EFEM" DirID="1"> <AttrDir name="Aligner" DirID="2"> <AttrDir name="SequenceID" DirID="3"> <AttrObj text="Slot01" gid="3810" unit="" scale="1"/> <AttrObjCount value="1"/> </AttrDir> </AttrDir> </AttrDir> </Attributes> </root> I wrote the test.cs as below public class Sample { public static void Main() { XmlDocument doc = new XmlDocument(); doc.Load("test.xml"); XmlNode book; XmlNode root = doc.DocumentElement; book = root.SelectSingleNode("Attributes[AttrDir[@name='EFEM']/AttrDir[@name='Aligner']/AttrDir[@name='SequenceID']/AttrObj[@text='Slot01']]"); Console.WriteLine("Display the modified XML document...."); doc.Save(Console.Out); } }

    Read the article

  • Ajax return string links not working

    - by Andreas Lympouras
    I have this ajax function: function getSearchResults(e) { var searchString = e.value; /*var x = e.keyCode; var searchString = String.fromCharCode(x);*/ if (searchString == "") { document.getElementById("results").innerHTML = ""; return; } var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("results").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET", "<%=Page.ResolveUrl("~/template/searchHelper.aspx?searchString=")%>"+searchString, true); xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); //solve any AJAX caching problem(not refreshing) xmlhttp.send(); } and here is when I call it: <input class="text-input" value="SEARCH" id="searchbox" onkeyup="javascript:getSearchResults(this);" maxlength="50" runat="server" /> and all my links in the searchHelper.aspx file(which retruns them as a string) are like this: <a class="item" href='../src/actors.aspx?id=77&name=dasdassss&type=a' > <span class="item">dasdassss</span></a> When I click this link I want my website to go to ../src/actors.aspx?id=77&name=dasdassss&type=a but nothing happens. When I hover over the link, it also shows me where the link is about to redirect! any help?

    Read the article

  • Detect modification of variable at runtime in C/C++

    - by YuppieNetworking
    Hello, I am developing a library in C++ where users/programmer will extend a class BaseClass that has a method initArray. This method should be implemented by the user/programmer and it should normally initialize all elements of the array m_arr. Here is a snipplet, modified to this example: class BaseClass { public: BaseClass(int n) { m_arr = new double[n]; size = n; }; virtual ~BaseClass(); int size; double* m_arr; virtual int initArray(); }; Sometimes, the user/programmer implements a initArray that does not initialize some elements of m_arr. What I would like is to create a function in my library that checks if initArray did initialize all elements of m_arr. This function should be called by a sanity-check rutine at runtime. My question: is it possible to detect changes on this array? I can only think of initializing the array with some invalid values (like NaN or Inf), call initArray and check that all values have changed. Thanks for your ideas, David

    Read the article

  • Draggable cards (touch enumeration) issue

    - by glitch
    I'm trying to let a player tap, drag and release a card from a fanned stack on the screen to a 4x4 field on the board. My cards are instantiated from a custom class that inherits from the UIImageView class. I started with the Touches sample app, and I modified the event handlers for touches to iterate over my player's card hand instead of the 3 squares the sample app allows you to move on screen. Everything works, until that is, I move the card I'm dragging near another card. I'm really drawing a blank here for the logic to get the cards to behave properly. Here's my code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSUInteger numTaps = [[touches anyObject] tapCount]; if(numTaps = 1) { for (UITouch *touch in touches) { [self dispatchFirstTouchAtPoint:[touch locationInView: self.boardCardView] forEvent:nil]; } } } -(void) dispatchFirstTouchAtPoint:(CGPoint)touchPoint forEvent:(UIEvent *)event { for (int i = 0; i<5; i++) { UIImageView *touchedCard = boardBuffer[i]; if (CGRectContainsPoint([touchedCard frame], touchPoint)) { [self animateFirstTouchAtPoint:touchPoint forView:touchedCard]; } } } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { NSUInteger touchCount = 0; for (UITouch *touch in touches){ [self dispatchTouchEvent:[touch view] toPosition:[touch locationInView:self.boardCardView]]; touchCount++; } } My questions are: How do I get the touch logic to disallow other cards from being picked up by a dragging finger? Is there anyway I can only enumerate the objects that are directly below a player's finger and explicitly disable other objects from responding? Thanks!

    Read the article

  • How to retrieve data from a dialog box?

    - by Ralph
    Just trying to figure out an easy way to either pass or share some data between the main window and a dialog box. I've got a collection of variables in my main window that I want to pass to a dialog box so that they can be edited. They way I've done it now, is I pass in the list to the constructor of the dialog box: private void Button_Click(object sender, RoutedEventArgs e) { var window = new VariablesWindow(_templateVariables); window.Owner = this; window.ShowDialog(); if(window.DialogResult == true) _templateVariables = new List<Variable>(window.Variables); } And then in there, I guess I need to deep-copy the list, public partial class VariablesWindow : Window { public ObservableCollection<Variable> Variables { get; set; } public VariablesWindow(IEnumerable<Variable> vars) { Variables = new ObservableCollection<Variable>(vars); // ... So that when they're edited, it doesn't get reflected back in the main window until the user actually hits "Save". Is that the correct approach? If so, is there an easy way to deep-copy an ObservableCollection? Because as it stands now, I think my Variables are being modified because it's only doing a shallow-copy.

    Read the article

  • Saving an ActiveRecord non-transactionally.

    - by theFunkyEngineer
    My application accepts file uploads, with some metadata being stored in the DB, and the file itself on the file system. I am trying to make the metadata visible in the application before the file upload and post-processing are finished, but because saves are transactional, I have had no success. I have tried the callbacks and calling create_or_update() instead of save(), all to no avail. Is there a way to do this without re-writing the guts of ActiveRecord::Base? I've even attempted naming the method make() instead of save(), but perplexingly that had no effect. The code below "works" fine, but the database is not modified until everything else is finished. def save(upload) uploadFile = upload['datafile'] originalName = uploadFile.original_filename self.fileType = File.extname(originalName) create_or_update() # write the file File.open(self.filePath, "wb") { |f| f.write(uploadFile.read) } begin musicFile = TagLib::File.new(self.filePath()) self.id3Title = musicFile.title self.id3Artist = musicFile.artist self.id3Length = musicFile.length rescue TagLib::BadFile => exc logger.error("Failed to id track: \n #{exc}") end if(self.fileType == '.mp3') convertToOGG(); end create_or_update() end Any ideas would be quite welcome, thanks.

    Read the article

  • Meteor: how to update DOM via Javascript without a page refresh?

    - by strack
    UPDATE: It looks like this script may be the catalyst I'm looking for. Will test it and answer/close this question if so. I'm sure I'll find the answer to this eventually, but I'm putting it out there now, in case someone else knows it right off... I am using RaphaelJS to manipulate the DOM (adds a bunch of SVG tags to an identified DIV), and I want to re-render those specific DOM parts, if there's an update to the MongoDB collection. As an example: -Let's say that I have a collection called PiePieces. -When the page is first rendered/ called, let's pretend that the number of pieces in the collection is 4. -I programmatically add a pie piece using console: PiePieces.insert({...}) -I want the page to update like it would for a standard handlebars binding situation, but the problem is, the new entry needs to go through the Raphael script, which performs direct DOM manipulation. So, the logic would go something like this: MongoDB collection update event - Client function call to manipulate DOM - DOM modified/ page updated without a refresh. I've tried implementing this by reading values from the DOM itself, and I can get the updated DOM, but the entire page refreshes and/or I have to manually refresh the page, OR the DOM tree isn't completed yet, and so it's blank until I refresh. Can you point me in the right direction, maybe with a small code snippet/example? (if something similar already exists, just tell me where and I'll go digging) Thanks in advance! (I am LOVING Meteor so far...)

    Read the article

  • Is it possible to auto update only selected properties on an existent entity object without touching the others

    - by LaserBeak
    Say I have a bunch of boolean properties on my entity class public bool isActive etc. Values which will be manipulated by setting check boxes in a web application. I will ONLY be posting back the one changed name/value pair and the primary key at a time, say { isActive : true , NewsPageID: 34 } and the default model binder will create a NewsPage object with only those two properties set. Now if I run the below code it will not only update the values for the properties that have been set on the NewsPage object created by the model binder but of course also attempt to null all the other non set values for the existent entity object because they are not set on NewsPage object created by the model binder. Is it possible to somehow tell entity framework not to look at the properties that are set to null and attempt to persist those changes back to the retrieved entity object and hence database ? Perhaps there's some code I can write that will only utilize the non-null values and their property names on the NewsPage object created by model binder and only attempt to update those particular properties ? [HttpPost] public PartialViewResult SaveNews(NewsPage Np) { Np.ModifyDate = DateTime.Now; _db.NewsPages.Attach(Np); _db.ObjectStateManager.ChangeObjectState(Np, System.Data.EntityState.Modified); _db.SaveChanges(); _db.Dispose(); return PartialView("MonthNewsData"); } I can of course do something like below, but I have a feeling it's not the optimal solution. Especially considering that I have like 6 boolean properties that I need to set. [HttpPost] public PartialViewResult SaveNews(int NewsPageID, bool isActive, bool isOnFrontPage) { if (isActive != null) { //Get entity and update this property } if (isOnFontPage != null) { //Get entity and update this property } }

    Read the article

  • Why do we need Audit Columns in Database Tables?

    - by Software Enthusiastic
    Hi I have seen many database designs having following audit columns on all the tables... Created By Create DateTime Updated By Upldated DateTime From one perspective I see tables from the following view... Entity Tables: Good candidate for Audit columns) Reference Tables: Audit columns may or may not required. In some case last update information is not at all required because record is never going to be modified.) Reference Data Tables Like Country Names, Entity State etc... Audit columns may not required because these information is created only during system installation time, and never going to be changed. I have seen many designers blindly put all audit columns to all tables, is this practice good, if yes what could be the reason... I just want to know because to me it seems illogical. It is difficult for me to figure out why do they design their db this way? I am not saying they are wrong or right, just want to know the WHY? You can also suggest me, if there is an alternative auditing patter or solution available... Thanks and Regards

    Read the article

  • Handling primary key duplicates in a data warehouse load

    - by Meff
    I'm currently building an ETL system to load a data warehouse from a transactional system. The grain of my fact table is the transaction level. In order to ensure I don't load duplicate rows I've put a primary key on the fact table, which is the transaction ID. I've encountered a problem with transactions being reversed - In the transactional database this is done via a status, which I pick up and I can work out if the transaction is being done, or rolled back so I can load a reversal row in the warehouse. However, the reversal row will have the same transaction ID and so I get a primary key violation. I've solved this for now by negating the primary key, so transaction ID 1 would be a payment, and transaction ID -1 (In the warehouse only) would be the reversal. I have considered an alternative of generating a BIT column, where 0 is normal and 1 is reversal, then making the PK the transaction ID and the BIT column. My question is, is this a good practice, and has anyone else encountered anything like this? For reference, this is a payment processing system, so values will not be modified, so there will only ever be transactions and reversals.

    Read the article

  • switch statemt functioning improperly and giving error when i put break;

    - by nav
    The following is the code i used in a program - over here the month variable is an integer switch(month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; break; case 2: return 28; break; case 4: case 6: case 9: case 11: return 30; break; default: System.out.println("Invalid month."); return 0; } surprisingly, when i use the above switch construct.. it gives an error saying.. code unreachable for statements after each break statement Then i removed all the break statements, and the new code looks like this --- switch(month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; case 2: return 28; case 4: case 6: case 9: case 11: return 30; default: System.out.println("Invalid month."); return 0; } Now.. after removing the break statements .. the code worked perfectly well.. My question is... in the switch construct.. it is mandatory to use break.. or else the control flow continued.. and all the conditions are tested and executed!! right??? So why in the world is the previous ** syntactically Right** version giving an error.. and the modified syntactically incorrect version running perfectly well.. Any explanation.. anyone!!

    Read the article

  • Visual C++ function suddenly 170 ms slower (4x longer)

    - by Mikael
    For the past few months I've been working on a Visual C++ project to take images from cameras and process them. Up until today this has taken about 65 ms to update the data but now it has suddenly increased significantly. What happens is: I launch my program and for the first 30 or so iterations it performs as expected, then suddenly the loop time increases from 65 ms to 250 ms. The odd thing is, after timing each function I found out that the part of the code which is causing the slowdown is fairly basic and has not been modified in over a month. The data which goes into it is unchanged and identical every iteration but the execution time which is initially less than 1 ms suddenly increases to 170 ms while the rest of the code is still performing as expected (time-wise). Basically, I am calling the same function over and over, for the first 30 calls it performs as it should, after that it slows down for no apparent reason. It might also be worth noting that it is a sudden change in execution time, not a gradual increase. What could be causing this? The code is leaking some memory (~50 kb/s) but not nearly enough to warrant a sudden 4x slowdown. If anyone has any ideas I'd love to hear them!

    Read the article

  • Not crawling the same content twice

    - by sirrocco
    I'm building a small application that will crawl sites where the content is growing (like on stackoverflow) the difference is that the content once created is rarely modified. Now , in the first pass I crawl all the pages in the site. But next, the paged content of that site - I don't want to re-crawl all of it , just the latest additions. So if the site has 500 pages, on the second pass if the site has 501 pages then I would only crawl the first and second pages. Would this be a good way to handle the situation ? In the end, the crawled content will end up in lucene - creating a custom search engine. So, I would like to avoid crawling multiple times the same content. Any better ideas ? EDIT : Let's say the site has a page : Results that will be accessed like so : Results?page=1 , Results?page=2 ...etc I guess that keeping a track of how many pages there were at the last crawl and just crawl the difference would be enough. ( maybe using a hash of each result on the page - if I start running into the same hashes - I should stop)

    Read the article

  • Creating multiple instances of a generic database

    - by sagekilla
    Hi all, currently I'm trying to have a setup where a generic database is distributed to students. They would develop an application using this database (Say a shopping cart application), submit their project onto our server, and then it would be graded automatically. These databases are being run in Microsoft SQL Server 2005. We're using user instances to instantiate each database, and multiple requests could be serviced at once. But, the problem is when more than one student submitted a project to be graded, the first database to be instantiated would be the only one and would overwrite all other copies that were currently open. So if stu1 modified his database and stu2 and stu3 had their projects being graded concurrently, at the end of the grading stu1, stu2, and stu3 would have identical DB's at the end. Is there any way I can have multiple independent copies of a generic database, each of which I can load concurrently and modify without having any changes made to any one affecting the others? I did a little reading, and thought it might be possible to do something along the lines of: Student submits project Attach the database with unique db name (specified by student) Do all necessary operations Detach the database I'm unsure if this would fix our problem or be possible, so any help would be much appreciated!

    Read the article

  • How do I call this function in CodeIgniter controller?

    - by Jason Shultz
    I've got this code, but I'm not sure I make it work: /** * Function: youtube data grabber * * @description : * @param $ : video code, url type (embed/url) * @return : data array * @author : Mamun. * @last -modified-by: Mamun. */ if (! function_exists('youtube_data_grabber')) { function youtube_data_grabber($video_code, $link_type = "embed") { if ($video_code != '') { if ($link_type == "embed") { $splited_data = explode("=",$video_code); $video_unique_code = substr(strrchr($splited_data[4],"/"),1,-strlen(strrchr($splited_data[4],"&"))); } else if ($link_type == "url") { $splited_data = explode("=",$video_code); $video_unique_code = substr($splited_data[1],0,-strlen(strrchr($splited_data[1],"&"))); } else { return; } // set feed URL $feedURL = 'http://gdata.youtube.com/feeds/api/videos/'.$video_unique_code; // read feed into SimpleXML object $sxml = simplexml_load_file($feedURL); return $sxml; } } } // End Youtube Function I'm not sure how to activate it is what I'm trying to say. I placed it in the controller and it's within a function for one of my pages. I don't have any syntax errors. I just don't know how to wake it up and make it work. I thought I could just put youtube_data_grabber('http://www.youtube.com/watch?v=LAcrFym10ZI', 'url'); but that didn't work. I got the code from here: http://bit.ly/b7YnDt and I have the zend functionality working. I tested it earlier and had no errors. I'm just having trouble with this youtube part. Any ideas?

    Read the article

< Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >