Monthly Archives

Articles indexed in June 2010

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

  • jQuery Autocomplete & jTemplates - handling response

    - by Diegos Grace
    Has anyone had any experience with using jTemplates to display autocomplete results. I have the following $("#address-search").autocomplete({ source: "/Address/SearchAddress", minLength: 2, delay: 400, focus: function (event, ui) { $('#address-search').val(ui.item.name); return false; }, parse: function(data) { $("#autocomplete-results").setTemplate($("#templateHolder").html()); $("#autocomplete-results").processTemplate(data); }, select: function (event, ui) { $('#address-search').val(ui.item.name); $('#search-address-id').val(ui.item.id); $('#search-description').html(ui.item.address); }); and the simple jtemplate holder: <script type="text/html" id="templateHolder"> <ul class="autocomplete"> {#foreach $T as data} <li>{$T.name}</li> {#/for} </ul> </script> Above i'm using 'Parse' to format results, I've also tried the autocomplete result method but not having any luck so far. The only success I've had is by using the private method ._renderItem and formatting the data that way but we want to render the output using the jTemplate. Any advice appreciated.

    Read the article

  • how to match var/id to class

    - by circey
    Hi. I'm new to jquery and, in addition, I think I'm having a brain freeze. I have a number of links with different ids. I want to match the clicked link with a div with the corresponding class so the div will show/hide/toggle as appropriate. I have: <script type="text/javascript"> $(document).ready(function() { $('.folioBox').hide(); $('a.interface').click(function(){ var currentId = $(this).attr('id'); var currentBox = $('.folioBox .' + currentId); $(currentBox).toggle(400); }); }); </script> <a class="interface" id="apple">Apple flavor</a> <a class="interface" id="banana">Banana flavor</a> <a class="interface" id="cherry">Cherry flavor</a> <div class="folioBox apple">content</div> <div class="folioBox banana">content</div> <div class="folioBox cherry">content</div> I just can't get it to work and I can't figure out whether I would be best using match or find or filter. Some assistance would be much appreciated!

    Read the article

  • Ajax Minifier Visual Studio include all javascript files

    - by Michael
    I am using the Ajax Minifier http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=766 and have embedded it in the csproj file for use in Visual Studio 2008 (not the free version). I have two folders, Content and Scripts, directly under the root of the project. Also, the Content folder has subfolders, and would like to include all of these as well (if I have to manually add each subfolder that is fine as well). Currently, my csproj file looks like this (and is included within the Project tags as instructed). There are no build errors, the files simply do not get minified. (I've enabled Project - View All files) <Import Project="$(MSBuildExtensionsPath)\Microsoft\MicrosoftAjax\ajaxmin.tasks" /> <Target Name="AfterBuild"> <ItemGroup> <JS Include="Scripts\*.js" Exclude="Scripts\*.min.js;"/> <JS Include="Content\**\*.js" Exclude="Content\**\*.min.js;"/> </ItemGroup> <AjaxMin SourceFiles="@(JS)" SourceExtensionPattern="\.js$" TargetExtension=".min.js" /> </Target> How would I edit the csproj file in order to include these folders?

    Read the article

  • how to show page on the parent of the iframe

    - by zjm1126
    index.html is : <iframe src="/changeDataAndBack"></iframe> but the html file return back is show in the iframe , how to show page on the parent of the iframe thanks updated: i changeed to this,but nothing happend : <iframe src="/_openid/login?continue=/" target="_top"></iframe>

    Read the article

  • Rails - Preventing users from contributing to website when there score is too low - callback / obser

    - by adam
    A User can add a Sentence directly on my website, via twitter or email. To add a sentence they must have a minimum score. If they don't have the minimum score they cant post the sentence and a warning message is either flashed on the website, sent back to them via twitter or email. So I'm wondering how best to code this check. Im thinking a sentence observer. So far my thoughts are in before_create score_sufficient() - score ok = save - score too low = do not save In the case of too low i need to return some flag so that the calling code can then fire off teh relevant warning. What type of flag should I return? False is too ambiguous as that could refer to validation. I could raise an exception but that doesn't sound right or I could return a symbol? Is this even the right approach? What's the best way to code this?

    Read the article

  • Having problem loading data from AppDelegate using UITableView into a flip view, loads first view bu

    - by Ms. Ryann
    AppDelegate: @implementation Ripe_ProduceGuideAppDelegate -(void)applicationDidFinishLaunching:(UIApplication *)application { Greens *apricot = [[Greens alloc] init]; apricot.produceName = @"Apricot"; apricot.produceSight = @"Deep orange or yellow orange in appearance, may have red tinge, no marks or bruises. "; apricot.produceTouch = @"Firm to touch and give to gentle pressure, plump."; apricot.produceSmell = @"Should be Fragrant"; apricot.produceHtoP = @"raw, salads, baked, sauces, glazes, desserts, poached, stuffing."; apricot.produceStore = @"Not ripe: place in brown paper bag, at room temperature and out of direct sunlight, close bag for 2 - 3 days. Last for a week. Warning: Only refrigerate ripe apricots."; apricot.produceBest = @"Spring & Summer"; apricot.producePic = [UIImage imageNamed:@"apricot.jpg"]; Greens *artichoke = [[Greens alloc] init]; artichoke.produceName = @"Artichoke"; artichoke.produceSight = @"Slightly glossy dark green color and sheen, tight petals that are not be too open, no marks, no brown petals or dried out look. Stem should not be dark brown or black."; artichoke.produceTouch = @"No soft spots"; artichoke.produceSmell = @" Should not smell"; artichoke.produceHtoP = @"steam, boil, grill, saute, soups"; artichoke.produceStore = @"Stand up in vase of cold water, keeps for 2 -3 days. Or, place in refrigerator loose without plastic bag. May be frozen, if cooked but not raw."; artichoke.produceBest = @"Spring"; artichoke.producePic = [UIImage imageNamed:@"artichoke.jpg"]; self.produce = [[NSMutableArray alloc] initWithObjects:apricot, artichoke, nil]; [apricot release]; [artichoke release]; FirstView: @implementation ProduceView -(id)initWithIndexPath: (NSIndexPath *)indexPath { if (self == [super init] ){ index = indexPath; } return self; } -(void)viewDidLoad { Ripe_ProduceGuideAppDelegate *delegate = (Ripe_ProduceGuideAppDelegate *) [[UIApplication sharedApplication] delegate]; Greens *thisProduce = [delegate.produce objectAtIndex:index.row]; self.title = thisProduce.produceName; sightView.text = thisProduce.produceSight; touchView.text = thisProduce.produceTouch; smellView.text = thisProduce.produceSmell; picView.image = thisProduce.producePic; } FlipView: @implementation FlipsideViewController @synthesize flipDelegate; -(id)initWithIndexPath: (NSIndexPath *)indexPath { if ( self == [super init]) { index = indexPath; } return self; } -(void)viewDidLoad { Ripe_ProduceGuideAppDelegate *delegate = (Ripe_ProduceGuideAppDelegate *) [[UIApplication sharedApplication] delegate]; Greens*thisProduce = [delegate.produce objectAtIndex:index.row]; self.title = thisProduce.produceName; bestView.text = thisProduce.produceBest; htopView.text = thisProduce.produceHtoP; storeView.text = thisProduce.produceStore; picView.image = thisProduce.producePic; } *the app works, the flip view for Artichoke shows the information for Apricot. Been working on it for two days. I have been working with iPhone apps for two months now and would very much appreciate any assistance with this problem. Thank you very much.

    Read the article

  • What are the attack vectors for passwords sent over http?

    - by KevinM
    I am trying to convince a customer to pay for SSL for a web site that requires login. I want to make sure I correctly understand the major scenarios in which someone can see the passwords that are being sent. My understanding is that at any of the hops along the way can use a packet analyzer to view what is being sent. This seems to require that any hacker (or their malware/botnet) be on the same subnet as any of the hops the packet takes to arrive at its destination. Is that right? Assuming some flavor of this subnet requirement holds true, do I need to worry about all the hops or just the first one? The first one I can obviously worry about if they're on a public Wifi network since anyone could be listening in. Should I be worried about what's going on in subnets that packets will travel across outside this? I don't know a ton about network traffic, but I would assume it's flowing through data centers of major carriers and there's not a lot of juicy attack vectors there, but please correct me if I am wrong. Are there other vectors to be worried about outside of someone listening with a packet analyzer? I am a networking and security noob, so please feel free to set me straight if I am using the wrong terminology in any of this.

    Read the article

  • IBM laptop remove access-connections

    - by Kevin
    I installed IBM Access Connections on my IBM t61 laptop to manage my wireless connections but it simply will not connect to my network. I want to uninstall it and try the Intel software which is capable to performing the same task. However, when I go into "Control Panel" - "Add/Remove Programs" and try to "Remove" this package, it simply opens up a screen and closes it immediately. This happens too fast for me to see whether its an error. Has anyone encountered this issue ? The event logs do not show any error.

    Read the article

  • Windows Upgrade vs Full Install

    - by James Atkinson
    I'm in the process of purchasing a Netbook for use while traveling. The included OS is XP, however, I would like to upgrade(?) to Windows 7. My question: Does a Windows Upgrade have the same physical footprint and performance as a full install? Does an upgrade leave behind non used files/resources that were originally included in XP? If so, are there ways to reduce this? I'm trying to reduce as much OS bloat as possible. Please let me know if my question is unclear. Thanks. Related to http://superuser.com/questions/60646/is-a-clean-install-really-better-than-an-upgrade however, this doesn't address the "leftovers" question.

    Read the article

  • Saving all posts to .NET WebService in XML to DB

    - by Nic
    I am sure this is an easy question however I am not finding the solution. I want to save the XML files posted to my .NET Web Service. I am sure it is just a simple method call when the service is invoked but I am not finding it. I would like to save the full XML posted to the service Any help would be greatly appreciated. Thank you in advance.

    Read the article

  • Default values for Content Taxonomy fields in Drupal with Hierarchical Select widget

    - by lazysoundsystem
    I'm trying to set the default value for a Content Taxonomy field in a hook_form_alter, but can't pin down the necessary format. I've tried this and many variations: foreach (element_children($form) as $child) { // Set $default_value. if ($form[$child]['tids']) { // This, for Content Taxonomy fields, isn't working: $form[$child]['tids']['#default_value'] = array('value' => $default_value); dsm($form[$child]['tids']['#default_value']); } else { // This, for other fields, is working: $form[$child][0]['#default_value']['value'] = $default_value; } } Can anyone tell me what I'm missing? Edit: In response to Henrik Opel (thanks for getting involved), here is the print out of the relevant field of the form with my changes to the default fields commented out, showing the '#default_value' field I'm trying to influence. It also shows that the option widget I'm using is Hierarchical Select (could this be a factor?). In the dsm() in the code above, the changes to the default value are recognised, but they don't get processed later on. field_name_of_content_taxonomy_field (Array, 3 elements) #tree (Boolean) TRUE #weight (String, 1 characters ) 5 tids (Array, 7 elements) #title (String, 10 characters ) Vocabulary_name #type (String, 19 characters ) hierarchical_select #weight (String, 1 characters ) 5 #config (Array, 15 elements) // 15 elements here #required (String, 1 characters ) 0 #description (String, 0 characters ) #default_value (Array, 0 elements)

    Read the article

  • Problem with greek characters using java

    - by Subhendu Mahanta
    I am trying to write greek characters to a file using java like this: String greek = "\u03c1\u03ae\u03bc. \u03c7\u03b1\u03b9\u03c1\u03b5\u03c4\u03ce"; try { BufferedWriter out = new BufferedWriter(new FileWriter("E:\\properties\\outfilename.txt")); out.write(greek); out.close(); } catch (IOException e) { } Not working. Tried to use javac -encoding ISO-8859-7. Also tried java -Dfile.encoding=ISO-8859-7. Assuming that as I do not have greek font in my pc, I downloaded achillies (greek font - Ach4.ttf).Installed it by going to control panel fonts. Any ideas?

    Read the article

  • Is there such a thing as an "elisp bundle" for TextMate?

    - by Vivi
    I started using Code Collector Pro to organise and save my Emacs codes, and this software requires TextMate bundles for syntax highlighting. They have a lisp bundle, but not an elisp bundle, at least not that I can see. I would think that the syntax highlighting would work under the lisp bundle, but for some reason it isn't happening. I have never even seen any lisp code with syntax highlighting, so it is possible that the thing is working and I don't know, but I honestly don't think so, because the ;; before a line seems to me to be a comment thing, so anything after that should be in the color defined for comments which in my case is green. Here is a picture of my code collector screen with a piece of code written by huaiyuan answering my question posted here: Is this looking as it should or is there something wrong? Back to the initial question: is there a textmate bundle for elisp or a bundle like the ones from textmate I can download to get syntax highlighting?

    Read the article

  • Visual Studio reports that not all code path return a value, even though they do

    - by chris12892
    I have an API in NETMF C# that I am writing that includes a function to send an HTTP request. For those who are familiar with NETMF, this is a heavily modified version of the "webClient" example, which a simple application that demonstrates how to submit an HTTP request, and recive a response. In the sample, it simply prints the response and returns void,. In my version, however, I need it to return the HTTP response. For some reason, Visual Studio reports that not all code paths return a value, even though, as far as I can tell, they do. Here is my code... /// <summary> /// This is a modified webClient /// </summary> /// <param name="url"></param> private string httpRequest(string url) { // Create an HTTP Web request. HttpWebRequest request = HttpWebRequest.Create(url) as HttpWebRequest; // Set request.KeepAlive to use a persistent connection. request.KeepAlive = true; // Get a response from the server. WebResponse resp = request.GetResponse(); // Get the network response stream to read the page data. if (resp != null) { Stream respStream = resp.GetResponseStream(); string page = ""; byte[] byteData = new byte[4096]; char[] charData = new char[4096]; int bytesRead = 0; Decoder UTF8decoder = System.Text.Encoding.UTF8.GetDecoder(); int totalBytes = 0; // allow 5 seconds for reading the stream respStream.ReadTimeout = 5000; // If we know the content length, read exactly that amount of // data; otherwise, read until there is nothing left to read. if (resp.ContentLength != -1) { for (int dataRem = (int)resp.ContentLength; dataRem > 0; ) { Thread.Sleep(500); bytesRead = respStream.Read(byteData, 0, byteData.Length); if (bytesRead == 0) throw new Exception("Data laes than expected"); dataRem -= bytesRead; // Convert from bytes to chars, and add to the page // string. int byteUsed, charUsed; bool completed = false; totalBytes += bytesRead; UTF8decoder.Convert(byteData, 0, bytesRead, charData, 0, bytesRead, true, out byteUsed, out charUsed, out completed); page = page + new String(charData, 0, charUsed); } page = new String(System.Text.Encoding.UTF8.GetChars(byteData)); } else throw new Exception("No content-Length reported"); // Close the response stream. For Keep-Alive streams, the // stream will remain open and will be pushed into the unused // stream list. resp.Close(); return page; } } Any ideas? Thanks...

    Read the article

  • Question about Transact SQL syntax

    - by Yousui
    Hi guys, The following code works like a charm: BEGIN TRY BEGIN TRANSACTION COMMIT TRANSACTION END TRY BEGIN CATCH IF @@TRANCOUNT > 0 ROLLBACK; DECLARE @ErrorMessage NVARCHAR(4000), @ErrorSeverity int; SELECT @ErrorMessage = ERROR_MESSAGE(), @ErrorSeverity = ERROR_SEVERITY(); RAISERROR(@ErrorMessage, @ErrorSeverity, 1); END CATCH But this code gives an error: BEGIN TRY BEGIN TRANSACTION COMMIT TRANSACTION END TRY BEGIN CATCH IF @@TRANCOUNT > 0 ROLLBACK; RAISERROR(ERROR_MESSAGE(), ERROR_SEVERITY(), 1); END CATCH Why?

    Read the article

  • jQuery: Need to "refresh" a widget.

    - by Legend
    I am adapting the Coverflow technique to work with a div. The coverflow function (included as a js file in the head section) is here. When I dynamically add a DIV, it doesn't show up in the coverflow. I am wondering if there is a way to add a destroy function to this js file so that whenever a new div add is added, I can call the destroy method and then reinstantiate. Any suggestions on how I should go about doing this?

    Read the article

  • Deleting Multiple rows from a TableView

    - by Sid
    hi Frnz, i want to delete multiple rows from a table view based on users selection.obviously i cant use didSelectRowAtIndexPath method coz it will be called for every row selected. i want to allow user to select multiple rows for deletion and then delete them in one go...Is it possible if yes then how to go about it.Also i am using a single view based project and i want the header of table view changed to "Delete" on the same view when the user want to delete the rows from the view. Thx

    Read the article

  • java alternative for phpMyAdmin

    - by rcourtna
    I find myself working in an environment where all I have access to is Tomcat + MySQL. No Apache, no PHP. I'm looking for a web interface to MySQL that will run under Tomcat (can't be a desktop interface, as the mysql port is not accessible). I'm tried jMyAdmin and javaMyAdmin. I can't get either to work, and both lack documentation and community support. Can anyone make a recommendation please?

    Read the article

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