Search Results

Search found 14344 results on 574 pages for 'path'.

Page 141/574 | < Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >

  • git-svn clone checkouts wrong repo?

    - by hyperboreean
    So I am trying to switch to git, by using git-svn. I am having a svn repo called myrepo from which I want to clone just the project called myproject. The thing is that by running the following command: git svn clone path-to-repo/myrepo/myproject --stdlayout --prefix=svn myproject the whole repo myrepo is cloned rather than just myproject. I tried using -T, -t, -b as well to let git know about the layout of the project, but without any success. I always get the following output: Using higher level of URL: path-to-repo/myrepo/myproject => path-to-repo/myrepo and tries to clone that one. Am I doing something wrong? It might be that the svn repo layout could be broken or git incompatible ?

    Read the article

  • What is this Hash-like/Tree-like Construct Called?

    - by viatropos
    I want to create a "Config" class that acts somewhere between a hash and a tree. It's just for storing global values, which can have a context. Here's how I use it: Config.get("root.parent.child_b") #=> "value" Here's what the class might look like: class Construct def get(path) # split path by "." # search tree for nodes end def set(key, value) # split path by "." # create tree node if necessary # set tree value end def tree { :root => { :parent => { :child_a => "value", :child_b => "another value" }, :another_parent => { :something => { :nesting => "goes on and on" } } } } end end Is there a name for this kind of thing, somewhere between Hash and Tree (not a Computer Science major)? Basically a hash-like interface to a tree.

    Read the article

  • How to release audio properly? (AVAudioPlayer)

    - by Aluminum
    Hello everyone! I need help with my iOS application ^^,. I want to know if I'm releasing AVAudioPlayer correctly. MyViewController.h #import <UIKit/UIKit.h> @interface MyViewController : UIViewController { NSString *Path; } - (IBAction)Playsound; @end MyViewController.m #import <AVFoundation/AVAudioPlayer.h> #import "MyViewController.h" @implementation MyViewController AVAudioPlayer *Media; - (IBAction)Playsound { Path = [[NSBundle mainBundle] pathForResource:@"Sound" ofType:@"wav"]; Media = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:Path] error:NULL]; [Media play]; } - (void)dealloc { [Media release]; [super viewDidUnload]; } @end

    Read the article

  • Read Call History from iPhone on iOS 5 and above

    - by Sandeep Dhama
    I am developing an application and need to read the users call history from iPhone.I have go though all the forums and google it and found that we can get the records from teh callHistory sqlite database by "private/var/root/Library/CallHistory/call_history.db". But this path is not working from iOS 5 and above. Seems like apple has changed all their database path and structure so that no one can accees it. I have also seen some of the application on iTunes who are capable of getting the users call history like:-https://itunes.apple.com/us/app/callog/id327883585?mt=8 I have also check a mac desktop utility called "WonderShare Dr.Fone" which will fetch all the data from your iPhone like call history messages, notes , etc.How this utility is fetching the call history records and other details? If their is any API or private APIs by which i can get the callHistory data path please let me know.

    Read the article

  • What is the better Shebang Line to use ?

    - by Anonymous
    What is better/faster to use: #! perl or #! perl.exe or #! fullpath/perl(/perl.exe) or #! partialpath/perl(/perl.exe) ? And, when using "#! perl", when it works on a particular system, what is the print() for showing the full path to perl.exe, that could be included into the Shebang Line ? And, if using a /path/path/perl, are "*" or "..." allowed to be used for the folders ?

    Read the article

  • Load local Html file doesn't refer the js file in UIWebView

    - by Hero Vs Zero
    I am working with UIWebView project and I want to load an HTML file from a project resource. It is working fine when I run from the URL, but when I view the HTML file locally, JS files are not loaded. Loading the local HTML local file doesn't refer to js files in UIWebView. Here's my code to load the HTML file project local resource and does't refer the js file: NSString *path = [[NSBundle mainBundle] pathForResource:@"textfile" ofType:@"txt"]; NSError *error = nil; NSString *string = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error]; NSString *path1 = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path1]; NSLog(@"%@ >>> %@",baseURL,path); [webview loadHTMLString:string baseURL:baseURL]; This code doesn't find JS files in UIWebView, even though it loads image files from the project resource successfully.

    Read the article

  • iPhone framework paths?

    - by user158103
    I recently moved my projects to a new mac, along with a newer version of Xcode. When i opened my project i noticed that some files were red. So i remapped them by setting the path (by project path) and then providing the proper path location. Now my problem is that the frameworks that i have are red, and i cant find their location! I did set the framework paths to be "relative to current SDK" however. Can anybody help me get my frameworks mapped correctly? The frameworks im using are: - QuartzCore.framework - libsqlite3.0.dylib - UIKit.framework - Foundation.frameowrk - CoreGraphics.framework The XCode version is 3.1.4 (the only one installed). The iPhone app was originally created using a prior version of Xcode (i dont remember which version).

    Read the article

  • PHP: read all files but randomly?

    - by mathiregister
    hi there, i wonder if there's a way of reading a directory in a random order. With the following code i'm running through the directory thumbs and it's printing images on my website. However, they are always read alphabetically and i wonder if there's a way in doing this randomly? <?php $path = 'thumbs'; if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && $file != '.DS_Store' && $file != 'Thumbs.db') { print "<img class='thumb' src='$path/$file'/>"; } else { //no proper file } } closedir($handle); } ?> thank you for your suggestions! regards

    Read the article

  • basename() returning int?

    - by EB
    Probably something stupid I'm missing but, why am I getting this warning? static void foo(char *path) { char *bname; char *path2 = strdup(path); bname = basename(path2); (line with basename() call): warning: assignment makes pointer from integer without a cast Indeed, if I change to this, the warning goes away: bname = (char *)basename(path2); man 3 basename tells me: char *basename(char *path); Both dirname() and basename() return pointers to null-terminated strings. What gives?

    Read the article

  • Linux - Bash Redirect a String to a file

    - by user3502786
    I wrote a simple script that is reading the file content and incrementing a a number inside this file, then i'm holding the change using awk, when i'm trying ro redirect the new String using '' the whole string is redirected in one line and not like the original was which is 4 lines. #!/bin/bash -x # This script is for Incrementing build numbers path=/home/RND/abrodov file=tst.txt tst=`cat $path/$file` printf "this is the content of the file before incrementing: \n $tst" newexpr=`awk '/^Build Number/{$4=$4+1;}1' /home/RND/abrodov/tst.txt` printf "\n the new content \n $newexpr" echo $newexpr > $path/$file This is the original file before running the script: Major Release Number = 4 Minor Release Number = 1 Service Pack Release Number = 2 Build Number = 22 This is the content after i used the script: Major Release Number = 4 Minor Release Number = 1 Service Pack Release Number = 2 Build Number = 23 I'm trying to figure out how can i redirect the text in the original format which is 4 lines.

    Read the article

  • How to convert objects in reflection (Linq to XML)

    - by user829174
    I have the following code which is working fine, the code creates plugins in reflection via run time: using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Xml.Linq; using System.Reflection; using System.Text; namespace WindowsFormsApplication1 { public abstract class Plugin { public string Type { get; set; } public string Message { get; set; } } public class FilePlugin : Plugin { public string Path { get; set; } } public class RegsitryPlugin : Plugin { public string Key { get; set; } public string Name { get; set; } public string Value { get; set; } } static class MyProgram { [STAThread] static void Main(string[] args) { string xmlstr =@" <Client> <Plugin Type=""FilePlugin""> <Message>i am a file plugin</Message> <Path>c:\</Path> </Plugin> <Plugin Type=""RegsitryPlugin""> <Message>i am a registry plugin</Message> <Key>HKLM\Software\Microsoft</Key> <Name>Version</Name> <Value>3.5</Value> </Plugin> </Client> "; Assembly asm = Assembly.GetExecutingAssembly(); XDocument xDoc = XDocument.Load(new StringReader(xmlstr)); Plugin[] plugins = xDoc.Descendants("Plugin") .Select(plugin => { string typeName = plugin.Attribute("Type").Value; var type = asm.GetTypes().Where(t => t.Name == typeName).First(); Plugin p = Activator.CreateInstance(type) as Plugin; p.Type = typeName; foreach (var prop in plugin.Descendants()) { var pi = type.GetProperty(prop.Name.LocalName); object newVal = Convert.ChangeType(prop.Value, pi.PropertyType); pi.SetValue(p, newVal, null); } return p; }).ToArray(); // //"plugins" ready to use // } } } I am trying to modify the code and adding new class named DetailedPlugin so it will be able to read the following xml: string newXml = @" <Client> <Plugin Type=""FilePlugin""> <Message>i am a file plugin</Message> <Path>c:\</Path> <DetailedPlugin Type=""DetailedFilePlugin""> <Message>I am a detailed file plugin</Message> </DetailedPlugin> </Plugin> <Plugin Type=""RegsitryPlugin""> <Message>i am a registry plugin</Message> <Key>HKLM\Software\Microsoft</Key> <Name>Version</Name> <Value>3.5</Value> <DetailedPlugin Type=""DetailedRegsitryPlugin""> <Message>I am a detailed registry plugin</Message> </DetailedPlugin> </Plugin> </Client> "; for this i modified my classes to the following: public abstract class Plugin { public string Type { get; set; } public string Message { get; set; } public DetailedPlugin DetailedPlugin { get; set; } // new } public class FilePlugin : Plugin { public string Path { get; set; } } public class RegsitryPlugin : Plugin { public string Key { get; set; } public string Name { get; set; } public string Value { get; set; } } // new classes: public abstract class DetailedPlugin { public string Type { get; set; } public string Message { get; set; } } public class DetailedFilePlugin : Plugin { public string ExtraField1 { get; set; } } public class DetailedRegsitryPlugin : Plugin { public string ExtraField2{ get; set; } } from here i need some help to accomplish reading the xml and create the plugins with the nested DetailedPlugin

    Read the article

  • PHP: variable not working inside of function?

    - by mathiregister
    hi guys, echo $path; //working function createList($retval) { echo $path; //not working print "<form method='POST' action='' enctype='multipart/form-data'>"; foreach ($retval as $value) { print "<input type='checkbox' name='deletefiles[]' id='$value' value='$value'>$value<br>"; } print "<input class='submit' name='deleteBtn' type='submit' value='Datei(en) löschen'>"; print "</form>"; } what am I doing wrong? why is $path printed corretly outside of the createlist function, but it's not inside of the function?

    Read the article

  • What is the best design to this class?

    - by HPT
    assume this class: public class Logger { static TextWriter fs = null; public Logger(string path) { fs = File.CreateText(path); } public static void Log(Exception ex) { ///do logging } public static void Log(string text) { ///do logging } } and I have to use this like: Logger log = new Logger(path); and then use Logger.Log() to log what I want. the question is: is this a good design? to instantiate a class and then always call it's static method? any suggestion yield in better design is appreciated.

    Read the article

  • Combining XmlSerializer and XmlWriter?

    - by num3ric
    In addition to a list of objects I am serializing to an xml file using C#'s XmlSerializer, I would like to store a few more independent elements (mainly strings from textboxes) in the same xml. public static void SaveBehaviors(ObservableCollection<Param> listParams) { XmlSerializer _paramsSerializer = new XmlSerializer(listParams.GetType()); string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); path += "\\test.xml"; using (TextWriter writeFileStream = new StreamWriter(path)) { _paramsSerializer.Serialize(writeFileStream, listParams); using (XmlWriter writer = XmlWriter.Create(writeFileStream)) { writer.WriteStartElement("Foo"); //test entry... writer.WriteAttributeString("Bar", "Some & value"); writer.WriteElementString("Nested", "data"); writer.WriteEndElement(); } } } However, deserializing "test.xml" results in an error because of the added element. I suppose writing in the serialized xml file is prohibited and should be avoided?

    Read the article

  • How can I embed a flash movie in a zend view programmatically?

    - by curro
    I have tried to embed a flash movie in a zend view using the htmlFlash helper. In theory you only have to pass the movie path to the htmlFlash helper in a phtml view: echo $this-htmlFlash('/path/to/myMovie.swf'); And the framework will generate the html code in the html page: <object data="/path/to/flash.swf" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> </object> However, I have done so and the code doesn't appear on the source code. Has anyone had this problem? Thank you

    Read the article

  • How to load a resource bundle from a file resource in Java?

    - by user143794
    I have a file called mybundle.txt in c:/temp - c:/temp/mybundle.txt how do I load this file into a java.util.resource bundle? The file is a valid resource bundle. This does not seem to work: java.net.URL resourceURL = null; String path = "c:/temp/mybundle.txt"; java.io.File fl = new java.io.File(path); try { resourceURL = fl.toURI().toURL(); } catch (MalformedURLException e) { } URLClassLoader urlLoader = new URLClassLoader(new java.net.URL[]{resourceURL}); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle( path , java.util.Locale.getDefault(), urlLoader ); What is the best way to do this?

    Read the article

  • How can I change ruby log level in unit tests based on context

    - by Stuart
    I'm new to ruby so forgive me if this is simple or I get some terminology wrong. I've got a bunch of unit tests (actually they're integration tests for another project, but they use ruby test/unit) and they all include from a module that sets up an instance variable for the log object. When I run the individual tests I'd like log.level to be debug, but when I run a suite I'd like log.level to be error. Is it possible to do this with the approach I'm taking, or does the code need to be restructured? Here's a small example of what I have so far. The logging module: #!/usr/bin/env ruby require 'logger' module MyLog def setup @log = Logger.new(STDOUT) @log.level = Logger::DEBUG end end A test: #!/usr/bin/env ruby require 'test/unit' require 'mylog' class Test1 < Test::Unit::TestCase include MyLog def test_something @log.info("About to test something") # Test goes here @log.info("Done testing something") end end A test suite made up of all the tests in its directory: #!/usr/bin/env ruby Dir.foreach(".") do |path| if /it-.*\.rb/.match(File.basename(path)) require path end end

    Read the article

  • How to add header, footer with images using PDF::API2::Lite ?

    - by Space
    Is it possible to add header(with image) and footer (with page number) with images. I wrote below code to create a PDF document which shows png images. If this can be done easily with any other module, please suggest.Really appreciate response with sample code. use strict; use PDF::API2::Lite; use Getopt::Long; my $outfile; my $path; my $options = GetOptions( "outfile=s" => \$outfile, "images=s" => \$path,); my @images = sort glob("$path") or die "No Files\n"; my $pdf = PDF::API2::Lite->new(); for my $png ( sort @images ) { my $image = $pdf->image_png( "$png" ); $pdf->page(1150,450); $pdf->image($image, 10, 10); } $pdf->saveas( $outfile );

    Read the article

  • Export environment variable from PHP, for use by exec()'d shell command?

    - by anonymous coward
    Somewhat similar to http://stackoverflow.com/questions/2002970/export-a-variable-from-php-to-shell, but my problem is different. I am forced to work with a program that gets an important location variable from an Environment Variable (Linux), rather than a config or, better, a command line option. I have to call this program from within PHP, and currently am doing it like so: shell_exec('/path/to/program option1 option2'); I need to be able to set/override the environment variable that program will be looking for. As an example, this does not work: shell_exec('VAR1=foo /path/to/program option1 option2'); nor does: shell_exec('VAR1=foo; export foo; /path/to/program option1 option2'); for good measure. Both of the above command lines work "as expected" from the shell. Is it possible to override environment variables for programs called via exec, shell_exec, etc?

    Read the article

  • php include file issue using document root

    - by nithi
    I have used the following code to get the document root. $path = get_file_dir(); function get_file_dir() { global $argv; return realpath($argv[0]); } Below code includes config.php and config.php has the $setuprun variable with a value. if((file_exists("$path/admin/config.php"))) { include_once "$path/admin/config.php"; } if($setuprun=="true") { //do some code } In my system, it takes the document root like /home/myname/myfolder and the variable $setuprun has the value and the code works perfectly. But in another user's system, it shows the following error. Notice: Undefined variable: setuprun in /usr/local/www/chat/setup.php on line 22. He is using FreeBSD 8.2 Stable with MySQL 5, PHP5 and Apache 2.2. Can anyone please help me to solve this error?

    Read the article

  • Problem with access to file

    - by phenevo
    Hi, I have winforms application and it has reference to library MyLibrary. MyLibrary has method: string[] GiveMeNamesOfAirports() { string[] lines= File.ReadLines("airports.txt"); foreach(string line in lines) ... } And when I run my Winforms application: I get error: file couldn't be find. I was trying other function: string[] lines = File.ReadAllLines(Path.Combine(System.Environment.CurrentDirectory, "airports.txt")); string[] lines = File.ReadAllLines(Path.Combine(Assembly.GetExecutingAssembly().Location, "airports.txt")); string[] lines = File.ReadAllLines(Path.Combine(Assembly.GetAssembly(typeof(Airport)).Location, "airports.txt"));

    Read the article

  • ExpandEnvironmentStrings Not Expanding My Variables

    - by Adam Driscoll
    I have a process under the Run key in the registry. It is trying to access an environment variable that I have defined in a previous session. I'm using ExpandEnvironmentStrings to expand the variable within a path. The environment variable is a user profile variable. When I run my process on the command line it does not expand as well. If I call 'set' I can see the variable. Some code... CString strPath = "\\\\server\\%share%" TCHAR cOutputPath[32000]; DWORD result = ExpandEnvironmentStrings((LPSTR)&strPath, (LPSTR)&cOutputPath, _tcslen(strPath) + 1); if ( !result ) { int lastError = GetLastError(); pLog->Log(_T( "Failed to expand environment strings. GetLastError=%d"),1, lastError); } When debugging Output path is exactly the same as Path. No error code is returned. What is goin on?

    Read the article

  • VC++ - Asynchronous Thread

    - by JVNR
    I am working on VC++ project, in that my application process a file from input path and generates 3 output "*.DAT" files in the destination path. I will FTP these DAT file to the destination server. After FTP, I need to delete only two output .DAT files the folder. I am able to delete those files, because there one Asynchronous thread running behind the process. Since the thread is running, while deleting it says, "Cannot delete, the file is used by another person". I need to stop that thread and delete the files. Multiple files can also be taken from the input path to process. Please help me in resolving this issue. Its very high priority issue for me. Please help me ASAP.

    Read the article

  • Is it possible to import specific class from project propreties

    - by Alex
    I have 2 projects. First project need to include second. When I copy sources from second project to first I need to modify manually import path to R.java file. The problem is that I need to use SVN external link connection between this 2 projects, that is mean, one project (the bigger one) will take sources from another through svn and should be able to use it without any modifications. If I would be able to specify R.java file path anywhere in project properties it will resolve my problem by changing manually that path. Need to specify that package name of these 2 projects are different. Another solution to resolve this problem also would be accepted. Thank you.

    Read the article

  • How to load image from NSMutableArray

    - by pbcoder
    I want to load the image URL from my NSMutableArray. Here is my Code: id path = (NSString *)[[stories objectAtIndex: storyIndex] objectForKey: @"icon"]; NSURL *url = [NSURL URLWithString:path]; NSData *data = [NSData dataWithContentsOfURL:url]; UIImage *img = [[UIImage alloc] initWithData:data cache:NO]; If I use: id path = @"http://www.xzy.de/icon.png"; it´s all right, but not if I want to extract the imageURL from my Array Anyone who can help me? Thanks!

    Read the article

< Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >