Search Results

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

Page 19/139 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Why pass by const reference instead of by value?

    - by Maulrus
    From what I understand: when you pass by value, the function makes a local copy of the passed argument and uses that; when the function ends, it goes out of scope. When you pass by const reference, the function uses a reference to the passed argument that can't be modified. I don't understand, however, why one would choose one over the other, except in a situation where an argument needs to be modified and returned. If you had a void function where nothing is getting returned, why choose one over the other?

    Read the article

  • How to update many databases when we update any tablw

    - by Lalit Kandpal
    I am creating a C# window application which is based on a medical inventory.In this application I have mainly three forms as PurchaseDetail,SalesDetail,and StockDetail. Now I want a functionality in which if i insert or modify the records in PurchaseDetail,or SalesDetail the Data in the StockDetail should also be modified.(for example if i insert some quantity of medicines in PurchaseDetail then Quantity In StockDetail should also modified and same as for SalesDetail ) Columns in PurchaseDetail: Id(Primary Key and auto increment int),BatchNumber,MedicineName,ManufacturingDate,ExpiryDate,Rate,MRP,Tax,Discount,Quantity Columns in SalesDetail: Id(PrimaryKey and auto increment int),BillNumber,CustomerName,BatchNumber,Quantity,Rate,SalesDate Columns in StockDetail: Id(Primary Key and auto increment int),ProductId,ProductName,OpeningStock,ClosingStock,PurchaseQty,DispenseQty,PurchaseReturn,DispenseReturn Please Help me.

    Read the article

  • Why is 'volatile' parasitic in C++?

    - by Steve
    Consider the following code: int main() { int i; volatile int* p = &i; int *v = p; return 0; } This gives an error in g++: $ g++ -o volatile volatile.cpp volatile.cpp: In function ‘int main()’: volatile.cpp:6: error: invalid conversion from ‘volatile int*’ to ‘int*’ My intention was that I want to make p volatile. However, once I've read the value of p, I don't care if accessing v is volatile. Why is it required that v be declared volatile? This is hypothetical code of course. In a real situation you could imagine that p points to a memory location, but is modified externally and I want v to point to the location that p pointed to at the time of v = p, even if later p is externally modified. Therefore p is volatile, but v is not. By the way I am interested in the behaviour both when this is considered C and C++, but in C this only generates a warning, not an error.

    Read the article

  • Serve static symbolic links with nginx

    - by mirceapasoi
    I'm using nginx to serve some static files that are actually symbolic links. When I do this the Last-Modified headers sent by nginx use the timestamp of the target file, not of the link itself. So, if I now have link C pointing to A, and I change it to point it to B (A and B have the same timestamp) I still see the content of A in the browser. I don't know if it's from the browser cache (because it has the same Last-Modified header) or from nginx. Any idea on how to fix this?

    Read the article

  • sqlite3.OperationalError: database is locked - non-threaded application

    - by James C
    Hi, I have a Python application which throws the standard sqlite3.OperationalError: database is locked error. I have looked around the internet and could not find any solution which worked (please note that there is no multiprocesses/threading going on, and as you can see I have tried raising the timeout parameter). The sqlite file is stored on the local hard drive. The following function is one of many which accesses the sqlite database, and runs fine the first time it is called, but throws the above error the second time it is called (it is called as part of a for loop in another function): def update_index(filepath): path = get_setting('Local', 'web') stat = os.stat(filepath) modified = stat.st_mtime index_file = get_setting('Local', 'index') connection = sqlite3.connect(index_file, 30) cursor = connection.cursor() head, tail = os.path.split(filepath) cursor.execute('UPDATE hwlive SET date=? WHERE path=? AND name=?;', (modified, head, tail)) connection.commit() connection.close() Many thanks.

    Read the article

  • What requests do browsers' "F5" and "Ctrl + F5" refreshes generate?

    - by Morgan Cheng
    Is there a standard for what actions F5 and Ctrl+F5 trigger in web browsers? I once did experiment in IE6 and Firefox 2.x. The "F5" refresh would trigger a HTTP request sent to the server with an "If-Modified-Since" header, while "Ctrl+F5" would not have such a header. In my understanding, F5 will try to utilize cached content as much as possible, while "Ctrl+F5" is intended to abandon all cached content and just retrieve all content from the servers again. But today, I noticed that in some of the latest browsers (Chrome, IE8) it doesn't work in this way anymore. Both "F5" and "Ctrl+F5" send the "If-Modified-Since" header. So how is this supposed to work, or (if there is no standard) how do the major browsers differ in how they implement these refresh features?

    Read the article

  • rsync useful w/ encrypted files?

    - by barrycarter
    Is rsync efficient for transferring encrypted files? More specifically: I encrypt 'x' with my public key and call the result 'y'. I rsync 'y' to my backup server. 'x' changes slightly I encrypt the modified 'x' and rsync the modified 'y' to my backup server. Is this efficient? I know a small change in 'x' yields a large change in 'y', but is the change localized? Or has 'y' changed so thoroughly that rsync is not much better than scp? I currently backup my "critical" files by tarring/bzipping them nightly, then encrypting the .tar.bz file and rsync'ing it to my backup server. Many of the individual files don't change, but, of course, the tar file changes if even one of the files change. Is this efficient? Should I be encrypting and backing up each file individually? That way, unchanged files will take no time to rsync.

    Read the article

  • Find images that have a certain HTML class name

    - by Frederik Vig
    I have some markup that contains certain HTML image tags with the class featured. What I need is to find all those images, add an anchor tag around the image, set the href attribute of the anchor to the images src value (the image path), and lastly replace the images src value with a new value (I call a method that will return this value). <p>Some text here <img src="/my/path/image.png" alt="image description" class="featured" />. Some more text and another image that should not be modified <img src="/my/path/image2.png" alt="image description" /></p> Should become. <p>Some text here <a href="/my/path/image.png"><img src="/new/path/from/method.png" alt="image description" class="featured" /></a>. Some more text and another image that should not be modified <img src="/my/path/image2.png" alt="image description" /></p>

    Read the article

  • Why is volatile not considered useful in multithreaded C or C++ programming?

    - by Michael E
    As demonstrated in this answer I recently posted, I seem to be confused about the utility (or lack thereof) of volatile in multi-threaded programming contexts. My understanding is this: any time a variable may be changed outside the flow of control of a piece of code accessing it, that variable should be declared to be volatile. Signal handlers, I/O registers, and variables modified by another thread all constitute such situations. So, if you have a global int foo, and foo is read by one thread and set atomically by another thread (probably using an appropriate machine instruction), the reading thread sees this situation in the same way it sees a variable tweaked by a signal handler or modified by an external hardware condition and thus foo should be declared volatile (or, for multithreaded situations, accessed with memory-fenced load, which is probably a better a solution). How and where am I wrong?

    Read the article

  • WP7 databinding displays int but not string?

    - by user1794106
    Whenever I test my app.. it binds the data from Note class and displays it if it isn't a string. But for the string variables it wont bind. What am I doing wrong? Inside my main: <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <ListBox x:Name="Listbox" SelectionChanged="listbox_SelectionChanged" ItemsSource="{Binding}"> <ListBox.ItemTemplate> <DataTemplate> <Border Width="800" MinHeight="60"> <StackPanel> <TextBlock x:Name="Title" VerticalAlignment="Center" FontSize="{Binding TextSize}" Text="{Binding Name}"/> <TextBlock x:Name="Date" VerticalAlignment="Center" FontSize="{Binding TextSize}" Text="{Binding Modified}"/> </StackPanel> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Grid> </Grid> in code behind: protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { MessageBox.Show("enters onNav Main"); DataContext = null; DataContext = Settings.NotesList; Settings.CurrentNoteIndex = -1; Listbox.SelectedIndex = -1; if (Settings.NotesList != null) { if (Settings.NotesList.Count == 0) { Notes.Text = "No Notes"; } else { Notes.Text = ""; } } } and public static class Settings { public static ObservableCollection<Note> NotesList; static IsolatedStorageSettings settings; private static int currentNoteIndex; static Settings() { NotesList = new ObservableCollection<Note>(); settings = IsolatedStorageSettings.ApplicationSettings; MessageBox.Show("enters constructor settings"); } notes class: public class Note { public DateTimeOffset Modified { get; set; } public string Title { get; set; } public string Content { get; set; } public int TextSize { get; set; } public Note() { MessageBox.Show("enters Note Constructor"); Modified = DateTimeOffset.Now; Title = "test"; Content = "test"; TextSize = 32; } }

    Read the article

  • Apply Patch Update

    - by Velu
    Hi, We are the product devlopement company. We have the MSI setup for product it will install the more than 500 assemblies files in customers machine. Once we had released the product there may be some problem in any our of the assemblies due to serveal reason. At the time we will fix those problem and provided the patch update to the customer. [b]Current System:[/b] 1) Fix the problem in the devlopement environment and build the assemblies. 2) Generate the Patch setup using the Inno script with modified assemblies. 3) While installing the patch setup in the customer machine it will backup the old assemblies and replace the modified assemblies. [b]Drawback:[/b] Customer can't able to uninstall the installed patch becoz it just replace the assemblies. Is it possible to have the patch system in MSI like MSP files or else is there any option to uninstall the patch in my current system itself ? Thanks, Velu

    Read the article

  • Keeping track of dirty blocks on a block device

    - by mikeY
    I'm looking for a way to keep track of what blocks on a block device are modified after a point in time. How I eventually want to use this for is to keep two 2TB disks in sync, one which only comes online (connected through USB) once a month. Without knowing what blocks have been modified, I have to go through the whole 2TB every time. I'm using a recent GNU/Linux OS and have C and Python experience. I'm hoping to avoid writing kernel level code as I don't have any experience in that area whatsoever. My current theory is that there should be some hooks somewhere where my code can get called when a disk flush is performed. Any ideas?

    Read the article

  • How can I get an error or a warning from a PreparedStatement?

    - by Geo
    I had an update like this: update table set col1=?,col2=?,col3=? where col4=?; and I filled it up like this: statement.setString(1,"some_value"); statement.setString(2,"some_value"); statement.setString(3,"some_value"); and I forgot to add a fourth value.I did a executeUpdate and of course nothing happened to the database. I spent about 1 hour debugging it, to see where it goes wrong. I then modified my code to print the SQLWarning object returned by the getWarnings method. It always returned null. I even modified the code to the buggy state it was, before I set the fourth parameter, and still no warning. Does anyone know how one can get an error/warning? If it matters, my Connection is set to autoCommit.

    Read the article

  • How to get rid of bogus changes in git?

    - by zaza
    I'm a happy user of PortableGit 1.7.0.2. Today I wanted to pull a project changes from GitHub.com repository, so I did git pull. It failed with the following message: error: Your local changes to 'main.rb' would be overwritten by merge. Aborting.. I didn't care about the local changes so I typed git reset --hard HEAD (git clean from here didn't help neither), but it didn't work. When asked for git status I was still able to see the file as modified. git diff showed me that each line of the file has been modified, while git diff -b showed no differences at all, so I guess this is a line ending issue. Which is strange because the code is only pushed from Windows machines. Anyway, the question is: how can I ignore the local, bogus changes and merge with the latest changes from the remote repository?

    Read the article

  • HTML5 localStorage for assets (stylesheets, JavaScript, images etc)

    - by Sam
    To save both client download time and network usage, is it possible to use the localStorage feature of HTML5 to store contents of linked stylesheets, javascript files and binary data (e.g. images), rather than hitting the server each time? Would that just complicate things - since I assume you would have to add the linked asset via JavaScript rather than just a script or link element, breaking the page for those without JavaScript enabled)? Unless you can parse the content (using HEAD requested to check last modified date and other headers) before the browser downloads it. Or best just to stick with 304 Not Modified and eTag headers?

    Read the article

  • C# - Making fields/properties read only conditionally

    - by Alistair77
    I have three classes; Classes A and B both reference class C. How can I make it so members of class C can be modified when referenced from class A but not modified when referenced from class B? IE, the following should be possible; classA myClassA = new classA(); myClassA.myClassC.IssueNumber = 3; But this should not be possible; classB myClassB = new classB(); myClassB.myClassC.IssueNumber = 3; Making classB.classC read-only still allows properties of classC to be altered. I'm sure this is basic stuff but can't find a simple answer. Thanks, A

    Read the article

  • Is there any convinient way that i can deepclone 'style' instance in silverlight?

    - by Kevin Yang
    if a style is used, it can not be modified agaign. so i need a clone method. but its hard to implement. what i want to do is implementing a cascading 'style' mechanism. for example, i set two style to the same frameworkelement. the same property of latter style will override the former one, while the different property remain unchanged. but if i set the style property of the frameworkelement twice directly, the 1st style will be gone. so i use the baseon property of style class to do that. but now come across another problem, the style can not be modified after it's been set to a frameworkelement. so now i need a clone method.

    Read the article

  • PHP file modification time in milliseconds

    - by Steven Rosato
    I there, I am currently writing a unit test which asserts that a file did not get modified. The test code execution takes less than one second and therefore I would like to know if it is possible to retrieve the file modification time in milliseconds. filemtime() function returns the UNIX timestamp in seconds. My current solution is using the sleep(1) function which will assure me that 1 second passed before checking if it was modified or not. I don't like that solution since it slows down the test by a great deal. I cannot assert the content equality via get_file_contents() since the data that can be rewritten would be the same. I am guessing it is impossible, is it?

    Read the article

  • What's the most simple way to retrieve all data from a table and save it back in .NET 3.5?

    - by zoman
    I have a number of tables containing some basic (business related) mapping data. What's the most simple way to load the data from those tables, then save the modified values back. (all data should be replaced in the tables) An ORM is out of question as I would like to avoid creating domain objects for each table. The actual editing of the data is not an issue. (it is exported into Excel where the data is edited, then the file is uploaded with the modified data) The technology is .NET 3.5 (ASP.NET MVC) and SQL Server 2005. Thanks.

    Read the article

  • XCode 3.2.5 Cocoa project modifies linked 3rd party dylib. Why?

    - by Barrie
    I'm linking a 3rd party dylib into a cocoa project. And I arrange for XCode to copy it into the Frameworks directory of the app. But when I cmp the original dylib with the dylib in Frameworks I discover the 3rd party dylib has been modified. I have some old XCode cocoa projects which don't do this, i.e. the dylib in Frameworks is the same as the original. I've tried modifying the XCode projects to isolate what is causing the dylib to be modified but so far no luck. Any ideas?

    Read the article

  • Foreign Key Relationships

    - by Yehonathan Quartey
    I have two models class Subject(models.Model): name = models.CharField(max_length=100,choices=COURSE_CHOICES) created = models.DateTimeField('created', auto_now_add=True) modified = models.DateTimeField('modified', auto_now=True) syllabus = models.FileField(upload_to='syllabus') def __unicode__(self): return self.name and class Pastquestion(models.Model): subject=models.ForeignKey(Subject) year =models.PositiveIntegerField() questions = models.FileField(upload_to='pastquestions') def __unicode__(self): return str(self.year) Each Subject can have one or more past questions but a past question can have only one subject. I want to get a subject, and get its related past questions of a particular year. I was thinking of fetching a subject and getting its related past question. Currently am implementing my code such that I rather get the past question whose subject and year correspond to any specified subject like this_subject=Subject.objects.get(name=the_subject) thepastQ=Pastquestion.objects.get(year=2000,subject=this_subject) I was thinking there is a better way to do this. Or is this already a better way? Please Do tell ?

    Read the article

  • Storing SQL Tables for use in visual studio

    - by Raven Dreamer
    Greetings. I'm trying to create a windows form application that manipulates data from several tables stored on a SQL server. 1) What's the best way to store the data locally, while the application is running? I had a previous program that only modified one table, and that was set up to use a datagridview. However, as I don't necessarily want to view all the tables, I am looking for another way to store the data retrieved by the SELECT * FROM ... query. 2) Is it better to load the tables, make changes within the C# application, and then update the modified tables at the end, or simply perform all operations on the database, remotely (retrieving the tables each time they are needed)? Thank you.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >