w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to change the current working directory to a specific directory and execute a program under the specific directory?
One of your principal problems is that you don't capture the return value (output) of the command in backticks. You are merely throwing away the output you want. Do something like: my $output = `perl ./script.pl` system("perl ./script.pl")

Categories : Perl

Missing photos when retrieving Users tagged photos facebook-graph API
The only thing that comes to mind is the settings of each user since according to the answer posted here - facebook graph api - missing fields, API access to these things can be turned off at the user's discretion.

Categories : Facebook

getting the full filenames from all top directory files in a specific directory and suppressing the occuring error
Did I understand correctly that you only need the File-names with directory-names. This code works for me, no elevations needed. private void button1_Click(object sender, EventArgs e) { string folder = @"C:windowsprefetch"; string filemask = @"*.pf"; string[] filelist = Directory.GetFiles(folder, (filemask)); //now use filelist[i] for any operations. }

Categories : C#

How can I show last saved photo in Photos app iOS via "photos-redirect:" URL scheme?
photos-redirect:// is the URL Scheme for Photo App. However, it is undocumented, thus you shouldn't use it. To view / select a photo, use UIImagePickerController .

Categories : IOS

How can i get a list of files(only sound related .flac, .m4b, .mp3) and folders with them from a directory on the sd card?
static Uri[] mUris; static String[] mFiles = null; public static String[] getMusic(){ File music = Environment.getExternalStorageDirectory(); // File asd = Environment. // String[] savedFiles = getApplicationContext().fileList(); File[] musicList = music.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { // TODO Auto-generated method stub return ((name.endsWith(".mp3")||(name.endsWith(".m4b")||(name.endsWith(".flac")))); } }); mFiles = new String[musicList.length]; for(int i=0; i<musicList.length;i++) { mFiles[i]=musicList[i].getAbsolutePath(); } return mFiles;

Categories : Android

Copy files from source directory to target directory and exclude specific file types from specified directories
This is one way to do it $SourceDirectory = 'C:Source' $DestinationDirectory = 'C:Destination' $ExcludeExtentions = '*.txt*', '*.xml*' $ExcludeSubDirectory = 'C:Sourcead_directory1', 'C:Sourcead_directory2' Get-ChildItem $SourceDirectory -Recurse -Exclude $ExcludeExtentions | Where-Object { $ExcludeSubDirectory -notcontains $_.DirectoryName } | Copy-Item -Destination $DestinationDirectory Your best friend here is Where-Object, or where. It takes a scriptblock as parameter and uses that scriptblock to validate each object that goes through pipeline. Only objects that make script return $true are passed through Where-Object. Also, take a look at the object that represents a file you get from Get-ChildItem. It has Name, Directory and DirectoryName containing pieces of file's FullNam

Categories : File

rsync recursively and exclude content of specific directory, not the directory
In recent versions of rsync, you can use the -F option and put a file ".rsync-filter" in the directory src, containing: - dir1/*** That seemed to work for me. I'm assuming that your hierarchy above is all under "src/".

Categories : Linux

How to access specific raw data on SD card?
You want to read data from sd card.So do something like this.. File dir = Environment.getExternalStorageDirectory(); File yourFile = new File(dir, "path_of_your_file"); And then you can read the file like.. fileInputStream = new FileInputStream(yourFile); BufferedReader br = new BufferedReader(new InputStreamReader(fileInputStream)); String readString = new String(); while((readString = br.readLine())!= null){ //readString has your data }

Categories : Java

Get path of Specific file from SD Card
EDIT again ^-^: I think i finally understood what you want to do: having only a filename as the input, you want to search the whole sd card for it, and if it is present, you want to obtain the path of the directory in which it is in. Bear in mind that a full search for a file might be slow if user's SD-card contains a lot of folders and files. Here is a simple function to search for a file: public static void findFilePath(File dir, String filename, List<String> result) { // get all files in dir File[] files = dir.listFiles(); for( File f : files ){ if( f.isDirectory() ){ // Recurse findFilePath(dir, filename, result); } else{ if( f.getName().equals("filename") ){ String absPath = f.getAbsol

Categories : Misc

getting the number of records having a specific condition and the the other that don't for the same card in the same query
SELECT O.ID AS OBJECT_ID ,SUM(CASE WHEN E.STATUS = 1 THEN 1 ELSE 0 END) AS PENDING_EVENTS ,SUM(CASE WHEN E.STATUS = 0 THEN 1 ELSE 0 END) AS COMPLETED_EVENTS FROM OBJECT O LEFT OUTER JOIN EVENT E ON O.UD = E.OBJECT_ID GROUP BY O.ID

Categories : SQL

Specific locations and menu items for each bundled card
You can't do this with a "HTML Bundle". You would have to create several timeline items with a common bundleId. Then you have full control over the contents and options of each separate card.

Categories : Java

How to create a file of specific size on sd card programatically
First you obtain prermission for External storage. Edit the AndroidManifest.xml with the following line of code. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> After that in java file write the following code. File fileName = new File(Environment.getExternalStorageDirectory(), "output.dat"); FileOutputStream fos = new FileOutputStream(fileName ) fos.write(bytes);

Categories : Android

Display all the video from a specific folder in SD card in android
Use this File Browser library to browse through files and put the filter of video type in the following code Intent intent = new Intent(getBaseContext(), FileDialog.class); intent.putExtra(FileDialog.START_PATH, "/sdcard"); //can user select directories or not intent.putExtra(FileDialog.CAN_SELECT_DIR, true); //alternatively you can set file filter intent.putExtra(FileDialog.FORMAT_FILTER, new String[] { "avi" }); startActivityForResult(intent, REQUEST_SAVE);

Categories : Android

Card.io usage in android. Displaying Credit card number and Expiry date
Maybe I missed it but I dont see anything wrong with the code. The problem may be in your XML so I thought I would make it easy for you. Send the user to another activity when the scan is completed. Copy this in the appropriate place. Create a new xml.file and see if this works. If you have any problems tell me. This is working fine for me. private Button scanButton; } @Override protected void onResume() { super.onResume(); if (CardIOActivity.canReadCardWithCamera(this)) { scanButton.setText("Charge"); } else { scanButton.setText("Charge"); } } final String TAG = getClass().getName(); private int MY_SCAN_REQUEST_CODE = 100; // arbitrary int public void onScanPress(View v) { // This method is set up as an onClick handler in the layout xml // e.g. and

Categories : Android

What is the difference between twitter photo card and summary with large image card?
The difference between a summary_large_image card and a photo card is what occurs when the user clicks on the image in the card: In the case of a summary_large_image card, a click on the image opens the link in a new tab (or in a browser on smartphones). In the case of a photo card, a click on the image opens a bigger version of the image in the same browser window (or displays the image full-screen on smartphones).

Categories : Twitter

Im trying to figure out how to deal a card from the deck in my card game class
yeah, now that i've thinked about, "hand" was empty because you fill it from "deck" that is in turn empty. Maybe you can define a method "initDeck" in deck class that fills the deck with random cards, and call it from game constructor. or maybe you already do this out of the game class, but in that case you should pass the deck to game!

Categories : Java

How to implemet creadit card and debit card payment in salesforce
If you are not experienced with API development, paypal API details are here: https://developer.paypal.com/docs/api/ Then the best other option is an App. I have used the connected Epos solution, which is great for taking payments from credit cards, either with the customer present (chip n pin) or by keying in the card numbers. You need to get the PayPalHere card terminal which is about $50, but it is a great all round solution. https://appexchange.salesforce.com/listingDetail?listingId=a0N30000000qD0GEAU

Categories : Paypal

Java Card: How to load SIM applet to real smart card?
It might not work because the SIM application might have dependencies to APIs that are not present in the JCOP cards (for instance ETSI 102 705). But then it is worth trying. Make sure that the file format is compatible between the tools (a cap file is not always a cap file by the way; a real cap file is a zip, some tools prefer IJC files). Try using the cap file from the Gemalto tool in the jcManager. If it does not work you can try GPShell. The main challenge is to have the keys to your target, and then the right tool.

Categories : Java

iOS Phonegap app crashes after Card.io scans credit card
@Paul if you using latest card.io SDK just modify the CardIOPGPlugin.m file on line 101 from [CardIOCreditCardInfo displayStringForCardType:info.cardType] to [CardIOCreditCardInfo displayStringForCardType:info.cardType usingLanguageOrLocale:[[NSLocale currentLocale] localeIdentifier]] Hope it helps.

Categories : IOS

Reset Smart Card pin having Muscle card applet
MSCUnblockPIN is the function to use, but you have to know the unblock value of course. The corresponding ISO command Reset Retry Counter allows variants without unblock value, but these need another kind of protection to avoid arbitrary many retries.

Categories : Security

Coordinate Id of same card that is read by two different card readers
Its rather hard to understand just exactly what your wanting, but in the bottom you state: 'in other words, i want to convert this array of bytes to corresponding hex code'. You can perform that operation like so: public static string ByteArrayToString(byte[] ba) { StringBuilder sb = new StringBuilder(ba.Length * 2); foreach (byte b in ba) { sb.AppendFormat("{0:x2}", b); } return sb.ToString(); } Just pass in your Byte array and the result will be your hex conversion in string format. Edit: This will probably yield the same results, but try this: byte[ ] bytes = {0, 1, 2, 4, 8, 16, 32, 64, 128, 255 } Console.WriteLine( BitConverter.ToString( bytes ) );

Categories : C#

Card holder's name in APDU commands (ICC Card)
Reading the card holders name and other info on a chip & pin card is not as simple as you might think. It's not as simple as just one straight forward APDU , there are several more steps you have to go through first. First you need to perform an application selection. How you do this, depends on your card and your terminal. There are 2 standard ways. 1) Application file selection 2) AID Scanning For type 1, you typically call a known file name using the select file apdu (NOTE: I'm not going to implement full apdu sentences in what I type here as there is just too much data to try and represent, if there is enough attention to this post then I might do a blog entry) The file name to select for most EMV standard cards is '1PAY.SYS.DDF01' or '2PAY.SYS.DDF01' for contactless ca

Categories : Misc

Card.io SDK gives partial credit card number
Josh from card.io here. The sample code you're probably looking at reads: - (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)info inPaymentViewController:(CardIOPaymentViewController *)scanViewController { // The full card number is available as info.cardNumber, but don't log that! NSLog(@"Received card info. Number: %@, expiry: %02i/%i, cvv: %@.", info.redactedCardNumber, info.expiryMonth, info.expiryYear, info.cvv); // Use the card info... [scanViewController dismissModalViewControllerAnimated:YES]; } Note the comment above the NSLog call. What is being logged is info.redactedCardNumber. You want info.cardNumber instead. See the header files, which are pretty well documented, for more details. The older version of the SDK is has been publicly deprecated for nearly a

Categories : Iphone

Git checkout from a specific directory
You can try cloning your repository using the --depth option, to see if it fits your need. --depth option won't clone the full repository history, and thus, will be faster. > git clone http://myrepo.git --depth 1 You can further restrict the checkout by specifying a branch name : > git clone http://myrepo.git -b master --depth 1 If you want to checkout only a subdirectory of a git repository, AFAIK, it is not currently possible.

Categories : GIT

Is it possible to get credit card type using card.io?
I have no experience of using card.io. But your question got me all curious about this API. In github, I found it and in there, there is a file: CardIOCreditCardInfo.h // Derived from cardNumber. // When provided by card.io, cardType will not be CardIOCreditCardTypeUnrecognized or CardIOCreditCardTypeAmbiguous. @property(nonatomic, assign, readonly) CardIOCreditCardType cardType; Hope this helps. I am trying to learn this, if it doesnot help you please tell me.

Categories : Iphone

Running Cronjob from a specific directory
I don't know if there's a better solution, but I would suggest to write a bash script that changes to the correct directory before executing the PHP file, and use cron to execute this script. E.g: #!/bin/bash cd /Library/WebServer/Documents/clientname/siteroot/rss/ php dorss.php Or even just: #!/bin/bash php /Library/WebServer/Documents/clientname/siteroot/rss/dorss.php Save it somewhere and use cron to run that.

Categories : PHP

PHP Search Sub-Directory for a specific file
Give this a try: <?php //--- get all the directories $dirname = ''; $findme = "*.php"; $dirs = glob($dirname.'*', GLOB_ONLYDIR); $files = array(); //--- search through each folder for the file //--- append results to $files foreach( $dirs as $d ) { $f = glob( $d .'/'. $findme ); if( count( $f ) ) { $files = array_merge( $files, $f ); } } if( count($files) ) { foreach( $files as $f ) { echo "<a href='{$dirname}/{$f}'>{$f}</a><br>"; } } else { echo "Nothing was found.";//Tell the user nothing was found. echo '<img src="yourimagehere.jpg"/>';//Display an image, when nothing was found. } ?>

Categories : PHP

Get log with SVNKit from specific directory from repo
Ok, so solution looks like this (for next generation of searchers :P): for (Iterator entries = logEntries.iterator(); entries.hasNext();) { SVNLogEntry logEntry = (SVNLogEntry) entries.next(); if (logEntry.getChangedPaths().size() > 0) { Set<String> changedPathsSet = logEntry.getChangedPaths().keySet(); for (Iterator<String> changedPaths = changedPathsSet.iterator(); changedPaths .hasNext();) { SVNLogEntryPath entryPath = (SVNLogEntryPath) logEntry .getChangedPaths().get(changedPaths.next()); String path = entryPath.getPath(); if (!path.startsWith(updatePath)) {

Categories : Java

copy all the files that end with specific name to another directory
Use rename('images/06/*abc.jpg', 'images/07/*abc.jpg'); and if you want just the Thumbnails: rename('images/06/*_abc.jpg', 'images/07/*_abc.jpg'); btw if you want all files that begin with abc use abc*.jpg

Categories : PHP

Saving Photo to a Specific Directory
Automatically saving is just saving without explicitly asking the user if you should. The process of saving the image is identical: Get your instance of UIImage Convert to data (using UIImageJpegRepresentation or UIImagePngRepresentation) Save the data (using writeToFile:atomically:) Something like: folderPath = [documentsDirectory stringByAppendingPathComponent:directoryNames[0]]; or folderPath = [documentsDirectory stringByAppendingPathComponent:@"hats"];

Categories : IOS

How to use php keep only specific file and remove others in directory?
http://php.net/manual/en/function.scandir.php This will get all files in a directory into an array, then you can run a foreach() on the array and look for patterns / matches on each file. unlink() can be used to delete the file. $dir = "/pathto/files/" $exclude[] = "2.jpeg"; foreach(scandir($dir) as $file) { if (!in_array($file, $exclude)) { unlink("$dir/$file"); } } Simple and to the point. You can add multiple files to the $exclude array.

Categories : PHP

show specific file from the directory in php
If you know the name of the file, you could use $result = mysql_query("SELECT * FROM photos WHERE caption LIKE '".$name."'"); If you know the id of the file it would be better to use that as selecting using an integer is generally faster than selecting on a string. Note that mysql_query is depreceated in PHP now, and you really should be using mysqli_query. Take a look: http://php.net/manual/en/function.mysql-query.php

Categories : PHP

directory or site specific php.ini directives with php and iis 6+
Similar functionality actually does exist - if you're using php 5.3+. You can easily edit your php.ini and add entries similar to the following per each site you want to modify at the end of your existing php.ini file: [PATH=C:/code/website1.com/] upload_max_filesize = 2M [PATH=C:/code/website2.com/] upload_max_filesize = 12M

Categories : PHP

Zipping to a specific directory in python
You should be able to just set zip = zipfile.ZipFile('/home/zipfiles/whatever.zip', 'w') What you have now will create the file in whatever directory you're running the script from. Note: It'd probably be a good idea to pick a name that isn't zip. zip is a builtin, and it's always annoying to find that you're getting weird TypeErrors because you accidentally shadowed a builtin you needed.

Categories : Python

Print on file in a specific directory c#
By setting the file name. You're setting one here: printDocumentSempre.PrinterSettings.PrintFileName = DateTime.Now.Ticks.ToString() + ".xps"; It sounds like you also want to specify the full directory path in that file name. The most immediate approach would be something like this: printDocumentSempre.PrinterSettings.PrintFileName = @"C:path ofile" + DateTime.Now.Ticks.ToString() + ".xps"; This is kind of sloppy, though. Take a look at the Path class for building something a little more robust. Perhaps like this: printDocumentSempre.PrinterSettings.PrintFileName = Path.Combine({@"C:path", "to", "file", DateTime.Now.Ticks.ToString() + ".xps"}).GetFullPath(); There's probably an even cleaner way that escapes me at the moment. You'll find lots of functionality for interfacing w

Categories : File

Getting name(s) of FOLDER containing a specific SUBSTRING from the C:Temp directory in C#
You don't want to have the message box inside the loop. string name = txtNameSubstring.Text; string[] allFiles = System.IO.Directory.GetFiles("C:\Temp");//Change path to yours foreach (string file in allFiles) { if (file.Contains(name)) { cblFolderSelect.Items.Add(file); // MessageBox.Show("Match Found : " + file); } } if(cblFolderSelect.Items.Count==0) { MessageBox.Show("No files found"); } (Assuming cblFolderSelect was empty before this code runs) As you currently have it, you're deciding whether to show the message box for each file that you examine. So if the first file doesn't match, you'll be told "No files found" even though the next file might match. (I've also changed the Add to add the individual file that matches, not all of the files (for which one

Categories : C#

How to install python package in a specific directory
Use virtual environment and virtual environment wrapper , you dont have to use the wrapper but use it for simplicity.. https://pypi.python.org/pypi/virtualenv

Categories : Python

Ignore a directory except specific files in a subdirectory in Git
Allowing everything under install after ignoring everything else (*) has the form * !/dev !/dev/host !/dev/host/mail !/dev/host/mail/htdocs !/dev/host/mail/htdocs/install !/dev/host/mail/htdocs/install/* But this also allows stray files at higher levels of the tree. That means adding the additional ignore rules from your question. The short answer is what you have is necessary. It is an odd repository structure, so git does not optimize for it.

Categories : GIT

Having difficulty installing R package in specific directory
If you are sure you can create that directory AND that you can see it on .libPaths() ... Then you also need to make sure that your system is configured to meet this requirement in the DESCRIPTION file: SystemRequirements: libcurl (version 7.14.0 or higher) http://curl.haxx.se. On Linux systems, you will often have to explicitly install libcurl-devel to have the header files and the libcurl library. First version erroneously left off the "." from .libPaths()

Categories : R

Retrieve by specific file name from document directory in iOS
The method is contentsOfDirectoryAtPath:. Read the name of the method. Read the description in the docs. The path you pass must reference a directory, not a file. What you are trying to do doesn't make sense logically. If you know a specific file, then why search for it? Why create an array? If you want to see if the file exists, use the fileExistsAtPath: method of NSFileManager. If you just want the filename in the array then do: NSString *filename = [documentsDirectory stringByAppendingPathComponent:@"Manual.txt"]; [arrayToSearch addObject:filename]; // since the array was pre-allocated Please don't use stringWithFormat to create the filename. Use the proper NSString path methods like I did above.

Categories : IOS



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