Search Results

Search found 2375 results on 95 pages for 'dir'.

Page 20/95 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Making an ANT Macro more reusable

    - by 1ndivisible
    I have a simple macro (simplified version below). At the moment it assumes that there will be a single value for a single argument, however there might be multiple values for that argument. How can I pass in 0+ values for that argument so that the macro is usable in situations where I need to pass in 0+ values for that argument, not just a single value <macrodef name="test"> <attribute name="target.dir" /> <attribute name="arg.value" /> <sequential> <java jar="${some.jar}" dir="@{target.dir}" fork="true" failonerror="true"> <arg value="-someargname=@{arg.value}"/> </java> </sequential> </macrodef>

    Read the article

  • Create a new output file in ant replace task

    - by Sathish
    Ant replace task does a in-place replacement without creating a new file. The below snippet replaces tokens in any of the *.xml files with the corresponding values from my.properties file. <replace dir="${projects.prj.dir}/config" replacefilterfile="${projects.prj.dir}/my.properties" includes="*.xml" summary="true"/'> I want those *.xml files that had their tokens replaced be created as *.xml.filtered (for e.g.) and still have the original *.xml. Is this possible in Ant with some smart combination of tasks and concepts ?

    Read the article

  • Why doesn't Perl threading work when I call readdir beforehand?

    - by Kevin
    Whenever I call readdir before I create a thread, I get an error that looks like this: perl(2820,0x7fff70c33ca0) malloc: * error for object 0x10082e600: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug Abort trap What's strange is that it happens when I call readdir before I create a thread (i.e. readdir is not called in any concurrent code). I don't even use the results from readdir, just making the call to it seems to screw things up. When I get rid of it, things seem to work fine. Some example code is below: opendir(DIR, $someDir); my @allFiles = readdir(DIR); close(DIR); my $thread = threads-create(\&sub1); $thread-join(); sub sub1 { print "in thread\n" }

    Read the article

  • Excluding some classes from the cobertura report doesn't work

    - by user357480
    I tried to exclude some classes from cobertura as specified in this site <cobertura-instrument todir="${voldemort.instrumented.dir}" datafile="${cobertura.instrument.file}"> <classpath refid="tools-classpath" /> <ignore regex=".*\.xsd" /> <fileset dir="${voldemort.dist.dir}/classes"> <include name="**/*.class" /> <exclude name="**/client/protocol/pb/*.class"/> <exclude name="**/server/http/*.class"/> </fileset> </cobertura-instrument> but that doesn't work help me out, pleaseeeeeeeeeeee

    Read the article

  • How do I use pdo's prepared statement for order by and limit clauses(or can I?If not,what should I r

    - by user198729
    $sql = "SELECT * FROM table ORDER BY :sort :dir LIMIT :start, :results"; $stmt = $dbh->prepare($sql); $stmt->execute(array( 'sort' => $_GET['sort'], 'dir' => $_GET['dir'], 'start' => $_GET['start'], 'results' => $_GET['results'], ) ); I tried to use prepare to do the job,but $stmt->fetchAll(PDO::FETCH_ASSOC); returns nothing. Can someone point out what's the wrong thing I am doing?

    Read the article

  • Create Directory, 'cd' to it and download a file pipeline in Perl

    - by neversaint
    I have a file that looks like this: ftp://url1/files1.tar.gz dir1 ftp://url2/files2.txt dir2 .... many more... What I want to do are these steps: Create directory based on column 2 Unix 'cd' to that directory Download file with 'wget' based on column1 But how come this approach of mine doesn't work while(<>) { chomp; my ($url,$dir) = split(/\t/,$_); system("mkdir $dir"); system("cd $dir"); # Fail here system("wget $url"); # here too } What's the right way to do it?

    Read the article

  • No class def find error

    - by John Smith
    I have the following piece of code which helps me to read the paths of all the files in a directory and its subdirectories : File dir = new File("directory path"); try { System.out.println("Getting all files in " + dir.getCanonicalPath() + " including those in subdirectories"); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } List<File> files = (List<File>) FileUtils.listFiles(dir, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE); for (File file : files) { try { System.out.println("file: " + file.getCanonicalPath()); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } The problem is that I get a java.lang.NoClassDefFoundError: org/apache/commons/io/filefilter/TrueFileFilter error. I've imported the necessary libraries. I mention that I work on a plugin project. This code runs in a class with main function. I don't understand why it gave me this error. Thank you !

    Read the article

  • USB device Set Attribute in C#

    - by p19lord
    I have this bit of code: DriveInfo[] myDrives = DriveInfo.GetDrives(); foreach (DriveInfo myDrive in myDrives) { if (myDrive.DriveType == DriveType.Removable) { string path = Convert.ToString(myDrive.RootDirectory); DirectoryInfo mydir = new DirectoryInfo(path); String[] dirs = new string[] {Convert.ToString(mydir.GetDirectories())}; String[] files = new string[] {Convert.ToString(mydir.GetFiles())}; foreach (var file in files) { File.SetAttributes(file, ~FileAttributes.Hidden); File.SetAttributes(file, ~FileAttributes.ReadOnly); } foreach (var dir in dirs) { File.SetAttributes(dir, ~FileAttributes.Hidden); File.SetAttributes(dir, ~FileAttributes.ReadOnly); } } } I have a problem. It is trying the code for Floppy Disk drive first which and because no Floppy disk in it, it threw the error The device is not ready. How can I prevent that?

    Read the article

  • bashscript for file search and replace!

    - by D3orn
    Hey I try to write a littel bash script. This should copy a dir and all files in it. Then it should search each file and dir in this copied dir for a String (e.g @ForTestingOnly) and then this save the line number. Then it should go on and count each { and } as soon as the number is equals it should save againg the line number. = it should delete all the lines between this 2 numbers. I'm trying to make a script which searchs for all this annotations and then delete the method which is directly after this ano. Thx for help...

    Read the article

  • Why does this mod_rewrite rule 'not-match'? (big rewrite log included)

    - by Christopher
    I've got a scenario involving two domains: WordPress site hosted on domain1.com domain2.co.uk, simply redirecting users to domain1 via mod_rewrite This rule applies irrespective of whether www. is specified or not. (It's eventually removed from the URL, I'm a no-WWW fan.) There's nothing on domain2.co.uk at all except for an .htaccess with some mod_rewrite rules. However, I want to be able to allow users to be redirected to the correct article URI even if they specify the "wrong" URL (i.e., a 301 redirect preserving the stuff after the first forward slash). I'm currently achieving this with this ruleset: RewriteCond %{HTTP_HOST} ^((www\.)?[^\.]+)\.domain2\.co\.uk [NC,OR] RewriteCond %{HTTP_HOST} ^domain2\.co\.uk [NC] RewriteRule ^(.*)$ http://domain1.com/$1 [R=301,L] This works but is uglier than I want it to be. I'm not a mod_rewrite zen master, but from what I can tell the top rule should match irrespective of whether www. is specified... But it doesn't. In order to catch www-less requests, I need the second RewriteCond. From the rewrite log, with just the first RewriteCond: [domain2.co.uk/sid#e200498][rid#e670168/initial] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] strip per-dir prefix: /home/devnull/domains/domain2.co.uk/public_html/ -> [domain2.co.uk/sid#e200498][rid#e670168/initial] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] applying pattern '^(.*)$' to uri '' [domain2.co.uk/sid#e200498][rid#e670168/initial] (4) [perdir /home/devnull/domains/domain2.co.uk/public_html/] RewriteCond: input='domain2.co.uk' pattern='^((www\.)|[^\.]+)\.domain2\.co\.uk' [NC] => not-matched [domain2.co.uk/sid#e200498][rid#e670168/initial] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/ [domain2.co.uk/sid#e200498][rid#e653868/subreq] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/index.html [domain2.co.uk/sid#e200498][rid#e65f8b8/subreq] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/index.htm [domain2.co.uk/sid#e200498][rid#e653868/subreq] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/index.shtml [domain2.co.uk/sid#e200498][rid#e65f8b8/subreq] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/index.php [domain2.co.uk/sid#e200498][rid#e653868/subreq] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/index.php5 [domain2.co.uk/sid#e200498][rid#e666c98/subreq] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/index.php4 [domain2.co.uk/sid#e200498][rid#e65f8b8/subreq] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/index.php3 [domain2.co.uk/sid#e200498][rid#e653868/subreq] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/index.phtml [domain2.co.uk/sid#e200498][rid#e65f8b8/subreq] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/index.cgi [domain2.co.uk/sid#e200498][rid#e66c370/initial/redir#1] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] strip per-dir prefix: /home/devnull/domains/domain2.co.uk/public_html/403.shtml -> 403.shtml [domain2.co.uk/sid#e200498][rid#e66c370/initial/redir#1] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] applying pattern '^(.*)$' to uri '403.shtml' [domain2.co.uk/sid#e200498][rid#e66c370/initial/redir#1] (4) [perdir /home/devnull/domains/domain2.co.uk/public_html/] RewriteCond: input='domain2.co.uk' pattern='^((www\.)|[^\.]+)\.domain2\.co\.uk' [NC] => not-matched [domain2.co.uk/sid#e200498][rid#e66c370/initial/redir#1] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/403.shtml [domain2.co.uk/sid#e200498][rid#e668ca8/initial] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] strip per-dir prefix: /home/devnull/domains/domain2.co.uk/public_html/favicon.ico -> favicon.ico [domain2.co.uk/sid#e200498][rid#e668ca8/initial] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] applying pattern '^(.*)$' to uri 'favicon.ico' [domain2.co.uk/sid#e200498][rid#e668ca8/initial] (4) [perdir /home/devnull/domains/domain2.co.uk/public_html/] RewriteCond: input='domain2.co.uk' pattern='^((www\.)|[^\.]+)\.domain2\.co\.uk' [NC] => not-matched [domain2.co.uk/sid#e200498][rid#e668ca8/initial] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/favicon.ico [domain2.co.uk/sid#e200498][rid#f160b40/initial/redir#1] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] strip per-dir prefix: /home/devnull/domains/domain2.co.uk/public_html/404.shtml -> 404.shtml [domain2.co.uk/sid#e200498][rid#f160b40/initial/redir#1] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] applying pattern '^(.*)$' to uri '404.shtml' [domain2.co.uk/sid#e200498][rid#f160b40/initial/redir#1] (4) [perdir /home/devnull/domains/domain2.co.uk/public_html/] RewriteCond: input='domain2.co.uk' pattern='^((www\.)|[^\.]+)\.domain2\.co\.uk' [NC] => not-matched [domain2.co.uk/sid#e200498][rid#f160b40/initial/redir#1] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] pass through /home/devnull/domains/domain2.co.uk/public_html/404.shtml However with the second RewriteCond added, the rule works, and the logs show this: [domain2.co.uk/sid#e200498][rid#e65fe58/initial] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] strip per-dir prefix: /home/devnull/domains/domain2.co.uk/public_html/ -> [domain2.co.uk/sid#e200498][rid#e65fe58/initial] (3) [perdir /home/devnull/domains/domain2.co.uk/public_html/] applying pattern '^(.*)$' to uri '' [domain2.co.uk/sid#e200498][rid#e65fe58/initial] (4) [perdir /home/devnull/domains/domain2.co.uk/public_html/] RewriteCond: input='domain2.co.uk' pattern='^((www\.)?[^\.]+)\.domain2\.co\.uk' [NC] => not-matched [domain2.co.uk/sid#e200498][rid#e65fe58/initial] (4) [perdir /home/devnull/domains/domain2.co.uk/public_html/] RewriteCond: input='domain2.co.uk' pattern='^domain2\.co\.uk' [NC] => matched [domain2.co.uk/sid#e200498][rid#e65fe58/initial] (2) [perdir /home/devnull/domains/domain2.co.uk/public_html/] rewrite '' -> 'http://domain1.com/' [domain2.co.uk/sid#e200498][rid#e65fe58/initial] (2) [perdir /home/devnull/domains/domain2.co.uk/public_html/] explicitly forcing redirect with http://domain1.com/ [domain2.co.uk/sid#e200498][rid#e65fe58/initial] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] escaping http://domain1.com/ for redirect [domain2.co.uk/sid#e200498][rid#e65fe58/initial] (1) [perdir /home/devnull/domains/domain2.co.uk/public_html/] redirect to http://domain1.com/ [REDIRECT/301] Can anybody help me figure out why it just won't work with the one rule? I feel like I'm missing the bleeding obvious, and while the second RewriteCond is a valid workaround, it's a kludge and that annoys me. ;-) All help appreciated...

    Read the article

  • how to solve error processing /usr/lib/python2.7/dist-packages/pygst.pth:?

    - by ChitKo
    Error processing line 1 of /usr/lib/python2.7/dist-packages/pygst.pth: Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 161, in addpackage if not dircase in known_paths and os.path.exists(dir): File "/usr/lib/python2.7/genericpath.py", line 18, in exists os.stat(path) TypeError: must be encoded string without NULL bytes, not str Remainder of file ignored Error processing line 1 of /usr/lib/python2.7/dist-packages/pygtk.pth: Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 161, in addpackage if not dircase in known_paths and os.path.exists(dir): File "/usr/lib/python2.7/genericpath.py", line 18, in exists os.stat(path) TypeError: must be encoded string without NULL bytes, not str Remainder of file ignored Traceback (most recent call last): File "/usr/share/apport/apport-gtk", line 16, in <module> from gi.repository import GObject File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 76, in load_module dynamic_module._load() File "/usr/lib/python2.7/dist-packages/gi/module.py", line 222, in _load version) File "/usr/lib/python2.7/dist-packages/gi/module.py", line 90, in __init__ repository.require(namespace, version) gi.RepositoryError: Failed to load typelib file '/usr/lib/girepository-1.0/GLib-2.0.typelib' for namespace 'GLib': Invalid magic header

    Read the article

  • How to format a USB stick

    - by VictorL
    My USB stick looks dead : victor@X301A1:~$ umount /dev/sdc1 victor@X301A1:~$ sudo mkfs -t vfat /dev/sdc1 mkfs.vfat 3.0.12 (29 Oct 2011) mkfs.vfat: unable to open /dev/sdc1: Read-only file system victor@X301A1:~$ sudo hdparm -r0 /dev/sdc1 /dev/sdc1: setting readonly to 0 (off) readonly = 0 (off) victor@X301A1:~$ sudo fsck -n /dev/sdc1 fsck de util-linux 2.20.1 dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN /.Trash-1000/files/sans_titre Start does point to root directory. Deleting dir. /.Trash-1000/files/Bus CAN Start does point to root directory. Deleting dir. Reclaimed 190903 unused clusters (781938688 bytes). Free cluster summary wrong (1001897 vs. really 1383698) Auto-correcting. Leaving file system unchanged. /dev/sdc1: 8052 files, 566660/1950358 clusters Is there anyway for me to recover my USB stick ? Thank

    Read the article

  • Permissions problem when copying files to /usr/share/tomcat6

    - by Nazar Hussain S
    Hi, I am running springsource framework in ubuntu 10.01. In my home folder, I have installed springsource IDE. I have my tomcat6 appserver in the /usr/share/tomcat6. While executing a sample project springapp, I have created the springapp dir in /users/share/tomcat6/webapps/ folder using sudo as I am unable to do it directly. On running the ant deploy or ant deploywar command, I am unable to copy the sample file -index.jsp from my workspace in springsource IDE to springapp dir in /usr/share/tomcat6/webapps as I am getting the error permission denied while copying the .jsp file. Can anybody please provide suggestion as to how to overcome this issue? Regards

    Read the article

  • How to impale and stack targets correctly according to the collider and its coordinate?

    - by David Dimalanta
    I'm making another simple game, a catch game, where a spawning target game object must be captured using a skewer to impale it. Here how: At the start, the falling object (in red) will fall in a vertical direction (in blue) When aimed properly, the target will fall down along the line of the skewer. (in blue) Then, another target is spawned and will fall vertically. (in red) When aimed successfully again in a streak, the second target will fall along the skewer and stacked. Same process over and over when another target is spawned. However, when I test run it on the scene tab in Unity, when impaled several targets, instead of a smooth flow and stacking it ended up overlaying it instead of stacking it up like a pancake. Here's what it look like: As I noticed when reaching the half-way of my progress, I tried to figure out how to deal with collider bodies without sticking each other so that it will actually stack like in the example of the image at no. 3. Here's the script code I added in the target game object: using UnityEngine; using System.Collections; public class ImpaleStateTest : MonoBehaviour { public GameObject target; public GameObject skewer; public bool drag = false; private float stack; private float impaleCount; void Start () { stack = 0; impaleCount = 0; } void Update () { if(drag) { target.transform.position = new Vector3 (DragTest.dir.transform.position.x, DragTest.dir.transform.position.y - 0.35f, 0); target.transform.rotation = DragTest.degrees; target.rigidbody2D.fixedAngle = true; target.rigidbody2D.isKinematic = true; target.rigidbody2D.gravityScale = 0; if(Input.GetMouseButton(0)) { Debug.Log ("Skewer: " + DragTest.dir.transform.position.x); Debug.Log ("Target: " + target.transform.position.x); } } } void OnTriggerEnter2D(Collider2D collider) { impaleCount++; Debug.Log ("Impaled " + impaleCount + " time(s)!"); drag = true; audio.Play (); } } Aside from that, I'm not sure if it's right but, the only way to stick the impaled targets while dragging the skewer left or right is to get the X coordinates from the skewer only. Is there something else to recommend it in order to improve this behavior as realistic as possible? Please help.

    Read the article

  • HTML Lang ISO Code

    - by jsmoove88
    I have a multi-language site for English and Chinese (Hong Kong). My previous setting for Chinese Hong Kong (zh-hk) had: <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-hk" xml:lang="zh-hk"> Shortly, I began to notice browser with other Chinese language sub-codes like zh-tw and zh-cn were seeing my English site in search engines instead of Chinese Hong Kong (zh-hk), which makes sense. I want to change my html lang to: <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh" xml:lang="zh"> Would this cover all Chinese language settings? Also, would Google prefer to show pages that match language subcodes of the browser/country (zh-hk for Hong Kong, zh-cn for Taiwan) than a general language code (zh)?

    Read the article

  • Are there well-known PowerShell coding conventions?

    - by Tahir Hassan
    Are there any well-defined conventions when programming in PowerShell? For example, in scripts which are to be maintained long-term, do we need to: Use the real cmdlet name or alias? Specify the cmdlet parameter name in full or only partially (dir -Recurse versus dir -r) When specifying string arguments for cmdlets do you enclose them in quotes (New-Object 'System.Int32' versus New-Object System.Int32 When writing functions and filters do you specify the types of parameters? Do you write cmdlets in the (official) correct case? For keywords like BEGIN...PROCESS...END do you write them in uppercase only? It seems that MSDN lack coding conventions document for PowerShell, while such document exist for example for C#.

    Read the article

  • PowerShell - grabbing values out of the registry and running them

    - by Rob Farley
    So I closed an application that runs when Windows starts up, but it doesn’t have a Start Menu entry, and I was trying to find it. Ok, I could’ve run regedit.exe, navigated through the tree and found the list of things that run when Windows starts up, but I thought I’d use PowerShell instead. PowerShell presents the registry as if it’s a volume on a disk, and you can navigate around it using commands like cd and dir. It wasn’t hard to find the folder I knew I was after – tab completion (starting the word and then hitting the Tab key) was a friend here. But unfortunately dir doesn’t list values, only subkeys (which look like folders). PS C:\Windows\system32> dir HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run PS C:\Windows\system32> Instead, I needed to use Get-Item to fetch the ‘Run’ key, and use its Property property. This listed the values in there for me, as an array of strings (I could work this out using Get-Member). PS C:\Windows\system32> (Get-Item HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run).Property QuickSet SynTPEnh Zune Launcher PS C:\Windows\system32> Ok, so the thing I wanted wasn’t in there (an app called PureText, whicih lets me Paste As Text using Windows+V). That’s ok – a simple change to use HKCU instead of HKLM (Current User instead of Local Machine), and I found it. Now to fetch the details of the application itself, using the RegistryKey method GetValue PS C:\Windows\system32> (Get-Item HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run).GetValue('PureText') "C:\Users\Rob\Utilities\PureText.exe" PS C:\Windows\system32> And finally, surrounding it in a bit of code to execute that command. That needs an ampersand and the Invoke-Expression cmdlet. PS C:\Windows\system32> '& ' + (Get-Item HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run).GetValue('PureText') | Invoke-Expression A simple bit of exploring PowerShell which will makes for a much easier way of finding and running those apps which start with Windows.

    Read the article

  • links for 2011-01-05

    - by Bob Rhubart
    A Role-Based Approach to Automated Provisioning and Personalized Portals Authors Rex Thexton (Managing Dir, PricewaterhouseCoopers), Nishidhdha Shah (Sr. Associate at PwC Consulting) and Harish Gaur (Dir. Product Management, Oracle Fusion Middleware) bring you the final article in the Fusion Middleware Patterns series. (tags: Oracle otn entarch enterprise2.0) 13 Jan 2011 - New York, NY - Coherence Special Interest Group - Oracle Coherence Knowledge Base The world's largest enterprise software company, Oracle is the only vendor to offer solutions for every tier of your business -- database, middleware, business intelligence, business applications, and collaboration. With Oracle, you get information that helps you measure results, improve business processes, and communicate a single truth to your constituents. (tags: ping.fm) Marc Kelderman: Exporting the SOA MDS Marc Kelderman show you how in this brief tutorial. (tags: oracle otn soa mds)

    Read the article

  • PowerShell programming conventions

    - by Tahir Hassan
    Do you follow any any conventions when programming in PowerShell? For example, in scripts which are to be maintained long-term do you: Use the real cmdlet name or alias? Specify the cmdlet parameter name in full or only partially (dir -Recurse versus dir -r) When specifying string arguments for cmdlets do you enclose them in quotes (New-Object 'System.Int32' versus New-Object System.Int32 When writing functions and filters do you specify the types of parameters? Do you write cmdlets in the (official) correct case? For keywords like BEGIN...PROCESS...END do you write them in uppercase only? Thanks for any replies.

    Read the article

  • Is it possible to auto-mount sshfs

    - by Mark D
    Is it possible to auto-mount a remote FS using sshfs upon instantiating a proper VPN connection? Allow me to explain the scenario, I'm working remotely, to do that it helps if I can mount my home dir from a server in the office. To do that I need to vpn in. So within network manager I select the relevant VPN and connect. It connects but now I have to drop to the command line and mount my home dir on several machines. If I forget to do one machine my local dev environment isn't as efficient. I suppose I could write a quick bash script to do this but I'd rather get it running automatically when I connect.

    Read the article

  • EntityRepository not found [migrated]

    - by PachinSV
    I'm new in Doctrine, I'm following the examples in the documentation. I created my entities and everything is working fine until I created a Repository. I have an entity called User and a UserRepository. But when I try to use the User repository I get the error message: Fatal error: Class 'Doctrine\ORM\EntityRepository' not found in C:\xampp\htdocs\excap\repositories\UserRepository.php on line 10 use Doctrine\ORM\EntityRepository; /** * Description of UserRepository * * @author Mario */ class UserRepository extends EntityRepository { How can I solved this? <?php //bootstrap_doctrine.php $isDevMode = true; use Doctrine\ORM\Tools\Setup; require_once 'vendor/autoload.php'; $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__.'/entities'), $isDevMode); $conn = array( 'driver' => 'pdo_mysql', 'user' => 'mydbuser', 'password' => 'mydbpassword', 'dbname' => 'mydbname' ); $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config); ?> <?php //boostrap.php //Entities require_once 'entities/User.php'; require_once 'entities/Gender.php'; require_once 'entities/AccessPoint.php'; //Repositories require_once 'repositories/UserRepository.php'; if(!class_exists("Doctrine\Common\Version", FALSE)) { require_once 'bootstrap_doctrine.php'; } ?> <?php // autoload.php generated by Composer if (!class_exists('Composer\\Autoload\\ClassLoader', false)) { require __DIR__ . '/composer' . '/ClassLoader.php'; } return call_user_func(function() { $loader = new \Composer\Autoload\ClassLoader(); $composerDir = __DIR__ . '/composer'; $map = require $composerDir . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { $loader->add($namespace, $path); } $classMap = require $composerDir . '/autoload_classmap.php'; if ($classMap) { $loader->addClassMap($classMap); } $loader->register(); return $loader; }); ?>

    Read the article

  • amixer volume controls applies twice

    - by user214604
    The volume increment or decrement is happening double the intended amount using amixer for my alsa driver using ./amixer -c 0 set Master 1- command. This happens becuase by default volume controls apply for both playback and capture moduels. My alsa driver config doesnt enabled any of the capture controls. even there is no capture enabled, the function from simple_none.c returns true for capture channel. All the capture volume controls are applied to my playback driver. static int is_ops(snd_mixer_elem_t *elem, int dir, int cmd, int val) case SM_OPS_IS_CHANNEL: return (unsigned int) val < s-str[dir].channels; ./amixer -c 0 set Master Playback 10+ ./amixer -c 0 set Master Playback 10 - ./amixer -c 0 set Master Capture 10+ ./amixer -c 0 set Master Capture 10 - I suspect capture is enabled by default in my system for alsa drivers. Let me know what are the things to ensure to disable the capture.

    Read the article

  • How can i add a checkbox for optional files during install? (innosetup)

    - by Globulorozzo
    i'm trying to make a custom checkbox in my custom page (because is a one page installer), is needed only a checkbox without dialogs or anything, the installer that i'm trying to compile is very linear and simple. i want to bind "FILE3.EXE" on a checkbox in this way: if checkbox is checked copy the file (FILE3.EXE) in DestDir, otherwise if checkbox is unchecked skip the file (FILE3.EXE) during installation. This is the code that i use, obviously the checkbox code is missing because i'm not able to do that [Files] Source: FILE1.EXE; DestDir: {app}; Source: FILE2.EXE; DestDir: {app}; Source: FILE3.EXE; DestDir: {app}; //OPTIONAL [Code] procedure ExitProcess(uExitCode: UINT); external '[email protected] stdcall'; var MainPage : TWizardPage; FolderToInstall : TEdit; InstallLocation : String; procedure CancelClick(Sender: TObject); begin if ExitSetupMsgBox then begin ExitProcess(0); end; end; procedure BrowseClick(Sender : TObject); var Dir : String; begin Dir := FolderToInstall.Text; if BrowseForFolder('Browse',Dir,false) then FolderToInstall.Text := Dir; WizardForm.DirEdit.Text := Dir; end; procedure InitializeWizard(); var LabelFolder : TLabel; begin WizardForm.ClientWidth:=ScaleX(550); WizardForm.ClientHeight:=ScaleY(250); WizardForm.Center; WizardForm.OuterNotebook.Hide; WizardForm.InnerNotebook.Hide; WizardForm.Bevel.hide; Wizardform.NextButton.top := 180; Wizardform.NextButton.Left := 470; WizardForm.NextButton.Height := 25; WizardForm.StatusLabel.Parent := WizardForm; WizardForm.StatusLabel.Left := 6; WizardForm.StatusLabel.Top := 206; WizardForm.FilenameLabel.Parent := WizardForm; WizardForm.FilenameLabel.Left := 87; WizardForm.FilenameLabel.Top := 206; WizardForm.FilenameLabel.Width := ScaleX(383); WizardForm.ProgressGauge.Parent := WizardForm; WizardForm.ProgressGauge.Left :=5; WizardForm.ProgressGauge.Top := 222; WizardForm.ProgressGauge.Width := ScaleX(460); MainPage := CreateCustomPage(wpWelcome,'',''); LabelFolder := TLabel.Create(MainPage); LabelFolder.Parent := WizardForm; LabelFolder.Top := 164; LabelFolder.Left := 6; LabelFolder.Caption := 'Directory:' FolderToInstall := TEdit.Create(MainPage); FolderToInstall.Parent := WizardForm; FolderToInstall.Top := 182; FolderToInstall.Left := 85; FolderToInstall.Width := 380; FolderToInstall.Text := WizardDirValue; FolderToInstall.ReadOnly := True; end;

    Read the article

  • Where are classpath, path and pathelement documented in Ant version 1.8.0?

    - by Robert Menteer
    I'm looking over the documentation that comes with Apache Ant version 1.8.0 and can't find where classpath, path and pathelement are documented. I've found a page that describes path like structures but it doesn't list the valid attributes or nested elements for these. Another thing I can't find in the documentation is a description of the relationships between filelist, fileset, patternset and path and how to convert them back and forth. For instance there has to be an easier way to compile only those classes in one package while removing all class dependencies on the package classes and update documentation. <!-- Get list of files in which we're interested. --> <fileset id = "java.source.set" dir = "${src}"> <include name = "**/Package/*.java" /> </fileset> <!-- Get a COMMA separated list of classes to compile. --> <pathconvert property = "java.source.list" refid = "java.source.set" pathsep = ","> <globmapper from = "${src}/*.@{src.extent}" to = "*.class" /> </pathconvert> <!-- Remove ALL dependencies on package classes. --> <depend srcdir = "${src}" destdir = "${build}" includes = "${java.source.list}" closure = "yes" /> <!-- Get a list of up to date classes. --> <fileset id = "class.uptodate.set" dir = "${build}"> <include name = "**/*.class" /> </fileset> <!-- Get list of source files for up to date classes. --> <pathconvert property = "java.uptodate.list" refid = "class.uptodate.set" pathsep = ","> <globmapper from="${build}/*.class" to="*.java" /> </pathconvert> <!-- Compile only those classes in package that are not up to date. --> <javac srcdir = "${src}" destdir = "${build}" classpathref = "compile.classpath" includes = "${java.source.list}" excludes = "${java.uptodate.list}"/> <!-- Get list of directories of class files for package. --: <pathconvert property = "class.dir.list" refid = "java.source.set" pathsep = ","> <globmapper from = "${src}/*.java" to = "${build}*" /> </pathconvert> <!-- Convert directory list to path. --> <path id = "class.dirs.path"> <dirset dir = "${build}" includes = "class.dir.list" /> </path> <!-- Update package documentation. --> <jdepend outputfile = "${docs}/jdepend-report.txt"> <classpath refid = "compile.classpath" /> <classpath location = "${build}" /> <classespath> <path refid = "class.dirs.path" /> </classespath> <exclude name = "java.*" /> <exclude name = "javax.*" /> </jdepend> Notice there's a number of conversions between filesets, paths and comma separated list just to get the proper 'type' required for the different ant tasks. Is there a way to simplify this while still processing the fewest files in a complex directory structure?

    Read the article

  • Does JUnit4 testclasses require a public no arg constructor?

    - by Thomas Baun
    I have a test class, written in JUnit4 syntax, that can be run in eclipse with the "run as junit test" option without failing. When I run the same test via an ant target I get this error: java.lang.Exception: Test class should have public zero-argument constructor at org.junit.internal.runners.MethodValidator.validateNoArgConstructor(MethodValidator.java:54) at org.junit.internal.runners.MethodValidator.validateAllMethods(MethodValidator.java:39) at org.junit.internal.runners.TestClassRunner.validate(TestClassRunner.java:33) at org.junit.internal.runners.TestClassRunner.<init>(TestClassRunner.java:27) at org.junit.internal.runners.TestClassRunner.<init>(TestClassRunner.java:20) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26) at junit.framework.JUnit4TestAdapter.<init>(JUnit4TestAdapter.java:24) at junit.framework.JUnit4TestAdapter.<init>(JUnit4TestAdapter.java:17) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:386) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768) Caused by: java.lang.NoSuchMethodException: dk.gensam.gaia.business.bonusregulering.TestBonusregulerAftale$Test1Reader.<init>() at java.lang.Class.getConstructor0(Class.java:2706) at java.lang.Class.getConstructor(Class.java:1657) at org.junit.internal.runners.MethodValidator.validateNoArgConstructor(MethodValidator.java:52) I have no public no arg constructor in the class, but is this really necessary? This is my ant target <target name="junit" description="Execute unit tests" depends="compile, jar-test"> <delete dir="tmp/rawtestoutput"/> <delete dir="test-reports"/> <mkdir dir="tmp/rawtestoutput"/> <junit printsummary="true" failureproperty="junit.failure" fork="true"> <classpath refid="class.path.test"/> <classpath refid="class.path.model"/> <classpath refid="class.path.gui"/> <classpath refid="class.path.jfreereport"/> <classpath path="tmp/${test.jar}"></classpath> <batchtest todir="tmp/rawtestoutput"> <fileset dir="${build}/test"> <include name="**/*Test.class" /> <include name="**/Test*.class" /> </fileset> </batchtest> </junit> <junitreport todir="tmp"> <fileset dir="tmp/rawtestoutput"/> <report todir="test-reports"/> </junitreport> <fail if="junit. failure" message="Unit test(s) failed. See reports!"/> </target> The test class have no constructors, but it has an inner class with default modifier. It also have an anonymouse inner class. Both inner classes gives the "Test class should have public zero-argument constructor error". I am using Ant version 1.7.1 and JUnit 4.7

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >