Search Results

Search found 1626 results on 66 pages for 'age'.

Page 13/66 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • 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

  • asp.net Dynamic Data Site own MetaData

    - by loviji
    Hello, I'm searching info about configuring own MetaData in asp.NET Dynamic Site. For example. I have a table in MS Sql Server with structure shown below: CREATE TABLE [dbo].[someTable]( [id] [int] NOT NULL, [pname] [nvarchar](20) NULL, [FullName] [nvarchar](50) NULL, [age] [int] NULL) and I have Ms Sql table, sysTables and sysColumns. sysTables: ID sysTableName TableName TableDescription 1 | someTable |Persons |All Data about Persons in system sysColumns ID TableName sysColumnName ColumnName ColumnDesc ColumnType MUnit 1 |someTable | sometable_pname| Name | Persona Name(ex. John)| nvarchar(20) | null 2 |someTable | sometable_Fullname| Full Name | Persona Name(ex. John Black)| nvarchar(50) | null 3 |someTable | sometable_age| age | Person age| int | null

    Read the article

  • asp.net Dynamic Data Site with custom own MetaData

    - by loviji
    Hello, I'm searching info about configuring own MetaData in asp.NET Dynamic Site. For example. I have a table in MS Sql Server with structure shown below: CREATE TABLE [dbo].[someTable]( [id] [int] NOT NULL, [pname] [nvarchar](20) NULL, [FullName] [nvarchar](50) NULL, [age] [int] NULL) and I there are 2 Ms Sql tables (I've created), sysTables and sysColumns. sysTables: ID sysTableName TableName TableDescription 1 | someTable |Persons |All Data about Persons in system sysColumns: ID TableName sysColumnName ColumnName ColumnDesc ColumnType MUnit 1 |someTable | sometable_pname| Name | Persona Name(ex. John)| nvarchar(20) | null 2 |someTable | sometable_Fullname| Full Name | Persona Name(ex. John Black)| nvarchar(50) | null 3 |someTable | sometable_age| age | Person age| int | null I want that, in Details/Edit/Insert/List/ListDetails pages use as MetaData sysColumns and sysTableData. Because, for ex. in DetailsPage fullName, it is not beatiful as Full Name . someIdea, is it possible? thanks

    Read the article

  • How can I extract values out of this array?

    - by Jagira
    Array ( [status] => success [abc] => Array ( [0] => Array ( [name] => John Doe [age] => 23) [1] => Array ( [name] => John Doe_1 [age] => 23) [2] => Array ( [name] => John Doe_2 [age] => 23) ) ) When I try foreach($stories as $story){ } It returns an error.

    Read the article

  • Get a DB result with a value between two column values

    - by vitto
    Hi, I have a database situation where I'd like to get a user profile row by a user age range. this is my db: table_users username age email url pippo 15 [email protected] http://example.com pluto 33 [email protected] http://example.com mikey 78 [email protected] http://example.com table_profiles p_name start_age_range stop_age_range young 10 29 adult 30 69 old 70 inf I use MySQL and PHP but I don't know if there is some specific tacnique to do this and of course if it's possible. # so something like: SELECT * FROM table_profiles AS profiles INNER JOIN table_users AS users # can I do something like this? ON users.age IS BETWEEN profiles.start_age_range AND profiles.stop_age_range

    Read the article

  • Automatically number items in a wpf listbox

    - by evan
    I have a person class with two properties, Name an Age. I know how to use databinding to display a collection of person in a wpf list box and how to modify the listitemtemplate to customize how each person is displayed. Now I'd like to number each person on the list according to the order they appear on the list (which could change as the the items were sorted via name or age in the display). Is there a way to do that with the item template so instead of having a list like Rob - 14 John - 56 Suzy - 32 it would be 1) Rob - 14 2) John - 56 3) Suzy - 32 Basically i'd like to do something like: <ListView.ItemTemplate> <DataTemplate> <WrapPanel> **<TextBlock Text="{Binding CurrentPositionInList}" />** <TextBlock Text="{Binding Path=Name}" /> <TextBlock Text="{Binding Path=Age}" /> </WrapPanel> </DataTemplate> Thanks in advance!

    Read the article

  • Changing ylim (axis limits) drops data falling outside range. How can this be prevented?

    - by Alex Holcombe
    df <- data.frame(age=c(10,10,20,20,25,25,25),veg=c(0,1,0,1,1,0,1)) g=ggplot(data=df,aes(x=age,y=veg)) g=g+stat_summary(fun.y=mean,geom="point") Points reflect mean of veg at each age, which is what I expected and want to preserve after changing axis limits with the command below. g=g+ylim(0.2,1) Changing axis limits with the above command unfortunately causes veg==0 subset to be dropped from the data, yielding "Warning message: Removed 4 rows containing missing values (stat_summary)" This is bad because now the data plot (stat_summary mean) omits the veg==0 points. How can this be prevented? I simply want to avoid showing the empty part of the plot- the ordinate from 0 to .2, but not drop the associated data from the stat_summary calculation.

    Read the article

  • Calculating a delta of years from a date

    - by Spiros
    I am trying to figure out a way to calculate the year of birth for records when given the age to two decimals at a given date - in Perl. To illustrate this example consider these two records: date, age at date 25 Nov 2005, 74.23 21 Jan 2007, 75.38 What I want to do is get the year of birth based on those records - it should be, in theory, consistent. The problem is that when I try to derive it by calculating the difference between the year in the date field minus the age, I run into rounding errors making the results look wrong while they are in fact correct. I have tried using some "clever" combination of int() or sprintf() to round things up but to not avail. I have looked at Date::Calc but cant see something I can use. p.s. As many dates are pre-1970, I cannot not unfortunately use UNIX epoch for this.

    Read the article

  • Perl: calculating a delta of years from a date

    - by Spiros
    Hello, I am trying to figure out a way to calculate the year of birth for records when given the age to two decimals at a given date - in Perl. To illustrate this example consider these two records: date, age at date 25 Nov 2005, 74.23 21 Jan 2007, 75.38 What I want to do is get the year of birth based on those records - it should be, in theory, consistent. The problem is that when I try to derive it by calculating the difference between the year in the date field minus the age, I run into rounding errors making the results look wrong while they are in fact correct. I have tried using some "clever" combination of int() or sprintf() to round things up but to not avail. I have looked at Date::Calc but cant see something I can use. p.s. As many dates are pre-1970, I cannot not unfortunately use UNIX epoch for this.

    Read the article

  • C# Reflection and Getting Properties

    - by Nathan
    I have the following dummy class structure and I am trying to find out how to get the properties from each instance of the class People in PeopleList. I know how to get the properties from a single instance of People but can't for the life of me figure out how to get it from PeopleList. I am sure this is really straightforward but can someone point me in the right direction? public class Example { public class People { private string _name; public string Name { get { return _name; } set { _name = value; } } private int _age; public int Age { get { return _age; } set { _age = value; } } public People() { } public People(string name, int age) { this._name = name; this._age = age; } } public class PeopleList : List<People> { public static void DoStuff() { PeopleList newList = new PeopleList(); // Do some stuff newList.Add(new People("Tim", 35)); } } }

    Read the article

  • Real thing about "->" and "."

    - by fsdfa
    I always wanted to know what is the real thing difference of how the compiler see a pointer to a struct (in C suppose) and a struct itself. struct person p; struct person *pp; pp->age, I always imagine that the compiler does: "value of pp + offset of atribute "age" in the struct". But what it does with person.p? It would be almost the same. For me "the programmer", p is not a memory address, its like "the structure itself", but of course this is not how the compiler deal with it. My guess is it's more of a syntactic thing, and the compiler always does (&p)->age. I'm correct?

    Read the article

  • JavaScript - question regarding data structure

    - by orokusaki
    I'm trying to calculate somebody's bowel health based on a points system. I can edit the data structure, or logic in any way. I'm just trying to write a function and data structure to handle this ability. Pseudo calculator function: // Bowel health calculator var points = 0; If age is from 30 and 34: points += 1 If age is from 35 and 40: points += 2 If daily BMs is from 1 and 3: points -= 1 If daily BMs is from 4 and 6: points -= 2 return points; Pseudo data structure: var points_map = { age: { '30-34': 1, '35-40': 2 }, dbm: { '1-3': -1, '4-6': -2 } }; I have a full spreadsheet of data like this, and I am trying to write a DRY version of code and a DRY version of this data (ie, probably not a string for the '30-34', etc) in order to handle this sort of thing without a humongous number of switch statements.

    Read the article

  • Get a DB result with a value between two columns values

    - by vitto
    Hi, I have a database situation where I'd like to get a user profile row by a user age range. this is my db: table_users username age email url pippo 15 [email protected] http://example.com pluto 33 [email protected] http://example.com mikey 78 [email protected] http://example.com table_profiles p_name start_age_range stop_age_range young 10 29 adult 30 69 old 70 inf I use MySQL and PHP but I don't know if there is some specific tacnique to do this and of course if it's possible. # so something like: SELECT * FROM table_profiles AS profiles INNER JOIN table_users AS users # can I do something like this? ON users.age IS BETWEEN profiles.start_age_range AND profiles.stop_age_range

    Read the article

  • custom helpers inside each block

    - by Unspecified
    myArray = [{name: "name1", age: 20}, {name: "name2", age:22}]; {{#each person in myArray}} {{#myHelper person}} Do something {{/myHelper}} {{/each}} Handlebars.registerHelper(function(context, options){ if(context.age > 18){ return options.fn(this); }else{ return options.inverse(this); } }) In the above code when I tried to debug my custom helper it shows the context="person" while I want the context to be the person object, what's wrong with my code ? I found a similar question here but did not get it either...

    Read the article

  • The type{0} does not support direct content - WPF / XAML

    - by Levo
    Hi there: I defined in my code two classes: a "Person" class with public "Age" and "Name" property, and a "People" class that inherits from Generic.List(of T). The code for People class is as followed: Public Class People Inherits Collections.Generic.List(Of Person) ... End Class What I want to achieve is to directly initialize the People class, and add individual Person to it in XAML, i.e.: <local:People x:Key="Familty"> <local:Person Age="11" Name="John" /> <local:Person Age="12" Name="John2" /> ... </local:People> But I keep getting an error in XAML saying: The type 'People' does not support direct content. Any idea as for how to solve this problem? Thank you very much!

    Read the article

  • What is the MVC version of this code?

    - by Ian Boyd
    i'm trying to wrap my head around how to enterprise up my code: taking a simple routine and splitting it up into 5 or 6 methods in 3 or 4 classes. i quickly came up three simple examples of code how i currently write it. Could someone please convert these into an MVC/MVP obfuscated version? Example 1: The last name is mandatory. Color the text box red if nothing is entered. Color it green if stuff is entered: private void txtLastname_TextChanged(object sender, EventArgs e) { //Lastname mandatory. //Color pinkish if nothing entered. Greenish if entered. if (txtLastname.Text.Trim() == "") { //Lastname is required, color pinkish txtLastname.BackColor = ControlBad; } else { //Lastname entered, remove the coloring txtLastname.BackColor = ControlGood; } } Example 2: The first name is optional, but try to get it. We'll add a bluish tint to this "try to get" field: private void txtFirstname_TextChanged(object sender, EventArgs e) { //Firstname can be blank. //Hint them that they should *try* to get it with a bluish color. //If they do enter stuff: it better be not all spaces. if (txtFirstname.Text == "") { //Nothing there, hint it blue txtFirstname.BackColor = ControlRequired; } else if (txtFirstname.Text.Trim() == "") { //They entered spaces - bad user! txtFirstname.BackColor = ControlBad; } else { //Entered stuff, remove coloring txtFirstname.BackColor = SystemColors.Window; } } Example 3 The age is totally optional. If an age is entered, it better be valid: private void txtAge_TextChanged(object sender, EventArgs e) { //Age is optional, but if entered it better be valid int nAge = 0; if (Int32.TryParse(txtAge.Text, out nAge)) { //Valid integer entered if (nAge < 0) { //Negative age? i don't think so txtAge.BackColor = ControlBad; } else { //Valid age entered, remove coloring txtAge.BackColor = SystemColors.Window; } } else { //Whatever is in there: it's *not* a valid integer, if (txtAge.Text == "") { //Blank is okay txtAge.BackColor = SystemColors.Window; } else { //Not a valid age, bad user txtAge.BackColor = ControlBad; } } } Every time i see MVC code, it looks almost like random splitting of code into different methods, classes, and files. i've not been able to determine a reason or pattern to their madness. Without any understanding of they why it's being one some way, it makes no sense. And using the words model, view, controller and presenter, like i'm supposed to know what that means, doesn't help. The model is your data. The view shows data on screen. The controller is used to carry out the users actions And oranges taste orangy. Here's my attempt at splitting things up in order to make the code more difficult to follow. Is this anywhere close to MVC? private void txtFirstname_TextChanged(object sender, EventArgs e) { FirstnameTextChangedHandler(sender, e); } private void FirstnameTextChangedHandler(sender, e) { string firstname = GetFirstname(); Color firstnameTextBoxColor = GetFirstnameTextBoxColor(firstname); SetFirstNameTextBoxColor(firstnameTextBoxColor); } private string GetFirstname() { return txtFirstname.Text; } private Color GetFirstnameTextBoxColor(string firstname) { //Firstname can be blank. //Hint them that they should *try* to get it with a bluish color. //If they do enter stuff: it better be not all spaces. if (firstname == "") { //Nothing there, hint it blue return GetControlRequiredColor(); } else if (firstname.Trim() == "") { //They entered spaces - bad user! return GetControlBadColor(); } else { //Entered stuff, remove coloring return GetControlDefaultColor(); } } private Color GetControlRequiredColor() { return ControlRequired; } private Color GetControlBadColor() { return ControlBad; } private Color GetControlGoodColor() { return ControlGood; } //am i doin it rite i've obfuscated the code, but it's still altogether. The next step in the MVC obfuscation, i gather, is to hide the code in 3 or 4 different files. It's that next step that i don't understand. What is the logical separation of which functions are moved into what other classes? Can someone translate my 3 simple examples above into full fledged MVC obfuscation? Edit: Not ASP/ASP.NET/Online. Pretend it's on a desktop, handheld, surface, kiosk. And pretend it's language agnostic.

    Read the article

  • HOw to find specific child node in XML using AS3 flash

    - by Mirage
    I have this xml var testXML:XML = <family> <father name1="tom" age="5" ><father1 name1="test1"/><father2 name1="test2"/></father> <mother name1="tomylee" age="55" ><mother1/><mother2/></mother> <sister name1="sister1" age="35" ><sister1/><sister2/></sister> </family>; I want to get the child node with name1 = test1 but i only know family so is there something like trace (testXML.children(@name1="test1"); I only know the family node , i don't know where that node is inside the father or not is there any filter can be applied on root node to find something

    Read the article

  • Constructors for C++ objects

    - by sasquatch
    I have class Person as following : class Person { char* name; int age; }; Now I need to add two contructors. One taking no arguments, that inserts field values to dynamically allocated resources. Second taking (char*, int) arguments initialized by initialization list. Last part is to define a destructor showing information about destroying objects and deallocating dynamically allocated resources. How to perform this task ? That's what I already have : class Person { char* name; int age; public: Person(){ this->name = new *char; this->age = new int; } Person(char* c, int i){ } };

    Read the article

  • PHP: Find element with certain property value in array

    - by Svish
    I'm sure there is an easy way to do this, but I can't think of it right now. Is there an array function or something that lets me search through an array and find the item that has a certain property value? For example: $people = array( array( 'name' => 'Alice', 'age' => 25, ), array( 'name' => 'Waldo', 'age' => 89, ), array( 'name' => 'Bob', 'age' => 27, ), ); How can I find and get Waldo?

    Read the article

  • I have a KVP Key value pair Table, Need sql to make it relational structure...!

    - by Muthuveerappan
    I have a KVP Table and the structure is ID, Key, Value and below are the sample values.... Table with values ID , Key, Value 1 , STATUS, TRUE 1, AGE GROUP, 10 1, TRAVEL, Y 2 , STATUS, FALSE 2, AGE GROUP, 20 2, TRAVEL, N I want these date to transform as below (Output) ID , STATUS, AGE GROUP, TRAVEL 1, TRUE , 10, Y 2, FALSE, 20, N I have read about crosstab/pivot - but not able to make a query which can give me the above output. The table structure cant be changed...! My bad. Is there any way in sql, to make my output look like above ?

    Read the article

  • PreparedStatement throws MySQLSyntaxErrorException

    - by sqlBugs
    I have the following Java code: String query = "Select 1 from myTable where name = ? and age = ?"; PreparedStatement stmt = conn.prepareStatement(query); stmt.setString(1, name); stmt.setInt(2, age); ResultSet rs = stmt.executeQuery(); Whenever I run the above code, it throws an exception on line 2 (where the PreparedStatement is declared): Error 0221202: SQLException = com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AND age = ?' at line 1 Does anyone have any suggestions about what I am doing wrong? Thanks!

    Read the article

  • Passing through lists from jQuery to the service

    - by thedixon
    I'm sure I've done this in another solution, but I can't seem to find any solution as to do it again and wondered if anyone can help me... This is my WebAPI code: public class WebController : ApiController { public void Get(string telephone, string postcode, List<Client> clients) { } } And, calling this from jQuery: function Client(name, age) { this.Name = name; this.Age = age; } var Clients = []; Clients.push(new Client("Chris", 27)); $.ajax({ url: "/api/Web/", data: { telephone: "999", postcode: "xxx xxx", clients: Clients } }); But the "clients" object always comes back as null. I've also tried JSON.stringify(Clients), and this is the same result. Can anyone see anything obvious I'm missing here?

    Read the article

  • How to invoke RESTful WCF service method with multiple parameters?

    - by Scythe
    I have a RESTful WCF service with a method declared like this: [OperationContract(Name = "IncrementAge")] [WebInvoke(UriTemplate = "/", Method = "POST", ResponseFormat = WebMessageFormat.Json)] Person IncrementAge(Person p); Here's the implementation: public Person IncrementAge(Person p) { p.age++; return p; } So it takes the Person complex type, increments the age property by one, and spits it back, using JSON serialization. I can test the thing by sending a POST message to the service like this: POST http://localhost:3602/RestService.svc/ HTTP/1.1 Host: localhost:3602 User-Agent: Fiddler Content-Type: application/json Content-Length: 51 {"age":25,"firstName":"Hejhaj","surName":"Csuhaj"} This works. What if I'd like to have a method like this? Person IncrementAge(Person p, int amount); So it'd have multiple parameters. How should I construct the POST message for this to work? Is this possible? Thanks

    Read the article

  • Is it possible to select data with max value for a column using Criteria in Hibernate?

    - by Palo
    Lets say I have the following mapping: <hibernate-mapping package="mypackage"> <class name="User" table="user"> <id name="id" column="id"> <generator class="native"></generator> </id> <property name="name" /> <property name="age" /> </class> </hibernate-mapping> Is it possible to select the oldest user (that is age is maximal) using Criteria in Hibernate? I can imagine that i could do this with 2 selects. (first select total number of users and then order the entries descending by age and select the first entry). But is it possible with a single select? Thank you Palo

    Read the article

  • Java PreparedStatement Throws MySQLSyntaxErrorException

    - by sqlBugs
    I have the following Java code: String query = "Select 1 from myTable where name = ? and age = ?"; PreparedStatement stmt = conn.prepareStatement(query); stmt.setString(1, name); stmt.setInt(2, age); ResultSet rs = stmt.executeQuery(); Whenever I run the above code, it throws an exception on line 2 (where the PreparedStatement is declared): Error 0221202: SQLException = com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AND age = ?' at line 1 Does anyone have any suggestions about what I am doing wrong? Thanks!

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >