Search Results

Search found 46908 results on 1877 pages for 'managing files and folder'.

Page 63/1877 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • Managing lots of callback recursion in Nodejs

    - by Maciek
    In Nodejs, there are virtually no blocking I/O operations. This means that almost all nodejs IO code involves many callbacks. This applies to reading and writing to/from databases, files, processes, etc. A typical example of this is the following: var useFile = function(filename,callback){ posix.stat(filename).addCallback(function (stats) { posix.open(filename, process.O_RDONLY, 0666).addCallback(function (fd) { posix.read(fd, stats.size, 0).addCallback(function(contents){ callback(contents); }); }); }); }; ... useFile("test.data",function(data){ // use data.. }); I am anticipating writing code that will make many IO operations, so I expect to be writing many callbacks. I'm quite comfortable with using callbacks, but I'm worried about all the recursion. Am I in danger of running into too much recursion and blowing through a stack somewhere? If I make thousands of individual writes to my key-value store with thousands of callbacks, will my program eventually crash? Am I misunderstanding or underestimating the impact? If not, is there a way to get around this while still using Nodejs' callback coding style?

    Read the article

  • Managing aesthetic code changes in git

    - by Ollie Saunders
    I find that I make a lot of small changes to my source code, often things that have almost no functional effect. For example: Refining or correcting comments. Moving function definitions within a class for a more natural reading order. Spacing and lining up some declarations for readability. Collapsing something using multiple lines on to one. Removing an old piece of commented-out code. Correcting some inconsistent whitespace. I guess I have a formidable attention to detail in my code. But the problem is I don't know what to do about these changes and they make it difficult to switch between branches etc. in git. I find myself not knowing whether to commit the minor changes, stash them, or put them in a separate branch of little tweaks and merge that in later. None those options seems ideal. The main problem is that these sort of changes are unpredictable. If I was to commit these there would be so many commits with the message "Minor code aesthetic change.", because, the second I make such a commit I notice another similar issue. What should I do when I make a minor change, a significant change, and then another minor change? I'd like to merge the three minor changes into one commit. It's also annoying seeing files as modified in git status when the change barely warrants my attention. I know about git commit --amend but I also know that's bad practice as it makes my repo inconsistent with remotes.

    Read the article

  • Unit Testing Private Method in Resource Managing Class (C++)

    - by BillyONeal
    I previously asked this question under another name but deleted it because I didn't explain it very well. Let's say I have a class which manages a file. Let's say that this class treats the file as having a specific file format, and contains methods to perform operations on this file: class Foo { std::wstring fileName_; public: Foo(const std::wstring& fileName) : fileName_(fileName) { //Construct a Foo here. }; int getChecksum() { //Open the file and read some part of it //Long method to figure out what checksum it is. //Return the checksum. } }; Let's say I'd like to be able to unit test the part of this class that calculates the checksum. Unit testing the parts of the class that load in the file and such is impractical, because to test every part of the getChecksum() method I might need to construct 40 or 50 files! Now lets say I'd like to reuse the checksum method elsewhere in the class. I extract the method so that it now looks like this: class Foo { std::wstring fileName_; static int calculateChecksum(const std::vector<unsigned char> &fileBytes) { //Long method to figure out what checksum it is. } public: Foo(const std::wstring& fileName) : fileName_(fileName) { //Construct a Foo here. }; int getChecksum() { //Open the file and read some part of it return calculateChecksum( something ); } void modifyThisFileSomehow() { //Perform modification int newChecksum = calculateChecksum( something ); //Apply the newChecksum to the file } }; Now I'd like to unit test the calculateChecksum() method because it's easy to test and complicated, and I don't care about unit testing getChecksum() because it's simple and very difficult to test. But I can't test calculateChecksum() directly because it is private. Does anyone know of a solution to this problem?

    Read the article

  • Managing a log stream in C++ in a cout-like notation

    - by Andry
    Hello! I have a class in c++ in order to write log files for an application of mine. I have already built the class and it works, it is something like this: class Logger { std::string _filename; public: void print(std::string tobeprinted); } Well, it is intuitive that, in order to print a line in the log file, for an object of Logger, it is simply necessary to do the following: Logger mylogger("myfile.log"); mylogger.print(std::string("This is a log line")); Well. Using a method approach is not the same as using a much better pattern like << is. I would like to do the following: Logger mylogger("myfile.log"); mylogger << "This is a log line"; That's all. I suppose I must overload the << operator... But overloading using this signature (the classic one): ostream& operator<<(ostream& output, const MyObj& o); But I do not have a ostream... So, should I do as follows? Logger& operator<<(Logger& output, const std::string& o); Is this the right way? Thanks

    Read the article

  • Managing My Database in Source Control

    - by Jason
    As I am working with a new database project (within VS2008), and as I have never developed a database from scratch, I immediately began looking into how to manage a database within source control (in this case, Subversion). I found some information on SO, including this post: Keeping development databases in multiple environments in sync. One of the answers in particular pointed to a number of a links, all of which had good, useful information. I was reading a series of posts by K. Scott Allen which describe how he manages database change. From my reading (and please pardon the noobishness of my question), it seems as though the database itself is never checked into a repository. Rather, scripts that can build the database, along with test data (which is also populated from scripts) is checked into the repository. Ultimately, this means that, when a developer is testing his or her app, these scripts, which are part of the build process, are run. This ensures that the database is up-to-date, but is also run locally from every developer's machine. This makes sense to me (if I am indeed reading that correctly). However, if I am missing something, I would appreciate correction or additional guidance. In addition, another question I wanted to ask - does this also mean that I should NOT check in the mdf or ldf files that are created from Visual Studio? Thanks for any help and additional insight. Always appreciated.

    Read the article

  • two finder windows next to each other like Ubuntu F3 shortcut

    - by RussellHarrower
    Ok, so at work I use Ubuntu and its create for copying a files from one folder to another folder without having two finder windows open. What I would like is to have that function on my mac and I am wondering if anyone knows how to do this. I understand Ubuntu is Linux and Mac well its from Linux has all the features of Linux but is a mac. The feature may not be there but if it is, it would help me alot. As I am always moving files around servers and systems

    Read the article

  • Setting up a fileserver, some questions?

    - by Tanax
    Recently I've become very interested in setting up a fileserver, mostly for home usage but also because of the fact that I live in 2 places, I need to be able to access my files from both homes. I have already done some research into this but I am unclear about some things. My requirements are the following; Needs to work on both Mac and PC(only using Windows atm on PC but could be good if it supports more OS's to make it futureproof in case I need Linux or something else) Need to be able to set up a folder/drive/network space to act as a link to a certain folder on the fileserver All files should only be stored on the fileserver, e.g. no "shared" folders like in Dropbox where files are stored on the client computer Would prefer it if folders are password protected or that I can somehow specify what users can access the fileserver's shares Fileserver's OS most likely have to be Windows due to other factors outside of being just a fileserver I've already kinda figured out that I will need to set up a VPN so that I can access my fileserver from outside the local network. Probably going to use OpenVPN. Question 1: How would I go about to set up a VPN server so that I can connect to my local network at the fileserver's location? I know that since I'm on a dynamic IP I will have to get some sort of dynamic DNS server - I've already checked into this and I'm fairly sure I know how to fix that. I also know that I will have to forward the port OpenVPN uses in my router. Question 2: How would I actually share the folders on the fileserver so that I can access them on my other computers? I've researched into Samba but I'm uncertain if it needs to be run on a Linux OS. I know that the clients connecting to it can be Windows for example but can the Samba "server" be run on Windows? Also it appears that Samba shares a folder, meaning it works like Dropbox - I don't want that. So how would I share a folder in that case to make it work like I want it to? Sorry for the incredibly long question, I tried to structure it the best I could for easier read. Thanks in advance!

    Read the article

  • Setting up a fileserver, some questions?

    - by Tanax
    Recently I've become very interested in setting up a fileserver, mostly for home usage but also because of the fact that I live in 2 places, I need to be able to access my files from both homes. I have already done some research into this but I am unclear about some things. My requirements are the following; Needs to work on both Mac and PC(only using Windows atm on PC but could be good if it supports more OS's to make it futureproof in case I need Linux or something else) Need to be able to set up a folder/drive/network space to act as a link to a certain folder on the fileserver All files should only be stored on the fileserver, e.g. no "shared" folders like in Dropbox where files are stored on the client computer Would prefer it if folders are password protected or that I can somehow specify what users can access the fileserver's shares Fileserver's OS most likely have to be Windows due to other factors outside of being just a fileserver I've already kinda figured out that I will need to set up a VPN so that I can access my fileserver from outside the local network. Probably going to use OpenVPN. Question 1: How would I go about to set up a VPN server so that I can connect to my local network at the fileserver's location? I know that since I'm on a dynamic IP I will have to get some sort of dynamic DNS server - I've already checked into this and I'm fairly sure I know how to fix that. I also know that I will have to forward the port OpenVPN uses in my router. Question 2: How would I actually share the folders on the fileserver so that I can access them on my other computers? I've researched into Samba but I'm uncertain if it needs to be run on a Linux OS. I know that the clients connecting to it can be Windows for example but can the Samba "server" be run on Windows? Also it appears that Samba shares a folder, meaning it works like Dropbox - I don't want that. So how would I share a folder in that case to make it work like I want it to? Sorry for the incredibly long question, I tried to structure it the best I could for easier read. Thanks in advance!

    Read the article

  • Windows File System Analysis

    - by bouvierr
    I am looking for a FREE tool to perform analyses on the NTFS file system of my Windows 7 PC. I want to easily see the amount of data distributed throught out the entire file system. The following applications seem very good, but they are not free and probably overkill for my requirements: FolderSizes 5 MailMeter Windows File System Reporting Tool I am aware that some applications (like Folder Size 2.5) can add a column in Windows Explorer to show the size of each folder, but I am looking for something more like a reporting tool. Thank you for your suggestions.

    Read the article

  • Delete a directory with pipe (|) in its name?

    - by Dave Jarvis
    Without booting to Linux, how do you delete a directory that was created in Linux on an NTFS partition that contains a pipe in the file name? For example: f:\flac\foreign\Yoshida_Brothers\Best_of_Yoshida_Brothers_|_Tsugaru_Shamisen Tried and failed: Midnight Commander Recursively deleting the parent folder del /f /s /q Yoshida_Brothers del /f /s /q "\\?f:\flac\foreign\Yoshida_Brothers\" rmdir /s Yoshida_Brothers rmdir Best* FileASSASSIN Cannot delete folder Other ideas?

    Read the article

  • Clone roaming Appdata in two places

    - by blsub6
    I have my users appdata (roaming) stored on a external server in the location that they're normally in. I have some users that are in two locations equally. This provides a problem when someone tries to open up Firefox on a computer in a location other than where their appdata is stored, it takes forever. Is there a way that I can clone the redirected appdata (roaming) folder to two locations and have the folder redirection look for appdata (roaming) based on the location that the user is at?

    Read the article

  • batch file to deploy files

    - by Martin Michalak
    hi I have created batch file which pulls info from *.txt file and deploy code from the source to destination: SET Source=%1 if exist %Source% ( ECHO Source for WEB exists ) else ( ECHO Wrong build%Source% doesn't exist GOTO Menu ) SET Server=%2 SET AppPool=%3 SET Destination=%4 SET Folder=%5 SET ENV=%6 SET AppName=%7 SET Envlog=%8 ECHO Deployment of WEB > %Envlog% %Date% %Time% echo. @ECHO Stopping App Pools @ECHO Stopping App Pools >> %Envlog% %Date% %Time% D:\ICTTools\PSEXEC.EXE -d \\%Server% cmd.exe /c c:\windows\system32\inetsrv\appcmd STOP apppool /apppool.name:%AppPool% echo. @ECHO App Pools will be stopped in the background @ECHO App Pools will be stopped in the background >> %Envlog% %Date% %Time% Pause echo. IF EXIST "%Destination%" ( ECHO Deleting %AppName% %Folder% RMDIR %Destination% /s /q ECHO Destination Folder %Folder% Deleted ECHO Destination Folder %Folder% Deleted >> %Envlog% %Date% %Time% ) else ( ECHO Destination Folder %Destination% does not exist, please check ECHO Destination Folder %Destination% does not exist, please check >> %Envlog% %Date% %Time% Pause ) echo. @ECHO Starting Robocopy for %AppName% @ECHO Starting Robocopy for %AppName% >> %Envlog% %Date% %Time% echo. START /WAIT /MIN ROBOCOPY.EXE %Source% %Destination% *.* /S /NP /R:3 /W:5 /LOG:"Logs\Robo%AppName%%ENV%.log" D:\Tools\Windiff\windiff.exe %Source% %Destination% echo. @ECHO Finished with Robocopy @ECHO Finished with Robocopy >> %Envlog% %Date% %Time% echo. @ECHO Checking if App pools stopped: @ECHO Checking if App pools stopped: >> %Envlog% %Date% %Time% D:\ICTTools\PSEXEC.EXE \\%Server% c:\windows\system32\inetsrv\appcmd LIST apppool /apppool.name:%AppPool% @echo off set /p ask=All app pools stopped? (y/n) if %ask%==y (echo Great, please continue with deployemnt) else echo Before continuing please check why app pools did not stop @echo App pools stopped?: %ask% >> %Envlog% %Date% %Time% DEL %Source%\web.config echo. @ECHO Production Config check if exist "%Destination%\%ENV%-Web.config" ( echo. ECHO The Application production configuration file does exist. ECHO The Application production configuration file does exist. >> %Envlog% %Date% %Time% COPY %Destination%\%ENV%-Web.config web.config echo. ECHO Production %ENV%-Web.config has been renamed to web.config ECHO Production %ENV%-Web.config has been renamed to web.config >> %Envlog% %Date% %Time% ) else ( ECHO The Application production configuration file is missing in Production %AppName% ECHO The Application production configuration file is missing in Production %AppName% >> %Envlog% %Date% %Time% explorer %Destination% Pause ) echo. @ECHO Confirm that configs were renamed correclty, if yes please hit any key to START APP Pools @ECHO Confirm that configs were renamed correclty, if yes please hit any key to START APP Pools >> %Envlog% %Date% %Time% Pause echo. @ECHO Start %AppName% Application Pool >> %Envlog% %Date% %Time% D:\ICTTools\PSEXEC.EXE \\%Server% c:\windows\system32\inetsrv\appcmd START apppool /apppool.name:%AppPool% @echo off set /p ask=All app pools started? (y/n) if %ask%==y (echo Great, please continue with deployemnt) else echo Before continuing please check why app pools did not start @echo App pools started?: %ask% >> %Envlog% %Date% %Time% Pause echo. @ECHO Build Version for %AppName% @ECHO Build Version for %AppName% >> %Envlog% %Date% %Time% type %Destination%\buildinfo.xml echo. ECHO ............................................... @ECHO ...........Deployment Compelted................ @ECHO ...........Deployment Compelted................>> %Envlog% %Date% %Time% ECHO ............................................... here are my issues: Lets say I am running code for 3 servers, then for each instance: For all three servers I am performing destination folder delete even so destination folder is always the same, the code should only delete it in the 1st instance (when code is deployed to first server) then I would prefer if script would check if the code from the source and destination is the same and if it is it should delete the folder or not. Then based on 1: a) deleting web.config and renaming should only happen if code in destination is new b) Robocopy should not override files if they are the same I think there is /Xo option to do that any idea how to achieve that? :)

    Read the article

  • Program for Synchronizing folders across multiple computers automatically

    - by Mcad001
    I work in a company of about 20 people, I need to share some files with all of them in a folder(s) (files are constantly changed by me).., so they need to get the latest changed file automatically (pushed to their computer) What's the best program/system for this task? I need to be able to administrate their read/write access to the folder on a user level. Windows Live Mesh seemed to be perfect for me, but unfortunatly there's a limit of only 9 people in that system.

    Read the article

  • how to use new image folder in cakephp

    - by manish
    Hi sir, i am very new in cakephp.i have created a folder in app/webroot/. for image placing. eralier by default img folder cantain image. which i have used some thing like this " image('foldopen.png',array('width'=14,'height'='10','alt'='open'));? " now i have created new image folder insted of img folder. how to use this. please help me .its very urgent. Thanks Manish [email protected]

    Read the article

  • Git ignore deleted files

    - by Petah
    Ok heres my situation. I have a website project that has more than 50,000 unimportant files (to development) in some directories. /website.com/files/1.txt /website.com/files/2.txt /website.com/files/3.txt /website.com/files/etc.txt The stuff in /files is already in the repo. I want to delete all the files in /files on my local copy but I want git to ignore it so it doesn't delete them when I do a pull on the web server. Any ideas?

    Read the article

  • upload tmp folder

    - by ntan
    Hi, when upload an image is stored in tmp folder, but because i am in shared hosting i can not change the upload_dir in php.ini. Is it possible after image store in common tmp folder show it to user <img src="path to tmp folder" /> (Which is the path to tmp folder) Thanks

    Read the article

  • Calculate the size of a folder...

    - by iphone_developer
    Just a quick one... I'm creating a folder to cache images inside Documents with my iPhone App. I want to be able to keep the size of this folder down to 1MB, so I need to to check the size in bytes of my folder. I have code to calculate the size of file, but I need the size of the folder. What would be the best way to do this? Will I need to loop through each file? Cheers

    Read the article

  • Folder not created by app in android

    - by Ankuj
    I am creating a folder through my app File direct_playlist = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + PLAYLIST_PATH); if(!direct_playlist.exists()) { if(direct_playlist.mkdir()); //directory is created; } Even though the command executes perfectly I can not see the folder in Explorer. I have also given permission to my app in the manifest.xml <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> When I try to access this folder my app crashes as the folder is not present.

    Read the article

  • Multiple email accounts in a single personal folder in Outlook 2007

    - by Neoclearyst
    I have an account with on Yahoo! Mail, another on Gmail. In Outlook 2007, I've set them up so that I can access them without having to go to their websites. I've password protected my personal folder, but can't find a way to merge my accounts into one personal folder. When I want to switch between my accounts, I must type my password again. Besides that, I can't check for new mail messages in both accounts at the same time. How do I merge multiple email accounts into one single personal folder on Outlook 2007?

    Read the article

  • How to change local user home folder on Windows 2000 and above

    - by Adi Roiban
    I was using a local account on a Windows 7 desktop that is not connected to any Active Directory. After a while it was required to rename the local account. Renaming the account was simple using Local users and groups management tool. After renaming the user, the user home folder was not renamed and I could not find any information about how to change user home folder. I found the ProfileList registry folder but maybe there is a command line for doing such changes. HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList Any help is much appreciated. Thanks!

    Read the article

  • How to change local user home folder on Windows 2000 and above

    - by Adi Roiban
    I was using a local account on a Windows 7 desktop that is not connected to any Active Directory. After a while it was required to rename the local account. Renaming the account was simple using Local users and groups management tool. After renaming the user, the user home folder was not renamed and I could not find any information about how to change user home folder. I found the ProfileList registry folder but maybe there is a command line for doing such changes. HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList Any help is much appreciated. Thanks!

    Read the article

  • Extract reply to addresses from all emails in an outlook folder

    - by RodH257
    I've got to send a bulk email out to a bunch of people in reply to emails they sent me. I've got all the original emails stored in a single outlook folder. I want to extract all of the reply-to addresses from the emails in that folder so I can send an email to all of them. http://thetechieguy.wordpress.com/2008/04/22/extracting-email-address-from-outlook-2007-folder/ shows you how to export the FROM address of these emails, however a large amount of them came from a web service that sends emails 'on behalf of' the person I'm trying to mail to. So I need the reply-to address, and the export wizard doesn't do that. Does anyone have a tip on how to do this? This is Outlook 2007 on Exchange 2010.

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >