Search Results

Search found 922 results on 37 pages for 'h2'.

Page 7/37 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Disabling the right-click sub menu using JQuery

    - by nikolaosk
    Recently I needed to disable the right-click contextual menu in an HTML page for a very simple HTML application I was creating for a friend.This is going to be a short post where I will demonstrate how to disable the right-click contextual menu.I will use the very popular JQuery Library. Please download the library (minified version) from http://jquery.com/downloadPlease find here all my posts regarding JQuery.In this hands-on example I will be using Expression Web 4.0.This application is not a free application. You can use any HTML editor you like.You can use Visual Studio 2012 Express edition. You can download it here. I am going to create a very simple HTML 5 page with some text and an image. The HTML markup for the page follows. <!DOCTYPE html><html lang="en">  <head>    <title>HTML 5, CSS3 and JQuery</title>        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >    <link rel="stylesheet" type="text/css" href="style.css">     <script type="text/javascript" src="jquery-1.8.2.min.js">        </script><script type="text/javascript"> (function ($) { $(document).bind('contextmenu', function () { return false;}); })(jQuery); </script>       </head>  <body>      <div id="header">      <h1>Learn cutting edge technologies</h1>      <h2>HTML 5, JQuery, CSS3</h2>    </div>      <figure>  <img src="html5.png" alt="HTML 5"></figure>        <div id="main">          <h2>HTML 5</h2>                        <article>          <p>            HTML5 is the latest version of HTML and XHTML. The HTML standard defines a single language that can be written in HTML and XML. It attempts to solve issues found in previous iterations of HTML and addresses the needs of Web Applications, an area previously not adequately covered by HTML.          </p>          </article>      </div>             </body>  </html> This is the JQuery code, I use (function ($) { $(document).bind('contextmenu', function () { return false;}); })(jQuery); I simply disable/cancel the contextmenu event.When I load the simple page on the browser and I right-click the context menu does not appear.Hope it helps!!!

    Read the article

  • flickr api advice

    - by sico87
    Hi There, I am working with the API from flickr trying to get my photosets into my site, my problem is I am wanting to only show the primary image for each set but current it is showing all the images from each of my sets. Can anyone see where I am going wrong? <?php $f = new phpFlickr(FLICKR_API_KEY); $f->enablecache("fs", $_SERVER['DOCUMENT_ROOT']. '/../system/cache'); $result = $f->people_findByusername(FLICKR_USERNAME); $user = $result['id']; $photosets = $f->photosets_getList($user); $count = 1; foreach ($photosets['photoset'] as $ph_set): ?> <li> <h2>Images</h2> <h2>Videos</h2> <?php $photoset_id = $ph_set['id']; $photos = $f->photosets_getPhotos($photoset_id); foreach ($photos['photoset']['photo'] as $photo): ?> <a rel="lightbox[album<?=$count;?>]" href="<?= $f->buildPhotoURL($photo, 'medium') ?>" title="<?= $photo['title'] ?>"> <img src="<?= $f->buildPhotoURL($photo, 'rectangle') ?>" alt="<?= $photo['title'] ?>" width="210" height="160" title="<?= $photo['title'] ?>" /> <h3><?=$ph_set['title']?></h3> <p><?=$ph_set['description'];?></p> </a> <?php endforeach; ?> </li> <?php $count++; ?> <?php endforeach; ?>

    Read the article

  • IHttpAsyncHandler and IObservable web requests

    - by McLovin
    Within Async handler I'm creating an IObservable from webrequest which returns a redirect string. I'm subscribing to that observable and calling AsyncResult.CompleteCall() but I'm forced to use Thread.Sleep(100) in order to get it executed. And it doesn't work every time. I'm pretty sure this is not correct. Could you please shine some light. Thank you! public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object state) { _context = context; _ar = new AsyncResult(cb, state); _tweet = context.Request["tweet"]; string url = context.Request["url"]; if(String.IsNullOrEmpty(_tweet) || String.IsNullOrEmpty(url)) { DisplayError("<h2>Tweet or url cannot be empty</h2>"); return _ar; } _oAuth = new oAuthTwitterRx(); using (_oAuth.AuthorizationLinkGet().Subscribe(p => { _context.Response.Redirect(p); _ar.CompleteCall(); }, exception => DisplayError("<h2>Unable to connect to twitter, please try again</h2>") )) return _ar; } public class AsyncResult : IAsyncResult { private AsyncCallback _cb; private object _state; private ManualResetEvent _event; private bool _completed = false; private object _lock = new object(); public AsyncResult(AsyncCallback cb, object state) { _cb = cb; _state = state; } public Object AsyncState { get { return _state; } } public bool CompletedSynchronously { get { return false; } } public bool IsCompleted { get { return _completed; } } public WaitHandle AsyncWaitHandle { get { lock (_lock) { if (_event == null) _event = new ManualResetEvent(IsCompleted); return _event; } } } public void CompleteCall() { lock (_lock) { _completed = true; if (_event != null) _event.Set(); } if (_cb != null) _cb(this); } }

    Read the article

  • Tagging translated text correctly (tagging with lang="")

    - by toomanyairmiles
    A client has asked me to add some polish text to their website, not having much experience in this area, can anyone tell me which of the two 'lang' solutions below is correct (or offer an alternative):- Tag everything:- <div lang="pl"> <h2 lang="pl">Najlepszy ruch jaki zrobisz!</h2> <p lang="pl">Do przyszlych najemców:</p> <p lang="pl">Tutaj w SPS mamy bogate doswiadczenie na rynku najmu i wyszukiwaniu domu, który bedzie idealnym miejscem dla przyszlych lokatorów. Dla wielu moze to byc trudne i stresujace, dlatego my w SPS pomozemy Wam przejsc przez pole minowe zwiazane z najmem i uczynic ten proces najprostszym i najszybszym jak to mozliwe.</p> <p lang="pl">Jesli szukasz nieruchomosci obecnie lub w najblizszej przyszlosci prosimy o kontakt z naszym doswiadczonym , przyjaznym i pomocnym personelem, a my postaramy sie pomóc znalezc Ci idealne miejsce, które jest wlasnie dla Ciebie.</p> <p lang="pl">Wiec aby w latwy sposób wynajac zadzwon juz dzis.</p> </div> Just tag the div <div lang="pl"> <h2>Najlepszy ruch jaki zrobisz!</h2> <p>Do przyszlych najemców:</p> <p>Tutaj w SPS mamy bogate doswiadczenie na rynku najmu i wyszukiwaniu domu, który bedzie idealnym miejscem dla przyszlych lokatorów. Dla wielu moze to byc trudne i stresujace, dlatego my w SPS pomozemy Wam przejsc przez pole minowe zwiazane z najmem i uczynic ten proces najprostszym i najszybszym jak to mozliwe.</p> <p>Jesli szukasz nieruchomosci obecnie lub w najblizszej przyszlosci prosimy o kontakt z naszym doswiadczonym , przyjaznym i pomocnym personelem, a my postaramy sie pomóc znalezc Ci idealne miejsce, które jest wlasnie dla Ciebie.</p> <p>Wiec aby w latwy sposób wynajac zadzwon juz dzis.</p> </div>

    Read the article

  • problem getting info from a cookie with javascript

    - by Jason
    I am having an issue with my cookies and I can't figure it out. Basically I have it set up so it checks for the cookie to see if the user is logged in, and then displays either a welcome message or a login link. It works - except that instead of returning the persons name in the welcome message it just is blank where the name should be. The cookie is there, with all the appropriate info.. not sure what I am doing wrong. var itm = new Array(); itm[0] = findCookie("ui"); if (itm[0] == null) { document.write("<h2><a href='logreg.html'>Log In or Sign Up</a></h2>"); } else { var c1 = itm[0].indexOf(","); var c2 = itm[0].indexOf(",",c1); var c3 = itm[0].indexOf(",",c2); var gname = itm[0].substring(c2,c3); document.write("<h2>Welcome "+gname+"!</h2>"); } The findCookie function is.. function findCookie(val){ var cookie = null; var findVal = val + "="; var dc = document.cookie; if (dc.length > 0) { var start = dc.indexOf(findVal); if (start >= 0) { start += findVal.length; lastVal = dc.indexOf(";", start); if (lastVal == -1) { lastVal = dc.length; } cookie = (dc.substring(start, lastVal)); } else { return cookie; } } return cookie; }

    Read the article

  • Why are my descenders being cut off when using CSS @font-face?

    - by Olly Hodgson
    I'm using the Google webfonts API to embed Droid Sans on a page. All is fine, except for the descenders (i.e. the dangly bits on y, g, etc). The latest versions of Firefox, IE and Chrome on my Windows Vista box are all cutting the bottom off. <!DOCTYPE html> <html> <head> <title>Droid sans descender test</title> <meta charset="utf-8"> <link href="http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold" rel="stylesheet" type="text/css"> <style type="text/css"> body { font-size: 16px; font-family: "Droid Sans"sans-serif; } h1, h2, h3 { margin: 1em 0; font-weight: normal; } h1 { font-size: 2em; } h2 { font-size: 1.5em; } h3 { font-size: 1em; } </style> </head> <body> <h1>A bug ran under the carpet anyway</h1> <h2>A bug ran under the carpet anyway</h2> <h3>A bug ran under the carpet anyway</h3> </body> </html> The above code looks like this: I've tried line-height, font-size, padding etc to no avail. I had some success with font-size-adjust, but the last time I checked it was Gecko only. Does anybody know of a fix for this?

    Read the article

  • How should I go about implementing a points-to analysis in Maude?

    - by reprogrammer
    I'm going to implement a points-to analysis algorithm. I'd like to implement this analysis mainly based on the algorithm by Whaley and Lam. Whaley and Lam use a BDD based implementation of Datalog to represent and compute the points-to analysis relations. The following lists some of the relations that are used in a typical points-to analysis. Note that D(w, z) :- A(w, x),B(x, y), C(y, z) means D(w, z) is true if A(w, x), B(x, y), and C(y, z) are all true. BDD is the data structure used to represent these relations. Relations input vP0 (variable : V, heap : H) input store (base : V, field : F, source : V) input load (base : V, field : F, dest : V) input assign (dest : V, source : V) output vP (variable : V, heap : H) output hP (base : H, field : F, target : H) Rules vP(v, h) :- vP0(v, h) vP(v1, h) :- assign(v1, v2), vP(v2, h) hP(h1, f,h2) :- store(v1, f, v2), vP(v1, h1), vP(v2, h2) vP(v2, h2) :- load(v1, f, v2), vP(v1, h1), hP(h1, f, h2) I need to understand if Maude is a good environment for implementing points-to analysis. I noticed that Maude uses a BDD library called BuDDy. But, it looks like that Maude uses BDDs for a different purpose, i.e. unification. So, I thought I might be able to use Maude instead of a Datalog engine to compute the relations of my points-to analysis. I assume Maude propagates independent information concurrently. And this concurrency could potentially make my points-to analysis faster than sequential processing of rules. But, I don't know the best way to represent my relations in Maude. Should I implement BDD in Maude myself, or Maude's internal unification based on BDD has the same effect?

    Read the article

  • XmlSlurper/NekoHTML document fragment parsing - No HTML or BODY tags wanted

    - by Misha Koshelev
    Dear All, I am trying to parse the following HTML fragment, and I would like to get the same fragment as output (without HTML and BODY tags). Is this possible? If so, how? Thank you Misha p.s. I am reading here: http://nekohtml.sourceforge.net/faq.html#fragments and I believe I have added the correct options below. However, the output is still incorrect :( Thank you Misha import groovy.xml.MarkupBuilder import groovy.xml.StreamingMarkupBuilder import groovy.util.XmlNodePrinter import groovy.util.slurpersupport.NodeChild def text=""" <div><h2>Test</h2> <div>Hi</div> </div> """ // Parse def config=new org.cyberneko.html.HTMLConfiguration() config.setFeature("http://cyberneko.org/html/features/balance-tags/document-fragment",true) def html=new XmlSlurper(new org.cyberneko.html.parsers.SAXParser()).parseText(text) // Output def printNode(NodeChild node) { def writer = new StringWriter() writer << new StreamingMarkupBuilder().bind { mkp.declareNamespace('':node[0].namespaceURI()) mkp.yield node } new XmlNodePrinter().print(new XmlParser().parseText(writer.toString())) } printNode(html) Output: <HTML> <tag0:HEAD xmlns:tag0="http://www.w3.org/1999/xhtml"/> <BODY> <DIV> <H2> Test </H2> <DIV> Hi </DIV> </DIV> </BODY> </HTML>

    Read the article

  • Jquery .html() function returns html out of nested order

    - by forcripesake
    I have a method which returns a persisted html template from a database. The template is of the format: <div id="item_collection"> <div id="item_x"> <p id="item_x_headline"><h2>Some Headline</h2></p> <p id="item_x_excerpt>Some text here</p> </div> <div id="item_x+1"> <p id="item_x+1_headline"><h1>Some Headline</h1></p> <p id="item_x+1_excerpt>Some text here</p> </div> ...and so on. </div> However after I run the following: alert(data); //check that the template is in order. It Is. $('#template_area').html(data); the Html is now: <div id="item_collection"> <div id="item_x"> <p id="item_x_headline"></p> <!--Note The Lack of Nesting --> <h2>Some Headline</h2> <p id="item_x_excerpt>Some text here</p> </div> <div id="item_x+1"> <p id="item_x+1_headline"></p> <!--Note The Lack of Nesting --> <h1>Some Headline</h1> <p id="item_x+1_excerpt>Some text here</p> </div> ...and so on. </div> So what gives? Is there a better way to replace the empty template_area's content than the .html() method?

    Read the article

  • How do I Emit Escaped XML representation of a Node in my XSLT's HTML Output

    - by Emmanuel
    I'm transforming XML to an HTML document. In this document I want to embed XML markup for a node that was just transformed (the HTML document is a technical spec). For example, if my XML was this: <transform-me> <node id="1"> <stuff type="floatsam"> <details>Various bits</details> </stuff> </node> </transform-me> I'd want my XSLT output to look something like this: <h1>Node 1</h1> <h2>Stuff (floatsam)</h2> Various bits <h2>The XML</h2> &lt;stuff type=&quot;floatsam&quot;&gt; &lt;details&gt;Various bits&lt;/details&gt; &lt;/stuff&gt; I'm hoping there is an XSLT function that I can call in my <stuff> template to which I can pass the current node (.) and get back escaped XML markup for <stuff> and all its descendants. I have a feeling unparsed-text() might be the way to go but can't get it to work.

    Read the article

  • Completely bizarre Firefox CSS bug

    - by Jason
    I've been doing front end development for a long time, and I have NEVER come across a bug like this before... Save the following HTML to a file and view it in Firefox (mine is 3.6.3): <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> body { font-family: Helvetica, Sans-Serif;} h2 {font-weight: normal;} </style> </head> <body> <h2>Some normal text <strong>some bold text</strong> weird huh?</h2> </body> </html> If you don't want to give it a shot the output is like your cat walked across your keyboard while character map was turned on, except in the strong tags. I feel like this may be a font issue? When I get rid of font-weight: normal it goes back to normal, but I don't want everything to be bolded in my h2... Anyone have any ideas? More importantly, is anyone able to reproduce this?? Thanks.

    Read the article

  • innerHTML doesn't work correctly with xhtml in Chrome

    - by Desperadeus
    Hi! I've got a trouble with Chrome5.0.375.70, but FF 3.6.3 and Opera 10.53 are OK. Below is the line of code: document.getElementById('content').innerHTML = data.documentElement.innerHTML; The data object from the code is a document (typeof(data) == 'object') and I've got it by ajax request to chapter01.xhtml: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html [ <!ENTITY D "&#x2014;"> <!ENTITY o "&#x2018;"> <!ENTITY c "&#x2019;"> <!ENTITY O "&#x201C;"> <!ENTITY C "&#x201D;"> ]> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Alice's Adventures in Wonderland by Lewis Carroll. Chapter I: Down the Rabbit-Hole</title> <link rel="stylesheet" type="text/css" href="style.css"/> <link rel="stylesheet" type="application/vnd.adobe-page-template+xml" href="page-template.xpgt"/> </head> <body> <div class="title_box"> <h2 class="chapnum">Chapter I</h2> <h2 class="chaptitle">Down the Rabbit-Hole</h2> <hr/> </div> The Chrome cuts all before body and as a result link to css in header is missed; user can't see formatted text and images. How can I fix it or bypass?

    Read the article

  • Drupal6: How to programmatically style a block?

    - by Fronker
    In Drupal6, I basically have a block (a hierarchical menu structure) that turns out like this in HTML: <div class="block block-menu_block" id="block-menu_block-1"> <div class="content"> <div class="menu-block-1 menu-name-menu-navigation parent-mlid-0 menu-level-1"> <ul class="menu"> <li class="leaf first menu-mlid-248 active active-trail"><a class="active-trail active" title="" href="/">Start</a></li> <li class="expanded menu-mlid-249 active"><a class="active" title="" href="/">Aktuell</a> <ul class="menu"> <li class="leaf first menu-mlid-259"> <a title="News und Presse" href="/news-und-presse">News and Press</a> </li>... What I would like to get is actually a lot simpler: <div id="topmenu"> <ul class="one"> <li>some main entry <ul> <li> some sub entry ... or maybe: <div id="topmenu"> <h2>some main entry</h2> <h3><a href="#">some sub entry</a></h3> <h3><a href="#">another sub entry</a></h3> <h2>another main entry</h2> So, keeping the structure, but being able to use simpler, even completely different tags, if and when needed. I think I understand from the drupal docs, that I am (maybe) looking at <div class="block block-menu_block" id="block-menu_block-1" ==> module := menu_block delta := 1 (?) regrettably, none of the suggested * block-[module]-[delta].tpl.php * block-[module].tpl.php * block-[region].tpl.php placed next to page.tpl.php has any impact (yes, I did clear the cache).

    Read the article

  • Making text align equally in both IE and Chrome

    - by bobo
    <style type="text/css"> h2{ font-size:13px; line-height:16px; color:#000000; margin:0; padding:6px 22px; font-family: 'Times New Roman'; } div{ border:1px solid black; } </style> <div> <h2> ????????</h2> </div> Pasting the above codes here: http://htmledit.squarefree.com/ You will see that the text stays a little bit higher in the div in IE than in Chrome, I would like to make them consistent. By adding a &nbsp; after the text within the <h2>in IE, the text will automatically move up, which is consistent with Chrome. But I don't quite like this hack, so I would like to know if anybody knows what problem this is and recommends a better way to fix it if possible. Many thanks to you all. Note: this problem does not appear if the text is english only.

    Read the article

  • Are there any thead limitations that make it not print on each page in Firefox?

    - by SeanJA
    I have a table that has a <thead>, a <tfoot> and a <tbody>. It is supposed to print the thead and tfoot on each page in theory, but for some reason the thead does not if it contains certain elements together. This works: <thead> <tr> <td colspan="3">This works</td> <tr> <tr> <th colspan="2">column 1</th> <th> column 2 </th> </tr> </thead> This does not seem to work: <thead> <tr> <td colspan="3"> <h2>Header</h2> <address> <strong>address 1</strong> <br /> address 2 <br /> address 3 <br /> </address> <img src="/images/logo.png" alt="Logo" /> <h2>Another header</h2> <hr /> </td> </tr> <tr> <th colspan="2">column 1</th> <th> column 2 </th> </tr> </thead> Is there a reason for this not to work?

    Read the article

  • uploading image & getting back from database

    - by Anup Prakash
    Putting a set of code which is pushing image to database and fetching back from database: <!-- <?php error_reporting(0); // Connect to database $errmsg = ""; if (! @mysql_connect("localhost","root","")) { $errmsg = "Cannot connect to database"; } @mysql_select_db("test"); $q = <<<CREATE create table image ( pid int primary key not null auto_increment, title text, imgdata longblob, friend text) CREATE; @mysql_query($q); // Insert any new image into database if (isset($_POST['submit'])) { move_uploaded_file($_FILES['imagefile']['tmp_name'],"latest.img"); $instr = fopen("latest.img","rb"); $image = addslashes(fread($instr,filesize("latest.img"))); if (strlen($instr) < 149000) { $image_query="insert into image (title, imgdata,friend) values (\"". $_REQUEST['title']. "\", \"". $image. "\",'".$_REQUEST['friend']."')"; mysql_query ($image_query) or die("query error"); } else { $errmsg = "Too large!"; } $resultbytes=''; // Find out about latest image $query = "select * from image where pid=1"; $result = @mysql_query("$query"); $resultrow = @mysql_fetch_assoc($result); $gotten = @mysql_query("select * from image order by pid desc limit 1"); if ($row = @mysql_fetch_assoc($gotten)) { $title = htmlspecialchars($row[title]); $bytes = $row[imgdata]; $resultbytes = $row[imgdata]; $friend=$row[friend]; } else { $errmsg = "There is no image in the database yet"; $title = "no database image available"; // Put up a picture of our training centre $instr = fopen("../wellimg/ctco.jpg","rb"); $bytes = fread($instr,filesize("../wellimg/ctco.jpg")); } if ($resultbytes!='') { echo $resultbytes; } } ?> <html> <head> <title>Upload an image to a database</title> </head> <body bgcolor="#FFFF66"> <form enctype="multipart/form-data" name="file_upload" method="post"> <center> <div id="image" align="center"> <h2>Heres the latest picture</h2> <font color=red><?php echo $errmsg; ?></font> <b><?php echo $title ?></center> </div> <hr> <h2>Please upload a new picture and title</h2> <table align="center"> <tr> <td>Select image to upload: </td> <td><input type="file" name="imagefile"></td> </tr> <tr> <td>Enter the title for picture: </td> <td><input type="text" name="title"></td> </tr> <tr> <td>Enter your friend's name:</td> <td><input type="text" name="friend"></td> </tr> <tr> <td><input type="submit" name="submit" value="submit"></td> <td></td> </tr> </table> </form> </body> </html> --> Above set of code has one problem. The problem is whenever i pressing the "submit" button. It is just displaying the image on a page. But it is leaving all the html codes. even any new line message after the // Printing image on browser echo $resultbytes; //************************// So, for this i put this set of code in html tag: This is other sample code: <!-- <?php error_reporting(0); // Connect to database $errmsg = ""; if (! @mysql_connect("localhost","root","")) { $errmsg = "Cannot connect to database"; } @mysql_select_db("test"); $q = <<<CREATE create table image ( pid int primary key not null auto_increment, title text, imgdata longblob, friend text) CREATE; @mysql_query($q); // Insert any new image into database if (isset($_POST['submit'])) { move_uploaded_file($_FILES['imagefile']['tmp_name'],"latest.img"); $instr = fopen("latest.img","rb"); $image = addslashes(fread($instr,filesize("latest.img"))); if (strlen($instr) < 149000) { $image_query="insert into image (title, imgdata,friend) values (\"". $_REQUEST['title']. "\", \"". $image. "\",'".$_REQUEST['friend']."')"; mysql_query ($image_query) or die("query error"); } else { $errmsg = "Too large!"; } $resultbytes=''; // Find out about latest image $query = "select * from image where pid=1"; $result = @mysql_query("$query"); $resultrow = @mysql_fetch_assoc($result); $gotten = @mysql_query("select * from image order by pid desc limit 1"); if ($row = @mysql_fetch_assoc($gotten)) { $title = htmlspecialchars($row[title]); $bytes = $row[imgdata]; $resultbytes = $row[imgdata]; $friend=$row[friend]; } else { $errmsg = "There is no image in the database yet"; $title = "no database image available"; // Put up a picture of our training centre $instr = fopen("../wellimg/ctco.jpg","rb"); $bytes = fread($instr,filesize("../wellimg/ctco.jpg")); } } ?> <html> <head> <title>Upload an image to a database</title> </head> <body bgcolor="#FFFF66"> <form enctype="multipart/form-data" name="file_upload" method="post"> <center> <div id="image" align="center"> <h2>Heres the latest picture</h2> <?php if ($resultbytes!='') { // Printing image on browser echo $resultbytes; } ?> <font color=red><?php echo $errmsg; ?></font> <b><?php echo $title ?></center> </div> <hr> <h2>Please upload a new picture and title</h2> <table align="center"> <tr> <td>Select image to upload: </td> <td><input type="file" name="imagefile"></td> </tr> <tr> <td>Enter the title for picture: </td> <td><input type="text" name="title"></td> </tr> <tr> <td>Enter your friend's name:</td> <td><input type="text" name="friend"></td> </tr> <tr> <td><input type="submit" name="submit" value="submit"></td> <td></td> </tr> </table> </form> </body> </html> --> ** But in this It is showing the image in format of special charaters and digits. 1) So, Please help me to print the image with some HTML code. So that i can print it in my form to display the image. 2) Is there any way to convert the database image into real image, so that i can store it into my hard-disk and call it from tag? Please help me.

    Read the article

  • How SQLite on Android handles long strings?

    - by Levara
    I'm wondering how Android's implementation of SQLite handles long Strings. Reading from online documentation on sqlite, it said that strings in sqlite are limited to 1 million characters. My strings are definitely smaller. I'm creating a simple RSS application, and after parsing a html document, and extracting text, I'm having problem saving it to a database. I have 2 tables in database, feeds and articles. RSS feeds are correctly saved and retrieved from feeds table, but when saving to the articles table, logcat is saying that it cannot save extracted text to it's column. I don't know if other columns are making problems too, no mention of them in logcat. I'm wondering, since text is from an article on web, are signs like (",',;) creating problems? Is Android automaticaly escaping them, or I have to do that. I'm using a technique for inserting similar to one in notepad tutorial: public long insertArticle(long feedid, String title, String link, String description, String h1,tring h2, String h3, String p, String image, long date) { ContentValues initialValues = new ContentValues(); initialValues.put(KEY_FEEDID, feedid); initialValues.put(KEY_TITLE, title); initialValues.put(KEY_LINK, link); initialValues.put(KEY_DESCRIPTION, description ); initialValues.put(KEY_H1, h1 ); initialValues.put(KEY_H2, h2); initialValues.put(KEY_H3, h3); initialValues.put(KEY_P, p); initialValues.put(KEY_IMAGE, image); initialValues.put(KEY_DATE, date); return mDb.insert(DATABASE_TABLE_ARTICLES,null, initialValues); } Column P is for extracted text, h1, h2 and h3 are for headers from a page. Logcat reports only column p to be the problem. The table is created with following statement: private static final String DATABASE_CREATE_ARTICLES = "create table articles( _id integer primary key autoincrement, feedid integer, title text, link text not null, description text," + "h1 text, h2 text, h3 text, p text, image text, date integer);";

    Read the article

  • urllib2.Request() with data returns empty url

    - by Mr. Polywhirl
    My main concern is the function: getUrlAndHtml() If I manually build and append the query to the end of the uri, I can get the response.url(), but if I pass a dictionary as the request data, the url does not come back. Is there anyway to guarantee the redirected url? In my example below, if thisWorks = True I get back a url, but the returned url is the request url as opposed to a redirect link. On a sidenote, the encoding for .E2.80.93 does not translate to - for some reason? #!/usr/bin/python import pprint import urllib import urllib2 from bs4 import BeautifulSoup from sys import argv URL = 'http://en.wikipedia.org/w/index.php?' def yesOrNo(boolVal): return 'yes' if boolVal else 'no' def getTitleFromRaw(page): return page.strip().replace(' ', '_') def getUrlAndHtml(title, printable=False): thisWorks = False if thisWorks: query = 'title={:s}&printable={:s}'.format(title, yesOrNo(printable)) opener = urllib2.build_opener() opener.addheaders = [('User-agent', 'Mozilla/5.0')] response = opener.open(URL + query) else: params = {'title':title,'printable':yesOrNo(printable)} data = urllib.urlencode(params) headers = {'User-agent':'Mozilla/5.0'}; request = urllib2.Request(URL, data, headers) response = urllib2.urlopen(request) return response.geturl(), response.read() def getSoup(html, name=None, attrs=None): soup = BeautifulSoup(html) if name is None: return None return soup.find(name, attrs) def setTitle(soup, newTitle): title = soup.find('div', {'id':'toctitle'}) h2 = title.find('h2') h2.contents[0].replaceWith('{:s} for {:s}'.format(h2.getText(), newTitle)) def updateLinks(soup, url): fragment = '#' for a in soup.findAll('a', href=True): a['href'] = a['href'].replace(fragment, url + fragment) def writeToFile(soup, filename='out.html', indentLevel=2): with open(filename, 'wt') as out: pp = pprint.PrettyPrinter(indent=indentLevel, stream=out) pp.pprint(soup) print('Wrote {:s} successfully.'.format(filename)) if __name__ == '__main__': def exitPgrm(): print('usage: {:s} "<PAGE>" <FILE>'.format(argv[0])) exit(0) if len(argv) == 2: help = argv[1] if help == '-h' or help == '--help': exitPgrm() if False:''' if not len(argv) == 3: exitPgrm() ''' page = 'Led Zeppelin' # argv[1] filename = 'test.html' # argv[2] title = getTitleFromRaw(page) url, html = getUrlAndHtml(title) soup = getSoup(html, 'div', {'id':'toc'}) setTitle(soup, page) updateLinks(soup, url) writeToFile(soup, filename)

    Read the article

  • ASP.NET MVC is not displaying the image

    - by Pinu
    <asp:Conte nt ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <%-- <h2>Notes</h2> <% Html.RenderPartial("~/Views/Shared/UserControl/Notes.ascx",Model.Notes); %> <br /> <h2>User Tracking Informtaion</h2> <% Html.RenderPartial("~/Views/Shared/UserControl/Tracking.ascx",Model.Log); %>--%> <div> <% for (int i = 1; i <= ViewData.Model.SelectedDocument.DocumentPages ; i++) { %> <br /> <img src="<%=DocuvaultMVC.Helpers.AppHelper.PDFUrl(ViewData.Model.SelectedDocument.DocumentID,i)%>" alt="Document" width="612" height="792" /> <%}%> <div> </div> </div> public static string PDFUrl(int id, int page) { return VirtualPathUtility.ToAbsolute("~/ViewDocument.aspx/" + id + "/" + page); }

    Read the article

  • Can I attach data gathered by a form to a file that is being uploaded?

    - by Jacob
    I need customers to upload files to my website and I want to gather their name or company name and attach it to the file name or create a folder on the server with that as the name so we can keep the files organized. Using PHP to upload file PHP: if(isset($_POST['submit'])){ $target = "upload/"; $file_name = $_FILES['file']['name']; $tmp_dir = $_FILES ['file']['tmp_name']; try{ if(!preg_match('/(jpe?g|psd|ai|eps|zip|rar|tif?f|pdf)$/i', $file_name)) { throw new Exception("Wrong File Type"); exit; } move_uploaded_file($tmp_dir, $target . $file_name); $status = true; } catch (Exception $e) { $fail = true; } } Other PHPw/form: <form enctype="multipart/form-data" action="" method="post"> input type="hidden" name="MAX_FILE_SIZE" value="1073741824" /> label for="file">Choose File to Upload </label> <br />input name="file" type="file" id="file" size="50" maxlength="50" /><br /> input type="submit" name="submit" value="Upload" /> php if(isset($status)) { $yay = "alert-success"; echo "<div class=\"$yay\"> <br/> <h2>Thank You!</h2> <p>File Upload Successful!</p></div>"; } if(isset($fail)) { $boo = "alert-error"; echo "<div class=\"$boo\"> <br/> <h2>Sorry...</h2> <p>There was a problem uploading the file.</p><br/><p>Please make sure that you are trying to upload a file that is less than 50mb and an acceptable file type.</p></div>"; }

    Read the article

  • Font alignment problem in webkit based browsers

    - by Mike
    Here is the code: <style type="text/css"> html, body {font:0.9em/1.2em arial, verdana, helvetica, sans-serif;} #todayOn {background-color:#efefef; repeat-x top left;border-bottom:1px solid #ddd;border-top:1px solid #ddd;height:52px;margin:15px 0;} #todayOn #pageTitle {float:left;padding-left:3px;} #todayOn #pageTitle h2 {color:#feb425;font-size:32px;margin:10px 0 0 0;padding:0;} #todayOn #pageTitle h2 em {color:#7498c0;display:block;font-size:14px;font-style:italic;font-weight:normal;line-height:20px;padding:5px 0 0 0;} </style> <div id="todayOn"> <div id="pageTitle"> <h2>TODAY <em>on this page.com</em></h2> </div> </div> In Firefox, IE (6+), Opera, etc. the subheader "on this page.com" displays vertically how I want it to. In Webkit browsers like Chrome and Safari, it's pushed down a couple more pixels. What's the prob? Thanks.

    Read the article

  • Excel VBA creating a new column with formula

    - by Amatya
    I have an excel file with a column which has date data. I want the user to input a date of their choosing and then I want to create a new column that lists the difference in days between the two dates. The Macro that I have is working but I have a few questions and I would like to make it better. Link to MWE small data file is here. The user input date was 9/30/2013, which I stored in H20 Macro: Sub Date_play() Dim x As Date Dim x2 As Date Dim y As Variant x = InputBox(Prompt:="Please enter the Folder Report Date. The following formats are acceptable: 4 1 2013 or April 1 2013 or 4/1/2013") x2 = Range("E2") y = DateDiff("D", x2, x) MsgBox y 'Used DateDiff above and it works but I don't know how to use it to fill a column or indeed a cell. Range("H20").FormulaR1C1 = x Range("H1").FormulaR1C1 = "Diff" Range("H2").Formula = "=DATEDIF(E2,$H$20,""D"")" Range("H2").AutoFill Destination:=Range("H2:H17") Range("H2:H17").Select End Sub Now, could I have done this without storing the user input date in a particular cell? I would've preferred to use the variable "x" in the formula but it wasn't working for me. I had to store the user input in H20 and then use $H$20. What's the difference between the function Datedif and the procedure DateDiff? I am able to use the procedure DateDiff in my macro but I don't know how to use it to fill out my column. Is one method better than the other? Is there a better way to add columns to the existing sheet, where the columns include some calculations involving existing data on the sheet and some user inputs? There are tons of more complicated calculations I want to do next. Thanks

    Read the article

  • Jquery Double clicking on link removing div content

    - by ram
    I wrote this code to load the content of a DIV ,when some one clicks on a link. Now,if you click on a link twice,it is removing the content. Here is the code $('a').click(function() { var id = $(this).attr('class'); if(id == 'first') { $('.active').removeClass('active'); $('a.first').addClass('active'); } else if(id == 'second') { $('.active').removeClass('active'); $('a.second').addClass('active'); } $('#first').toggle(id == 'first'); $('#second').toggle(id == 'second'); });? <a class="first">one</a> <a class="second">two</a> <div> <li id="first"> <h2>pen</h2> <div> <div>parker</div> </div> </li> <li id="second" style="display: none;"> <h2>car</h2> <div>Bugatti</div> </div> </li> </div>? .active { color: green; }

    Read the article

  • Ruby on rails 2 level model

    - by jony17
    I need some help creating a very simple forum in a existing model. What I want in a Game page, have a mini forum, where is possible create some topics and some comments to this topics. In the beginning I'm only implement topics. This is the error I have: Mysql2::Error: Column 'user_id' cannot be null: INSERT INTO `topics` (`game_id`, `question`, `user_id`) VALUES (1, 'asd', NULL) This is my main model: game.rb class Game < ActiveRecord::Base attr_accessible :name validates :user_id, presence: true validates :name, presence: true, length: { maximum: 50 } belongs_to :user has_many :topics, dependent: :destroy end topic.rb class Topic < ActiveRecord::Base validates_presence_of :question validates_presence_of :game_id attr_accessible :question, :user_id validates :question, length: {maximum: 50}, allow_blank: false belongs_to :game belongs_to :user end topic_controller.rb def create @game = Game.find(params[:game_id]) @topic = @game.topics.create(params[:topic]) @topic.user_id = current_user.id respond_to do |format| if @topic.save format.html { redirect_to @game, notice: 'Topic was successfully created.' } else format.html { render action: "new" } end end end game/show.html.erb <h2>Topics</h2> <% @game.topics.each do |topic| %> <p> <b>Question:</b> <%= topic.question %> </p> <% end %> <h2>Add a topic:</h2> <%= form_for([@game, @game.topics.build]) do |f| %> <div class="field"> <%= f.label :question %><br /> <%= f.text_field :question %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> Thanks ;)

    Read the article

  • Is there a selector or a work around to select any element with no children.

    - by rnaud
    Looking at the CSS3 specs, I can't find any way to select any element that has no children. Let me explain. <body> <h1>Main Page</h1> <div id="main"> <div class="post"> <h2>Article 1</h1> <p>some text</p> </div> <div class="post"> <h2>Article 2</h1> <p>some text</p> </div> </div> </body> I'm looking for a CSS syntax to select the h1, the two h2 and the two p. A way to select in any page, all elements with no children. Any suggestion ? Sorry, I forgot to add the "empty" part, I am actually already using the *:empty selector, but it's not working for any tag that has a nodeText as a child. So it's working for any input, image, object, but not for h2, h1, or any p.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >