Search Results

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

Page 69/139 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • T-SQL: How Do I Create A "Private" Function Inside A Stored Procedure

    - by RPM1984
    Okay so im writing a SQL Server 2008 Stored Procedure (maintenance script). In doing so, being a good boy i've done plenty of error handling, checking rowcounts, printing output messages, etc But in doing this, ive found myself writing over and over again something like this: SELECT @RowsAffected = @@ROWCOUNT IF @RowsAffected > 0 BEGIN PRINT CAST(@RowsAffected, NVARCHAR(2)) + 'rows updated.' END Or debug messages like this: PRINT 'User ' + CAST(@UserId AS NVARCHAR(5)) + ' modified successfully' Is there a way i can create a kind of 'subroutine' inside the stored procedure (like a private method) that can accept something as a parameter (doesnt have to though) and do some logic? I want to be able to do something like this: CheckRowCounts Or this: PrintUserUpatedMessage(@UserId) Which would then perform the above logic (check rowcount, print message, etc) And yes obviously i can create a UDF, but then i would need to create/drop it etc as this logic is only required for the life of the execution of this stored procedure. Getting sick and tired of writing the same code over and over again, and changing all the different areas ive used it when i get an error =) Can anyone help?

    Read the article

  • retrivenewly inserted record ID with Linq2SQL

    - by devmania
    hi, i am using the following private BlogDataContext db = new BlogDataContext (); article.Created = DateTime.UtcNow; article.Modified = DateTime.UtcNow; db.Articles.InsertOnSubmit(article); db.SubmitChanges( ); int id = article.Id; i am wondering is this save, i mean will it give me the Id of the article user inserted or will there be case of concurrences if another user update the article in fraction of second of second after this user ? thanks in advanced.

    Read the article

  • How can I dynamically inject code to event handlers in Delphi?

    - by mjustin
    For debugging / performance tests I would like to dynamically add logging code to all event handlers of components of a given type. For example, for all Dataset components located ona TDatamodule, I would like to add some code for the BeforeOpen and the AfterOpen event to store the start and end time and send a line to a logger with the elapsed time in the AfterOpen event. I would prefer to do this dynamically (no component subclassing), so that I can add this to all existing datamodules and forms with minimal effort only when needed. Iterating all components and filtering by their type is easy, but for the components which already have event handlers assigned, I need a way to store the existing event handlers, and assign a new modified event handler which first does the logging and then will invoke the original code which was already present. Is there a design pattern which can be applied, or even some example code which shows how to implement this in Delphi?

    Read the article

  • "Initializing" the pointer in the separate function in C

    - by pechenie
    I need to do a simple thing, which I used to do many times in Java, but I'm stuck in C (pure C, not C++). The situation looks like this: int *a; void initArray( int *arr ) { arr = malloc( sizeof( int ) * SIZE ); } int main() { initArray( a ); // a is NULL here! what to do?! return 0; } I have some "initializing" function, which SHOULD assign a given pointer to some allocated data (doesn't matter). How should I give a pointer to a function in order to this pointer will be modified, and then can be used further in the code (after that function call returns)? Thanx for help.

    Read the article

  • Best practice for Google app engine and Git.

    - by systempuntoout
    I'm developing a small pet project on Google App Engine and i would like to keep code under source control using github; this will allow a friend of mine to checkout and modify the sources. I just have a directory with all sources (call it PetProject) and Google App Engine development server points to that directory. Is it correct to create a Repo directly from PetProject directory or is it preferable to create a second directory (mirror of the develop PetProject directory); in this case, anytime my friend will release something new, i need to pull from Git and then copy the modified files to the develop PetProject directory. If i decide to keep the Repo inside the develop directory, skippin .git on yaml is enough? What's the best practice here?

    Read the article

  • Android EditText within a ListView

    - by metalideath
    I have created a custom Array Adapter to bind a custom row that contains some static text and an editable EditText. I am trying to register to be notified when the user changes the text within the edit text and when notified to determine which ArrayList row the modified EditText corresponds to. In the past with other types of views such as a Spinner I could simply put a reference to the parent view and the row number into the tag for the Spinner view. And then when I was notified that the value changed I read the tag to determine how to correlate it back to the master ArrayList. The problem with registering to be notifed with an EditText change is that you do not get back a view but instead get a TextWatcher and I have no way to correlate back to the parent view or ArrayList row. What is the technique that you need to use in this circumstance?

    Read the article

  • [iPhone]Objective C, objects which do not conform to NSCoding. How to write them to a file.

    - by Noah
    Hi, I am using an Objective c class, a subclass of NSObject. This class cannot be modified. I have an instance of this class that I wish to write to a file which can be retrieved and later reinstate. The object does not conform to NSCoding. To sum up, I need to save an instance of a class to a file which can be retrieved later, without using any of the NSCoding methods such as NSKeyedArchiving encodeWithCoder ... Using them returns this... NSInvalidArgumentException ...encodeWithCoder:] unrecognised selector sent to instance... Is there any other way I can store this object for later use Thank you

    Read the article

  • Chrome Extension Manifest 'Matches'

    - by Aristotle
    I'm trying my hands at a simple Chrome Extension, but am running into a problem with providing a value for the matches array in my content_scripts. { "name": "My Extension", "version": "1.0", "description": "My Extension Experiment", "browser_action": { "default_icon": "icon.png", "default_title": "Ext", "default_popup": "popup.html" }, "content_scripts": { "matches": ["http://*"], "js": ["scripts.js"] } } When I try to load this extension into Chrome, I get the following message: Could not load extension from 'C:\Users\foo\Desktop\Extensions\bar'.Invalid value for 'content_scripts'. I cannot see what is "invalid" about my value though. What I'm trying to do is match every URL, so my extension can manipulate the DOM (via javascript within scripts.js) of any page it is ran on. Am I missing something, going about this all wrong, or what? update After posting this question, I did notice that the Google example was slightly different than mine, so I modified my code a bit to reflect their syntax: "content_scripts": [{ "matches": ["http://*"], "js": ["scripts.js"] }] That being said, I still get the following error when trying to load my extension: Could not load extension from 'C:\Users\foo\Desktop\Extensions\bar'. Invalid value for 'content_scripts[0].matches[0]'.

    Read the article

  • Font-face, Raphael and IE8

    - by Sucrenoir
    I am desesperatly trying to get some google font faces to work with Raphael (SVG / VML rendering JavaScript library) on IE8. At first i tried the google fonts code. My second try has been to download and convert the fonts to host my own more complete css. Now the fonts show in the html part of the page (inside a modified bootstrap nav dropdown), but it does not work in the VML canvas (generated by Raphael). Example here : http://beta.yetiprint.com/fr/etiquettes-autocollantes/4-etiquettes-couleur-ronde.html Is it possible to get that working in iE8? Any clue?

    Read the article

  • How to write in an file in MSIL code

    - by Thomas
    Hi all, I have a aspx webpage which uses an assembly mine (which mades a custom authentification). I would like to modify MSIL code (so just with ILDASM/ILASM tools) of my assembly in order to log something in a file. I have tried to add this at the end of the authentification method of my assembly : IL_0034: ldstr "C:\\path_to_my_website\\log.txt" IL_0039: newobj instance void [mscorlib]System.IO.StreamWriter::.ctor(string) IL_003e: stloc.1 IL_003f: ldloc.1 IL_0040: ldstr "test" IL_0045: callvirt instance void [mscorlib]System.IO.TextWriter::Write(string) IL_004a: nop IL_004b: ldloc.1 IL_004c: callvirt instance void [mscorlib]System.IO.TextWriter::Close() IL_0051: nop ILASM does not find any error, and the CLR does not throw any exception at runtime, but the file is not created or modified ! :( Any idea ?

    Read the article

  • namespace extension.. galaxy file system toolkit...gmail shell drive like utility...

    - by Muhammad Adnan
    i was looking for some namespace extention to extend using c# (.net) but didn't find much help online except Galaxy Filesystem tooklkit. which are vc++ based but comes with c# and java wrapper classes... which helps me alot to start and i did. i have extended that enough now and made installer to install. it get installed successfully but don't know why, when i open it, system get stuck... :( i thought my modified version might have some problem so i tried to run Galaxy filesystem toolkit's author original version and it responded in same way as mine do :D :( now feeling bit helpless as even author is not responding my queries regarding my queries for some reason... any help would be really appreciated.... FYI: i need to have Gmail drive like stuff...

    Read the article

  • How can I dynamically inject code into event handlers in Delphi?

    - by mjustin
    For debugging / performance tests I would like to dynamically add logging code to all event handlers of components of a given type. For example, for all Dataset components located ona TDatamodule, I would like to add some code for the BeforeOpen and the AfterOpen event to store the start and end time and send a line to a logger with the elapsed time in the AfterOpen event. I would prefer to do this dynamically (no component subclassing), so that I can add this to all existing datamodules and forms with minimal effort only when needed. Iterating all components and filtering by their type is easy, but for the components which already have event handlers assigned, I need a way to store the existing event handlers, and assign a new modified event handler which first does the logging and then will invoke the original code which was already present. Is there a design pattern which can be applied, or even some example code which shows how to implement this in Delphi?

    Read the article

  • Best practices for using Hg with Grails?

    - by leeand00
    What should I check in/not check in? Since many of the files are sometimes auto-generated I'm not entirely sure how to handle this using version control...does it have something to do with tags? For instance in ANT, I know not to check-in my target/bin directories...but Grails adds another level of confusion to this...since some of code is generated and some of it is not. (It may become clearer as I go...but it seems to be that there needs to be some way of being able to tell what was just generated and what was modified by a developer so that it needs to be placed in version control)

    Read the article

  • What is the best way to convince management that virtualization isn't always appropriate in producti

    - by uncle brad
    I work for a small company with a .NET product that was acquired by a medium sized company with "big iron" products. Recently, the medium-sized part of the company acquired another small company with a similar .NET product and management went to have a look at their technology. They make heavy use of virtualization in their production environment and it's been decided that we will too. Our product was not designed to be run in a virtual environment, but some accommodations can be made. For instance; there are times when we're resource bound due to customer initiated processes. This initiation is "bursty" by nature, but the processing can be made asynchronous and throttled. This is something that would need to be done for scalability anyway. But there is other processing that we do that isn't so easily modified because we're resource bound for extended periods of time. How do I convince management that heavy use of virtualization is probably not appropriate for us?

    Read the article

  • Displaying current time above the thumb of a slider in Silverlight

    - by Scharrels
    I've made a time slider in Silverlight. To style it, I've made a control template and modified the style. I've added a text field above the thumb (always centered above the thumb), which should display the time. However, I can't find any way to access the slider information (e.g. current value) or find another way to pass any information to the style, which I can then data bind to the text field. So my question in short: how can I display time information above the thumb?

    Read the article

  • Generic Any/Attach/Add function for Entity Framework

    - by Matt Thrower
    Looking through my EF classes, they're littered with code that looks like this: if (_myContext.[EntityType].Any(d => d.RowId == dc.RowId)) { _myContext.[EntityType].Attach(dc); _myContext.Entry(dc).State = EntityState.Modified; } else { _myContext.[EntityType].Add(dc); } It's the same thing over and over, and is clearly itching to be handled by a generic function. However, I'm not sure how you'd go about handling the need for it to deal with a variety of unexpected entity types. A good example to get me started would be most appreciated.

    Read the article

  • Ideas for building vulnerabilities into your site?

    - by Jaco Pretorius
    I'm trying to create a programming challenge that would require developers to hack into the MVC site I create. The idea is obviously to teach them about preventing these types of attacks. The current idea I have is to build multiple vulnerabilities into the site - but the second vulnerability would require the first to be completed, etc. So I was thinking the first could be a sql injection attack, the second would require a modified GET request, etc. Exploiting the final vulnerability would reveal a specific piece of information which is proof that you have completed the entire challenge. This will not be deployed on a public site - it's simply a learning tool for developers at my company. I'm not looking for MVC-specific vulnerabilities - I'm simply using MVC because it allows me to work with the 'raw' HTML. Any ideas on the different vulnerabilities I can use?

    Read the article

  • jQuery Validate - Require at least one from group, plus additional items.

    - by Kevin Pullin
    I'm attempting to use 'jQuery Validate' on a form that requires an email address plus either all items of a shipping address completed or none at all. Using the sample provided by the solution to this question: jQuery Validate - “Either skip these fields, or fill at least X of them”, I have been able to successfully solve the validation of the address group. The problem, however, is that the logic for validating the email address field does not work. From debugging the Validate scripts, the "re-entrant" validation code triggered by calling 'fields.data('being_validated', true).valid();' in the linked example results in a reset of all previously validated errors (i.e. the email validation error is cleared). I have modified some existing samples, the first in which removes the offending line and the second with it included. Email Validation Working Email Validation Fails Any tips or suggestions on how to properly solve this or work around the failure?

    Read the article

  • Socket.recv works but not gets or read?

    - by Earlz
    Hello I've been messing around with Sockets in Ruby some and came across some example code that I tried modifying and broke. I want to know why it's broken. Server: require "socket" dts = TCPServer.new('127.0.0.1', 20000) loop do Thread.start(dts.accept) do |s| print(s, " is accepted\n") s.write(Time.now) print(s, " is gone\n") s.close end end Client that works: require 'socket' streamSock = TCPSocket.new( "127.0.0.1", 20000 ) streamSock.print( "Hello\n" ) str = streamSock.recv( 100 ) print str streamSock.close Client that is broken require 'socket' streamSock = TCPSocket.new( "127.0.0.1", 20000 ) streamSock.print( "Hello\n" ) str=streamSock.read #this line modified print str streamSock.close I know that the streamSock.print is unnecessary (as well as the naming scheme being non-ruby) but I don't understand why read doesn't work while recv does, Why is this?

    Read the article

  • Exception when programmatically copying content type

    - by BeraCim
    Hi all: I'm getting exceptions when copying content type from one web to another: foreach (SPContentType destinationWebCt in destinationWeb.ContentTypes) { destinationWeb.ContentTypes.Add(existingWebCt); destinationWeb.Update(); } existingWebCt is the content type from another web e.g. /Site/Web. destinationWeb is the web that I wish to copy the content type to e.g. /Site/DestinationWeb. I got the SPException that says something like content type can not be added outside of its scope. Then I decided to replace all "ContentTypes" to "AvailableContentTypes", but then I got the SPException saying this collcetion could not be modified. So how can I copy a content type to another web? Thanks.

    Read the article

  • Is there any way to modify a column before it is ordered in MySQL?

    - by George Edison
    I have a table with a field value which is a varchar(255). The contents of the field can be quite varied: $1.20 $2994 $56 + tax (This one can be ignored or truncated to $56 if necessary) I have a query constructed: SELECT value FROM unnamed_table ORDER BY value However, this of course uses ASCII string comparison to order the results and does not use any numerical type of comparison. Is there a way to truly order by value without changing the field type to DECIMAL or something else? In other words, can the value field be modified ('$' removed, value converted to decimal) on the fly before the results are sorted?

    Read the article

  • Creating a project, from Makefile to static/dynamic libraries in UNIX

    - by Sasha
    Guys, would you describe a few things about c++ building blocks, on unix. I want to create an application that links against static libs and dynamic libs (.so). Question 1: How do I create static library using gcc/g++ ?How do I make my app link against it. Question 2: How to specify it in the makefile, linking against static and dynamic libs, assuming that both libraries have header files Summary: I have been using makefiles and libraries for years, written by someone else. Thus every time I modified it, I simply cut-and-pasted things around, without really understanding it. Now I want to get down to the ground and understand the building/linking/Creating Makfile process in-depth. What is a good book describing these concepts in intimate details? Thanks

    Read the article

  • deriving activity diagram-based GUIs and CRUD them with a DB?

    - by Xin Tanaka
    i received a big book full of processes. i was thinking about the end user (they will be lawyers) and decided the best GUI would be showing activity diagrams or business processes. It reminded me Quickbooks and how non-accountants can successfully use it and understand accounting processes. i began doing research before sending my project to a bunch of programmers: is there some open source solution? can i use MS Visio libraries? which UML tool is programable? what about Eclipse and its modeling tools? etc etc the key points here are: relationships between events, artifacts, actors, etc should be stored in a database. processes or steps in a process should be easily modified by updating the database do this sounds too crazy? (should I explain a bit more why it must be programmed this way?)

    Read the article

  • Lightweight PHP server to bundle with application?

    - by munchybunch
    Does there exist some sort of PHP server that can be bundled with a locally-deployed application? It sounds wonky, but the end result is I can't use a remote web server to do anything. Clients will be downloading a package, and the plan is to use a Java backend that reads from a flat file. The flat file contains settings and is modified through a GUI written in HTML/JS, and this is where the server would come in. The forms in HTML should be able to submit to the server, which does a simple file write to the flat file. Is there any simple, lightweight server that has that simple feature? When running the executable for the application, it would start the installation process for the server before moving the web GUI files to the appropriate locations. Note that I'm doing this for a client, so I can't quite change the reqs and would rather not discuss their effectiveness. I would be ever thankful if people had suggestions for the server though!

    Read the article

  • SQL Server: query database user roles for all databases in server

    - by atricapilla
    I would like to make a query for database user roles for all databases in my sql server instance. I modified a query from sp_helpuser: select u.name ,case when (r.principal_id is null) then 'public' else r.name end ,l.default_database_name ,u.default_schema_name ,u.principal_id from sys.database_principals u left join (sys.database_role_members m join sys.database_principals r on m.role_principal_id = r.principal_id) on m.member_principal_id = u.principal_id left join sys.server_principals l on u.sid = l.sid where u.type <> 'R' How can I modify this to query from all databases? What is the link between sys.databases and sys.database_principals?

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >