Search Results

Search found 344 results on 14 pages for 'ethan hunt'.

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

  • json object composition details

    - by Ethan
    in .json text, is the 'value' in a basic single pair object the title of a value type (e.g. [string, number, object]), or a value for a typed object (e.g. 2, or "dog", or Object3)? This is how http://www.json.org/ presents the information: "An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma)."

    Read the article

  • Rails: how do you access RESTful helpers?

    - by Ethan
    I'm trying to work through this guide to Rails routing, but I got stuck in section 3.3: Creating a RESTful route will also make available a pile of helpers within your application and then they list some helpers like photos_url, photos_path, etc. My questions: Where can I find the complete list of helpers that is "made available?" Is there a way to call the helpers in the console? I created an app, then opened up the console with script/console. I tried to call one of the helpers on the console like this: >> entries_url But got: NameError: undefined local variable or method `entries_url' for #<Object:0x349a4> from (irb):8

    Read the article

  • How can one make a web-site accessible only when someone has a dongle?

    - by Brian M. Hunt
    Suppose you want to add an extra layer of credentials on top of a SSL-encrypted login/password, but you don't want to increase complexity to the user. Is there a way to add the requirement of the possession of a dongle to web-server authentication schemes with existing cross-platform browser capabilities? In other words, to get access to the web-site, you would need a username, password, and a USB dongle that has been plugged into the client computer. The dongle would presumably do some sort of challenge/response. It'd be ideal if this dongle solution worked with Firefox automatically or with the simple addition of a plugin. Thoughts and suggestions are appreciated.

    Read the article

  • File upload with Sinatra.

    - by Ethan Turkeltaub
    I am trying to be able to upload files with Sinatra. I have the code here, but I'm getting the error "method file_hash does not exist" (see /lib/mvc/helpers/helpers.rb). What is going on here? Is there some dependency I'm missing.

    Read the article

  • Need help with a conditional SELECT statement

    - by Ethan
    I've got a stored procedure with a select statement, like this: `SELECT author_ID, author_name, author_bio FROM Authors WHERE author_ID in (SELECT author_ID from Books) ` This limits results to authors who have book records. This is the Books table: Books book_ID INT author_ID INT book_title NVARCHAR featured_book BIT What I want to do is conditionally select the ID of the featured book by each author as part of the select statement above, and if none of the books for a given author are featured, select the ID of the first (top 1) book by the author from the books table. How do I approach this?

    Read the article

  • Javascript function using "this = " gives "Invalid left-hand side in assignment"

    - by Brian M. Hunt
    I am trying to get a Javascript object to use the "this" assignments of another objects' constructor, as well as assume all that objects' prototype functions. Here's an example of what I'm attempting to accomplish: /* The base - contains assignments to 'this', and prototype functions */ function ObjX(a,b) { this.$a = a, $b = b; } ObjX.prototype.getB() { return this.$b; } function ObjY(a,b,c) { // here's what I'm thinking should work: this = ObjX(a, b * 12); /* and by 'work' I mean ObjY should have the following properties: * ObjY.$a == a, ObjY.$b == b * 12, * and ObjY.getB() == ObjX.prototype.getB() * ... unfortunately I get the error: * Uncaught ReferenceError: Invalid left-hand side in assignment */ this.$c = c; // just to further distinguish ObjY from ObjX. } I'd be grateful for your thoughts on how to have ObjY subsume ObjX's assignments to 'this' (i.e. not have to repeat all the this.$* = * assignments in ObjY's constructor) and have ObjY assume ObjX.prototype. My first thought is to try the following: function ObjY(a,b,c) { this.prototype = new ObjX(a,b*12); } Ideally I'd like to learn how to do this in a prototypal way (i.e. not have to use any of those 'classic' OOP substitutes like Base2). It may be noteworthy that ObjY will be anonymous (e.g. factory['ObjX'] = function(a,b,c) { this = ObjX(a,b*12); ... }) -- if I've the terminology right. Thank you.

    Read the article

  • ASP.NET 4.0 webforms routing

    - by Ethan
    I have an existing site that I'd like to convert to use routing, and after reading Scott Guthrie's post here, I built a working sample that works for most circumstances. However, since not all of the pages on the existing site match a particular pattern, I'll need to check against a database to determine which route (destination .aspx page) to use. For example, most pages are like this: http://www.mysite.com/people/person.html This is fine - I can easily route these to the view_person.aspx page because of the 'people' directory. But some pages are like this: http://www.mysite.com/category_page.html http://www.mysite.com/product_page.html This necessitates checking the database to see whether to route to the view_category.aspx page or the view_product.aspx page. And this is where I'm stuck. Do I create an IRouteHandler that checks the database and returns the route? Or is there a better way? The only code I've found that kind of fits is the answer to this question. Thanks in advance.

    Read the article

  • Initialize Tab Event in JQuery UI

    - by hunt
    Is there any initialize event in Jquery UI Tabs , which executes only once when particular tab loads ? As show function in Jquery UI tabs executes every time when tab gets load , i want an event that executes only once..

    Read the article

  • Create a jQueryUI 1.8 Button menu

    - by Brian M. Hunt
    Now that jQueryUI 1.8 is out, I was browsing through the updates and came across the new Button widget, and in particular one of the demos with the SplitButton with a dropdown. This demo seems to suggest that the Button widget could be used to create a dropdown menu here. As a matter of discussion, I was wondering what ways there are to go about creating a dropdown menu with this new Button widget. Cheers.

    Read the article

  • Multiple ajax request and progress bar

    - by hunt
    Hi, In a following piece of code i am create a progress bar and showing its progress as the ajax request get processed. i am faking the progress shown here just by adding 5 in to cnt counter variable after that i made a check when counter reach to 90. at this point if the request is not executed successfully then i will pause/disable the progress bar and whenever response come i will complete the whole progress bar with 100. now the problem is i want to add multiple progress bar as i am firing multiple ajax request. so following is the code to implement only for one request and one progress bar but i want it for more than one. as global variables are used over here for checking response and timer id so i don't know how well i can handle it for multiple request var cnt=0; var res=null; function getProgress(data){ res=data; } var i =0; $('#start').click(function(){ i = setInterval(function() { if(res!=null) { clearInterval(i); $("#pb1").progressbar( "option", "value", cnt=cnt+100 ); } var value = $("#pb1").progressbar("option", "value"); if(value >=90 && res==null){ $("#pb1").progressbar("option", "disable"); } else{ $("#pb1").progressbar( "option", "value", cnt=cnt+5 ); } },2500); $.ajax({ url: 'http://localhost/beta/demo.php', success: getProgress }); }); $("#pb1").progressbar({ value: 0 , change: function(event, ui) { if(res!=null) clearInterval(i); } });

    Read the article

  • How can I make sure the Sphinx daemon runs?

    - by Ethan
    I'm working on setting up a production server using CentOS 5.3, Apache, and Phusion Passenger (mod_rails). I have an app that uses the Sphinx search engine and the Thinking Sphinx gem. According to the Thinking Sphinx docs... If you actually want to search against the indexed data, then you’ll need Sphinx’s searchd daemon to be running. This can be controlled using the following tasks: rake thinking_sphinx:start rake ts:start rake thinking_sphinx:stop rake ts:stop What would be the best way to ensure that this takes place in production? I can deploy my app, then manually run rake thinking_sphinx:start, but I like to set things up so that if I have to bounce the server, everything will come back up. Should I put a call to that Rake task in an initializer? Or something in rc.local?

    Read the article

  • Moving Wordpress from Apache to IIS

    - by Dave Hunt
    I've encountered a problem when moving a Wordpress installation from a Linux Apache server to a Windows IIS server. Nearly all pages load blank, including /wp-admin/. I created a php file in the main directory to check phpinfo, and it loads fine. I've copied the file system over, as well as the database. I've also updated the wp-config.php with the correct credentials. I think it has something to do with .htaccess, but I'm not sure how to correct it. Any help would be greatly appreciated.

    Read the article

  • Access element in json having numerical index

    - by hunt
    i have following format of json in which i want to asscess 0.4 , kem , 2 , 2000 values but it seems it doesn't have name index so how one can access it in jquery. when i paste following code in json viewer then i am getting numerical index for 0.4 , kem , 2 "td": [ { "@attributes": { "class": "odd" }, "span": [ "3", "7" ] }, "0.4", "Kem", "24\/04\/2010", "2000", "2", "14000", "Good", "Buckley", "56.0", "2:05.32", "36.65", "54.5" ] }

    Read the article

  • show horizontal scroll bar in jqgrid

    - by Hunt
    Please see the link below, http://www.logicatrix.com/example/records.html In this table there are many columns included , so what i want is to get fit the whole table into drawn gray border i.e. div element with class name bms-dashboard-body. with a horizontal scroll bar just like an excel sheet has on the right bottom corner a small one. is it possible to create liquid layout of this jqgrid table ? if someone has another approach , to fit the this table then i don't mind.

    Read the article

  • PHP file_get_contents() does not work after uploading to the webserver

    - by Ethan
    Sample code: $html = file_get_contents('http://www.google.com'); echo $html; It works on localhost. But after uploading to the webserver, it gives me a warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution. If I replace the domain name with google's IP address, it gives a warning: failed to open stream: Connection timed out. And ini_get("allow_url_fopen") return 1.

    Read the article

  • How can I avoid running ActiveRecord callbacks?

    - by Ethan
    I have some models that have after_save callbacks. Usually that's fine, but in some situations, like when creating development data, I want to save the models without having the callbacks run. Is there a simple way to do that? Something akin to... Person#save( :run_callbacks => false ) or Person#save_without_callbacks I looked in the Rails docs and didn't find anything. However in my experience the Rails docs don't always tell the whole story. UPDATE I found a blog post that explains how you can remove callbacks from a model like this: Foo.after_save.clear I couldn't find where that method is documented but it seems to work.

    Read the article

  • How can I increment a counter every N loops in JMeter?

    - by Dave Hunt
    I want to test concurrency, and reliably replicate an issue that JMeter brought to my attention. What I want to do is set a unique identifier (currently the time in milliseconds with a counter appended) and increment the counter between loops but not between threads. The idea being that the number of threads I have set up is the number of identical identifiers before incrementing and using another. If I had 3 threads with a loop count of 2 I want: 1. Unique ID: <current-time-in-millis>000000 2. Unique ID: <current-time-in-millis>000000 3. Unique ID: <current-time-in-millis>000000 4. Unique ID: <current-time-in-millis>000001 5. Unique ID: <current-time-in-millis>000001 6. Unique ID: <current-time-in-millis>000001 I've tried using Throughput Controllers to increment a counter, as well as several other things that seemed they should work but had no luck. This seems like something JMeter should be able to do. Is there any way to get the value of the loop count?

    Read the article

  • Image overlapping in widget

    - by Hunt
    I am trying to create a widget in android in which when I click over image the image gets changed with a new one -- kind of toggle image. But when I click over it, the image overwrites over the old one rather then replacing the new one. I don't know whether this is the way the widget works or am I doing something wrong. My images are semi-transparent so in case one overrides another one can see the image which is being overlapped. This is the code that I have written in OnReceive by overriding it: @Override public void onReceive(Context context, Intent intent){ if (intent.getAction().equals(iAlertConstant.ACTION_WIDGET_UPDATE_FROM_WIDGET)) { RemoteViews remoteViews = new RemoteViews(context.getPackageName(),R.layout.mywidget); remoteViews.setImageViewResource(R.id.btnOnOff,R.drawable.offbtn); ComponentName thisWidget = new ComponentName(context, EmergencyWidget.class); AppWidgetManager.getInstance(context).updateAppWidget(thisWidget, remoteViews); } else super.onReceive(context, intent); } Layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/widget_background" android:paddingLeft="10.0dip" android:paddingTop="8.0dip" android:paddingRight="10.0dip" android:paddingBottom="8.0dip" android:layout_width="fill_parent" android:layout_height="72dp" android:layout_marginLeft="10.0dip" android:layout_marginTop="10.0dip" android:layout_marginRight="10.0dip" android:id="@+id/emergencyWidget" android:orientation="horizontal"> <ImageView android:background="@drawable/offbtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="7dp" android:layout_marginLeft="4dp" android:layout_marginRight="4dp" android:layout_gravity="right" android:id="@+id/btnOnOff" /> </LinearLayout>

    Read the article

  • Codeigniter form action with slashes instead of normal GETs?

    - by Ethan
    Hey, so this is one of those questions that seems obvious, and I'm probably going to feel stupid, but here goes: I'm doing a CodeIgniter site with a search. Think of a Google type input, where you'd search for "white huskies." I have a search results page that takes a URI (MySite.com/dogs/white huskies), and takes the third part, and performs the search on that term. I'd like this to be done in the URI, and no by POST so my users can bookmark results. The problem I'm having is how to get that search button directed to Mysite.com/dogs/WHATEVER IS IN THE INPUT. How do I get the what is in the input part into the anchor href? I know I could do this with javascript, but I've heard it's bad practice to force people to have javascript for things this small. Thanks for the help!

    Read the article

  • How to implement multi relationship in SQL Server?

    - by Ethan
    I’m trying to design a database to use with ASP.net MVC application. Here is the scenario: There are three entities and users can post their comments for each of these different entities. I just wonder how just put one table for Comments and link all other entities to it. Obviously, Comments table needs 3 references (foreign key) to those tables but as you know these foreign keys can’t be null and just one of them can be filled for each row. Is there any better way than implementing three different tables for each entity’s comments?

    Read the article

  • set the focus of a popup window everytime

    - by hunt
    I have two pages one.html and two.html i am opening a new window using following code //here popup is a global variable popup=window.open('two.html','two'); for the first time a popup window open successfully and get the focus but if i try to open it again without closing already opened popup then two.html is not getting focus for the second time. note: i have set popup window's name as 'two'

    Read the article

  • PHP 5.4 turn display_errors off php.ini

    - by Ethan H
    I need PHP errors not to be displayed but logged. I am using PHP 5.4 My current code to log errors in my php.ini is: log_errors = 1 error_log = "/path-to-file/error_log.txt" Which works however I am getting a 500 internal server error trying to turn error displaying off using display_errors. I have tried using the following, all returning 500 errors. display_errors = 0 display_errors = "0" display_errors = false display_errors = "false" display_errors = Off display_errors = "Off" According to the PHP documentation, as of PHP 5.4, it is a string. What am I suppose to set display_errors to to turn error displaying off?

    Read the article

  • jQuery/javascript events - prototype event handler

    - by Brian M. Hunt
    The following code doesn't work as I intuitively expect it to: function MyObject(input) { input.change(this._foo); this.X = undefined; } MyObject.prototype._foo = function() { alert("This code is never called"); // but if it did this.X = true; } var test_input = $("input#xyz"); // a random, existing input var m = MyObject(test_input); // attach handler (or try to) test_input.change(); // trigger event alert(m.X); // undefined I'd expect that _foo() would be called (and, if that ever happens, that the this variable in _foo() would be an instantiation of MyObject. Does anyone know why this doesn't work, and of any alternative pattern for passing an object to an event handler? Thank you for reading. Brian

    Read the article

  • How to Use border as an image in android xml

    - by Ethan Hunt
    I have a popup to show in my xml. It should have a border. Following is the code:- <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rl_parent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="20dp" > <RelativeLayout android:id="@+id/rl_startpopup" android:layout_width="340dp" android:layout_height="320dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:background="@drawable/popup_outline" android:orientation="vertical" /> </RelativeLayout> The popup_outline is a shape <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:angle="270" android:endColor="#192423" android:startColor="#4a7669" android:type="linear" /> <corners android:radius="8dp" /> <stroke android:width="2dp" android:color="#e4f4d3" /> </shape> here is the image of the popup:- This "popup_outline" is the white border shown. I want to use a repeatable pattern image instead of one color as the border. I have to do this in xml. Please help

    Read the article

  • scope of variables in JavaScript callback functions

    - by Ethan
    I expected the code below to alert "0" and "1", but it alert "2" twice. I don't the reason. Don't know if it is a problem of jQuery. Also, please help me to edit title and tags of this post if they are inaccurate. <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { for (var i=0; i<2; i++) { $.get('http://www.google.com/', function() { alert(i); }); } }); </script> </head> <body> </body> </html>

    Read the article

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