Search Results

Search found 3546 results on 142 pages for 'dos batch'.

Page 101/142 | < Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >

  • editing a file with vim that has no EOL marker on the last line but has CRLF line endings

    - by rmeador
    I often have to edit script files, the interpreter for which treats files that have an EOL marker on the last line of the file as an error (i.e. the file is treating CRLF as "newlines", not as "line endings"). Currently, I open these files in Vim using binary mode (-b on the command line). It autodetects the lack of EOL on the final line and sets the "noeol" option appropriately, which prevents it from writing an EOL on the last line. Because the file has CRLF line endings, I get lots of ^Ms at the end of my lines (because it interprets only Unix-style line endings in binary mode, it seems). I can't open it in text mode because the "noeol" option is ignored for non-binary files. This is very annoying, and I always have to remember to manually type the ^M at the end of each line! Is there some way I can force it to accept DOS-style line endings in binary mode, or force it to listen to the EOL option in text mode?

    Read the article

  • My HttpHandler doesn't want to create directory on a network

    - by Daok
    I use this simple line of code inside my HttpHandler: Directory.CreateDirectory(@"\\srv-001\dev\folderToCreate\"); I receive an UnauthoridezAccessException telling me that the access to the path is denied. From here, I create a little Dos application in C# doing the same thing and I was able to create the folder. So, I thought that it might be that IIS is running on a different user than myself. I went to IIS and changed the Application pool to a Custom user, myself. But, unfortunately, I got the same exception. I have try to create a Share folder on my computer and I can create directory. Also, when debugging I can see that System.Threading.Thread.CurrentPrincipal.Identity have its AuthenticationType to "", IsAuthenticated to false and name to "". So, with all those tests I can conclude that the HttpHandler that receive the file cannot create a directory because of some security access. How can I grand access to my HttpHandler to be able to create a directory (and files) to a network folder?

    Read the article

  • How can I throttle user login attempts in PHP

    - by jasondavis
    I was just reading this post http://stackoverflow.com/questions/549/the-definitive-guide-to-website-authentication-beta#477585 on Preventing Rapid-Fire Login Attempts. Best practice #1: A short time delay that increases with the number of failed attempts, like: 1 failed attempt = no delay 2 failed attempts = 2 sec delay 3 failed attempts = 4 sec delay 4 failed attempts = 8 sec delay 5 failed attempts = 16 sec delay etc. DoS attacking this scheme would be very impractical, but on the other hand, potentially devastating, since the delay increases exponentially. I am curious how I could implement something like this for my login system in PHP?

    Read the article

  • C# console applications all 16bit?

    - by Jon
    Hi all, I was reading up about NTVDM.exe as I build a quick test console app and it crashed on a friends machine complaining about this EXE. As I understand it all DOS cmd windows (C# console apps included) run as 16bit not 32bit. Is this true? Does this mean all my works console app back office apps are running as 16bit rather than making the most of the 32bit available? What about Windows services? As I believe we wrote it as a console app then made it run as a windows service? Thanks

    Read the article

  • Getting COM object to run in Vista

    - by rainslg
    We expose an interface to our simulation software using a COM/ActiveX object. This worked just fine in XP, but in Vista, we get "Error 429: ActiveX can't create object" when a VB client executes CreateObject(). The COM object has been registered by hand so that the Vista Registry is identical to XP's Registry. I run the VB interface from a DOS window that I started using "Run As Administrator". The client is correctly accessing and reading the Registry as I walk through using the debugger in VB, so it's apparently not a security setting, as near as I can tell. I have also loaded the files into VS2005 (the object was originally created in VS6) and rebuilt them to get a later ATL version, but that hasn't helped - we still get the 429 error. Is this a symptom of UAC problems, or should I be looking for something deeper?

    Read the article

  • Set User Defined Language Programmatically

    - by wonea
    I've been trying to select the User Defined Language programmatically unsuccessfully through various means, another problem is the files I need to apply the user defined language have no file extension, old DOS files; NPPM_SETCURRENTLANGTYPE (only enumerates built-in languages) Macros don't seem to sense changes with language selection, I was hoping to record a macro then trigger it with NPPExec. Notepad++ accepts only in-built languages for starting from the command line I can't select a UDL as the default language for a new document. ...and my attempts at overriding an in-built language seem to have failed. I've copied details from userDefinedLang.xml to langs.xml don't work. The highlighting doesn't change. Thanks for any help!!

    Read the article

  • Create Personalized Controls For Java ME

    - by Nathan Campos
    I'm starting to develop a eBook reader for mobile using Java ME, but for the control were the book will be shown I need a personalized control. For this I need to first know how to do one, to workaround with my needs. Then I need to know how can I do a personalized control as we do with Visual Basic. PS: I want to do a personalized TextBox, that in some parts can be in bold, italic, sublined, that supports topics(as the Edit, the MS-DOS Text Editor) and many other things that make a eBook better viewed than a simple plain text

    Read the article

  • Console-like control that allows full control over individual text formatting

    - by Rich.Carpenter
    I'm tinkering with writing a simple text-based role-playing game. I would like to use WinForms, and utilize WinForm controls for the UI and simple text for the output. The catch is, I would like to have complete control over the formatting of the individual text - some words being different colors, etc. A simple console control would suffice, as that would provide control over text colors, but it would be nice to also be able to change style, font and size. Less important: it would be nice to have complete control over where text appears in the control through a coordinate system, as with DOS windows of old. I'd appreciate suggestions on the best method of implementing this. Perhaps there is a better method I had not considered for rendering the output of a text-based game.

    Read the article

  • Unknown error sourcing a script containing 'typeset -r' wrapped in command substitution

    - by Bernard Assaf
    I wish to source a script, print the value of a variable this script defines, and then have this value be assigned to a variable on the command line with command substitution wrapping the source/print commands. This works on ksh88 but not on ksh93 and I am wondering why. $ cat typeset_err.ksh #!/bin/ksh unset _typeset_var typeset -i -r _typeset_var=1 DIR=init # this is the variable I want to print When run on ksh88 (in this case, an AIX 6.1 box), the output is as follows: $ A=$(. ./typeset_err.ksh; print $DIR) $ echo $A init When run on ksh93 (in this case, a Linux machine), the output is as follows: $ A=$(. ./typeset_err.ksh; print $DIR) -ksh: _typeset_var: is read only $ print $A ($A is undefined) The above is just an example script. The actual thing I wish to accomplish is to source a script that sets values to many variables, so that I can print just one of its values, e.g. $DIR, and have $A equal that value. I do not know in advance the value of $DIR, but I need to copy files to $DIR during execution of a different batch script. Therefore the idea I had was to source the script in order to define its variables, print the one I wanted, then have that print's output be assigned to another variable via $(...) syntax. Admittedly a bit of a hack, but I don't want to source the entire sub-script in the batch script's environment because I only need one of its variables. The typeset -r code in the beginning is the error. The script I'm sourcing contains this in order to provide a semaphore of sorts--to prevent the script from being sourced more than once in the environment. (There is an if statement in the real script that checks for _typeset_var = 1, and exits if it is already set.) So I know I can take this out and get $DIR to print fine, but the constraints of the problem include keeping the typeset -i -r. In the example script I put an unset in first, to ensure _typeset_var isn't already defined. By the way I do know that it is not possible to unset a typeset -r variable, according to ksh93's man page for ksh. There are ways to code around this error. The favorite now is to not use typeset, but just set the semaphore without typeset (e.g. _typeset_var=1), but the error with the code as-is remains as a curiosity to me, and I want to see if anyone can explain why this is happening. By the way, another idea I abandoned was to grep the variable I need out of its containing script, then print that one variable for $A to be set to; however, the variable ($DIR in the example above) might be set to another variable's value (e.g. DIR=$dom/init), and that other variable might be defined earlier in the script; therefore, I need to source the entire script to make sure I all variables are defined so that $DIR is correctly defined when sourcing.

    Read the article

  • How to restrict access to my web service?

    - by Hank
    I have http://example.com/index.html, which from within the HTML uses JavaScript to call a web services at http://example.com/json/?a=...&b=... The web service returns to index.html a JSON array of information to then be displayed on index.html. Since anyone can view the source code for index.html and see how I'm calling the JSON web services (http://example.com/json/), how do I prevent people from calling my JSON web service directly? Since the web service is essentially an open read into my database, I don't want people to abuse the web service and start DoS my server, fetching more information than they should, etc..

    Read the article

  • VB.NET Application which can compile and run C programs

    - by Arjun Vasudevan
    These days I'm working on a VB.NET application which can be used to edit, compile and run C programs. Can someone tell me how I can call a cl.exe process from within my VB program and also that how do I run the program in the console widow itself. Presently I have only the editor ready. With that one can type in a program and save it with a ".c" extension. Now there are 2 buttons on my form - "Compile" and "Run". When the user clicks on the "Compile" button, the program should be passed to the cl.exe process and the errors should be displayed in another textbox or the DOS(black screen itself). And when the user clicks on the "Run" button, the ".exe" file which just got created should get executed.

    Read the article

  • Can EC2 instances be set up to come from different IP ranges?

    - by Joshua Frank
    I need to run a web crawler and I want to do it from EC2 because I want the HTTP requests to come from different IP ranges so I don't get blocked. So I thought distributing this on EC2 instances might help, but I can't find any information about what the outbound IP range will be. I don't want to go to the trouble of figuring out the extra complexity of EC2 and distributed data, only to find that all the instances use the same address block and I get blocked by the server anyway. NOTE: This isn't for a DoS attack or anything. I'm trying to harvest data for a legitimate business purpose, I'm respecting robots.txt, and I'm only making one request per second, but the host is still shutting me down. Edit: Commenter Paul Dixon suggests that the act of blocking even my modest crawl indicates that the host doesn't want me to crawl them and therefore that I shouldn't do it (even assuming I can work around the blocking). Do people agree with this?

    Read the article

  • What first game did you program, and did it make you a better developer?

    - by thenonhacker
    What first game did you program? Name your game, the OS and language, and even a Website URL to get your game. Old DOS Games and Flash Games with ActionScript are allowed. Game kits are allowed, too. ...and did it make you a better developer? Programming games can be addicting, and it will bring out the best in us as we create our first game. What lessons did you learn form most? Algorithm and/or AI's? Graphics? User Interface? File Formats and Data Storage? Project and Time Management? Can you say that because you practiced programming by creating this game, you became more immersed with the programming language you used and helped you become a better developer?

    Read the article

  • What are the internal limits to WCF

    - by ligos
    WCF has lots of limits imposed on it to protect against DoS attacks and other developer brainlessness. What are these limits? And how can they be overriden? Specifically, if I was to try to send a large number of messages in a short period of time to a variety of different clients, what are the internal WCF limits they may cause messages to be sent slowly. PS: this question is a much shorter version of my previous question that did not get much attention. EDIT I have answered the original question. The issue being my async calls were being turned into synchronous ones.

    Read the article

  • Record locking problem between linux and Windows

    - by PabloG
    I need to run a bunch of old DOS FoxPro / Clipper applications in linux under DOSEMU. The programs access their "databases" located on a network server (could be a Windows or Linux server) Actually, the programs ran fine, but I cannot manage to make the record locking work as supposed: I can run a program in two terminals (or the server and any terminal for instance) and lock the same record in both. Now, I'm using Tiny Core Linux as terminal and Windows XP as server, accesing the shared files via CIFS and the latest DOSEMU (1.4.0), but I tried with various combinations of server (Ubuntu 7 to 9, Damn Small Linux, XP) <- protocol (CIFS, samba, various versions of smbclient) <- client (same as server) with no luck I tried to configure the server part to work without oplocks in samba (after reading the entire O'Reilly Samba book locking chapter in http://oreilly.com/catalog/samba/chapter/book/ch05_05.html ) and in XP (\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\UseOpportunisticLocking = 0) but the problem persist. Any ideas? TIA, Pablo

    Read the article

  • Why doesn't this work?

    - by user146780
    I'v tried to solve a memory leak in the GLU callback by creating a global variable but now it dos not draw anything: GLdouble *gluptr = NULL; void CALLBACK combineCallback(GLdouble coords[3], GLdouble *vertex_data[4], GLfloat weight[4], GLdouble **dataOut) { GLdouble *vertex; if(gluptr == NULL) { gluptr = (GLdouble *) malloc(6 * sizeof(GLdouble)); } vertex = (GLdouble*)gluptr; vertex[0] = coords[0]; vertex[1] = coords[1]; vertex[2] = coords[2]; for (int i = 3; i < 6; i++) { vertex[i] = weight[0] * vertex_data[0][i] + weight[1] * vertex_data[0][i] + weight[2] * vertex_data[0][i] + weight[3] * vertex_data[0][i]; } *dataOut = vertex; } basically instead of doing malloc each time in the loop (thus the memory leak) im using a global pointer, but this doesn't work (drawing to the screen). Why would using malloc to a pointer created in the function work any different than a global variable? Thanks

    Read the article

  • Bulk inserting and updating with Entity Framework (Probably a better alternative?)

    - by Dave
    I have a data set of devices, addresses, and companies that I need to import into our database, with the catch that our database may already include a specific device/address/company that is included in the new data set. If that is the case, I need to update that entry with the new information in the data set, excluding addresses. We check if an exact copy of that address exists, otherwise we make a new entry. My issue is that it is very slow to attempt to grab a device/company in EF and if it exist updated it, otherwise insert it. To fix this I tried to get all the companies, devices, and addresses and insert them into respective hashmaps, and check if the identifier of the new data exists in the hashmap. This hasn't led to any performance increases. I've included my code below. Typically I would do a batch insert, I'm not sure what I would do for a batch update though. Can someone advise a different route? var context = ObjectContextHelper.CurrentObjectContext; var oldDevices = context.Devices; var companies = context.Companies; var addresses = context.Addresses; Dictionary<string, Company> companyMap = new Dictionary<string, Company>(StringComparer.OrdinalIgnoreCase); Dictionary<string, Device> deviceMap = new Dictionary<string, Device>(StringComparer.OrdinalIgnoreCase); Dictionary<string, Address> addressMap = new Dictionary<string, Address>(StringComparer.OrdinalIgnoreCase); foreach (Company c in companies) { if (c.CompanyAccountID != null && !companyMap.ContainsKey(c.CompanyAccountID)) companyMap.Add(c.CompanyAccountID, c); } foreach (Device d in oldDevices) { if (d.SerialNumber != null && !deviceMap.ContainsKey(d.SerialNumber)) deviceMap.Add(d.SerialNumber, d); } foreach (Address a in addresses) { string identifier = GetAddressIdentifier(a); if (!addressMap.ContainsKey(identifier)) addressMap.Add(identifier, a); } foreach (DeviceData.TabsDevice device in devices) { // update a device Company tempCompany; Address tempAddress; Device currentDevice; if (deviceMap.ContainsKey(device.SerialNumber)) //update a device deviceMap.TryGetValue(device.SerialNumber, out currentDevice); else // insert a new device currentDevice = new Device(); currentDevice.SerialNumber = device.SerialNumber; currentDevice.SerialNumberTABS = device.SerialNumberTabs; currentDevice.Model = device.Model; if (device.CustomerAccountID != null && device.CustomerAccountID != "") { companyMap.TryGetValue(device.CustomerAccountID, out tempCompany); currentDevice.CustomerID = tempCompany.CompanyID; currentDevice.CustomerName = tempCompany.CompanyName; } if (companyMap.TryGetValue(device.ServicingDealerAccountID, out tempCompany)) currentDevice.CompanyID = tempCompany.CompanyID; currentDevice.StatusID = 1; currentDevice.Retries = 0; currentDevice.ControllerFamilyID = 1; if (currentDevice.EWBFrontPanelMsgOption == null) // set the Panel option to the default if it isn't set already currentDevice.EWBFrontPanelMsgOption = context.EWBFrontPanelMsgOptions.Where( i => i.OptionDescription.Contains("default")).Single(); // link the device to the existing address as long as it is actually an address if (addressMap.TryGetValue(GetAddressIdentifier(device.address), out tempAddress)) { if (GetAddressIdentifier(device.address) != "") currentDevice.Address = tempAddress; else currentDevice.Address = null; } else // insert a new Address and link the device to it (if not null) { if (GetAddressIdentifier(device.address) == "") currentDevice.Address = null; else { tempAddress = new Address(); tempAddress.Address1 = device.address.Address1; tempAddress.Address2 = device.address.Address2; tempAddress.Address3 = device.address.Address3; tempAddress.Address4 = device.address.Address4; tempAddress.City = device.address.City; tempAddress.Country = device.address.Country; tempAddress.PostalCode = device.address.PostalCode; tempAddress.State = device.address.State; addresses.AddObject(tempAddress); addressMap.Add(GetAddressIdentifier(tempAddress), tempAddress); currentDevice.Address = tempAddress; } } if (!deviceMap.ContainsKey(device.SerialNumber)) // if inserting, add to context { oldDevices.AddObject(currentDevice); deviceMap.Add(device.SerialNumber, currentDevice); } } context.SaveChanges();

    Read the article

  • Is there a recommended command for "hg bisect --command"?

    - by blokeley
    I have an emergent bug that I've got to track down tomorrow. I know a previous hg revision which was good so I'm thinking about using hg bisect. However, I'm on Windows and don't want to get into DOS scripting. Ideally, I'd be able to write a Python unit test and have hg bisect use that. This is my first attempt. bisector.py #!/usr/bin/env python import sys import unittest class TestCase(unittest.TestCase): def test(self): #raise Exception('Exception for testing.') #self.fail("Failure for testing.") pass def main(): suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestCase) result = unittest.TestResult() suite.run(result) if result.errors: # Skip the revision return 125 if result.wasSuccessful(): return 0 else: return 1 if '__main__' == __name__: sys.exit(main()) Perhaps I could then run: hg bisect --reset hg bisect --bad hg bisect --good -r 1 hg bisect --command=bisector.py Is there a better way of doing it? Thanks for any advice.

    Read the article

  • c#: RedirectStandardOutput prevents exit exception?

    - by user1743977
    All I want is to redirect standard output of a process to a file. Sounds easy, but everything I tried doesn't work: 1) putting a dos-style redirection in the list of arguments (e.g. "param1 param2 output.txt") doesn't work, 2) using RedirectStandardOutput = true works, BUT, apparently the process does not through an exception when it exists. So the handler defined via process.Exited += ... doesn't catch anything. To be clear, once I remove the 'RedirectStandardOutput = true ' statement, it DOES catch an exception. What am I doing wrong ? Thanks, Ofer

    Read the article

  • how to use execute() in groovy to run any command

    - by drake
    I usually build my project using these two commands from command line (dos) G:\> cd c: C:\> cd c:\my\directory\where\ant\exists C:\my\directory\where\ant\exists> ant -Mysystem ... ..... build successful What If I want to do the above from groovy instead? groovy has execute() method but following does not work for me: def cd_command = "cd c:" def proc = cd_command.execute() proc.waitFor() it gives error: Caught: java.io.IOException: Cannot run program "cd": CreateProcess error=2, The system cannot find the file specified at ant_groovy.run(ant_groovy.groovy:2)

    Read the article

  • help in security assignment

    - by scatman
    i have to write a program that sniffs network packets (part1-the simple part). and i have to update the program (part2) so that it will be able to terminate connections. the specific requirements are: construct raw packets by specifying data link layer and network layer information including appropriate source and destination MAC and IP addresses. These packets are intended to terminate the connection. To do so, you should used SOCK_RAW as the socket type to be able to set the header information by yourself. can anybody give me some ideas on the second part? should i hijack the session,apply a dos attack on one of the users?? all i need is some tips of how to terminate the connection. i am using c programming language. and this is a course assignment for the security course.

    Read the article

  • How to get Host OS (operating system) parameter of ZIP archive in C#

    - by bao
    Look. I have ZIP archives prepared in different os'es: mac, linux, windows. In windows file names encoded in DOS CP866, mac & linux in UTF-8. I need to know (in code) in which os zip file was prepared to decode file names correctly. There is a Host OS paramterer in "Central directory structure" of zip file (look http://www.fileformat.info/format/zip/corion.htm ). How to get 0005h 1 byte Host OS parameter in C#?

    Read the article

  • Book resources for x86/x64 assembly programming on Win platform

    - by Scott Davies
    Hello, I ran a search for assembly language resources on stackoverflow.com and found some interesting results, but they seemed to boil down to two groups: 1) Assembly references to old ia32 architecture, such as the 80386 to Pentium 2) Windows agnostic books. Most of the commenters make the point that assembler is CPU dependent and that the OS is irrelevant, but it seems pointless to me to pick a book that has assembly examples that refer to MS-DOS interrupts and memory layouts. Likewise, learning assembler on Linux would seem to produce Linux executables Are there any: 1) Modern 2) x86/x64 3) on Windows platform - book resources available ? The reason I am targeting the Win platform is I would like to do low-level, OS internals programming, to supplement my Win C/C++ work. Thanks

    Read the article

  • discovering files in the FileSystem, through SSIS

    - by cometbill
    I have a folder where files are going to be dropped for importing into my data warehouse. \\server\share\loading_area I have the following (inherited) code that uses xp_cmdshell shivers to call out to the command shell to run the DIR command and insert the resulting filenames into a table in SQL Server. I would like to 'go native' and reproduce this functionality in SSIS. Thanks in advance guys and girls. Here's the code USE MyDatabase GO declare @CMD varchar(500) declare @EXTRACT_PATH varchar(255) set @EXTRACT_PATH = '\\server\share\folder\' create table tmp_FILELIST([FILENUM] int identity(1,1), [FNAME] varchar(100), [FILE_STATUS] varchar(20) NULL CONSTRAINT [DF_FILELIST_FILE_STATUS] DEFAULT ('PENDING')) set @CMD = 'dir ' + @EXTRACT_PATH + '*.* /b /on' insert tmp_FILELIST([FNAME]) exec master..xp_cmdshell @CMD --remove the DOS reply when the folder is empty delete tmp_FILELIST where [FNAME] is null or [FNAME] = 'File Not Found' --Remove my administrative and default/common, files not for importing, such as readme.txt delete tmp_FILELIST where [FNAME] is null or [FNAME] = 'readme.txt'

    Read the article

  • Issues running python scripts in Command Prompt (Specifically with command line arguments)?

    - by dmanatunga
    I am trying to run my python scripts in DOS without calling python.exe first. I am specifically doing this in relation to running django-admin.py. I have C:\Python26 and C:\Python26\Scripts in my PATH. However, if I try running django-admin.py by doing: django-admin.py startproject helloworld I get the message: Type 'django-admin.py help' for usage. Now, after some experimentation, I realized the problem is that the secondary arguments to these scripts are not being passed for some reason, since I tried it with a some other python scripts I have. I know I could avoid this problem by simply doing: python C:\Python26\Scripts\django-admin.py startproject helloworld But I know it should be possible to run the first command only and get it to work, because I had it working before. I've looked everywhere, and not many places have been helpful so any idea would be useful for me at this point.

    Read the article

< Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >