w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Access the 'Application Data' folder when using Folder Redirection
You could use the environment variable Set objShell = CreateObject( "WScript.Shell" ) appDataLocation=objShell.ExpandEnvironmentStrings("%APPDATA%") quick_launch_location = appDataLocation & "MicrosoftInternet ExplorerQuick Launch"

Categories : Vbscript

Rails server command generates another folder in project's folder with default folders and files
This is because you are using rails 2 gem version, you can check by rails -v. As well you can see, there is no app/assets folder. there are only public/javascripts etc rails2 style directories Try to install rails 3 by gem install rails --version '>3.0.0'

Categories : Ruby On Rails

VB.net Change Variable To another locations but keep folder path
Why not just do a string.replace, then? Something looking like: File.Copy(SelectedFilePath, SelectedFilePath.Replace(ConvertDir,SaveDir)) Also, just look at the example provided here for some ideas about how to do this as a whole. Hope this helps...

Categories : Vb.Net

Copy folders and exclude folder
I'd suggest splitting the problem into 4 subs. Firstly two subs to allow users to select a folder they desire for source and destination. The a button click event that starts the copying and finally a sub that actually handles the copying. Try this on for size: Dim CopyFromPath As String Dim CopyToPath As String Private Sub TextBox1_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.MouseClick Dim fldbroser1 As New FolderBrowserDialog fldbroser1.RootFolder = Environment.SpecialFolder.MyMusic fldbroser1.ShowDialog() CopyFromPath = fldbroser1.SelectedPath End Sub Private Sub TextBox2_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.MouseClick Dim fldbroser1 As New FolderBrowserDialog f

Categories : Vb.Net

Items_ItemAdd listener for folder and it's sub folders in Outlook
You need to install the event sink on each folder's Items collection. To make sure all Items objects are alive while your app runs, store Items in a list (e.g. List<Outlook.Items>)

Categories : C#

delete all the folders inside a parent folder
Try this : function del($dir) { foreach(glob($dir . '/*') as $file) { if(is_dir($file)) del($file); } rmdir($dir); } It will also delete nested folders

Categories : PHP

How can I split a folder with thousands of images into multiple sub-folders?
awk one-liner can do that. Consider this awk command: find . -name "*.JPG" | awk '!(++cnt%100) {"mkdir sub_" ++d|getline}' Run it inside the folder with 5000 images. This will create 50 folders with the names sub_1, sub_2...sub_50. Also to move files into these newly created directories: find . -type f | awk '{ a[++cnt] = $0 } cnt==100 { subd = "sub_" ++d; system("mkdir " subd); for (f in a) system("mv " a[f] " " subd); cnt=0 }'

Categories : Osx

XCOPY files in batch to another folder but with structure of folders
Ah, finally found it. Putting an asterisk * behind the filename will do the trick. So, for any of you with the same problem: XCOPY "abcdef01.jpg" "D: ewphotosabcdef01.jpg*" This does the trick.

Categories : Misc

How to recursively retrieve files from folders returning file name and its Folder name
You may want to use folderFullPath.lastIndexOf(File.separator) in order to find the index of the character before the folder name and then use substring to extract the folder name from the full-path.

Categories : Java

Randomly select 20 folders out of 50 in php, and then enumerate (thumbs) folder in each for thumbnails
First, save all galleries in an array. $storage = glob($galdir . '*', GLOB_ONLYDIR); Now, shuffle the array. shuffle($storage); You now have an array with all your galleries randomly sorted. Loop through them again. for($i = 0; $i < 20; $i++) { //Only 20 echo $storage[$i]; //Directory name. Add your HTML stuff here }

Categories : PHP

Batch Renaming Folders in AppleScript, Will Only Change Names of Every Other Folder
Jart, the main issue was with the second loop, you need to be looping through every folder of the x folder variable instead. It appears that looping through the folder worked, but when you renamed them it caused an index issue resulting in only reading every 2nd folder. Here is a little reworking. renamed your variables from y and x to be less cryptic. changed the length test to support names > 9. i was unsure about the item at the end of the new name, and if it should be an incremented number instead. (you can easily revert) left in some log calls for your reference, these can help debug stuff tell application "Finder" -- Defining Pro Folders set pro_folder to folder POSIX file "/Users/Jart/Desktop/test" set all_pro_folders to every folder of pro_folder -- Iter

Categories : Osx

Create the same multiple folder in all sub directory folders from excel list using VBA
Use an array for the subfolders and loop through that for each of your 1st level folders. Change this line vSubfolders = Array("A", "B", "C") to add/remove your second level folders Sub MakeFolders() Dim xdir As String Dim fso As Object Dim lstrow As Long Dim i As Long Dim vSubfolders Dim vSubFolder vSubfolders = Array("A", "B", "C") Set fso = CreateObject("Scripting.FileSystemObject") lstrow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row Application.ScreenUpdating = False For i = 1 To lstrow xdir = "C:UsersNikkiSharedVIC" & Range("A" & i).Value If Not fso.FolderExists(xdir) Then fso.CreateFolder (xdir) End If For Each vSubFolder In vSubfolders If Not fso.FolderExists(xdir & "" & vSubFolder) Then fso.CreateFolder (xdir & "" & vSubFolder) End If Ne

Categories : Excel

Rename files within folders to folder names while retaining extensions
Here's something simple: find * -type f -maxdepth 1 | while read file do dirname="$(dirname "$file")" new_name="${dirname##*/}" file_ext=${file##*.} if [ -n "$file_ext" -a -n "$dirname" -a -n "$new_name" ] then echo "mv '$file' '$dirname/$new_name.$file_ext'" fi done The find * says to run find on all items in the current directory. The -type f says you only are interested in files, and -maxdepth 1 limits the depth of the search to the immediate directory. The ${file##*.} is using a pattern match. The ## says the largest left hand match to *. which is basically pulling everything off to the file extension. The file_dir="$(dirname "$file")" gets the directory name. Note quotes everywhere! You have to be careful about white spaces. By the way, I echo i

Categories : Bash

Return 3 closest locations to a users location (geolocation) and list those locations for them
You can use Google Places API. Docs: https://developers.google.com/places/documentation/search Supported location types: https://developers.google.com/places/documentation/supported_types After you have recieved the users location, make a request like that with your location and relevant types: https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AddYourOwnKeyHere Here is a fiddle based on yours, without using fusion tables: http://jsfiddle.net/iambnz/M9KrK/ Add this to your libary call: &libraries=places Add this to your code: Global var: var service; If statement when you found the users location: var request = { location: pos, radius: '500', types: ['sto

Categories : Javascript

Run a batch file that would delete files in a folder (and its sub folders) that are older then 30 days
I did some copy and paste for you from here: forfiles -p "C:whatever" -s -m *.* /D -30 /C "cmd /c del @path" See forfile documentation for more details.

Categories : Windows

Hadoop HDFS Copy Files from multiple folders to one destination folder
There is DistCp which is an map-reduce job which copies files from one or multiple source folders to one target folder in an parallel manner. However, its not merging files. But maybe you could use filecrush to do that! (let me know how this goes!)

Categories : Hadoop

Compare Facebook check-in locations with locations saved in db
So this is what i`ve come up with. Hope it helps out someone. First I selected some destinations where the difference between coordinates is smaller than 0.25. You can adjust this value as needed. My cypher query looks like this: START n = node:Destination('*:*') WHERE has( n.lat ) AND has( n.long ) AND ABS(n.lat - ".$value['place']['location']['latitude'].") < 0.25 AND ABS(n.long - ".$value['place']['location']['longitude'].") < 0.25 RETURN n, ABS(n.lat - ".$value['place']['location']['latitude']."), ABS(n.long - ".$value['place']['location']['longitude'].") Then i caclulate "Levenshtein distance" (the minimal number of characters you have to replace, insert or delete to transform str1 into str2.) with levenshtein() function and select only those those that have this value small

Categories : PHP

Google Drive - Change owner on folder, sub-folders and content, while saving tree structure
Sorry this answer is late but I figure the answer would be helpful either way. 1) Apps Script doesn't have the ability to suppress the notification email but Google's most recent version of the Drive SDK does allow for this. You just need to append "?sendNotificationEmails=false" to the url that you're sending your request to. You can run a test on the linked page to see exactly what the query string looks like. 2) The folders actually do maintain their structure. There is just the consequence of a user getting ownership of each of those folders explicitly. Since the rights are given one folder at a time, the user gets access one folder at a time so they show up individually in the user's Drive documents. Still, a Drive file/folder's sharing is stored separately from its parent folder me

Categories : Google Apps Script

Batch Script to find Folder Length of 2 alpha-numerics only and delete thos folders
this will delete all empty folders with two characters or less: for /f %%i in ('dir /b /ad ??') do rd %%i If you want also not-empty folders to be deleted: for /f %%i in ('dir /b /ad ??') do rd %%i /s /q If you use it not within a batchfile but as a single command, replace every %%i with %i EDIT (exclude a folder): for /f %%i in ('dir /b /ad ??') do ( if "%%i" neq "FP" rd %%i /s /q )

Categories : Regex

Using same drawable image in two different folder to support all tablets.(same image (no change)in two folders)
If you want to keep exactly the same image in drawable-large-xhdpi and drawable-xlarge-hdpi then you apparently do not really understand what these xhdpi and hdpi selectors stands for, as image cannot be hdpi and xhdpi at the same time, so your approach is basically wrong. Please read this article to get the picture of how Android manages assets: http://developer.android.com/guide/practices/screens_support.html EDIT Here another article that you need to read to understand how Android picks assets and how it falls back in case of lack of such: http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch that will help you organize your assets correctly

Categories : Android

Computing folder size: Empty folders have a default size?
Explorer shows both "Size" and "Size on disk". Since multiple files cannot share disk clusters, the minimum size a file will occupy on disk is one cluster (4096 bytes on your machine). Look at "Size" in Explorer.

Categories : Python

Move multiple files from multiple folders to one folder
How far have to got with this ? Have you managed to get them moving from one folder to another yet ? Is it an issue with the sub-folders ? I had a similar issue before and i found this answer really helped me : move files between folders

Categories : Windows

Batch: Create a list of folders and then copy multiple files/folders into all of them
Try this: @echo off &setlocal cd /d "RootFolder=X:folder omy data" for /d %%a in (*) do xcopy "_TEMPLATE" "%%~fa" /sihrky For xcopy options see xcopy /?, to test the command without writing add option /l.

Categories : List

How to stop threads of following type in Java used for watching folders for files using WatchService for folders by using jToggleButton
There is a Thread.stop() method, but is has been deprecated, because it's unsafe. Instead of using the deprecated method(s), you can modify some variable to indicate that the target thread should stop running.

Categories : Java

Batch file creating folders in all folders of current directory
Total rewrite of answer. This will make a "Outlook Archive" folder in only the DataMy Documents subfolders of wherever the batch file resides. for /f "delims=" %%i in ('dir /ad/s/b') do if EXIST "%%iDataMy Documents" MKDIR "%%iDataMy DocumentsOutlook Archive" pause Credit to here

Categories : Windows

MATLAB: Opening and Editing Files nested in folders in folders
Check out subdir! On the file exchange, its an awesome function that can return all folders and all files in expansive subfolders, and you can filter file names by extension and whatnot. http://www.mathworks.com/matlabcentral/fileexchange/15859-subdir-a-recursive-file-search

Categories : Matlab

JQuery File Upload and Carrierwave to Detect Folders and Sub Folders
I don't think this is possible. See here: http://www.codeproject.com/Questions/573788/HoeplustoplusGetplustheplusOriginalplusfilepluspat It appears that you can't know the context of the uploaded file on the source operating system. Therefore you can't create it's original parent folder structure on your system.

Categories : Jquery

Delete all folders except 2 lastest folders in Windows
for /f "skip=2 delims=" %G in ('dir /B /ad-h /o-d') DO echo going to delete %G For /f to process lines of "output" from single-quoted DIR... Delims= is better. tokens=* will work here, but suppresses leading spaces. /b to suppress header output from dir /o-d for REVERSE-date order. You want to KEEP the two skipped dirs, which occur FIRS in a reverse-date sort. ...good echo safety measure.

Categories : Windows

Personal SSE library
It would seem to me that the amount of overhead that you are introducing could easily overwhelm any speed you gain through the use of SSE operations. Without looking at the assembly produced I can't definitely say what is happening, but here are two possible forms of overhead. Calling a function (unless it is inlined) involves a call and a ret, and most likely a push and a pop etc.. to create a stack frame. You're calling _mm_store_ps for each operation, if you chain together a more than one operation you're paying the cost of this more times than necessary. Also, it isn't clear from your code if this is a problem, but make sure that temp is a valid pointer. Hope that helps somewhat. Good luck. Follow up for comment. Not sure if this is good C++ or not, please educate me if it is

Categories : C++

With what key should personal information be encypted?
No, that is not safe. All of those values are in the database. As a result, anyone who accesses the database can derive the key, decrypt the values, and read the data. Your original idea is better: use the output of a key derivation algorithm such as SCRYPT(don't just hash the password, its too weak) on the user's password as your encryption key. Then store a version of that in the user's session. Of course, you need to make sure session data is stored securely and deleted completely after user logout/idle. One fail safe way to do this is write the data to a file yourself, store the file name in the session, and then securely delete the file (e.g. via the shred command or overwriting with random data).

Categories : Security

Get only personal record of the DB and not all of the records
All you are missing is a WHERE statement in your model. As an argument for the WHERE statement you can use your session variable containing your email address(assuming your database table stores emails in a field called 'username': class Profile_model extends CI_Model{ function userInfo(){ $this->db->where('username', $this->session->userdata('username')); $query = $this->db->get('tbl_users'); return $query->result(); } } Or you can pass the email/username to the model from the controller: if($logged_in){ //if the user is logged in $this->load->model('profile_model'); $username = $this->session->userdata('username'); if($query = $this->profile_model->userInfo($username)){ $data['records']

Categories : Mysql

Continuous Integration for personal use
Automated build system (Maven, Ant, Gradle etc) can work as a CI. You can run it from command line or periodically from cron / task scheduler. Maven can generate a full HTML report with its "site" command. mvn site Or if you prefer a GUI, then use Jenkins. You can fire it up from the command line with a simple java -jar jenkins.war There is no need to install anything

Categories : Java

separating Model folder, view folder and controller folder in codeigniter
I am not sure that you can move views and models to different locations but you can change the location of application folder to the location of your choice. You can move your application directory to different location and then open your index.php file and set the $system_folder and $application_folder variables with the new path values, preferably with a full path, e.g. '/www/MyUser/system'. Reference: http://ellislab.com/codeigniter/user-guide/installation/index.html Hope this is helpful.

Categories : Codeigniter

Moving files from one folder to a hot folder BUT only move one at a time when the hot folder is empty
Pretty sure this should do what you want in vbscript: Set objFS = CreateObject("Scripting.FileSystemObject") set objFolderA = objFS.GetFolder("c:Folder A") set objFolderB = objFS.GetFolder("c:Folder B") For each objFile in objFolderA.Files Do While True If objFolderB.Files.Count = 0 Then objFS.MoveFile objFile.Path, ojbFolderB.Path & "" Exit Do End If Loop Next

Categories : Batch File

Rails personal class Each routine
If you added a each method to your ExcelRead class, and you create an instance of this class called xls, then you have to access it using xls.each, not xls.book_rows.each. Using the former, you are calling the each method from the Enumerator, as book_rows is a collection. I can only guess that you want a custom way to iterate your book_row, so i think something like this should be what you are trying to achieve: def iterate self.book_rows.each do |br| # do stuff end end And you call it like: xls.iterate But this is only a wild guess.

Categories : Ruby On Rails

Personal Intranet Setup - how to disable it - after having enabled it
Well, after a few days waiting for a reply from somebody here, I tried to see if there was anything else that I could do on my own. I was going to go back online hoping to find some other advice elsewhere, but then something came in my mind - maybe the fix for this problem is so simple it was under my nose all along - maybe if I simply uninstalled IIS it'd reset the installation. So, I did just that, uninstalled IIS and then reinstalled it. It did reset it, and it works just fine on my computer, and not on any other computers - just as I wanted. I should've tried this all along! So, if anyone else stumbles on this page, and has enabled an insecure intranet and couldn't figure out how to disable it (like I was in the predicament of), if you haven't tried uninstalling and reinstalling IIS -

Categories : Windows

Database options for personal code project
There Three options a. Windows azure b. Amazon Simple DB http://aws.amazon.com/simpledb/ c. Zoho Cloud Sql https://cloudsql.wiki.zoho.com/

Categories : Android

unable to cast to personal whitelisted receiver app
Try checking the box that says "Send this Chromecast's serial number when checking for updates". Mine didn't work at first, after doing this and restarting mine seemed to pick up the whitelisted appID. As mentioned by the author of question: Make sure to do from ChromeOS, Windows or Mac OSX client until they fix the issue from Android app. Clients can be downloaded here: https://cast.google.com/chromecast/setup

Categories : Android

jquery datepicker dynamic with personal format
My guess is that you're trying to show a date in another field formatted differently from what you see in your datepicker. Did you try using datepicker's altField and altFormat properties, as described here? You should be able to specify a selector identifying the other fields you want to populate upon datepicker selection and a different format for them.

Categories : Jquery

Submitting paid app to Cydia using personal repo - possible?
The large repositories such as ModMyi and BigBoss work very closely with Saurik to manage paid packages. In order to host paid apps on your own repository, you'll need to get into contact with either him or his assistant, Britta. Honestly, it's not practical to set up your own repository this way. There is really nothing to gain from hosting the paid packages yourself, except for instant updates. Having your package on one of the main repositories will make it much more available, and thus contribute to more sales. You also have the reliability of the main repositories, and won't have to go through the management yourself.

Categories : Iphone

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.