Search Results

Search found 4656 results on 187 pages for 'sleepy john'.

Page 166/187 | < Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >

  • Using css child selector

    - by David Thorisson
    I am trying to apply css on the first A element inside .Outer, .Outer > a:first-child {font-weight:bold} doesn't work. Why? <div class="Outer"> <img src='image123.jpg' /> <a href="Default.aspx?ID=4083" id="ctl00_CPH_Main_Rep_List2_ctl03_HyperLink1">John Johnsson</a> <a href="../Users/ViewList.aspx?module=Occupation&amp;ID=70">Doctor</a> <a href="../Workplaces/Default.aspx?ID=31">Mayo Clinica> </div>

    Read the article

  • Array.BinarySearch does not find item using IComparable

    - by Sir Psycho
    If a binary search requires an array to be sorted before hand, why does the following code work? string[] strings = new[] { "z", "a", "y", "e", "v", "u" }; int pos = Array.BinarySearch(strings, "Y", StringComparer.OrdinalIgnoreCase); Console.WriteLine(pos); And why does this code result return -1? public class Person : IComparable<Person> { public string Name { get; set; } public int Age { get; set; } public int CompareTo(Person other) { return this.Age.CompareTo(other.Age) + this.Name.CompareTo(other.Name); } } var people = new[] { new Person { Age=5,Name="Tom"}, new Person { Age=1,Name="Tom"}, new Person { Age=2,Name="Tom"}, new Person { Age=1,Name="John"}, new Person { Age=1,Name="Bob"}, }; var s = new Person { Age = 1, Name = "Tom" }; // returns -1 Console.WriteLine( Array.BinarySearch(people, s) );

    Read the article

  • Making an SVG DOM JavaScript class

    - by CryptoQuick
    I'm unsatisfied with other JavaScript libraries and frameworks like jQuery, MooTools, and Raphael, because of their inability to support SVG grouping. You'd think it'd be a very simple thing for them to implement. Anyway, I'm trying to make a JavaScript class (using John Resig's class.js script) like this: var El = Class.extend({ el: null, svgNS: "http://www.w3.org/2000/svg", init: function (type) { this.el = document.createElementNS(this.svgNS, type); }, set: function (name, attr) { this.el.setAttributeNS(null, name, attr); }, get: function (el, name) { var attr = this.el.getAttributeNS(null, name); return attr; }, add: function (targEl) { targEl.el.appendChild(this.el); }, remove: function (targEl) { targEl.el.removeChild(this.el); }, setEl: function (docId) { this.el = document.getElementById(docId); } }); I can add elements to the DOM using these statements outside of the class, but storing the element inside the class becomes problematic. Anyone have any creative ideas?

    Read the article

  • Creating get/set method dynamically in javascript

    - by portoalet
    I am trying to create a UserDon object, and trying to generate the get and set methods programmatically ( based on Pro Javascript book by John Resig page 37 ), and am testing this on Firefox 3.5 The problem is: in function UserDon, "this" refers to the window object instead of the UserDon object. So after calling var userdon = new UserDon(...) I got setname and getname methods created on the window object (also setage and getage). How can I fix this? function UserDon( properties ) { for( var i in properties ) { (function(){ this[ "get" + i ] = function() { return properties[i]; }; this[ "set" + i ] = function(val) { properties[i] = val; }; })(); } } var userdon = new UserDon( { name: "Bob", age: 44 });

    Read the article

  • cannot display json data returned from jquery ajax call

    - by amby
    Hi, can somebody please tell me, how can I display json data returning from the ajax call. I am new to this. $.ajax({ type: "POST", dataType: 'JSON', //data: "{'ntid':'john'}", //contentType: "application/json; charset=utf-8", //processData: false, url: "Testing.aspx/SendMessage", error: function(XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); }, success: function(result, txtStatus, httpRequest) { alert(txtStatus); the_object = result; $('#status').html(concatObject(the_object)); } above is the js file. should i need to do something on asp file directly to display it. if yes, then how? please reply me soon. i m stuck here and unable to display data here

    Read the article

  • Web-based JSON editor that works like property explorer with AJAXy input form

    - by dreftymac
    Background: This is a request for something that may not exist yet, but I've been meaning to build one for a long time. First I will ask if anyone has seen anything like it yet. Suppose you have an arbitrary JSON structure like the following: { 'str_title':'My Employee List' ,'str_lastmod': '2009-June-15' ,'arr_list':[ {'firstname':'john','lastname':'doe','age':'33',} ,{'firstname':'jane','lastname':'doe','age':'34',} ,{'firstname':'samuel','lastname':'doe','age':'35',} ] } Question: Is there a web-based JSON editor that could take a structure like this, and automatically allow the user to modify this in a user-friendly GUI? Example: Imagine an auto-generated HTML form that displays 2 input-type-text controls for both title and lastmod, and a table of input-type-text controls with three columns and three rows for arr_list ... with the ability to delete or add additional rows by clicking on a [+][X] next to each row in the table. Big Idea: The "big idea" behind this is that the user would be able to specify any arbitrary (non-recursive) JSON structure and then also be able to edit the structure with a GUI-based interaction (this would be similar to the "XML Editor Grid View" in XML Spy).

    Read the article

  • git: having 2 push/pull repos in sync (or 1 push/pull and 1 pull in sync)

    - by xavjuan
    Hello, We work on multiple geographically seperate sites. Today I have our git clones all live on one site A. Then users from site B have to ssh over to do a git clone or to push in changes. These are bare repos where the update is through pushes. Ideally, for git clone/push performance, I'd like to limit having to go over ssh. I'd like to have a copy of git repo X live on site A and site B... and have some syncing mechanism between them. OR to have X live on both sites, but only allow pushing to A (and have that setup correctly at clone time on B) I'm worried about the case where someone on site A pushes changes to the repo at site A at the same time that someone on site B pushes a truely conflicting change to the repo at site B. Is there some 'sync'ing solution built into git for distributed open repos like this? Or a way to have a clone from X set the origin/parent to the X from the other site? thanks, -John

    Read the article

  • need help transforming an XML file, whose part of it is with escape sequences, into html

    - by shlomi
    hello, i need help transforming the following XML <?xml-stylesheet type=text/xsl href=XSL_17.xsl?> <Root> <Book> <Author>John smith</Author> <Genre>Novel</Genre> <Details>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Dets&gt;&lt;Ds&gt;&lt;D DN="Pages" DV="381" /&gt;&lt;D DN="Binding" DV="Hardcover" /&gt;&lt;D DN="Rate" DV="7.8" /&gt;&lt;/Ds&gt;&lt;/Dets&gt;</Details> </Book> <Car> <Year>2010</Year> <Name>Charger</Name> <Manufacturer>Dodge</Manufacturer> </Car> </Root> to the following HTML <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <table> <tr> <td><strong>Book</strong></td> </tr> <tr> <td><strong>Name</strong></td> <td><strong>Value</strong></td> </tr> <tr> <td>Author</td> <td>John smith</td> </tr> <tr> <td>Genre</td> <td>Novel</td> </tr> <tr> <td>Details</td> <td> <table> <tr> <td><strong>Name</strong></td> <td><strong>Value</strong></td> </tr> <tr> <td>Pages</td> <td>381</td> </tr> <tr> <td>Binding</td> <td>Hardcover</td> </tr> <tr> <td>Rate</td> <td>7.8</td> </tr> </table> </td> </tr> </table> <table> <tr> <td><strong>Car</strong></td> </tr> <tr> <td><strong>Name</strong></td> <td><strong>Value</strong></td> </tr> <tr> <td>Year</td> <td>2010</td> </tr> <tr> <td>Name</td> <td>Charger</td> </tr> <tr> <td>Manufacturer</td> <td>Dodge</td> </tr> </table> </body> </html> i.e. i need to represent both normal XML and escaped XML in HTML tables.

    Read the article

  • Prepare and import data into existing database

    - by Álvaro G. Vicario
    I maintain a PHP application with SQL Server backend. The DB structure is roughly this: lot === lot_id (pk, identify) lot_code building ======== buildin_id (pk, identity) lot_id (fk) inspection ========== inspection_id (pk, identify) building_id (fk) date inspector result The database already has lots and buildings and I need to import some inspections. Key points are: It's a one-time initial load. Data comes in an Excel file. The Excel data is unaware of DB autogenerated IDs: inspections must be linked to buildings through their lot_code What are my options to do such data load? date inspector result lot_code ========== =========== ======== ======== 31/12/2009 John Smith Pass 987654X 28/02/2010 Bill Jones Fail 123456B

    Read the article

  • Extend a direct instance

    - by Diolor
    We have a new instance of an object with four properties: person={firstname:"John",lastname:"Doe",age:50,eyecolor:"blue"}; What is the best way to many other properties to that object? If we wanted few couple more sure we would: person[address_no] = 4; .... person[country] = 'Netherlands'; But what if we have a lot properties. Is there any minimalistic way like the one below? (I know it doesn't work) person +={address_no: '4', .... , country: 'Netherlands'};

    Read the article

  • Using Jquery $getJSON How do I dynamically create data for the [data] parameter after Url param?

    - by Breadtruck
    I have no problems getting the Json to work and parse the json return. I was just wondering how I could build a dynamic "whatever data is" and stick it into [data] to pass my parameters from there and not manually append them to the url. From jquery website example: $.getJSON("test.js", { name: "John", time: "2pm" }, function(json){ alert("JSON Data: " + json.users[3].name); }); I thought I could build a string ( which doesn't make sense anyway ) and drop it inside the { }, but I obviously don't understand that part. name: isn't a string and you can't put a variable in that part, so how would I dynamically put items into whatever [data] is.

    Read the article

  • Get the first and second objects from a list using LINQ

    - by Vahid
    I have a list of Person objects. How can I get the first and second Person objects that meet a certain criteria from List<Person> People using LINQ? Let's say here is the list I've got. How can I get the first and second persons that are over 18 that is James and Jodie. public class Person { public string Name; public int age; } var People = new List<Person> { new Person {Name = "Jack", Age = 15}, new Person {Name = "James" , Age = 19}, new Person {Name = "John" , Age = 14}, new Person {Name = "Jodie" , Age = 21}, new Person {Name = "Jessie" , Age = 19} }

    Read the article

  • How to add SQL elements to an array in PHP

    - by DanLeaningphp
    So this question is probably pretty basic. I am wanting to create an array from selected elements from a SQL table. I am currently using: $rcount = mysql_num_rows($result); for ($j = 0; $j <= $rcount; $j++) { $row = mysql_fetch_row($result); $patients = array($row[0] => $row[2]); } I would like this to return an array like this: $patients = (bob=>1, sam=>2, john=>3, etc...) Unfortunately, in its current form, this code is either copying nothing to the array or only copying the last element.

    Read the article

  • Returning the value of an identity column during/after SQL INSERT command

    - by Adam Kane
    Using VS 2010, with ASP.NET, and .NET 3.0, and C#... When I use a System.Web.UI.WebControls.SqlDataSource and call its Insert() method to insert a new row, and that table has an identity column, I'd like my method to return the value of that column. For example, in my SQL 2005 table, I've got: Customer.Id Customer.FirstName Customer.LastName Where Customer.Id is an identity colum. When I call my method InsertNewCustomerRecord( "John", "Smith" ), I'd like to be able to return the Customer.Id that gets automatically generated in the database. Sorry for such a roughly posed question. Let me know if I can add better detail. Thanks.

    Read the article

  • Relative Position in PHP between 2 points (Lat/Long)

    - by Brian H
    I have a database of airports with Latitude and Longitude for each point. I want to run a PHP script to find all airports that are nearby a given airport, with their distance and relative direction. I.e. for Airport KLDJ (40-37-02.810N 074-14-40.539W) Airport Nearby KJFK - John F Kennedy Airport (21.2 nm NE) (40-38-23.104N 073-46-44.132W) I have used code from http://www.movable-type.co.uk/scripts/latlong.html to find distance, and tried to use it to find bearing, which might not be right. //BEARING RHUMB LINE $phi = log(tan($lat2/2+pi/4)/tan($lat1/2+pi/4)); $distance['bearing'] = (rad2deg(atan2($theta, $phi)) +180) % 360; I basically want to run all points through this script and find the distance, which I have already, but then the direction. (i.e. N, S, W, E, NW, SW, NE, SE)

    Read the article

  • JavaScript inheritance

    - by Tower
    Hi, Douglas Crockford seems to like the following inheritance approach: if (typeof Object.create !== 'function') { Object.create = function (o) { function F() {} F.prototype = o; return new F(); }; } newObject = Object.create(oldObject); It looks OK to me, but how does it differ from John Resig's simple inheritance approach? Basically it goes down to newObject = Object.create(oldObject); versus newObject = Object.extend(); And I am interested in theories. Implementation wise there does not seem to be much difference.

    Read the article

  • mysql left outer join

    - by tirso
    hi to all I have two tables employee and timecard, employee table has fields employee_id,firstname,middlename,lastname and timecard table has fields employee_id,time-in,time-out,tc_date_transaction. I want to select all employee records which have the same employee_id with timecard and date is equal with the current date. If there are no records equal with the current date then return also the records of employee even without time-in,timeout and tc_date_transaction. I have query like this SELECT * FROM employee LEFT OUTER JOIN timecard ON employee.employee_id = timecard.employee_id WHERE tc_date_transaction = "17/06/2010"; result should like this: employee_id,firstname, middlename, lastname,time-in,time-out,tc_date_transaction 1,john,t,cruz,08:00,05:00,17/06/2010 2,mary,j,von,null,null,null any help would greatly appreciated Thanks in advance

    Read the article

  • How to get data type property values using SPARQL

    - by udayalkonline
    hey, I have created some sample ontology in protege.According to my ontology there is a class called person and which has sub class called Student.There are some student individuals(john,paul,marry,...). I have diffiend some data property called "email" and assigned their email addresses. Following query which is resulting all the individuals in ontology.But I want to get each individual and their email address. String queryStr = "PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# "+ "PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# "+ "select ?ind "+ "where { "+ "?ind rdf:type http://www.semanticweb.org/ontologies/2010/5/Ontology1275975684120.owl#Student ;"+ "}\n "; Above query was tested on jena in eclipse IDE. any idea..? Thank in advance!

    Read the article

  • Is wrapping new within the constructor good or bad?

    - by Timothy
    I watched John Resig's Best Practices in JavaScript Library Design presentation; one slide suggested "tweaking" the object constructor so it instantiates itself. function jQuery(str, con) { if (window === this) { return new jQuery(str, con); } // ... } With that, new jQuery("#foo") becomes jQuery("# foo"). I thought it was rather interesting, but I haven't written a constructor like that in my own code. A little later I read a post here on SO. (Sorry, I don't remember which or I'd supply a link. I will update the question if I can find it again.) One of the comments said it was bad practice to hide new from the programmer like that, but didn't go into details. My question is, it the above generally considered good, bad, or indifferent, and why?

    Read the article

  • vista bandwith reservation

    - by user185646
    I would like to write my own version of Microsoft Live labs pivot.http://www.getpivot.com/ For this i will use realtime texture streaming technology like John Carmack did for doom4. But i would like to use Windows vista SetFileBandwidthReservation api to have the best throughput possible. For example // reserve bandwidth of 200 bytes/sec result = SetFileBandwidthReservation( hFile, 1000, 200, FALSE, &transferSize, &outstandingRequests ); What i dont understand is the lpTransferSize and lpNumOutstandingRequests return parameters. How should i next read the file for this to be the most worth it. Should i do exactly lpNumOutstandingRequests number of request of size lpTransferSize. Or can i do one synchronous request bigger than lpTransferSize.

    Read the article

  • How to use a proprety/value table in MySQL

    - by David
    I inherited a mysql database that has a table with columns like this: object_id, property, value It holds data like this: 1,first_name,Jane 1,last_name,Doe 1,age,10 1,color,red 2,first_name,Mike 2,last_name,Smith 2,age,20 2,color,blue 3,first_name,John 3,last_name,Doe 3,age,20 3,color,red ... Basically what I want to do is treat this table as a regular table. How would I get the id numbers (or all properties) of a person who is age 20 sorted by last and than first name? So far I have: SELECT object_id FROM table WHERE property = 'age' AND value = '20' union SELECT object_id FROM table WHERE property = 'color' AND value = 'red' But I'm not sure how to go about ordering the data. Thanks

    Read the article

  • How to store private pictures and videos in Ruby on Rails

    - by TK
    Here's a story: User A should be able to upload an image. User A should be able to set a privacy. ("Public" or "Private"). User B should not be able to access "Private" images of User A. I'm planning to user Paperclip for dealing with uploads. If I store the images under "RAILS_ROOT/public/images", anyone who could guess the name of the files might access the files. (e.g., accessing http://example.com/public/images/uploads/john/family.png ) I need to show the images using img tags, so I cannot place a file except public. How can I ensure that images of a user or group is not accessible by others?

    Read the article

  • Graph call "/me/friends" doesn't contain names if called from a testuser

    - by Marc
    When I log into Facebook with my account and call the Graph API with /me/friends it returns an array like this: [ {id: "6868...", name: "John Smith"}, {id: "7531...", name: "Diane Smith"}, ... ] But if I'm logged in with a Facebook testuser and do the same call I get an array like this: [ {id: "100002927..."}, {id: "100003151..."}, ... ] So I'm missing the name property. Bug? Or did I some mistake? I'm using the JS SDK, but I think that doesn't matter.

    Read the article

  • How to get the position of a record in a table (SQL Server)

    - by Peter Siegmann
    Following problem: I need to get the position of a record in the table. Let's say I have five record in the table: Name: john doe, ID: 1 Name: jane doe, ID: 2 Name: Frankie Boy, ID: 4 Name: Johnny, ID: 9 Now, "Frankie Boy" is in the third position in the table. But How to get this information from the SQL server? I could count IDs, but they are not reliable, Frankie has the ID 4, but is in the third position because the record with the ID '3' was deleted. Is there a way? I am aware of ROW_RANK but it would be costly, because I need to select basically the whole set first before I can rank row_rank them. I am using MS SQL Server 2008 R2.

    Read the article

  • Using jep.invoke() method

    - by hofsoc
    Hi, I need to call a function from a python script and pass in parameters into it. I have a test python script which I can call and run from java using Jepp - this then adds the person. Eg Test.py import Finding from Finding import * f = Finding() f.addFinding("John", "Doe", 27) Within my Finding class I have addFinding(firstname, lastName, age) However, I wish to be able to do this from within java. Should I be using the jep.invoke() method. Does anyone have a hello world example of such a thing being done or forward me to some good examples? Does anyone have any suggestions please? Thanks in advance

    Read the article

< Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >