Search Results

Search found 1369 results on 55 pages for 'sam baker'.

Page 37/55 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Can't append space at end of NSString

    - by Sam V
    I have a UITextView in which I want the initial value to be "@username " (notice the space after the username). This way the user can start typing right away without having to tap space. So I do: textView.text = [NSString stringWithFormat:@"@%@ ", username]; But it seems like it's impossible to have an NSString ending with a space (it always gets stripped out). Am I correct? Is there any workaround for this?

    Read the article

  • Greasemonkey script not executed when unusual content loading is being used

    - by Sam Brightman
    I'm trying to write a Greasemonkey script for Facebook and having some trouble with the funky page/content loading that they do (I don't quite understand this - a lot of the links are actually just changing the GET, but I think they do some kind of server redirect to make the URL look the same to the browser too?). Essentially the only test required is putting a GM_log() on its own in the script. If you click around Facebook, even with facebook.com/* as the pattern, it is often not executed. Is there anything I can do, or is the idea of a "page load" fixed in Greasemonkey, and FB is "tricking" it into not running by using a single URL? If I try to do some basic content manipulation like this: GM.log("starting"); var GM_FB=new Object; GM_FB.birthdays = document.evaluate("//div[@class='UIUpcoming_Item']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (i = GM_FB.birthdays.snapshotLength - 1; i >= 0; i--) { if (GM_FB.birthdayRegex.test(GM_FB.birthdays.snapshotItem(i).innerHTML)) { GM_FB.birthdays.snapshotItem(i).setAttribute('style','font-weight: bold; background: #fffe88'); } } The result is that sometimes only a manual page refresh will make it work. Pulling up the Firebug console and forcing the code to run works fine. Note that this isn't due to late loading of certain parts of the DOM: I have adding some code later to wait for the relevant elements and, crucially, the message never gets logged for certain transitions. For example, when I switch from Messages to News Feed and back.

    Read the article

  • How to give alternating table rows different background colors using PHP

    - by Sam
    I have a table of data that is generated dynamically based on the contents stored in a mysql database. This is how my code looks: <table border="1"> <tr> <th>Name</th> <th>Description</th> <th>URL</th> </tr> <?php $query = mysql_query("SELECT * FROM categories"); while ($row = mysql_fetch_assoc($query)) { $catName = $row['name']; $catDes = $row['description']; $catUrl = $row['url']; echo "<tr class=''>"; echo "<td>$catName</td>"; echo "<td>$catDes</td>"; echo "<td>$catUrl</td>"; echo "</tr>"; } ?> </table> Now if the table was static, then I would just assign each alternating table row one of 2 styles in repeated order: .whiteBackground { background-color: #fff; } .grayBackground { background-color: #ccc; } and that would be the end of that. However since the table rows are dynamically generated, how can I achieve this?

    Read the article

  • repeat image c#

    - by sam
    Hi folks., i have an image with certain pattern.. i need to repeat it in another image using GDi? is there any method to do in GDI?

    Read the article

  • T-SQL QUERY PROBLEM

    - by Sam
    Hi All, I have table called Summary and the data in the table looks like this: ID Type Name Parent 1 Act Rent Null 2 Eng E21-01-Rent Rent 3 Prj P01-12-Rent E21-Rent 1 Act Fin Null 2 Eng E13-27-Fin Fin 3 Prj P56-35-Fin E13-Fin I am writing a SP which has to pull the parent based on type. Here always the type Act has ID 1, Eng has ID 2 and Prj has ID 3. The type ACT parent is always NUll, type Eng parent is Act and type Prj parent is Eng Now I have table called Detail.I am writing a SP to insert Detail Table data to the Summary table. I am passing the id as parameter: I am having problem with the parent. How do I get that? I can always say when ID is 1 then parent is Null but when ID is 2 then parent is name of ID 1 similarly when ID is 3 then parent is name of ID2. How do I get that? Can anyone help me with this:

    Read the article

  • Force NCover 1.5.8 to use v4 framework like testdriven.net does?

    - by Sam Holder
    I want to run coverage from the command line, but can't seem to get NCover 1.5.8 to instrument the code. It must be possible as when I run coverage tests with TestDriven.net it works. the difference seems to be that TD.NET is able to get NCover to use framework 4.0 (you get this in the log when it runs : MESSAGE: v4.0.30319) but from the command line I can't make it (I get this in the log : MESSAGE: v2.0.50727) So how can I make NCover play nice with nunit from the commandline, like it does with TD.NET?

    Read the article

  • Running Java plugin 1.5 on Firefox + Snow Leopard

    - by Sam
    I have a Java applet that needs to be able to run on Java 1.5. I have successfully installed Java 1.5 on Snow Leopard and I am able to use it to run applets in Safari by changing the order of the versions in Java Preferences. However, Firefox (3.5.9) doesn't seem to be able to pick up the changes and keeps reverting to using the Java 1.6 plugin. How do I force Firefox to use the Java 1.5 plugin? I tried re-linking the /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK folder to point to my 1.5 directory, but that seems to change the system-level Java runtime, not the Firefox plugin (it opened up the console differently, but inside the console it reported Java plugin 1.6.0).

    Read the article

  • How do I accurately handle a batch separator for SQL from C#

    - by Sam Saffron
    For Data Explorer I would like to add support for a Batch separator. So for example if users type in: select 'GO' go select 1 as go Go select 100 I would like to return the three result sets. Its clear that I need some sort of parser here, my hope is that this is a solved problem and I can just plug it in. (writing a full T-SQL parser is not something I would like to do) What component / demo code could achieve splitting this batch into its 3 parts?

    Read the article

  • Magento 1.4 - how to show html on product view?

    - by Sam
    Hi All The new version of Magento, 1.4, has it's own WYSIWYG editor, which can be enabled for any product attribute. However, if it is enabled, say for the additional info attribute, if you view the product page the html will be escaped, so you see all the tags (< p , < ul etc). If you change the following in template/catalog/product/view.phtml, you can get the "Quick Overview" and "Additional Information" sections to correctly show the html: <?php echo nl2br($this->htmlEscape($_product->getShortDescription())) ?> to <?php echo $_product->getShortDescription() ?> However, the additional info section is added via template/catalog/product/view/attributes.phtml using the following line, and I can't figure out how to get it to show the html correctly: <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?> This references Mage_Catalog_Block_Product_View_Attributes, and if I go to that file and change the following, it works: $value = $this->htmlEscape($value); to $value = value; But is there anyway to do this without overiding this core file with a local version?

    Read the article

  • Why doesn't this piece of php code work?

    - by Sam Gabriel
    Hey guys, I have a mysql database which stores an id for each picture, as well as the picture's url and its thumbnail url. the thumbnail url is something like thumbs/pic.jpg and the page I'm creating has the folder thumbs in the same place it is created. But when I run this piece of code, nothing shows up: <?php ini_set('display_errors', 'On'); error_reporting(E_ALL | E_STRICT); mysql_connect("localhost", "***", "***") or die(mysql_error()); mysql_select_db("pics") or die(mysql_error()); $results = mysql_query("select id from classpics") or die(mysql_error()); $data=mysql_fetch_array($results); foreach($data as $uno) { echo '<td valign="middle" align="center"><a class="neutral" href="../images.php?id=' . $uno['id'] . '"><img src="'. $uno['thumbs'].'" border="0" /></a></td>'; } ?>

    Read the article

  • How to show a form field ONLY if another is selected in JavaScript or jQuery?

    - by Sam
    I have a form, like so: <form action="" method="post"> <select name="pageType"> <option value="main">Main Page</option> <option value="sub">Sub Page</option> <option value="sub-sub">Sub-Sub Page</option> </select> <br /> <label>Choose Sub Sub Name:</label> <input type="text" name="sub-sub-name" /> <br /> <input type="submit" name="submit" value="GO!" /> </form> What I would like to achive is for this text field (and it's label): <label>Choose Sub Sub Name:</label> <input type="text" name="sub-sub-name" /> to only appear if the 3rd option (sub sub page) is selected from the drop down and not show up otherwise. How can this be done with either javascript or the jquery framework? EDIT by the way, it would be nice if this can be achieved without the page needing to refresh and losing previously submitted form data. I know form data can still be kept using variables that store the values even on page refresh, but I was hoping for that effect that I see on a lot of sites where the additional text area (or other form element) just appears without page refresh.

    Read the article

  • jQuery programming style?

    - by Sam Dufel
    I was recently asked to fix something on a site which I haven't worked on before. I haven't really worked with jQuery that much, but I figured I'd take a look and see if I could fix it. I've managed to mostly clear up the problem, but I'm still horrified at the way they chose to build this site. On document load, they replace the click() method of every anchor tag and form element with the same massive function. When clicked, that function then checks if the tag has one of a few different attributes (non-standard attributes, even), and does a variety of different tasks depending on what attributes exist and what their values are. Some hyperlinks have an attribute on them called 'ajaxrel', which makes the click() function look for another (hidden) hyperlink with an ID specified by the ajaxrel attribute, and then calls the click() function for that other hyperlink (which was also modified by this same click() function). On the server side, all the php files are quite long and have absolutely no indentation. This whole site has been a nightmare to debug. Is this standard jQuery practice? This navigation scheme seems terrible. Does anyone else actually use jQuery this way? I'd like to start incorporating it into my projects, but looking at this site is giving me a serious headache. Here's the click() function for hyperlinks: function ajaxBoxA(theElement, urltosend, ajaxbox, dialogbox) { if ($(theElement).attr("href") != undefined) var urltosend = $(theElement).attr("href"); if ($(theElement).attr('toajaxbox') != undefined) var ajaxbox = $(theElement).attr('toajaxbox'); // check to see if dialog box is called for. if ($(theElement).attr('dialogbox') != undefined) var dialogbox = $(theElement).attr('dialogbox'); var dodialog = 0; if (dialogbox != undefined) { // if dialogbox doesn't exist, then flag to create dialog box. var isDiaOpen = $('[ajaxbox="' + ajaxbox + '"]').parent().parent().is(".ui-dialog-container"); dodialog = 1; if (isDiaOpen) { dodialog = 0; } dialogbox = parseUri(dialogbox); dialogoptions = { close: function () { // $("[id^=hierarchy]",this).NestedSortableDestroy(); $(this).dialog('destroy').remove() } }; for ( var keyVar in dialogbox['queryKey'] ) eval( "dialogoptions." + keyVar + " = dialogbox['queryKey'][keyVar]"); }; $("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>"); $('#TB_load').show(); if (urltosend.search(/\?/) > 0) { urltosend = urltosend + "&-ajax=1"; } else { urltosend = urltosend + "?-ajax=1"; } if ($('[ajaxbox="' + ajaxbox + '"]').length) { $('[ajaxbox="' + ajaxbox + '"]').each( function () { $(this).empty(); }); }; $.ajax({ type: "GET", url: urltosend, data: "", async: false, dataType: "html", success: function (html) { var re = /^<toajaxbox>(.*?)<\/toajaxbox>+(.*)/; if (re.test(html)) { var match = re.exec(html); ajaxbox = match[1]; html = Right(html, String(html).length - String(match[1]).length); } var re = /^<header>(.*?)<\/header>+(.*)/; if (re.test(html)) { var match = re.exec(html); window.location = match[1]; return false; } if (html.length > 0) { var newHtml = $(html); if ($('[ajaxbox="' + ajaxbox + '"]').length) { $('[ajaxbox="' + ajaxbox + '"]').each( function () { $(this).replaceWith(newHtml).ready( function () { ajaxBoxInit(newHtml) if (window.ajaxboxsuccess) ajaxboxsuccess(newHtml); }); }); if ($('[ajaxdialog="' + ajaxbox + '"]').length = 0) { if (dodialog) $(newHtml).wrap("<div class='flora ui-dialog-content' ajaxdialog='" + ajaxbox + "' style='overflow:auto;'></div>").parent().dialog(dialogoptions); } } else { $("body").append(newHtml).ready( function () { ajaxBoxInit(newHtml); if (window.ajaxboxsuccess) ajaxboxsuccess(newHtml); }); if (dodialog) $(newHtml).wrap("<div class='flora ui-dialog-content' ajaxdialog='" + ajaxbox + "' style='overflow:auto;'></div>").parent().dialog(dialogoptions); } } var rel = $(theElement).attr('ajaxtriggerrel'); if (rel != undefined) $('a[ajaxrel="' + rel + '"]').click(); tb_remove(); return false; }, complete: function () { $("#TB_load").remove(); } }); return false; }

    Read the article

  • How do I include the capistrano thinking sphinx tasks when using the gem

    - by Sam Saffron
    Im using the gem for thinking sphinx: sudo gem install freelancing-god-thinking-sphinx \ --source http://gems.github.com So: require 'vendor/plugins/thinking-sphinx/recipes/thinking_sphinx' Which is prescribed on the website does not work. How do I include the capistrano thinking sphinx tasks in my deploy.rb file when using the gem? EDIT Adding: require 'thinking_sphinx/deploy/capistrano' gives me: /usr/lib/ruby/gems/1.8/gems/freelancing-god-thinking-sphinx-1.1.12/lib/thinking_sphinx/deploy/capistrano.rb:1: undefined method `namespace' for main:Object (NoMethodError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/loading.rb:152:in `require'

    Read the article

  • Information about upgrading a Resharper plugin to v 5.0

    - by Sam Holder
    I like the sound of the Exceptional plugin for resharper, but it says it currently only works with v4.5. Does anyone know what is involved with upgrading to 5.0 and how much things have changed, which bits will need to be looked at etc. I am quite tempted to upgrade it but would like some pointers before I start...

    Read the article

  • Making a rewriterule remove .php extension?

    - by Sam
    Hello, I have come up with a rewriterule to to go to any page on my website without typing in the .php extension because it is automatically added to the url. The rule is: RewriteRule ^(\w+)/?$ /$1.php It takes anything you type in my index and adds .php to it, so you can put in http://sampardee.com/index and it pulls up index.php Now my question is how to detect when a user enters http://sampardee.com/index.php and change it to http://sampardee.com/index How could I do so with a rewriterule?

    Read the article

  • About to migrate :string but I'm thinking :text might be better. Performance/Purpose?

    - by Sam
    class CreateScrapes < ActiveRecord::Migration def self.up create_table :scrapes do |t| t.text :saved_characters t.text :sanitized_characters t.string :href t.timestamps end end def self.down drop_table :scrapes end end I'm about to rake db:migrate and I'm think about the attribute type if I should be using text or string. Since saved_characters and sanitized_characters will be arrays with thousands of unicode values, its basically comma delimited data, I'm not sure if `:text' is really the right way to go here. What would you do?

    Read the article

  • Google Maps InfoBubble pixelOffset

    - by Sam
    I am trying to implement a custom infoBubble that has the box opening to the side of a marker. This has turned out to be harder than expected. Using the normal infoWindow you can use pixelOffset. See here for the documentation Using infoBubble this does not seem to be the case. Is there anyway of using pixelOffset in an infoBubble, or something that will do the same thing? I have found this very difficult to search for, as using a google search such as this returns no relevant results Google Search Below is all my resources I have been using. Example of infoBubble here. My JavaScript to setup the map and infoBubble here. And now my javascript here just in-case the jsfiddle link is broken. <script type="text/javascript"> $(document).ready(function () { init(); }); function init() { //Setup the map var googleMapOptions = { center: new google.maps.LatLng(53.5167, -1.1333), zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP }; //Start the map var map = new google.maps.Map(document.getElementById("map_canvas"), googleMapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(53.5267, -1.1333), title: "Just a test" }); marker.setMap(map); infoBubble = new InfoBubble({ map: map, content: '<div class="phoneytext">Some label</div>', //position: new google.maps.LatLng(-35, 151), shadowStyle: 1, padding: '10px', //backgroundColor: 'rgb(57,57,57)', borderRadius: 5, minWidth: 200, arrowSize: 10, borderWidth: 1, borderColor: '#2c2c2c', disableAutoPan: true, hideCloseButton: false, arrowPosition: 7, backgroundClassName: 'phoney', pixelOffset: new google.maps.Size(130, 120), arrowStyle: 2 }); infoBubble.open(map, marker); } </script>

    Read the article

  • What is the process involved in viewing a webservice in a browser from within visual studio?

    - by Sam Holder
    I have created a new VS2008 ASP.Net Web service project, with the default name WebService1. If I right click on the Service1.asmx file and select 'View in Browser' what are the processes that go on to make this happen? I am asking because I have a situation where when I run this from a visual studio project started in our development shell (which sets up a common build environment) I cannot get the web service to show up in the browser. It starts the asp.net development server and creates a single file: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c43ddc22\268ae91b\hash\hash.web but when I start it from a stand alone project i get a whole slew of files in here: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\edad4eee\d198cf0e\App_Web_defaultwsdlhelpgenerator.aspx.cdcab7d2.vicgkf94.dll C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\edad4eee\d198cf0e\service1.asmx.cdcab7d2.compiled etc etc I am trying to debug this but not really getting anywhere. i have inspected the output from VS but the only option I get is for the build output, which is basic and doesn't really contain any information that is useful. I have tried running both versions with DebugView running but no output there either. I would like to know if there are any log files I could look at, or if anyone has any suggestions on how I might be able to debug what is going wrong here? For completeness the output I get when it doesn't work is: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not create type 'WebService1.Service1'. Source Error: Line 1: Source File: /Service1.asmx Line: 1 Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

    Read the article

  • [Tkinter/Python] Different line widths with canvas.create_line?

    - by Sam
    Does anyone have any idea why I get different line widths on the canvas in the following example? from Tkinter import * bigBoxSize = 150 class cFrame(Frame): def __init__(self, master, cwidth=450, cheight=450): Frame.__init__(self, master, relief=RAISED, height=550, width=600, bg = "grey") self.canvasWidth = cwidth self.canvasHeight = cheight self.canvas = Canvas(self, bg="white", width=cwidth, height=cheight, border =0) self.drawGridLines() self.canvas.pack(side=TOP, pady=20, padx=20) def drawGridLines(self, linewidth = 10): self.canvas.create_line(0, 0, self.canvasWidth, 0, width= linewidth ) self.canvas.create_line(0, 0, 0, self.canvasHeight, width= linewidth ) self.canvas.create_line(0, self.canvasHeight, self.canvasWidth + 2, self.canvasHeight, width= linewidth ) self.canvas.create_line(self.canvasWidth, self.canvasHeight, self.canvasWidth, 1, width= linewidth ) self.canvas.create_line(0, bigBoxSize, self.canvasWidth, bigBoxSize, width= linewidth ) self.canvas.create_line(0, bigBoxSize * 2, self.canvasWidth, bigBoxSize * 2, width= linewidth) root = Tk() C = cFrame(root) C.pack() root.mainloop() It's really frustrating me as I have no idea what's happening. If anyone can help me out then that'd be fantastic. Thanks!

    Read the article

  • #nav css affecting all elements in page.

    - by Sam Gabriel
    Hey guys I set up this CSS file to use on the navbar: #nav { background-color: #98bf21; } #nav li { float:left; } #nav li ul{ position: absolute; width: 172px; left: -999em; } #nav li:hover ul{ left: auto; } #nav a:link,a:visited { display:block; width:164px; font-weight:bold; color:white; background-color:#98bf21; text-align:center; padding:4px; text-decoration:none; text-transform:uppercase; } #nav a:hover,a:active { background-color: #7A991A; } And it seems to be affecting all the elements. For example all elements take the styles if the #nav a styles. Is there something I'm missing here? I'm new to web design.

    Read the article

  • If I CFRelease() an image in core data, how do I get it back?

    - by Sam
    My iphone app plays a slide show made up of 5 user images.  These images are stored using core data.  I was noticing that memory was building up every time a different slide show was played and it was not releasing any of the previously played slide shows.   These images are showing up in Object Allocations as CFData. So I tried releasing this data in the dealloc method CFRelease(slideshow.image1); CFRelease(slideshow.image2); CFRelease(slideshow.image3); CFRelease(slideshow.image4); CFRelease(slideshow.image5); This releases the previous slideshow great...BUT when I go back to view that same slideshow again, it crashes.   I am guessing that I need to alloc/init these images again, but I am not sure how?  Or maybe I should be managing this memory in a different way?

    Read the article

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