Search Results

Search found 33 results on 2 pages for 'karlthorwald'.

Page 1/2 | 1 2  | Next Page >

  • How do I install LFE on Ubuntu Karmic?

    - by karlthorwald
    Erlang was already installed: $dpkg -l|grep erlang ii erlang 1:13.b.3-dfsg-2ubuntu2 Concurrent, real-time, distributed function ii erlang-appmon 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP application monitor ii erlang-asn1 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP modules for ASN.1 support ii erlang-base 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP virtual machine and base applica ii erlang-common-test 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP application for automated testin ii erlang-debugger 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP application for debugging and te ii erlang-dev 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP development libraries and header [... many more] Erlang seems to work: $ erl Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.7.4 (abort with ^G) 1> I downloaded lfe from github and checked out 0.5.2: git clone http://github.com/rvirding/lfe.git cd lfe git checkout -b local0.5.2 e207eb2cad $ configure configure: command not found $ make mkdir -p ebin erlc -I include -o ebin -W0 -Ddebug +debug_info src/*.erl #erl -I -pa ebin -noshell -eval -noshell -run edoc file src/leex.erl -run init stop #erl -I -pa ebin -noshell -eval -noshell -run edoc_run application "'Leex'" '"."' '[no_packages]' #mv src/*.html doc/ Must be something stupid i missed :o $ sudo make install make: *** No rule to make target `install'. Stop. $ erl -noshell -noinput -s lfe_boot start {"init terminating in do_boot",{undef,[{lfe_boot,start,[]},{init,start_it,1},{init,start_em,1}]}} Crash dump was written to: erl_crash.dump init terminating in do_boot () Is there an example how I would create a hello world source file and compile and run it?

    Read the article

  • How to get an outline view in sublime texteditor?

    - by karlthorwald
    How do I get an outline view in sublime code editor for Windos? http://www.sublimetext.com/ The minimap is helpful but I miss a traditional outline (a klickable list of all the functions in my code in the order they appear for quick navigation and orientation) Maybe there is a plugin, addon or similar? It would also be nice if you can shortly name which steps are neccesary to make it work. There is a duplicate of this question here: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=993&p=4308&sid=1a162626960826ab21861f1203f64ec5#p4308

    Read the article

  • A better JavaScript version of addslashes and stripslashes?

    - by karlthorwald
    I am using these 2 functions: http://javascript.about.com/library/bladdslash.htm But JSLint complains 'Bad Escapement' on this line: str=str.replace(/\\0/g,'\0'); [Edit] I converted to 2 lines, and now the first line is the one that fails JLint: var rep = '\0'; str=str.replace(/\\0/g,rep); So it is the '\0' can you help? I could try something but I want to understand what is going on. [/Edit] Can you make a better version and explain? I would like a version that passes JSLint and still works.

    Read the article

  • What does JSLint's "Bad Escapement" mean in this case?

    - by karlthorwald
    I thougth "bad escapement" stands for wrong use escaping with slash. Why does JSLint bring up the message in this function on the 3d line (for...) ? function splitTags(commaSeparated) { var tagArray = commaSeparated.split(','); for (var i=tagArray.length - 1; i>=0; --i ){ tagArray[i] = f.trim(tagArray[i]); } return tagArray; }

    Read the article

  • How to upload a file with watir and IE?

    - by karlthorwald
    I am writing a watir script to test an upload form. But the script does not automatically choose the file that is to be uploaded from my harddrive. Instead IE stops with the file chooser dialog open. As soon as I manually select the to be uploaded file in the dialog and click ok, watir continues as desired. I wonder why it stops. This is from my watir script: ie.file_field(:name, 'upload').set("s:\\localwatir\\Test_Pdf.pdf") ie.button(:name, 'submit').click I got the code from this page: http://wiki.openqa.org/display/WTR/File+Uploads This is the form: <form name="form1" enctype="multipart/form-data" method="post" action="uploadlegacy.php"> <input type="file" name="upload" size="30"> <input type="submit" name="submit" value="upload"> </form> I have found this manual http://svn.openqa.org/svn/watir/trunk/watir/unittests/filefield_test.rb also, but as I do not know what $htmlRoot stands for, I cannot really follow it. Does that mean, I have to put some "file///" into the parameter for set()? If so, how exactly? I am using IE 6 for the testing.

    Read the article

  • JSON stringify standalone function for JavaScript

    - by karlthorwald
    I know of YUI who has a JSON.stringify utility and also of JSON2 from json.org. What are other good implementations of JSON.stringify? It should also work in IE6, IE7 and not depend on a framework. If it depends on anything this should be easily included all in one file. Edit: I could easily use jquery-json, which was suggested in the comments of the accepted answer. It did what I wanted. (It depends on jquery but that was easily solved)

    Read the article

  • How to create small SPACES in HTML?

    - by karlthorwald
    There is em dash and en dash. Is there an "en" equivalent to &nbsp; ? Is there an en equivalent to pure Ascii 32? I want a better way to write this: 123<span class="spanen">&nbsp;</span>456<span class="spanen">&nbsp;</span>789 or this: 123<span class="spanen"> </span>456<span class="spanen"> </span>789

    Read the article

  • How can I put double quotes inside a string within an ajax JSON response from php?

    - by karlthorwald
    I receive a JSON response in an Ajax request from the server. This way it works: { "a" = "1", "b" = "hello 'kitty'" } But I did not succeed in putting double quotes around kitty. When I convert " to \x22 in the Ajax response, it is still interpreted as " by JavaScript and I cannot parse the JSON. Should I also escape the \ and unescape later (which would be possible)? How to do this? Edit: I am not sure if i expressed it well: I want this string inside of "b" after the parse: hello "kitty" If necessary I could also add an additional step after the parse to convert "b", but I guess it is not necessary, there is a more elegant way so this happens automatically? Edit2: The ajax page is generated by php. I tried several things now to create the value of b, all result in JSON parse error on the page: $b = 'hello "kitty"'; // no 1: //$b = str_replace('"',"\x22",$b); // or no 2: // $b = addslashes($b); // or no 3: //$b = str_replace('"','\"',$b); // or no 4: $b = str_replace('"','\\"',$b); echo '"b" : "' . $b . '"';

    Read the article

  • How to write this JavaScript code without eval?

    - by karlthorwald
    How to write this JavaScript code without eval? var typeOfString = eval("typeof " + that.modules[modName].varName); if (typeOfString !== "undefined") { doSomething(); } The point is that the name of the var that I want to check for is in a string. Maybe it is simple but I don't know how. Edit: Thank you for the very interesting answers so far. I will follow your suggestions and integrate this into my code and do some testing and report. Could take a while. Edit2: I had another look at the could and maybe itis better I show you a bigger picture. I am greatful for the experts to explain so beautiful, it is better with more code: MYNAMESPACE.Loader = ( function() { function C() { this.modules = {}; this.required = {}; this.waitCount = 0; this.appendUrl = ''; this.docHead = document.getElementsByTagName('head')[0]; } function insert() { var that = this; //insert all script tags to the head now! //loop over all modules: for (var modName in this.required) { if(this.required.hasOwnProperty(modName)){ if (this.required[modName] === 'required') { this.required[modName] = 'loading'; this.waitCount = this.waitCount + 1; this.insertModule(modName); } } } //now poll until everything is loaded or //until timout this.intervalId = 0; var checkFunction = function() { if (that.waitCount === 0) { clearInterval(that.intervalId); that.onSuccess(); return; } for (var modName in that.required) { if(that.required.hasOwnProperty(modName)){ if (that.required[modName] === 'loading') { var typeOfString = eval("typeof " + that.modules[modName].varName); if (typeOfString !== "undefined") { //module is loaded! that.required[modName] = 'ok'; that.waitCount = that.waitCount - 1; if (that.waitCount === 0) { clearInterval(that.intervalId); that.onSuccess(); return; } } } } } }; //execute the function twice a second to check if all is loaded: this.intervalId = setInterval(checkFunction, 500); //further execution will be in checkFunction, //so nothing left to do here } C.prototype.insert = insert; //there are more functions here... return C; }()); var myLoader = new MYNAMESPACE.Loader(); //some more lines here... myLoader.insert();

    Read the article

  • How to organize integrity tests and code unit tests?

    - by karlthorwald
    I have several files with code testing code (which uses a "unittest" class). Later I found it would be nice to test database integrity also. I put this into a separate directory tree. (Things like the keys have correct format, parent and child nodes are pointing correctly and such.) I use the same unittest class for the integrity tests. Now I wonder if it makes really sense to keep this separate. To test the integrity of data I often duplicate parts of code that I use to test the code that handles the data. But it is not the same. The code tests use test databases (that get deleted after each test) and the integrity tests connect to the live data and analyze it. The integrity tests I want to call from cron and send an alarm if something happens in the live database. How would you handle that? Are there standards for such a setup? What is your experience? My tendency is to put everything in the same file, which would result in the code tests also being executed by the cron on the production environment.

    Read the article

  • Should I go vor Arrays or Objects in PHP in a CouchDB/Ajax app?

    - by karlthorwald
    I find myself converting between array and object all the time in PHP application that uses couchDB and Ajax. Of course I am also converting objects to JSON and back (for sometimes couchdb but mostly Ajax), but this is not so much disturbing my workflow. At the present I have php objects that are returned by the CouchDB modules I use and on the other hand I have the old habbit to return arrays like array("error"="not found","data"=$dataObj) from my functions. This leads to a mixed occurence of real php objects and nested arrays and I cast with (object) or (array) if necessary. The worst thing is that I know more or less by heart what a function returns, but not what type (array or object), so I often run into type errors. My plan is now to always cast arrays to objects before returning from a function. Of course this implies a lot of refactoring. Is this the right way to go? What about the conversion overhead? Other ideas or tips? Edit: Kenaniah's answer suggests I should go the other way, this would mean I'd cast everything to arrays. And for all the Ajax / JSON stuff and also for CouchDB I would use $myarray = json_decode($json_data,$assoc = false) Even more work to change all the CouchDB and Ajax functions but in the end I have better code.

    Read the article

  • How to organize live data integrity tests and code unit tests?

    - by karlthorwald
    I have several files with code testing code (which uses a "unittest" class). Later I found it would be nice to test database integrity also. I put this into a separate directory tree. (Things like the keys have correct format, parent and child nodes are pointing correctly and such.) I use the same unittest class for the integrity tests. Now I wonder if it makes really sense to keep this separate. To test the integrity of data I often duplicate parts of code that I use to test the code that handles the data. But it is not the same. The code tests use test databases (that get deleted after each test) and the integrity tests connect to the live data and analyze it. The integrity tests I want to call from cron and send an alarm if something happens in the live database. How would you handle that? Are there standards for such a setup? What is your experience? My tendency is to put everything in the same file, which would result in the code tests also being executed by the cron on the production environment.

    Read the article

  • Module based web project directory layout with git and symlinks

    - by karlthorwald
    I am planning my directory structure for a linux/apache/php web project like this: Only www.example.com/webroot/ will be exposed in apache www.example.com/ webroot/ index.php module1/ module2/ modules/ module1/ module1.class.php module1.js module2/ module2.class.php module2.css lib/ lib1/ lib1.class.php the modules/ and lib/ directory will only be in the php path. To make the css and js files visible in the webroot directory I am planning to use symlinks. webroot/ index.php module1/ module1.js (symlinked) module2/ module2.css (symlinked) I tried following these principles: layout by modules and libraries, not by file type and not by "public' or 'non public', index.php is an exception. This is for easier development. symlinking files that need to be public for the modules and libs to a public location, but still mirroring the layout. So the module structure is also visible in the resulting html code in the links, which might help development. How will git handle the symlinking of the single files correctly, is there something to consider? When it comes to images I will need to link directories, how to handle that with git? modules/ module3/ module3.class.php img/ img1.jpg img2.jpg img3.jpg They should be linked here: webroot/ module3/ img/ (symlinked ?) So this is a git and symlink question. But I would be interested to hear comments about the php layout, maybe you want to use the comment function for this.

    Read the article

  • How to move an element in a sorted list and keep the CouchDb write "atomic"

    - by karlthorwald
    I have elements of a list in couchdb documents. Let's say these are 3 elements in 3 documents: { "id" : "783587346", "type" : "aList", "content" : "joey", "sort" : 100.0 } { "id" : "358734ff6", "type" : "aList", "content" : "jill", "sort" : 110.0 } { "id" : "abf587346", "type" : "aList", "content" : "jack", "sort" : 120.0 } A view retrieves all "aList" documents and displays them sorted by "sort". Now I want to move the elements, when I want to move "jack" to the middle, I could do this atomic in one write and change it's sort key to 105.0. The view now returns the documents in the new sort order. After a lot of sorting I could end up with sort keys like 50.99999 and 50.99998 after some years and in extreme situations run out of digits? What can you recommend, is there a better way to do this? I'd rather keep the elements in seperate documents. Different users might edit different elements in parallel (which also can get tricky). Maybe there is a much better way?

    Read the article

  • How can I put double quotes inside a string within an ajax JSON response?

    - by karlthorwald
    I receive a JSON response in an Ajax request from the server. This way it works: { "a" = "1", "b" = "hello 'kitty'" } But I did not succeed in putting double quotes around kitty. When I convert " to \x22 in the Ajax response, it is still interpreted as " by JavaScript and I cannot parse the JSON. Should I also escape the \ and unescape later (which would be possible)? How to do this? Edit: I am not sure if i expressed it well: I want this string inside of "b" after the parse: hello "kitty" If necessary I could also add an additional step after the parse to convert "b", but I guess it is not necessary, there is a more elegant way so this happens automatically?

    Read the article

  • How do I get the id or name of an element in watir?

    - by karlthorwald
    Watir can find a text on a page: <span id="i1" name="n1>Some Text</span> e.text.include?("Some Text") But how can I get the name or id of the span, when I only know "Some Text" e.text.findInPage("Some Text").parentElement.id (should be "i1") e.text.findInPage("Some Text").parentElement.name (should be "n1"); Something like this exists in watir?

    Read the article

  • Cannot select radio button that was added by JavaScript in watir

    - by karlthorwald
    This was added to the page later with jQuery: <input name="pdfRadio" id="pdfRadioNo0" value="0" type="radio"> This code: radio_id = "pdfRadioNo0" ie.radio(:id, radio_id).set() does not set it but returns an error message: Watir::Exception::UnknownObjectException: Unable to locate element, using {:id=>"pdfRadioNo0"} Does watir also find radio butons that were added later? This is windows 32bit XP SP 3 , IE 7, watir 1.6.5, ruby 1.8.6

    Read the article

  • Should I go for Arrays or Objects in PHP in a CouchDB/Ajax app?

    - by karlthorwald
    I find myself converting between array and object all the time in PHP application that uses couchDB and Ajax. Of course I am also converting objects to JSON and back (for sometimes couchdb but mostly Ajax), but this is not so much disturbing my workflow. At the present I have php objects that are returned by the CouchDB modules I use and on the other hand I have the old habbit to return arrays like array("error"="not found","data"=$dataObj) from my functions. This leads to a mixed occurence of real php objects and nested arrays and I cast with (object) or (array) if necessary. The worst thing is that I know more or less by heart what a function returns, but not what type (array or object), so I often run into type errors. My plan is now to always cast arrays to objects before returning from a function. Of course this implies a lot of refactoring. Is this the right way to go? What about the conversion overhead? Other ideas or tips? Edit: Kenaniah's answer suggests I should go the other way, this would mean I'd cast everything to arrays. And for all the Ajax / JSON stuff and also for CouchDB I would use $myarray = json_decode($json_data,$assoc = true); //EDIT: changed to true, whcih is what I really meant Even more work to change all the CouchDB and Ajax functions but in the end I have better code.

    Read the article

  • What are the typical reasons Javascript developed on Firefox fails on IE?

    - by karlthorwald
    I developed some javascript enhanced pages that run fine on recent Firefox and Safari. I missed to check in Internet Explorer, and now I find the pages don't work on IE 6 and 7 (so far). The scripts are somehow not executed, the pages show as if javascript wasn't there, although some javascript is executed. I am using own libraries with dom manipulation, from YUI 2 I use YUI-Loader and the XML-Http-Request, and on one page I use "psupload", which depends on JQuery. I am installing Microsoft Script Editor from Office XP and will now debug. I will also write specific tests now. What are the typical failing points of IE? What direction I can keep my eyes open. I found this page, which shows some differences: http://www.quirksmode.org/compatibility.html Can you from your experience name some typical things I should look for first? I will also ask more questions here for specific tasks later, but for now I am interested in your experience why IE usually fails on scripts that run fine in Firefox

    Read the article

  • PHP Object conversion question

    - by karlthorwald
    I am converting from JSON to object and from object to array. It does not what I expected, can you explain to me? $json = '{"0" : "a"}'; $obj = json_decode($json); $a = (array) $obj; print_r($a); echo("a0:".$a["0"]."<br>"); $b = array("0" => "b"); print_r($b); echo("b0:".$b["0"]."<br>"); The output here is: Array ( [0] => a ) a0: Array ( [0] => b ) b0:b I would have expected a0:a at the end of the first line.

    Read the article

  • How to build a test group in watir?

    - by karlthorwald
    I have some single watir.rb scripts that use IE and are written in a standard watir way. How do I create a test group that combines them? I want all of them be executed by executing the main script. Is it possible to auto include single test files into a test group by subidr? Is it possible to enumerate the files that should be included in the test group? Can I cascade (include other watir test groups in a watir test group)?

    Read the article

  • How to move a branch backwards in git?

    - by karlthorwald
    The title is not very clear. What I actually need to do often is the following: Let's say I have a development going on with several commits c1,c2,... and 3 branches A,B,C c1--c2--c3--(B)--c4--(A,C) Branch A and C are at the same commit. Now I want branch A to go back where B is, so that it loks like this: c1--c2--c3--(A,B)--c4--(C) Important is that this has to happen locally and on github. Sorry for my bad git speak, I hope I can make clear what it is.

    Read the article

  • [solved] Why can't I dynamically add lines to a HTML table using JavaScript in Internet Explorer?

    - by karlthorwald
    After many hours of debugging I am tired, maybe you can help me now to solve this: In a new Firefox it works, in my Internet Explorer 6 or 7 it doesn't: <html> <head> <script type="text/javascript"> function newLine() { var tdmod = document.createElement('td'); tdmod.appendChild(document.createTextNode("dynamic")); var tr = document.createElement('tr'); tr.appendChild(tdmod); var tt = document.getElementById("t1"); tt.appendChild(tr); } </script> </head> <body> <a href="#" onclick="newLine()">newLine</a> <table id="t1" border="1"> <tr> <td> static </td> </tr> </table> </body> You can klick on the link and new lines should be added to the table. Try it here: http://dl.dropbox.com/u/1508092/iejs.html#

    Read the article

  • Component based web project directory layout with git and symlinks

    - by karlthorwald
    I am planning my directory structure for a linux/apache/php web project like this: Only www.example.com/webroot/ will be exposed in apache www.example.com/ webroot/ index.php comp1/ comp2/ component/ comp1/ comp1.class.php comp1.js comp2/ comp2.class.php comp2.css lib/ lib1/ lib1.class.php the component/ and lib/ directory will only be in the php path. To make the css and js files visible in the webroot directory I am planning to use symlinks. webroot/ index.php comp1/ comp1.js (symlinked) comp2/ comp2.css (symlinked) I tried following these principles: layout by components and libraries, not by file type and not by "public' or 'non public', index.php is an exception. This is for easier development. symlinking files that need to be public for the components and libs to a public location, but still mirroring the layout. So the component and library structure is also visible in the resulting html code in the links, which might help development. git usage should be safe and always work. it would be ok to follow some procedure to add a symlink to git, but after that checking them out or changing branches should be handled safely and clean How will git handle the symlinking of the single files correctly, is there something to consider? When it comes to images I will need to link directories, how to handle that with git? component/ comp3/ comp3.class.php img/ img1.jpg img2.jpg img3.jpg They should be linked here: webroot/ comp3/ img/ (symlinked ?) If using symlinks for that has disadvantages maybe I could move images to the webroot/ tree directly, which would break the first principle for the third (git practicability). So this is a git and symlink question. But I would be interested to hear comments about the php layout, maybe you want to use the comment function for this.

    Read the article

  • Does watir's browser.text.include? count text inside invisible divs? If so, how to search only for v

    - by karlthorwald
    Does watir's browser.text.include? count text inside invisible divs? If so, how to search only for visible text? I put all the instructions into the html from the beginning and use jQuery to hide and unhide the relevant parts. How can I use watir's waiter to wait for only text that is visible? My problem is, that the waiter always returns true, even before I have shown a certain text.

    Read the article

1 2  | Next Page >