Daily Archives

Articles indexed Tuesday May 18 2010

Page 1/121 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • In a bash script echo shell commands

    - by user343547
    In a bash script how do I echo all shell commands called and expand any variable names? For example, given the following line: ls $DIRNAME I would like the script to run the command and display the following ls /full/path/to/some/dir The purpose is to save a log of all shell commands called and their arguments. Perhaps there is a better way of generating such a a log?

    Read the article

  • jquery hover not working properly other than IE6

    - by Kranthi
    Hi All, We developed navigation bar using jQuery 1.4.2. Functionality is to show submneus for different menu items when user hovers on it. It is working perfectly in IE6 but we see some weird problems in other browsers. In Firefox, when the page gets loaded, it works fine but when we hit f5, the submenu wont appear on hover. To get submenu we need to click on any other menu item. In Chrome, its the same to add on, some time even we click on any menu item, and hover submenu wont show up. In Safari, nothing shows up most of the times, but on clicking 5-6 menu items, submenu is shown.When we see loading text in safari it shows the submenu. but on every click the loading text wont appear.. We are very much confused..is it the browser behavior/code/jquery?? Below is the snippet: Html: <ul> <li><a class="mainLinks" href="google.com">Support</a> <ul><li>Sublink1</li></ul> </ul> Html code is absolutely fine. Jquery: var timeout = null; var ie = (document.all) ? true : false; $(document).ready(function(){ var $mainLink = null; var $subLink = null; $(".mainLinks").each(function(){ if ($(this).hasClass("current")) { $(this).mouseout(function() { var $this = $(this); timeout = setTimeout(function() { $(".popUpNav", $this.parent()).css({ visibility : 'hidden' }); $('.popUpArrow').hide(); ieCompat('show'); }, 200); }); } else { $(this).hover(function() { reset(); ieCompat('hide'); // Saving this for later use in the popUpNav hover event $mainLink = $(this); $popUpNav = $(".popUpNav", $mainLink.parent()); // Default width is width of one column var popupWidth = $('.popUpNavSection').width() + 20; // Calculate popup width depending on the number of columns var numColumns = $popUpNav.find('.popUpNavSection').length; if (numColumns != 0) { popupWidth *= numColumns; } var elPos = $mainLink.position(); var leftOffset = 0; if (elPos.left + popupWidth > 950) { leftOffset = elPos.left + popupWidth - 948; } $popUpNav.css({ top : elPos.top + 31 + 'px', left : elPos.left - leftOffset + 'px', visibility : 'visible', width : popupWidth + 'px' }); $('.popUpArrow').css({ left : elPos.left + Math.round(($mainLink.width() / 2)) + 20 + 'px', top : '27px' }).show(); }, function() { var $this = $(this); timeout = setTimeout(function() { $(".popUpNav", $this.parent()).css({ visibility : 'hidden' }); $('.popUpArrow').hide() ieCompat('show'); }, 200); } ); } }); $(".subLinks").hover( function(e) { $subLink = $(this); var elPos = $subLink.position(); var popupWidth = $(".popUpNavLv2",$subLink.parent()).width(); var leftOffset = 0; ieCompat('hide'); $(".popUpNavLv2",$subLink.parent()).css({ top : elPos.top + 32 + 'px', left : elPos.left - leftOffset + 'px', visibility : 'visible' }); }, function() { var $this = $(this); timeout = setTimeout(function() { $(".popUpNavLv2", $this.parent()).css({ visibility : 'hidden' }); }, 200); ieCompat('show'); } ); $('.popUpNav').hover( function() { clearTimeout(timeout); $mainLink.addClass('current'); $(this).css('visibility', 'visible'); $('.popUpArrow').show(); }, function() { $mainLink.removeClass('current'); $(this).css('visibility', 'hidden'); $('.popUpArrow').hide(); ieCompat('show'); } ); $('.popUpNavLv2').hover( function() { clearTimeout(timeout); $(this).css('visibility', 'visible'); ieCompat('hide'); }, function() { ieCompat('show'); $(this).css('visibility', 'hidden'); } ); // If on mac, reduce left padding on the tabs if (/mac os x/.test(navigator.userAgent.toLowerCase())) { $('.mainLinks, .mainLinksHome').css('padding-left', '23px'); } }); Thanks a lot in advance for looking into it. Thanks | Kranthi

    Read the article

  • How to connect to SQL Server using activerecord, JDBC, JTDS and Integrated Security

    - by Rob
    As per the above, I've tried: establish_connection(:adapter => "jdbcmssql", :url => "jdbc:jtds:sqlserver://myserver:1433/mydatabase;domain='mynetwork';", :username => 'user', :password=>'pass' ) establish_connection(:adapter => "jdbcmssql", :url => 'jdbc:jtds:sqlserver://myserver:1433/mydatabase;domain="mynetwork";user="mynetwork\user"' ) establish_connection(:adapter => "jdbcmssql", :url => "jdbc:jtds:sqlserver://myserver:1433/mydatabase;domain='mynetwork';", :username=>'user' ) establish_connection(:adapter => "jdbcmssql", :url => "jdbc:jtds:sqlserver://myserver:1433/mydatabase;domain='mynetwork';integratedSecurity='true'", :username=>'user' ) .. and various other combinations. Each time I get: net/sourceforge/jtds/jdbc/SQLDiagnostic.java:368:in `addDiagnostic': java.sql.SQLException: Login failed for user ''. The user is not associated with a trusted SQL Server connection. (NativeException) Any tips? Thanks, activerecord (2.3.5) activerecord-jdbc-adapter (0.9.6) activerecord-jdbcmssql-adapter (0.9.6) jdbc-jtds (1.2.5) jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) Client VM 1.6.0_18) [x86-java]

    Read the article

  • What files to backup on Lighttpd+MySQL+PHP server

    - by Tomaszs
    I have a VPS with CentOS 5. I would like to create backup of: all my config files tweaks of database, php, server a databases cron settings website files installed applications and their settings (?) What files should i take into account? I don't want to miss any file that will be necessary to restore fast my webserver in case of any failure. And I don't want to create whole backup because entire VPS has like 30 GB of data.

    Read the article

  • How to configure Linux to act as a Bluetooth RFCOMM SPP server?

    - by regulatre
    I'm writing a phone app for Android that connects to a bluetooth RFCOMM device in my car. My phone app talks AT commands with it. For development work, I often need to communicate with the device to try different commands and things. My neighbors are starting to think I'm weird because I sit in my car for hours on end with my laptop screen shining on my face, typing away like a script kiddie. I'd much rather configure one of my many Linux servers to act as a bluetooth RFCOMM device and allow me to connect to it (indoors, while I sit on my couch). I imagine I have to start with something like sdptool add SP But then what? I'm perfectly happy writing a perl app to handle the I/O, but I just don't know how to make the bluez stack accept connections and subsequently pipe that stream to a perl app.

    Read the article

  • OCR for low quality images

    - by dassouki
    Unfortunately, this is not CSI, we collected 20,000 images for license plates; we were wondering if there is a semi reliable way to read those license plates using OCR. the images especially night time ones are extremely low quality.

    Read the article

  • Does Entity Framework 4 not support property automatic lazy loading for model-first entities?

    - by KallDrexx
    All references that I find for lazy loading say it's possible but they all mention POCOs and that's it. I am using EF4 with the model-first methodology. In my model diagram I have a Project table and a UserObject table, with a 1 to many relationship between them. However, in code, when I have a valid UserObject and I attempt to get the project performing: Project prj = userobj.Project. Unfortunately, this doesn't work as it claims that UserObject.Project is null. It seems like I have to explicitly load the Project object via calling UserObject.ProjectReference.Load() prior to calling .Project. Is there any way for this to occur automatically when I access the .Project property?

    Read the article

  • Definition of the job titles involved in a software development process.

    - by Rafael Romão
    I have seen many job titles for people involved in a software development process, but never found a consensus about they mean. I know many of them are equivalent, and found some other questions about that here in SO, but I would like to know your definitions and comments about them. I want not only to know if there is really a consensus, but also to know if what I suppose to be a Software Architect, is really a Software Architect, and so on. The job titles I mean are: Developer; System Analyst; Programmer; Analyst Programmer; Software Engineer; Software Architect; Designer; Software Designer; Business Manager; Business Analyst; Program Manager; Project Manager; Development Manager; Tester; Support Analyst; Please, feel free to add more titles to this list in your answers. It would be very helpful.

    Read the article

  • f# iterating over two arrays, using function from a c# library

    - by user343550
    I have a list of words and a list of associated part of speech tags. I want to iterate over both, simultaneously (matched index) using each indexed tuple as input to a .NET function. Is this the best way (it works, but doesn't feel natural to me): let taggingModel = SeqLabeler.loadModel(lthPath + "models\penn_00_18_split_dict.model"); let lemmatizer = new Lemmatizer(lthPath + "v_n_a.txt") let input = "the rain in spain falls on the plain" let words = Preprocessor.tokenizeSentence( input ) let tags = SeqLabeler.tagSentence( taggingModel, words ) let lemmas = Array.map2 (fun x y -> lemmatizer.lookup(x,y)) words tags

    Read the article

  • Too nervous to install

    - by The Prop
    Yesterday I (a professional rugby prop of somewhat limited intellect) landed in http://htmlagilitypack.codeplex.com/ and found myself stranded in a town with no signposts. The locals don't need signposts - they know their way around - so who gives a hoot about visitors? Well I'm a visitor and I'm lost. Here's my plea to the good burgesses of Codeplex-sans-signs: HELP!! Let me back-track and explain what landed me at the bottom of this tangled ruck. There's a "Download" button positioned near the top-right of the Codeplex web page, right? Like the Sword of Damocles, a down-arrow to the left of the button indicates, presumably, what a download would include: CURRENT 1.4.0 Stable DATE Fri May 7 2010 at 7:00 AM STATUS Stable With a simple-minded confidence that has since deserted me (the confidence - not the simple-mindedness), I clicked "Download". This introduced 3 new files to my computer: HtmlAgilityPack.dll, HtmlAgilityPack.pdb, and HtmlAgilityPack.XML This is when the first stab of doubt penetrated that globe between my cauliflower ears that I call a head. Where's the dot cs? Somewhere in Codeplex, I'd read advice to another lost soul to "download and build the HTMLAgilityPack solution". As I've done so many times as an All Black prop, I glared at the opposition front row - ah, I mean the 3 new files. Shouldn't one of them have a ".cs" on the back of his jersey - er, on the end of its name? Or is this just how they play the game in Codeplex-sans-signs? Undaunted (props have more courage than sense) I packed into my first C# scrum. The half-back feeds the ball in, and the front rows collapse - er, the debugging stops at this line of my code: "HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();" Then the Referee blows his whistle and announces one of those verdicts that's utterly indecipherable to your average loose-head prop: Locating source for 'C:\Source\htmlagilitypack\Trunk\HtmlAgilityPack\HtmlDocument.cs'. Checksum: MD5 {62 bc f3 7e 9a 92 a6 32 7 d6 5b f8 76 59 7b 5b} The file 'C:\Source\htmlagilitypack\Trunk\HtmlAgilityPack\HtmlDocument.cs' does not exist. Looking in script documents for 'C:\Source\htmlagilitypack\Trunk\HtmlAgilityPack\HtmlDocument.cs'... Looking in the projects for 'C:\Source\htmlagilitypack\Trunk\HtmlAgilityPack\HtmlDocument.cs'. The file was not found in a project. Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\vc7\atlmfc'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\vc7\crt'... The debugger will ask the user to find the file: C:\Source\htmlagilitypack\Trunk\HtmlAgilityPack\HtmlDocument.cs. The user pressed Cancel [a brain-stemmer from the prop] in the Find Source dialog. The debug source files settings for the active solution have been modified so that the debugger will not ask the user to find the file: C:\Source\htmlagilitypack\Trunk\HtmlAgilityPack\HtmlDocument.cs. The debugger could not locate the source file 'C:\Source\htmlagilitypack\Trunk\HtmlAgilityPack\HtmlDocument.cs'. Even if it had been the first 50 stanzas of "Eskimo Nell", I couldn't have been more shocked. I'm so shocked, my jaws clamp shut around the opposition hooker's ear. He thumbs me in the iris. With a cornea-torn eye I peer at the Codeplex site. My brain stem sparks and I punch the "View all downloads" link. It sparks four more times on each download link, and.. lo! FOUR files this time: HAPExplorer.zip, HtmlAgilityPack.1.4.0.Source.zip, HtmlAgilityPack.1.4.0.zip, HtmlAgilityPack.Documentation.chm But... is this not the same place arrived at recently by my flat-mate Chaz, journalist extraordinaire? (Chaz, if you're reading this, I'm not plugging for nothing - just write kindly about me in your next report, okay?) Didn't these same four files flummox Chaz The Great? He told me about it. Chaz left a message with Codeplex and then solved the problem by just walking away. Typical journalist, huh. But I'm not like that. I don't walk away. I'm made of the sort of stubborn stuff that becomes an All Black prop. Hence this impassioned plea: GOOD TOWNSFOLK OF CODEPLEX-SANS-SIGNS, WHAT SHOULD I DO NEXT? Can somebody point me to Main Street? How does a simpleton install 'C:\Source\htmlagilitypack\Trunk\HtmlAgilityPack\HtmlDocument.cs'? I'm willing to prostrate myself and grovel to the first kind face that passes in front of my rapidly clouding sight. So help me, I'd even tug my forelock if I had one! Should I hold forth my rod over the wilderness, and create a folder called 'C:\Source\htmlagilitypack\Trunk\HtmlAgilityPack\' or some such? If so, what files should I move into it? ANYTHING else a dum-ass should know about? - and I mean ANYTHING - you just don't know how witless a punch-drunk prop can be.. %( Whenever I've installed other programs they've given me an ".exe" or ".msi" that I can click on and it's all done for me like magic. HEY... there's nothing of that nature here, is there? Am I missing something? Something for dummies to click? (From the waiting rooms of Dr I. Sight Phixes) (signed) The Prop

    Read the article

  • Automatically support new changes with Python.

    - by Zachary Brown
    I was working on a program,that I need to support new additions. Hmmm. Let me give you some background on the program. It is an educational software program that has quizzes for the user to take, just to gain odd knowledge. Now, It currently supports 6 subjects, all organized with directores on the HDD ( i.e. the Science directory is called science. ) and the way you launch the subject to see what quizzes you have to take is by pushing a button on the home screen. This sort of thing prevents easy subject additions. I want to be able to add a subject later on without having to recode the home screen and re organize all the buttons. I would use a Listbox and os.listdir(...), but I was kind of wanting something prettier than a Listbox. I am using Tkinter on Windows. The Python version I am using is 2.6 Is there a "fancy" listbox sort of thing that can be styled to work with the background?

    Read the article

  • setup for prawn, prawnto on heroku

    - by daniel
    I'm trying to use prawn, prawnto for generating pdfs in a rails application hosted on heroku. But I'm struggling on the setup. Is it possible to use prawn, prawnto on heroku? Is there a guide explaining what I should do? Thanks

    Read the article

  • Rails Catch All Route URL Helpers?

    - by viatropos
    If I have a catch-all-route like this: match '*request_path' => "pages#show", :as => :page ...and the pages can be arbitrarily nested, how do I make it so I can use the url helper methods? If I have a page structure like this: /about /about/people /about/story /about/story/in-depth Then I want to be able to write page_path(@page) and get /about/story/in-depth for the hypothetical "In Depth Story" page. But instead I'm just getting /in-depth. If I override Page#to_param, and do something like this: def to_param result = "" if parent result << parent.to_param result << "/" end result << super end ... it returns an encoded string like this: /about%2Fstory%2Fin-depth Is there a way to make this work?

    Read the article

  • Modify an object without using it as parameter

    - by Claire Huang
    I have a global object "X" and a class "A". I need a function F in A which have the ability to modify the content of X. For some reason, X cannot be a data member of A (but A can contain some member Y as reference of X), and also, F cannot have any parameter, so I cannot pass X as an parameter into F. (Here A is an dialog and F is a slot without any parameter, such as accept() ) How can I modify X within F if I cannot pass X into it? Is there any way to let A know that "X" is the object it need to modify?? I try to add something such as SetItem to specify X in A, but failed.

    Read the article

  • How can I condense stand-alone characters in Perl?

    - by brydgesk
    I'm trying to identify and condense single (uppercase) characters in a string. For example: "test A B test" - "test AB test" "test A B C test" - "test ABC test" "test A B test C D E test" - "test AB test CDE test" I have it working for single occurrences (as in the first above example), but cannot figure out how to chain it for multiple occurrences. $str =~ s/ ([A-Z]) ([A-Z]) / \1\2 /g; I'll probably feel stupid when I see the solution, but I'm prepared for that. Thanks in advance.

    Read the article

  • Iterating through a directory with Ant

    - by Shaggy Frog
    Let's say I have a collection of PDF files with the following paths: /some/path/pdfs/birds/duck.pdf /some/path/pdfs/birds/goose.pdf /some/path/pdfs/insects/fly.pdf /some/path/pdfs/insects/mosquito.pdf What I'd like to do is generate thumbnails for each PDF that respect the relative path structure, and output to another location, i.e.: /another/path/thumbnails/birds/duck.png /another/path/thumbnails/birds/goose.png /another/path/thumbnails/insects/fly.png /another/path/thumbnails/insects/mosquito.png I'd like this to be done in Ant. Assume I'm going to use Ghostscript on the command line and I've already worked out the call to GS: <exec executable="${ghostscript.executable.name}"> <arg value="-q"/> <arg value="-r72"/> <arg value="-sDEVICE=png16m"/> <arg value="-sOutputFile=${thumbnail.image.path}"/> <arg value="${input.pdf.path}"/> </exec> So what I need to do is work out the correct values for ${thumbnail.image.path} and ${input.pdf.path} while traversing the PDF input directory. I have access to ant-contrib (just installed the "latest", which is 1.0b3) and I'm using Ant 1.8.0. I think I can make something work using the <for> task, <fileset>s and <mapper>s, but I am having trouble putting it all together. I tried something like: <for param="file"> <path> <fileset dir="${some.dir.path}/pdfs"> <include name="**/*.pdf"/> </fileset> </path> <sequential> <echo message="@{file}"/> </sequential> </for> But unfortunately the @{file} property is an absolute path, and I can't find any simple way of decomposing it into the relative components. If I can only do this using a custom task, I guess I could write one, but I'm hoping I can just plug together existing components.

    Read the article

  • Can I use the character ñ in a sub-domain?

    - by nute
    We are launching our website in Spanish and are probably going to call it espanol.mydomain.com Since the real spelling is español, ideally we would allow people to type español.mydomain.com. Is that something that is possible today? Can we use this character in domains and sub-domains?

    Read the article

  • Diaspora se pose comme solution libre face à Facebook, le réseau social aGPL et décentralisé a-t-il

    Diaspora se pose comme solution libre face à Facebook, le réseau social aGPL et décentralisé a-t-il une chance de succès ? Google n'est pas le seul à se faire des ennemis parmi les organisations européennes. Facebook est également dans leur ligne de mire avec sa politique "inacceptable" concernant la protection de la vie privée de ses utilisateurs. Le 12 mai, le groupe de travail 29 (du numéro de l'article concerné) de l'Union européenne -chargé de la protection des données personnelles- a publié une lettre ouverte qui attaque violemment le leader des réseaux sociaux (plus de 450 millions de membres dont 15 millions en France) en lui reprochant de monétiser les données qu'on lui confie (en laissant les moteurs de recherch...

    Read the article

  • how does public key cryptography work

    - by rap-uvic
    Hello, What I understand about RSA is that Alice can create a public and a private key combination, and then send the public key over to Bob. And then afterward Bob can encrypt something using the public key and Alice will use the public and private key combo to decrypt it. However, how can Alice encrypt something to be sent over to Bob? How would Bob decrypt it? I ask because I'm curious how when I log onto my banking site, my bank sends me data such as my online statements. How does my browser decrypt that information? I don't have the private key.

    Read the article

  • InternetReadFile() corrupting donwloads C

    - by Lienau
    I'm able to download text documents (.html, .txt, etc) but I can't download images or exe's. I'm pretty sure that this is because I'm using a char, and thoes files are binary. I know that in C# I would use a byte. But what data-type would I use in this case? char buffer[1]; DWORD dwRead; FILE * pFile; pFile = fopen(file,"w"); while (InternetReadFile(hRequest, buffer, 1, &dwRead)) { if(dwRead != 1) break; fprintf(pFile,"%s",buffer); } fclose(pFile);

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >