Search Results

Search found 302 results on 13 pages for 'lorem ipsum'.

Page 11/13 | < Previous Page | 7 8 9 10 11 12 13  | Next Page >

  • Reading UTF-8 XML and writing it to a file with Python

    - by Harri
    I'm trying to parse UTF-8 XML file and save some parts of it to another file. Problem is, that this is my first Python script ever and I'm totally confused about the character encoding problems I'm finding. My script fails immediately when it tries to write non-ascii character to a file, but it can print it to command prompt (at least in some level) Here's the XML (from the parts that matter at least, it's a *.resx file which contains UI strings) <?xml version="1.0" encoding="utf-8"?> <root> <resheader name="foo"> <value>bar</value> </resheader> <data name="lorem" xml:space="preserve"> <value>ipsum öä</value> </data> </root> And here's my python script from xml.dom.minidom import parse names = [] values = [] def getStrings(path): dom = parse(path) data = dom.getElementsByTagName("data") for i in range(len(data)): name = data[i].getAttribute("name") names.append(name) value = data[i].getElementsByTagName("value") values.append(value[0].firstChild.nodeValue.encode("utf-8")) def writeToFile(): with open("uiStrings-fi.py", "w") as f: for i in range(len(names)): line = names[i] + '="'+ values[i] + '"' #varName='varValue' f.write(line) f.write("\n") getStrings("ResourceFile.fi-FI.resx") writeToFile() And here's the traceback: Traceback (most recent call last): File "GenerateLanguageFiles.py", line 24, in writeToFile() File "GenerateLanguageFiles.py", line 19, in writeToFile line = names[i] + '="'+ values[i] + '"' #varName='varValue' UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in ran ge(128) How should I fix my script so it would read and write UTF-8 characters properly? The files I'm trying to generate would be used in test automation with Robots Framework.

    Read the article

  • javascript regex: replace url text link with image,but not in html tags

    Hi this is my pice of code: <div style="overflow: hidden; width: 445px;">[IMG]http://i29.tinypic.com/mydog.png[/IMG] tak si to http://i29.tinypic.com/mycat.png Lorem ipsum loremai <img width="15" border="0" align="middle" src="images/smejo.gif" valign="middle"/> <img src=http://www.example.com/index.png alt> <img src="http://www.example.com/index.png" alt>     <a href="#reakcia" title="reagovat na temu"><span class="poradna-tl-reaguj"><reaction> </span></a></div> </td> </tr><img src=http://www.example.com/index.png alt><img src="http://www.example.com/index.png" alt> and i need regex pattern to replace ONLY text image links with image without touch of inner url tags. But i can't use "Lookbehind" or possessive quantifiers because JS don't support them=/ So i want to catch only "http://i29.tinypic.com/mydog.png" and "http://i29.tinypic.com/mycat.png". I using array method to replacing (will be greasemonkey script.) Many Thanks

    Read the article

  • CSS: Is it possible to get a div that is 100% height, less a top and bottom margin?

    - by Cheeso
    I can get a 100% height div, like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>T5</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style type="text/css"> * { padding: 0; margin: 0; } html, body { height: 100%; } body { font-family: "lucida sans", verdana, arial, helvetica, sans-serif; font-size: 75%; } h1 { font-size: 1.4em; padding: 10px 10px 0; } p { padding: 0 10px 1em; } #container { min-height: 100%; background-color: #DDD; border-left: 2px solid #666; border-right: 2px solid #666; width: 280px; margin: 0 auto; } * html #container { height: 100%; }</style> </head> <body> <div id="container"> <h1>100% Height Div</h1> <p>Lorem...</p> <p>Ut ...</p> </div> </body> </html> But is it possible to get a div with a height of "almost 100%" height? If I want margins at the top and bottom, can I do that? Margins as indicated here:

    Read the article

  • WPF DockPanel doesn't respect the "Filled" control's desired size

    - by Dan Puzey
    I have the following Xaml (simplified for brevity, but will repro the problem in Xamlpad or Kaxaml): <DockPanel Width="400"> <TextBlock DockPanel.Dock="Left" TextWrapping="Wrap"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum massa metus, ornare in fringilla nec, fringilla at orci. Nunc pharetra enim sit amet sapien aliquet eu euismod turpis vehicula. Aenean gravida tempus lectus ut ornare. Nullam massa augue, suscipit vel consectetur fringilla, pretium vitae neque. </TextBlock> <Button MinWidth="100" VerticalAlignment="Center" HorizontalAlignment="Left">Hello world</Button> </DockPanel> My problem is that I want the Button to take its minimum 100px of space, and for the text to wrap suitably to leave that space. However, what happens is that the text wraps as close to 400px as possible, and then the Button is clipped. If I Snoop the output I can see that the button is rendering at the desired 100px, but it's being clipped off the side of the DockPanel. If I reverse the Dock (so the button is docked "Right" and the TextBlock fills) then I get the layout I want, but unfortunately that's not an option due to the surrounding layout. Is there something I can do that will make the DockPanel a) not clip and b) layout in a way that respects the MinWidth? Or am I stuck finding an alternative layout mechanism? Thanks in advance!

    Read the article

  • CSS opacity and child elements

    - by Rob
    <style type="text/css"> div#foo { background: #0000ff; width: 200px; height: 200px; opacity: 0.30; filter: alpha(opacity = 30); } div#foo>div { color: black; opacity:1; filter: alpha(opacity = 100); } </style> <div id="foo"> <div>Lorem</div> <div>ipsum</div> <div>dolor</div> </div> In the above example, the opacity of div#foo is inherited by child elements, causing the text to become nearly unreadable. I suppose it's wrong to say it is inherited, the opacity is applied to the parent div and the children are part of that, so attempting to override it for the child elements doesn't work because technically they are opaque. I typically just use an alpha png background image in such cases, but today i'm wondering if there's a better way to make a background of a div semi-transparent without affecting the contents.

    Read the article

  • Javascript: Adding selected text to an array

    - by joeybaker
    My goal: each time a user selects text, and clicks a button, that text gets added to an array. The problem: each time the button is pressed, the all objects of the array get overridden with the currently selected text. I'd really appreciate help changing the behavior so that the selected text doesn't override all previous array items. <script type="text/javascript"> var selects = new Array(); selects.push("1"); function getSelText() { var i = 0; while (i<1) { var txt = [null]; var x = 0; if (window.getSelection) { txt[x] = window.getSelection(); } else if (document.getSelection) { txt[x] = document.getSelection(); } else if (document.selection) { txt[x] = document.selection.createRange().text; } else return; selects.push(txt); x++; i++; }; document.menu.selectedtext.value = selects; } </script> <form class="menu" name="menu"> <input type="button" value="highlight" class="highlightButton" onmousedown="getSelText()"/> <textarea name="selectedtext" rows="5" cols="20"></textarea> </form> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

    Read the article

  • CallbackValidator called with empty string

    - by Paolo Tedesco
    I am writing a custom configuration section, and I would like to validate a configuration property with a callback, like in this example: using System; using System.Configuration; class CustomSection : ConfigurationSection { [ConfigurationProperty("stringValue", IsRequired = false)] [CallbackValidator(Type = typeof(CustomSection), CallbackMethodName = "ValidateString")] public string StringValue { get { return (string)this["stringValue"]; } set { this["stringValue"] = value; } } public static void ValidateString(object value) { if (string.IsNullOrEmpty((string)value)) { throw new ArgumentException("string must not be empty."); } } } class Program { static void Main(string[] args) { CustomSection cfg = (CustomSection)ConfigurationManager.GetSection("customSection"); Console.WriteLine(cfg.StringValue); } } And my App.config file looks like this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="customSection" type="CustomSection, config-section"/> </configSections> <customSection stringValue="lorem ipsum"/> </configuration> My problem is that when the ValidateString function is called, the value parameter is always an empty string, and therefore the validation fails. If i just remove the validator, the string value is correctly initialized to the value in the configuration file. What am I missing?

    Read the article

  • How to use jQuery to show/hide divs based on radio button selection?

    - by manoj382
    Hello, I have some radio buttons and I'd like to have different hidden divs show up based on which radio button is selected. Here's what the HTML looks like: <form name="form1" id="my_form" method="post" action=""> <div><label><input type="radio" name="group1" value="opt1">opt1</label></div> <div><label><input type="radio" name="group1" value="opt2">opt2</label></div> <div><label><input type="radio" name="group1" value="opt3">opt3</label></div> <input type="submit" value="Submit"> </form> .... <style type="text/css"> .desc { display: none; } </style> .... <div id="opt1" class="desc">lorem ipsum dolor</div> <div id="opt2" class="desc">consectetur adipisicing</div> <div id="opt3" class="desc">sed do eiusmod tempor</div> And here's my jQuery: $(document).ready(function(){ $("input[name$='group2']").click(function() { var test = $(this).val(); $("#"+test).show(); }); }); The reason I'm doing it that way is because my radio buttons and divs are being generated dynamically (the value of the radio button will always have a corresponding div). The code above works partially - the divs will show when the correct button is checked, but I need to add in some code to make the divs hide again once the button is unchecked. Thanks!

    Read the article

  • How can I remove HTML span tags with a Perl one liner?

    - by yaya3
    I want to perform the following vim substitution as a one-liner in the terminal with Perl. I would prefer to allow for any occurences of whitespace or newlines, rather than explicitly catering for them as I am below. %s/blockDontForget">\n*\s*<p><span><a\(.*\)<\/span>/blockDontForget"><p><a\1/g I've tried this: perl -pi -e 's/blockDontForget"><p><span><a(.*)<\/span>/blockDontForget"><p><a$1/msg' I presume I am misinterpreting the flags. Where am I going wrong? Thanks. EDIT: The above example is to strip the spans out of the following html: <div class="block blockDontForget"> <p><span><a href="../../../foo/bar/x/x.html">Lorem Ipsum</a></span></p> EDIT: It's just the <span>'s and </span>'s that are inbetween <p> and <a> from the "blockDontForget" class </div> that I want to remove (there are lots or these blockDontForget divs with spans inside anchors that I want to keep).

    Read the article

  • How can I enable child inputs text selection in Mozilla Firefox using CSS?

    - by L. Shaydariv
    Hi. Let consider the following scenario. I have the following page where all rendered elements must be non-selectable. <html> <head> <style type="text/css"> body { -webkit-user-select: none; -moz-user-select: none; } div { border: solid 1px green; padding: 5px; } </style> </head> <body> <div> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat </div> <div> <input type="text" value="You can select the text from me" /> <textarea> And me too. </textarea> </div> </body> </html> The input and textarea text is still selectable in Google Chrome, but the text is not selectable in Firefox. I've already tried the following: input, textarea { -moz-user-select: text !important; } And... It simply doesn't work because (as far as I can see) input and textarea are nested in the document body element that's already is not selectable. So, is it possible to enable text selection of the nested user input elements in Firefox using CSS? Thank you for suggestions.

    Read the article

  • How to have current page selection using inludes navigation

    - by Anders Kitson
    I am using php includes to limit redundancy on my pages, how can I have my navigation have the current page selected with say a certain color for the HOME button when my navigation is called from a header.php file. If i were to say to add a "active" class to the home.php item and add a style so it looked different, that would happen across the board for all my pages, which is why I am using includes in the first place, how can I have one header.php file with my navigation, that also allows each page the ability to show the current page you are on reflected in the navigation? This is the nav portion of the header.php file <ul> <li><a href="index.php">About Us</a></li> <li><a href="portfolio.php">Portfolio</a></li> <li><a href="news.php">News</a></li> <li><a href="contact.php">Contact</a></li> </ul> This is the index.php file that the header.php file is included in <?php include("includes/header.php"); ?> <div class="span-8" id="welcome"> <p>Lorem ipsum</p> </div> <div class="span-16 last" id="slideshow"> <img src="images/introImage1.png" alt="fountain"> <img src="images/introImage2.png" alt="bench"> <img src="images/introImage3.png" alt="bridge"> </div> <?php include("includes/footer.php"); ?>

    Read the article

  • Two column layout, navigation div on the right, solution from previous thread didn't seem to work

    - by Tom
    I tried the solution from this thread, but I must be missing something because it doesn't work: <div style="float:left;margin-right:200px"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> <div style="float:right;width:200px"> <p>navigation</p> </div> It works when the text in the content div (the left one) is short, but when it's long then the div takes up the whole width of the browser and the margin is there, but the right div is pushed below the first one nevertheless. What am I missing? Edit: The goal is to have a fix sized navigation column on the right of the browser window and the left div should get all the space left by the right navigation column (liquid layout).

    Read the article

  • Find all CSS rules that apply to an element

    - by Carl Byström
    Many tools/APIs provide ways of selecting elements of specific classes or IDs. There's also possible to inspect the raw stylesheets loaded by the browser. However, for browsers to render an element, they'll compile all CSS rules (possibly from different stylesheet files) and apply it to the element. This is what you see with Firebug or the WebKit Inspector - the full CSS inheritance tree for an element. How can I reproduce this feature in pure JavaScript without requiring additional browser plugins? Perhaps an example can provide some clarification for what I'm looking for: <style type="text/css"> p { color :red; } #description { font-size: 20px; } </style> <p id="description">Lorem ipsum</p> Here the p#description element have two CSS rules applied: a red color and a font size of 20 px. I would like to find the source from where these computed CSS rules originate from (color comes the p rule and so on).

    Read the article

  • Liquid Layout: 100% max-width img not applied - why?

    - by MEM
    I'm totally new to this liquid layout stuff. I've notice, as most of us, that while most of my layout components "liquify", images, unfortunately, don't. So I'm trying to use the max-width: 100% on images as suggested on several places. However, and despite the definition of max-width and min-height of the img container, the img don't scale. Sample code: CSS img { max-width: 100%; } article { float: left; margin: 30px 1%; max-width: 31%; min-height: 350px; } HTML <article> <header> <h2>some header</h2> </header> <img src="/images/thumb1.jpg" alt="thumb"> <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin vel ante a orci tempus eleifend.</p> </article> Please have a look on the following link: http://tinyurl.com/d849f8x If you see it on a wide resolution, you will notice that the "kid image", for example, don't scale. Any clue about what could the issue be, why does that image not scale? Test case: Browsers: Firefox 15.0 / Chrome 21.0 IOS: MAC OS X Lion - 10.7.3 Resolution: 1920x1200 What I get: I get an image that doesn't scale until the end of it's container. The img width won't fit the article element that contains it. What I do expect: I expect the image to enlarge, until it reaches the end it's container. Visually, I'm expecting the image to be as wide as the paragraph immediately below, in a way that, the right side of the image stays vertically aligned with the right side of the paragraph below.

    Read the article

  • Open Select using Javascript/jQuery?

    - by Newbie
    Hello! Is there a way to open a select box using Javascript (and jQuery)? <select style="width:150px;"> <option value="1">1</option> <option value="2">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc arcu nunc, rhoncus ac dignissim at, rhoncus ac tellus.</option> <option value="3">3</option> </select> I have to open my select, cause of ie bug. All versions of IE (6,7,8) cut my options. As far as I know, there is no css bugfix for this. At the moment I try to do the following: var original_width = 0; var selected_val = false; if (jQuery.browser.msie) { $('select').click(function(){ if (selected_val == false){ if(original_width == 0) original_width = $(this).width(); $(this).css({ 'position' : 'absolute', 'width' : 'auto' }); }else{ $(this).css({ 'position' : 'relative', 'width' : original_width }); selected_val = false; } }); $('select').blur(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); }); $('select').blur(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); }); $('select').change(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); }); $('select option').click(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); selected_val = true; }); } But clicking on my select the first time will change the width of the select but I have to click again to open it.

    Read the article

  • Wordpress inserting comments via wp_insert_comment()

    - by Cyber Junkie
    Hello all happy holidays! :) I'm trying to insert comments in my wordpress blog via the wp_insert_comment() function. It's for a plugin I'm trying to make. I have this code in my header for testing. It works every time I refresh the page. $agent = $_SERVER['HTTP_USER_AGENT']; $data = array( 'comment_post_ID' => 256, 'comment_author' => 'Dave', 'comment_author_email' => '[email protected]', 'comment_author_url' => 'http://www.someiste.com', 'comment_content' => 'Lorem ipsum dolor sit amet...', 'comment_author_IP' => '127.3.1.1', 'comment_agent' => $agent, 'comment_date' => date('Y-m-d H:i:s'), 'comment_date_gmt' => date('Y-m-d H:i:s'), 'comment_approved' => 1, ); $comment_id = wp_insert_comment($data); It successfully inserts comments into the database. The problem: Comments don't show via the Disqus comment system. I compared table rows and I noticed that user_agent differs. Normal comments use for example, Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv... and Disqus comments use Disqus/1.1(2.61):119598902 numbers are different for each comment. Does anyone know how to insert comments with wp_insert_comment() when Disqus is enabled?

    Read the article

  • How to take a Serialized String from the DB and output a UL list with Coldfusion

    - by nobosh
    Given a string from the database as follows: ul[0][id]=main1&ul[0][children][0][id]=child2&ul[0][children][0][class]=&ul[1][id]=main3&ul[2][id]=main4&ul[3][id]=main5 Where what's after the equal sign is an ID, how can I take this string on the backend and build out a list as following from front-end output? <UL id="container"> <LI id="main1"> Lorem ipsum dolor sit amet, consectetur <UL> <LI id="child2"> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> </LI> <LI id="main3"> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main4"> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main5"> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> Thanks

    Read the article

  • In a Tab Bar based app a controller release data of the other ! !

    - by Flodev03
    Hi all ! I've made a ViewBased app, in the app delegate i've set a UITabBarCotntroller, in the app i have different view Controller two of them displays text in a UITextView and labels, the other one is my "ShakeController" a UIViewController in which i've set a UIAcelerometerDelegate, in it i create a instance of UIAccelerometer, in the method which manages the shake everything works fine, in this controller i have also set a UIImageView to make a simple animation, in the view Did Load method i set my imageView.animation to an array of UIImage. My problem is : when the app is launched i use the ViewControllers and everything work fine, but when i tap the ShakeController item in the tab bar and then when i come back to the other controllers the label looks like : label and textView like : Lorem ipsum..... the text of UItextView in IB. I have noticed thaht if i comment the initialisation of my imageView to the array of image i can navigate the items (from a view controller to another) without the label change and stay what i want them to be. Notice that the two controllers are in a UINavigationController. (i use @proprety (nonnatomic, retain) then @synthesize ... then releqse in the dealloc for the labels textview and my uiimageView) Do not know what to do thanks to all

    Read the article

  • jquery CSS doesn't work in webkit

    - by Mauro74
    I'm trying to apply some css to an image tag if the image is portrait, but for some reason .css() doesn't work in webkit. Basically the image tag doesn't get the 'style' property. Here's my code: $(document).ready(function () { $('.listing .item .thumb img').each(function () { var _img = $(this); var _imgWidth = _img.outerWidth(); var _imgHeight = _img.outerHeight(); if (_imgHeight > _imgWidth) { _img.css('top', '-40%'); } }); }); <div class="listing about"> <div class="item"> <a href="#" class="thumb"> <img src="../_uploads/siteassets/images/thumb-carousel-2.jpg" /> <span class="frame"></span> </a> <span class="snippet"> <a href="#" class="title">Name Surname</a> <span class="date">Role in the company</span> <p class="description">Lorem ipsum dolor sit amet...</p> </span> </div> </div> I've tried to use .attr() instead of .css() but nothing. It doesn't work! Any idea why?

    Read the article

  • jquery show / hide div on click even in a slideshow?

    - by KnockKnockWhosThere
    Is it possible to combine a slideshow and show / hide div functionality? My html structure is below, and basically, I'm trying to get the tabs a links to open up the div with the corresponding class if a user clicks on it. If a user doesn't click on it, it should still just cycle through each image. So, if the images are rotating, and I click on <a class="t2"> then would open. The thing is, it's unknown how many divs / tabs there will be, but they'll always be named t{n}. <div id="tab-content"> <div class="t1">content</div> <div class="t2">lorem ipsum</div> <div class="t3">knock knock</div> </div> <div id="nav"> <div id="tabs"> <ul> <li class="t1"><a class="t1" href="#">tab 1</a></li> <li class="t2"><a class="t2" href="#">tab 2</a></li> <li class="t3"><a class="t3" href="#">tab 3</a></li> </ul> </div> </div>

    Read the article

  • Given the Following List (UL), how can it be serialized and sent to the Database

    - by nobosh
    I have the follow structure which is created with a nested sortable: <UL id="container"> <LI id="main1"> <input type="checkbox" /> Lorem ipsum dolor sit amet, consectetur <UL> <LI id="child2"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> </LI> <LI id="main3"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main4"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main5"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> Where I'm stuck is how to send this back to the database. I"m guessing that it needs to be serialized, does that sound right to? so that is looks something like: item[]=main1&item[]=221&item_221[]=21&item_221[]=2&item_221[]=211&item[]=22 I'm a little lost at this point and appreciate any tips to move me in the right direction. Thanks, B

    Read the article

  • How to accurately resize nested elements with ems and font-size percentage?

    - by moonDogDog
    I have a carousel with textboxes for each image, and my client (who knows nothing about HTML) edits the textboxes using a WYSIWYG text editor. The resulting output is akin to your worst nightmares; something like: <div class="carousel-text-container"> <span style="font-size:18pt;"> <span style="font-weight:bold;"> Lorem <span style="font-size:15pt:">Dolor</span> </span> Ipsum <span style="font-size:19pt;"><span>&nbsp;<span>Sit</span>Amet</span> </span> </div> This site has to be displayed at 3 different sizes to accomodate smaller monitors, so I have been using CSS media queries to resize the site. Now I am having trouble resizing the text inside the textbox correctly. I have tried using jQuery.css to get the font size of each element in px, and then convert it to em. Then, by setting a font-size:x% sort of declaration on .carousel-text-container, I hoped that that would resize everything properly. Unfortunately, there seems to be a recursive nature with how font-size is applied in ems. That is, .example is not resized properly in the following because its parent is also influencing it <span style="font-size:2em;"> Something <span class="example" style="font-size:1.5em;">Else</span> </span> How can I resize everything reliably and precisely such I can achieve a true percentage of my original font size, margin, padding, line-height, etc. for all the children of .carousel-text-container?

    Read the article

  • Getting a UIImage from MySQL using PHP and jSON

    - by Daniel
    I'm developing a little news reader that retrieves the info from a website by doing a POST request to a URL. The response is a jSON object with the unread-news. E.g. the last news on the App has a timeStamp of "2013-03-01". When the user refreshes the table, it POSTS "domain.com/api/api.php?newer-than=2013-03-01". The api.php script goes to the MySQL database and fetches all the news posted after 2013-03-01 and prints them json_encoded. This is // do something to get the data in an array echo $array_of_fetched_data; for example the response would be [{"title": "new app is coming to the market", "text": "lorem ipsum dolor sit amet...", image: XXX}] the App then gets the response and parses it, obtaining an NSDictionary and adds it to a Core Data db. NSDictionary* obtainedNews = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&error]; My question is: How can I add an image to the MySQL database, store it, pass it using jSON trough a POST HTTP Request and then interpret it as an UIImage. It's clear that to store an UIImage in CoreData, they must be transform into/from NSData. How can I pass the NSData back and forth to a MySQL db using php and jSON? How should I upload the image to the db? (Serialized, as a BLOB, etc)

    Read the article

  • CSS3 Transitions in PhoneGap: Div Width issues

    - by MeltingDog
    I am building a PhoneGap/Cordova app and have a simple code that uses http://ricostacruz.com/jquery.transit/ to display a div when another div is clicked. <style> #hiddendiv { top: -2000px; position:absolute; } </style> <script> $('#clickme').click( function() { //SHOW DIV $('#hiddendiv').transition({ y: '2100px' }); }); </script> <!--HTML--> <div id="hiddendiv"> Lorem Ipsum blah blah blah Loooong piece of text </div> <div id="clickme"> Click Me </div> And it works fine. The issue is that I cannot scroll on my device once the #hiddendiv is displayed. I this is partly because the page is only about 500px height (not actually set anywhere) whilst the #hiddendiv is about 1500px height Does anyone know of a work around for this?

    Read the article

  • Left floated element and unordered lists (ul).

    - by superUntitled
    Hello, I am trying to indent the li elements of a ul. There is a left floated div with an image in it. The li element will indent only if I add left padding that is wider than the image itself. I you would like to look at a version irl, take a look. On this page, I have given the li a background color to demonstrate. <div class="left"> <p ><img src='image.jpg' alt='homepage.jpg' width="360" height="395" /></p> </div> <p> Est tincidunt doming iis nobis nibh. Ullamcorper eorum elit lius me delenit. </p> <hr /> <h3>Lorem</h3> <ul> <li>list element</li> <li>list element</li> <li>list element</li> </ul> The css: .left {float: left; } .left img {padding-right: 20px;} ul li { padding-left: 10px; background: blue; } thanks!

    Read the article

< Previous Page | 7 8 9 10 11 12 13  | Next Page >