Search Results

Search found 7529 results on 302 pages for 'replace'.

Page 85/302 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • How do i force a file to be deleted? Windows server 2008

    - by acidzombie24
    On my site a user may upload a file (pic, zip, audio, video, whatever). He then may decide to replace it with a newer revision. This user may upload a file, make a post then decide to put up a new revision replacing the old (lets say its a large zip or tar.gz file). Theres a good chance people may be downloading it if he sent out an email or even im for the home user. Problem. I need to replace the file and people may be downloading and it may be some minutes before it is deleted. I dont want my code to stall until i cant delete or check every second to see if its unused (especially bad if another user can start and he takes long creating a cycle). How do i delete the file while users are downloading the file? i dont care if they stop i just care that the file can be replaced and new downloads are the new revision.

    Read the article

  • Porting Windows C++ to Standard (Linux) C++ - WSAGetLastError()

    - by Donal Rafferty
    I am currently porting some Windows mobile C++ code to standard C++. So I am trying to find alternatives for windows specific functions. I have had very little luck in finding a standard C++ function that can help me replace the WSAGetLastError() windows specific function. WSAGetLastError() returns error numbers for errors that occur with sockets in windows. So I was wondering if anyone was aware of a way to replace this function in standard c++? A way to get different error numbers for different outcomes of connecting/dissconection a socket would be sufficent.

    Read the article

  • dynamic SQL not working as expected

    - by christine33990
    create or replace procedure createtables Authid current_user as begin execute immediate 'create table newcustomer as select * from customer'; end; create or replace procedure e is begin createtables; select * from newcustomer; end; I got two procedures above. first one will create a new tables called newcustomer, second procedure will call the first procedure and query to the newcustomer table. when I try to compile this code, it says the table is not yet created, I don't really get it as I have called createtables procedure so I assume I have created the table. Any help will be appreciated. Thanks

    Read the article

  • How to use External Procedures in Triggers on Oracle 11g..

    - by RBA
    Hi, I want to fire a trigger whenever an insert command is fired.. The trigger will access a pl/sql file which can change anytime.. So the query is, if we design the trigger, how can we make sure this dynamic thing happens.. As during the stored procedure, it is not workingg.. I think - it should work for 1) External Procedures 2) Execute Statement Please correct me, if I am wrong.. I was working on External Procedures but i am not able to find the way to execute the external procedure from here on.. SQL> CREATE OR REPLACE FUNCTION Plstojavafac_func (N NUMBER) RETURN NUMBER AS 2 LANGUAGE JAVA 3 NAME 'Factorial.J_calcFactorial(int) return int'; 4 / @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ SQL> CREATE OR REPLACE TRIGGER student_after_insert 2 AFTER INSERT 3 ON student 4 FOR EACH ROW How to call the procedure from heree... And does my interpretations are right,, plz suggest.. Thanks.

    Read the article

  • simple GET validation

    - by Andrew
    I have GET[] input and would like to carry out their validation. The input data is always a number by. Schema. I want to make sure that the pass number and the appropriate amount - not to throw the sql query. at this moment I am using the procedures $cc = $_GET['cc']; if ($cc=='') $cc='9012';$find=array("..", "/", "\\"); $replace=array("", "", ""); $cc=str_replace($find, $replace, $cc); $eic = $_GET['eic']; .... ect. // where f.ex. 9012 is an real existing data (in dbase) to generate sucure sql question GET[] variable data schema $_GET[$cc] - always 4 digits $_GET[$eic] - always 4 digits $_GET[$iy] - always 4 digits $_GET[$ir] - always 1 digit Can you show me a better way to secure my GET?

    Read the article

  • Change Image in Resources at Runtime

    - by zaidwaqi
    Hi, My understanding of Resources is that I can combine resources i.e. images and my program into single executable. Let's say I have image pic1.png and I put it into Resource of my project, and is accessible with Properties.Resource.pic1. For example, PictureBox pb = new PictureBox(); pb.Image = Properties.Resource.pic1; What I want to do is for that my program will be able to replace this image at runtime. For example, my program runs, and locate newPicture.png, and use this new image to replace pic1.png that was originally used. Maybe my question is better reworded as "Can I include new image into Resources at runtime?" Please help. Thanks.

    Read the article

  • Get URL parameter function that gets value of url part or returns true if it's there but with no val

    - by LLer
    I'm using the following function to get a URL parameter. function gup(name, url) { name = name.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]'); var results = new RegExp('[\\?&]'+name+'=?([^&#]*)').exec(url || window.location.href); return results == null ? null : results[1]; } It works only if the parameter has a value, for example. gup('a', 'http://example.com/page.php?a=1&b=2'); will return 1. But if I try gup('a', 'http://example.com/page.php?a&b=2'); It returns null. I want it to return true because parameter "a" exists in that url, even though it has no value it's still there and gup() should return true. Could I get a bit of help rewriting this? I'm not that good with regex.

    Read the article

  • 2 or more FOR loops in command shell merging fileA line1 with fileB line1, &c.

    - by rfransix
    Hi, i'm trying to build an ldif import file. I have 2 files, one with the DN and another with the employeeNumber, they match up line for line. Here's the code that does not work: @echo on ::Set BATCH Input Directory set batchdir=e:\Meta ::Set the input file containing the server list set infile=%batchdir%\DDNs3 set infile2=%batchdir%\DDNs4 ::If exists, we remove output file Rm DDNs3.ldif ::For loop below process each line in the input list. FOR /F "tokens=* delims=" %%i IN (%infile%) do ( FOR /F "tokens=* delims=" %%k IN (%infile2%) do ( Echo dn: %%i Echo changetype: modify Echo replace: employeeNumber Echo employeeNumber: %%k ) ) DDNs3.ldif I've tried several variations, including: ::For loop below process each line in the input list. FOR /F "tokens=* delims=" %%i IN (%infile%) do ( Echo dn: %%i Echo changetype: modify Echo replace: employeeNumber FOR /F "tokens=* delims=" %%k IN (%infile2%) do ( Echo employeeNumber: %%k echo. ) ) DDNs3.ldif

    Read the article

  • xml parsing takes extra spaces.

    - by SDK
    I have been trying to write/parse xml file in python. The tags are very simple <main> <data> abcdef </data> </main> I have written this xml using xml document writer from xml.dom.minidom. How-ever when i try to parse this and try to fetch data-text value, i get 'abcdef' with spaces/carriage return/newline characters in beg and end. Does parsing does not take of indenting spaces? Following is the parsing snippet (ref from net) dom = parseString(data) clipTag = dom.getElementsByTagName('clipdata')[0].toxml() clipData=clipTag.replace('<clipdata>','').replace('</clipdata>','') Kindly suggest.

    Read the article

  • Replacing characters in Ruby string according to some rule

    - by Kyle Kaitan
    In Ruby, I have a string of identical characters -- let's say they're all exclamation points, as in !!!!. I would like to replace the characters at certain indices with '*' if the integer corresponding to that index meets some criteria. For example, let's say I want to replace all the characters whose indices are even numbers and are greater than 3. In the string !!!!!!!! (8 characters long), that results in !!!!*!*! (indices 4 and 6 have been replaced). What's the most compact way to do this?

    Read the article

  • How to use Externel Procedures in Triggers on Oracle 11g..

    - by RBA
    Hi, I want to fire a trigger whenever an insert command is fired.. The trigger will access a pl/sql file which can change anytime.. So the query is, if we design the trigger, how can we make sure this dynamic thing happens.. As during the stored procedure, it is not workingg.. I think - it should work for 1) External Procedures 2) Execute Statement Please correct me, if I am wrong.. I was working on External Procedures but i am not able to find the way to execute the external procedure from here on.. SQL> CREATE OR REPLACE FUNCTION Plstojavafac_func (N NUMBER) RETURN NUMBER AS 2 LANGUAGE JAVA 3 NAME 'Factorial.J_calcFactorial(int) return int'; 4 / @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ SQL> CREATE OR REPLACE TRIGGER student_after_insert 2 AFTER INSERT 3 ON student 4 FOR EACH ROW How to call the procedure from heree... And does my interpretations are right,, plz suggest.. Thanks.

    Read the article

  • It is the arranging game in which

    - by bachchan
    1 2 3 13 5 4 7 10 6 14 11 9 8 15 12 1.Every time when we refresh the page the numbers in the cells will change but the These numbers will remain unique n from 1 to 15 2.Whenever we double click the number in the cell which is surrounded the empty cell then it will replace the empty cell with that number n that number cell become empty. 3.If we double click the cell which is not surrounded the empty cell then it will not replace the empty cell. 4.e.g. if we click 8 then it will not move to empty cell But if we click either 13, 7 , or 11 then it will move to empty cell 5.And every time when we click the cell it’s num color will change for a moment

    Read the article

  • Multiple uses of "this" keyword in Java

    - by frodosamoa
    So, I have this. It compares two card decks and if they are the same the result is true. public boolean equals ( Object obj ) { boolean result = true; for (int i = 0; i < 52; i++) { if (this.cardAt(i) = this2.cardlist(i)) { result = true; } else { result = false; } } } I would like to be able to compare two random card decks, if you will. But I don't know how to compare two different ones using "this . I simply wrote "this2" to replace another instance of "this". What could I do to replace this "this2" to still be able to compare two card decks?

    Read the article

  • How to write a list to a text file in the correct format

    - by lia1000
    I've got this piece of code that I want to write the output to a text file but with the correct format i.e. no brackets, single quotes so it appears as a formatted list. This is the code: file = open("env5.txt", "w"); for key in os.environ.keys(): env = os.environ[key]; key1 = key; list = str([key, env]).replace("'","").replace('[]', ''); list2 = list[1:-1]; print(list2); file.writelines(list2); file.close(); This is the original code: for key in os.environ.keys(): print(key, os.environ[key]); Many thanks

    Read the article

  • How to generate a script for changing a column of varchar to xml type with data being converted?

    - by user1323981
    Initially I have a column (partner_email) of varchar.Now a recent change has come where it needs to be changed to be changed to the XML type but the previous records needs to be reserve into the new column. I have applied the below algorithm to accomplish the work /*********************************************************************** Purpose: To change the partner_email column from Varchar Type To Xml Type and convert the existing records from varchar to xml types. Programmers Notes: 1. Create a new Column by the name partner_email_temp of type XML into the Partner Table 2. Copy the Email contents from partner_email to partner_email_temp column after proper conversion N.B.~ The format will be <PartnerEmails> <Email>[email protected]</Email> <Email /> <Email /> </PartnerEmails> 3. Drop the exisitng partner_email 4. Rename partner_email_temp column to partner_email ***********************************************************************/ USE [Test] GO --===== Create a partner_email_temp column of type xml into the Partner table IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.columns WHERE table_name = 'Partner' AND column_name = 'partner_email_temp' ) BEGIN ALTER TABLE [dbo].[Partner] ADD partner_email_temp XML NULL END GO --===== Copy the Email contents from partner_email to partner_email_temp column -- after proper conversion to xml type UPDATE [dbo].[Partner] SET partner_email_temp = CAST('<PartnerEmails><Email>' + REPLACE(partner_email, '&', '&amp;') + '</Email><Email></Email><Email></Email></PartnerEmails>' AS XML) GO --===== Drop the exisitng partner_email ALTER TABLE [dbo].[Partner] DROP COLUMN partner_email GO --===== Rename partner_email_temp column to partner_email Exec sp_RENAME 'Partner.partner_email_temp','partner_email','COLUMN' GO I works fine for the first time I ran. Now if I ran it for the next time, it am getting an error Msg 8116, Level 16, State 1, Line 4 Argument data type xml is invalid for argument 1 of replace function. Caution: Changing any part of an object name could break scripts and stored procedures. The intention is that, if the partner_email column is varchar, the script will change it to xml type and will convert all the data in xml format . If I ran it second time, it should ignore the statement. How to achieve this? I am trying in a different way DECLARE @columnDataType VARCHAR(50) SELECT @columnDataType = DATA_TYPE FROM INFORMATION_SCHEMA.columns WHERE table_name = 'Partner' AND column_name = 'partner_email' print @columnDataType IF (@columnDataType = 'varchar') BEGIN --===== Create a partner_email_temp column of type xml into the Partner table IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.columns WHERE table_name = 'Partner' AND column_name = 'partner_email_temp' ) BEGIN ALTER TABLE [dbo].[Partner] ADD partner_email_temp XML NULL --===== Copy the Email contents from partner_email to partner_email_temp column -- after proper conversion to xml type UPDATE [dbo].[Partner] SET partner_email_temp = CAST('<PartnerEmails><Email>' + REPLACE(partner_email, '&', '&amp;') + '</Email><Email></Email><Email></Email></PartnerEmails>' AS XML) --===== Drop the exisitng partner_email ALTER TABLE [dbo].[Partner] DROP COLUMN partner_email --===== Rename partner_email_temp column to partner_email EXEC sp_RENAME 'Partner.partner_email_temp','partner_email','COLUMN' END END but getting error Msg 207, Level 16, State 1, Line 29 Invalid column name 'partner_email_temp'. Help needed

    Read the article

  • Visual Basic 2013 String Replacement

    - by user3707612
    I found this code that replaces a string in a text file. But, I am trying to make it so that it replaces several strings in a text file. My.Computer.FileSystem.WriteAllText("C:\windows\PrinterList2.txt", My.Computer.FileSystem.ReadAllText("C:\windows\PrinterList.txt").Replace("IT", "ADM-IT"), False) For example, I need it to replace "IT" with "ADM-IT" and "AR" with "ADM-AR" and possibly a hundred or so more. How can I get it to loop to do them all? Running this line of code over and over just overwrites the file with the last item for replacement. Thanks in advance.

    Read the article

  • How to scramble string C#?

    - by a_Elnajjar
    I write the code to scramble word I am create simple game jumble string jumble = theWord; int length = jumble.Count(); for (int i = 0; i < length; ++i) { int index1 = (rand.Next() % length); int index2 = (rand.Next() % length); char temp =jumble[index1]; jumble = jumble.Replace(jumble[index1], jumble[index2]); jumble = jumble.Replace(jumble[index1], temp); }

    Read the article

  • quickflip + slideshow animation

    - by user288231
    I have been trying to integrate quickflip and a slideshow animation. So everytime when the user hovers over the image, it would pause the animation and "flip to the other side". When the user hovers out, it would then replace its normal state. The problem is here is I do not know how to handle the quickflip code (http://jonraasch.com/blog/quickflip-2-jquery-plugin). I have looked at the sample code and tried to replace it, but at the end the animations would get messed up... Javascript: var interval = setInterval( "slideSwitch()", 3000 ); $('.quickFlip').quickFlip(); $('#slideshow').hover(function () { clearInterval(interval); }, function () { interval = setInterval("slideSwitch()", 3000); });

    Read the article

  • replaceWith Automatically Closes the Tag

    - by Warrantica
    I have 3 divs and I want to replace the first div with an opening tag of another div and the third with the closing tag. This is what I meant: <div>1</div> <div>2</div> <div>3</div> When I tried to replace (using replaceWith()) the first div with <div class="foo"> and the third with </div>, jQuery somewhat misinterpret it as: <div class="foo"></div> <div>2</div> </div> While what I actually want is: <div class="foo"> <div>2</div> </div> Thank you in advance,

    Read the article

  • How can I install Firefox 4 nightlies and Firefox 3.6 stable on the same system

    - by Mussnoon
    I started using the firefox nightlies a while ago. I would get updates for both versions 4 (Minefield) and 3.7 (Namoroka). Now I want to keep version 4 nightly, but replace the 3.7 nightly with 3.6 stable. I've already removed the 3.7 nightly, but can't figure how to install 3.6 stable (systemwide). Trying to install it using apt-get starts downloading the nightly again. Where do I need to make the necessary changes?

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >