Search Results

Search found 6478 results on 260 pages for 'hippy head'.

Page 39/260 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • How can I use Awk inside a Perl script?

    - by papoyan
    I'm having trouble using the following code inside my Perl script, any advise is really appreciated, how to correct the syntax? # If I execute in bash, it's working just fine bash$ whois google.com | egrep "\w+([._-]\w)*@\w+([._-]\w)*\.\w{2,4}" |awk ' {for (i=1;i<=NF;i++) {if ( $i ~ /[[:alpha:]]@[[:alpha:]]/ ) { print $i}}}'|head -n1 [email protected] #----------------------------------- #but this doesn't work bash$ ./email.pl google.com awk: {for (i=1;i<=NF;i++) {if ( ~ /[[:alpha:]]@[[:alpha:]]/ ) { print }}} awk: ^ syntax error # Here is my script bash$ cat email.pl ####\#!/usr/bin/perl $input = lc shift @ARGV; $host = $input; my $email = `whois $host | egrep "\w+([._-]\w)*@\w+([._-]\w)*\.\w{2,4}" |awk ' {for (i=1;i<=NF;i++) {if ( $i ~ /[[:alpha:]]@[[:alpha:]]/ ) { print $i}}}'|head -1`; print my $email; bash$

    Read the article

  • Custom Tag Issue

    - by user1304570
    I got a problem in making custom tag in jsf2.0 for authentication.Actually I made a sample it get run successfully But When i am merging it with my project Its component class get skipped out.But When I remove Follwing entry from web.xml <context-param> <param-name> org.jboss.jbossfaces.JSF_CONFIG_NAME </param-name> <param-value>MyFaces-2.0</param-value> </context-param> It get run success fully .But It show a red line text in every page of my project i.e One or more resources have the target of 'head', but no 'head' component has been defined within the view.**

    Read the article

  • What's the advantage of an Adobe AIR app over a traditional desktop app?

    - by John
    I'm pretty familiar with using Adobe Flex & AS3, and compared with writing apps in JS/HTML I think it's very cool. However, since AIR is essentially a non-browser version of Flex with benefits like local storage, it seems to be competing as a cross-platform desktop application platform... and in that space it's much less mature than more established desktop technologies. So what's the advantage of creating a desktop application using AIR compared to something like Java (or C++ using a cross-platform GUI library like wxWidgets)? Java's equally capable of communicating with the server for instance, I'm not quite sure what AIR adds when competing head-to-head in the desktop development world?

    Read the article

  • jquery function inside .ready

    - by phil
    Could anyone tell me why 'function()' right after .ready is needed to make the script work? <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button type="button">Click me</button> </body> </html>

    Read the article

  • What is wrong with selecting with my drop down element.

    - by Babiker
    <html> <head> <script type='text/javascript' language='javascript' src="http://localhost/javascript/jquery-1.4.2.js"> </script> <script type='text/javascript' language='javascript'> $(document).ready(function(){ $("#button").mousedown(function(){ dropDownMenu = $("#dropDownMenu"); alert(dropDownMenu.options[0].text); }); }); </script> </head> <body> <select id="dropDownMenu"><option>Test</option></select><br> <input id="button" type="button"> </body> </html>

    Read the article

  • get iframe property and content

    - by zeroSeven
    is there a way to get the iframe properties and content and be able to display it? example: type it as Rich Text Editor on the iframe and it will be displayed as<b>Rich Text Editor</b> on some part of the page. Rich Text Editor == <b>Rich Text Editor</b> thank you in advance. <html> <head> <title>Rich Text Editor</title> </head> <script type="text/javascript"> function def() { document.getElementById("textEditor").contentWindow.document.designMode="on"; textEditor.document.open(); textEditor.document.write('<head><style type="text/css">body{ font-family:arial; font-size:13px;}</style></head>'); textEditor.document.close(); document.getElementById("fonts").selectedIndex=0; document.getElementById("size").selectedIndex=1; document.getElementById("color").selectedIndex=0; } function fontEdit(x,y) { document.getElementById("textEditor").contentWindow.document.execCommand(x,"",y); textEditor.focus(); } </script> <body onLoad="def()"> <center> <div style="width:500px; text-align:left; margin-bottom:10px "> <input type="button" id="bold" style="height:21px; width:21px; font-weight:bold;" value="B" onClick="fontEdit('bold')" /> <input type="button" id="italic" style="height:21px; width:21px; font-style:italic;" value="I" onClick="fontEdit('italic')" /> <input type="button" id="underline" style="height:21px; width:21px; text-decoration:underline;" value="U" onClick="fontEdit('underline')" /> | <input type="button" style="height:21px; width:21px;"value="L" onClick="fontEdit('justifyleft')" title="align left" /> <input type="button" style="height:21px; width:21px;"value="C" onClick="fontEdit('justifycenter')" title="center" /> <input type="button" style="height:21px; width:21px;"value="R" onClick="fontEdit('justifyright')" title="align right" /> | <select id="fonts" onChange="fontEdit('fontname',this[this.selectedIndex].value)"> <option value="Arial">Arial</option> <option value="Comic Sans MS">Comic Sans MS</option> <option value="Courier New">Courier New</option> <option value="Monotype Corsiva">Monotype</option> <option value="Tahoma">Tahoma</option> <option value="Times">Times</option> </select> <select id="size" onChange="fontEdit('fontsize',this[this.selectedIndex].value)"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <select id="color" onChange="fontEdit('ForeColor',this[this.selectedIndex].value)"> <option value="black">-</option> <option style="color:red;" value="red">-</option> <option style="color:blue;" value="blue">-</option> <option style="color:green;" value="green">-</option> <option style="color:pink;" value="pink">-</option> </select> | <input type="button" style="height:21px; width:21px;"value="1" onClick="fontEdit('insertorderedlist')" title="Numbered List" /> <input type="button" style="height:21px; width:21px;"value="?" onClick="fontEdit('insertunorderedlist')" title="Bullets List" /> <input type="button" style="height:21px; width:21px;"value="?" onClick="fontEdit('outdent')" title="Outdent" /> <input type="button" style="height:21px; width:21px;"value="?" onClick="fontEdit('indent')" title="Indent" /> </div> <iframe id="textEditor" style="width:500px; height:170px;"> </iframe> </center> </body>

    Read the article

  • Fake Template Engine php

    - by user1464822
    i got an idea for making php template engine fast and user friendly but i'm not sure if it's good or bad. the idea is to create a fake template engine: creating a template editor in control panel that let user see something like this: <html> <head> <title>{title}</title> </head> <body> {content} </body> </html> what the editor actually does is to replace all php code like <?php echo $this->title; ?> to user friendly {title} but it's not really replacing it just in the view when the user save the template the template actually saved as fast pure php template. the question is this a good idea or bad ? your answers is highly appreciated.

    Read the article

  • What is the CSS equivalent for the style of this table?

    - by user1451890
    I really would like to use the layout of this table, but how can I bring this up to CSS standards of its equivalent into HTML5? <html> <head></head> <body> <table border="1" bordercolor="#000000" style="background-color:#ffffff" width="100%" cellpadding="3" cellspacing="1"> <tr> <td>Table Cell</td> <td>Table Cell</td> <td>Table Cell</td> </tr> </table> </body> </html>

    Read the article

  • How to call AJAX API function from Windows App?

    - by stiopa
    Some company is providing me with web-based API for using their services. I have no problem calling this API functions from within web brower: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="http://someaddress.com?&key=somekey"></script> <script type="text/javascript"> var object = new SomeObject(); object.SomeFunction(); </script> </head> I am interested in return value of SomeFunction(). How would I get this return value from windows application?

    Read the article

  • Game network physics collision

    - by Jonas Byström
    How to simulating two client-controlled vehicles colliding (sensibly) in a typical client/server setup for a network game? I did read this eminent blog post on how to do distributed network physics in general (without traditional client prediction), but this question is specifically on how to handle collisions of owned objects. Example Say client A is 20 ms ahead of server, client B 300 ms ahead of server (counting both latency and maximum jitter). This means that when the two vehicles collide, both clients will see the other as 320 ms behind - in the opposite direction of the velocity of the other vehicle. Head-to-head on a Swedish highway means a difference of 16 meters/17.5 yards! What not to try It is virtually impossible to extrapolate the positions, since I also have very complex vehicles with joints and bodies all over, which in turn have linear and angular positions, velocities and accelerations, not to mention states from user input.

    Read the article

  • I am trying to make a simple toggle button in javascript.

    - by CDeanMartin
    I am trying to make a simple toggle button in javascript. However, the button will only turn "OFF" and will not turn back "ON" <html><head></head> <script type="text/javascript"> function toggle(button) { if(document.getElementById("1").value=="OFF"){ document.getElementById("1").value="ON";} if(document.getElementById("1").value=="ON"){ document.getElementById("1").value="OFF";} } </script> <body> <form action=""> <input type="button" id="1" value="ON" style="color:blue" onclick="toggle(this);"> </form></body></html> I am running:HP Netbook : Ubuntu Linux 10.04 : Firefox for Ubuntu 1.0.

    Read the article

  • Jquery .load and inner jquery .append

    - by speekeazy
    Hello, Ive just started using jquery for the .load ajax functionality. When i load an external page to a specific div it loads fine. inside the external page there is an .append that .appends javascript to the head. This works on the initial load but when i use .load to load it this portion is not showing. //This is the .load for the div function loadContent(elementSelector, sourceUrl) { url = ""+sourceUrl+""; $(""+elementSelector+"").load(url); alert(url); } //This is the append in the other page that is embedded in a js var cUrl = "http://intensedebate.com/js/genericCommentWrapper2.php?acct="+idcomments_acct+"&postid="+idcomments_post_id+"&title="+idcomments_post_title+"&url="+idcomments_post_url; alert(cUrl); commentScript.type = "text/javascript"; commentScript.src = cUrl; $('head').append(commentScript);

    Read the article

  • Singly-Linked Lists insert_back and isIncreasing

    - by rezivor
    I just finished writing a program that I can add, remove or print objects to a list, but I am having difficulty implementing two more functions that is insert_back, which inserts a value to the end of a list. Also,I have to modify the representation of a List and alter whatever methods are necessary to make insert_back run in constant time: O(1). This new operation should have the signature: void List::insert_back( const Object& data ); Also, isIncreasing, For example, for a list containing head-() (11) (8) (15) (3), isIncreasing() should return false. However, it would return true when working on a list containing head- () (7) (9) (15). This new operation should have the signature: bool List::isIncreasing() const; Thank you

    Read the article

  • Firefox Back Button is occaisionally breaking the back button.

    - by Webjedi
    Having a really frustrating time with Firefox and the back button...given this simple ASP form: <head> <title>Form 1</title> </head> <body> <form action="form2.asp" method="post"> Enter some text:<input type="text" name="thetext" id="thetext"> <input type="submit" id="submit" name="submit"> </form> </body> </html> Firefox (3.6.3) will occasionally clear the value of the text box after hitting submit and then the back button. It's unpredictable when it will strike. And it will work for dozens to hundreds of times, and then all of a sudden it stops working. Any ideas where I should start?

    Read the article

  • drawImage don't work on chrome extention

    - by shrwea
    I use canvas drawImage in popup.html. But it doesn't work. Please advise me. popup.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> </head> <body> <canvas id="test"></canvas> <script src="test.js"></script> </body> </html> test.js var image = document.createElement("img"); image.src = "test.png"; image.onload = function(){ var canvas = document.getElementById('test'); var ctx = canvas.getContext('2d'); ctx.drawImage(image, 0, 0); }

    Read the article

  • add .js file as source in html file from server

    - by zeeshan
    I have an HTML file on my server, and a Javascript file on the same server. I want it so that when I load the HTML file, it will the reference of .js file placed on the server. I tried this way: <html> <head> <script type="text/javascript src="...server side path...."></script> </head> </html> but it is not working. Can any one tell me how I can do this?

    Read the article

  • Simple nested setTimeout() only runs once (JavaScript)

    - by danielfaraday
    For some reason my galleryScroll() function only runs once, even though the function calls itself using setTimeout(). I'm thinking the issue may be related to scope, but I'm not sure: http://jsfiddle.net/CYEBC/2/ $(document).ready(function() { var x = $('#box').offset().left; var y = $('#box').offset().top; galleryScroll(); function galleryScroll() { x = x + 1; y = y + 1; $('#box').offset({ left: x, top: y }); setTimeout('galleryScroll()', 100); } });? The HTML: <html> <head> </head> <body> <div id="box"> </div> </body> </html>

    Read the article

  • Firefox running infinitely even after condition met in jquery function

    - by Kyle
    The following function is called with setTimeout(function () { get_progress(fileID,fileName)},8000); upon a form submit. The purpose of the function is to get read_file.php to read a txt file that stores the file upload status from a form (in percentage). Upon reaching 80%, my Firefox seems to run infinitely even when HEAD returns an error. Am I have too many recursions or have I used a wrong condition that's causing get_progress to run repeatedly even when filename does not exist in the folder ? function get_progress( fileID, filename) { $.ajax({ url: filename, type: 'HEAD', success: function() { $.ajax({ type: 'POST', url: 'read_file.php', data: 'filename=' +filename, success: function(html) { document.getElementById(fileID).innerHTML = html + ' <img src="images/loading.gif" />' setInterval(function() {get_progress(fileID,filename)},4000); } }); } });}

    Read the article

  • Get an array of forms in java script using prototype

    - by Saurabh
    My document contains more than one forms. How can I get an array of all forms using prototype? <html> <head></head> <body> <form id="form1"> <!-- Other stuffs here --> </form> <form id="form2"> <!-- Other stuffs here --> </form> <form id="form3"> <!-- Other stuffs here --> </form> </body> </html>

    Read the article

  • setting up linked list Java

    - by erp
    I'm working on some basic linked list stuff, like insert, delete, go to the front or end of the list, and basically i understand the concept of all of that stuff once i have the list i guess but im having trouble setting up the list. I was wondering of you guys could tell me if im going in the right direction. (mostly just the setup) this is what i have so far: public class List { private int size; private List linkedList; List head; List cur; List next; /** * Creates an empty list. * @pre * @post */ public List(){ linkedList = new List(); this.head = null; cur = head; } /** * Delete the current element from this list. The element after the deleted element becomes the new current. * If that's not possible, then the element before the deleted element becomes the new current. * If that is also not possible, then you need to recognize what state the list is in and define current accordingly. * Nothing should be done if a delete is not possible. * @pre * @post */ public void delete(){ // delete size--; } /** * Get the value of the current element. If this is not possible, throw an IllegalArgumentException. * @pre the list is not empty * @post * @return value of the current element. */ public char get(){ return getItem(cur); } /** * Go to the last element of the list. If this is not possible, don't change the cursor. * @pre * @post */ public void goLast(){ while (cur.next != null){ cur = cur.next; } } /** * Advance the cursor to the next element. If this is not possible, don't change the cursor. * @pre * @post */ public void goNext(){ if(cur.next != null){ cur = cur.next;} //else do nothing } /** * Retreat the cursor to the previous element. If this is not possible, don't change the cursor. * @pre * @post */ public void goPrev(){ } /** * Go to top of the list. This is the position before the first element. * @pre * @post */ public void goTop(){ } /** * Go to first element of the list. If this is not possible, don't change the cursor. * @pre * @post */ public void goFirst(){ } /** * Insert the given parameter after the current element. The newly inserted element becomes the current element. * @pre * @post * @param newVal : value to insert after the current element. */ public void insert(char newVal){ cur.setItem(newVal); size++; } /** * Determines if this list is empty. Empty means this list has no elements. * @pre * @post * @return true if the list is empty. */ public boolean isEmpty(){ return head == null; } /** * Determines the size of the list. The size of the list is the number of elements in the list. * @pre * @post * @return size which is the number of elements in the list. */ public int size(){ return size; } public class Node { private char item; private Node next; public Node() { } public Node(char item) { this.item = item; } public Node(char item, Node next) { this.item = item; this.next = next; } public char getItem() { return this.item; } public void setItem(char item) { this.item = item; } public Node getNext() { return this.next; } public void setNext(Node next) { this.next = next; } } } I got the node class alright (well i think it works alright), but is it necessary to even have that class? or can i go about it without even using it (just curious). And for example on the method get() in the list class can i not call that getItem() method from the node class because it's getting an error even though i thought that was the whole point for the node class. bottom line i just wanna make sure im setting up the list right. Thanks for any help guys, im new to linked list's so bear with me!

    Read the article

  • Ruby ActiveRecord + Mongrel going slow

    - by stel
    I have a class like this: class Router :: Mongrel::HttpHandler def process(req, res) status, header, body = [200, {"Content-type"="text/html"}, Model.all.to_xml] res.start(status) do |head, out| header.each_pair { |key, value| head[key] = value } out.write body end end end It's an server and I use an ActiveResource front end on the other side. Every 3rd request is very slow (about 5 seconds, 1st and 2nd is ok, about 0.01 sec). The problem in Model.all.to_xml (it is ActiveRecord - SQLite). Why it is too slow? It only happens when I use it in Mongrel::HttpHandler.. This 100.times do a = Time.now Car.all.to_xml puts "#{Time.now - a}" sleep(1) end is always works good.

    Read the article

  • Change URL of a saved HTML file

    - by Paul Camilleri
    I am new to HTML so this question might sound a bit lame. Anyways I have a saved webpage on my desktop that when i open it in google chrome i want it to show a specific URL instead of its current location. Any ideas how i might get this to work? I tried using the history.pushState but i have no idea why it is not working. I created a simple page for now to test it: <html> <head> <script> function setURL() { history.pushState("Test","page2", "www.test.com"); } </script> </head> <body> <button type="button" onclick="setURL()">Set Url</button> </body> </html> Any help would be greatly appreciated. Thank you

    Read the article

  • External files (css, js) in embedded jetty

    - by user1938185
    With jetty, you can easily produce "html" response importing external file like : <head> <link rel="stylesheet" type="text/css" href="myStyle.css"> <script src="myScript.js"></script> <head> However, where do you put myStyle.css and myScript.js, when jetty is embedded? Especially when the jetty server is a large OpenSource project not written by you? Is there by any chance a nice out.println(???); in the servlet.doGet that would provide the answer, or something similar?

    Read the article

  • Removing an element from an array (PHP)

    - by morpheous
    I want to remove an element from a PHP array (and shrink the array size). Just looking at the PHP docs, it seems this can be done using array_slice() and array_merge() so I am guessing (off the top of my head) that some combination of array_merge() and array_slice will work. However, array_slice() requires an index (not a key), so I'm not sure how to quickly cobble these functions together for a solution. Has anyone implemented such a function before?. I'm sure it must be only a few lines long, but I cant somehow get my head around it (its been one of those days) ... Actually, I just came up with this cheesy hack when writing up this question.... function remove_from_array(array $in, value) { return array_diff($in, (array)$value); } too ugly? or will it work (without any shocking side effects)?

    Read the article

  • jquery add either of two fields to form

    - by user2891182
    I have worked out how to add a field to a form through JQuery but cannot figure out how to have two add field buttons so I can add one or the other fields? Could someone lead me in the right direction? <html> <head> <title>jQuery add / remove textbox example</title> <script type="text/javascript" src="jquery-1.3.2.min.js"></script> <style type="text/css"> div{ padding:8px; } </style> </head> <body> <h1>jQuery add / remove textbox example</h1> <script type="text/javascript"> $(document).ready(function(){ var counter = 2; $("#addButton").click(function () { if(counter>10){ alert("Only 10 textboxes allow"); return false; } var newTextBoxDiv = $(document.createElement('div')) .attr("id", 'TextBoxDiv' + counter); newTextBoxDiv.after().html('<label>Textbox #'+ counter + ' : </label>' + '<input type="text" name="textbox' + counter + '" id="textbox' + counter + '" value="" >'); newTextBoxDiv.appendTo("#TextBoxesGroup"); counter++; }); $("#removeButton").click(function () { if(counter==1){ alert("No more textbox to remove"); return false; } counter--; $("#TextBoxDiv" + counter).remove(); }); $("#getButtonValue").click(function () { var msg = ''; for(i=1; i<counter; i++){ msg += "\n Textbox #" + i + " : " + $('#textbox' + i).val(); } alert(msg); }); }); </script> </head><body> <div id='TextBoxesGroup'> <div id="TextBoxDiv1"> <label>Textbox #1 : </label><input type='textbox' id='textbox1' > </div> </div> --I am trying to have a use click on either of these two buttons and have the appropriate field added next.-- <input type='button' value='Add field #01' id='addButton'> <input type='button' value='Add field #02' id='addButton'> <input type='button' value='Remove Last Field' id='removeButton'> </body> </html>

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >