Search Results

Search found 17734 results on 710 pages for 'values'.

Page 15/710 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • HiLo: how to control Low values

    - by Sandor Drieënhuizen
    I'm using the HiLo generator in my S#rpArchitecture/NHibernate project and I'm performing a large import batch. I've read somewhere about the possibility to predict the Low values of any new records because they are generated on the client. I figure this means I can control the Low values myself or at least fetch the next Low value from somewhere. The reason I want to use this is that I want to set relations to other entities I'm about to insert. They do not exist yet but will be inserted before the batch transaction completes. However, I cannot find information about how to set the Low values or how to get what Low value is up next. Any ideas?

    Read the article

  • plot negative and positive values in same Y-axis in coreplot ios

    - by user3774439
    I have an issue in converting axis labels to int or float values. This is my Y-Axis. It contains temperature values contains -50, 33, 117, 200. CPTXYAxis *y = axisSet.yAxis; y.labelingPolicy = CPTAxisLabelingPolicyNone; y.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(1); y.majorGridLineStyle = majorGridLineStyle; y.minorGridLineStyle = minorGridLineStyle; y.minorTicksPerInterval = 0.0; y.labelOffset = 0.0; y.title = @""; y.titleOffset = 0.0; NSMutableSet *yLabels = [NSMutableSet setWithCapacity:4]; NSMutableSet *yLocations = [NSMutableSet setWithCapacity:4]; NSArray *yAxisLabels = [NSArray arrayWithObjects:@"-50", @"33", @"117", @"200", nil]; NSNumberFormatter * nFormatter = [[NSNumberFormatter alloc] init]; [nFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; for ( NSUInteger i = 0; i < [yAxisLabels count]; i++ ) { NSLog(@"%@",[yAxisLabels objectAtIndex:i]); CPTAxisLabel *label = [[CPTAxisLabel alloc] initWithText:[NSString stringWithFormat:@"%@",[yAxisLabels objectAtIndex:i]] textStyle:axisTextStyle]; label.tickLocation = CPTDecimalFromUnsignedInteger(i); label.offset = y.majorTickLength; if (label) { [yLabels addObject:label]; [yLocations addObject:[NSDecimalNumber numberWithUnsignedInteger:i]]; } label = nil; } y.axisLabels = yLabels; y.majorTickLocations = yLocations; y.labelFormatter = nFormatter; Now, my issue is.. I am getting data from the BLE device as temperature values as strings like 50, 60.3, etc... Now I want plot these values from BLE device with the Y-axis values. i am unable convert these Y-axis labels to temperature values. Could you please help me guys...I have tried many time still no luck. Please help me UPDATE:: This is the way I am creating scatterplot: -(void)createScatterPlotsWithIdentifier:(NSString *)identifier color:(CPTColor *)color forGraph:(CPTGraph *)graph forXYPlotSpace:(CPTXYPlotSpace *)plotSpace{ CPTScatterPlot *scatterPlot = [[CPTScatterPlot alloc] init]; scatterPlot.dataSource = self; scatterPlot.identifier = identifier; //Plot a graph with in the plotspace [plotSpace scaleToFitPlots:[NSArray arrayWithObjects:scatterPlot, nil]]; plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(0) length:CPTDecimalFromUnsignedInteger(30)]; plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(-50) length:CPTDecimalFromUnsignedInteger(250)]; CPTMutablePlotRange *xRange = [[self getCoreplotSpace].xRange mutableCopy]; [xRange expandRangeByFactor:CPTDecimalFromCGFloat(-1)]; [self getCoreplotSpace].xRange = xRange; CPTMutableLineStyle *scatterLineStyle = [scatterPlot.dataLineStyle mutableCopy]; scatterLineStyle.lineWidth = 1; scatterLineStyle.lineColor = color; scatterPlot.dataLineStyle = scatterLineStyle; CPTMutableLineStyle *scatterSymbolLineStyle = [CPTMutableLineStyle lineStyle]; scatterSymbolLineStyle.lineColor = color; CPTPlotSymbol *scatterSymbol = [CPTPlotSymbol ellipsePlotSymbol]; scatterSymbol.fill = [CPTFill fillWithColor:color]; scatterSymbol.lineStyle = scatterSymbolLineStyle; scatterSymbol.size = CGSizeMake(2.0f, 2.0f); scatterPlot.plotSymbol = scatterSymbol; [graph addPlot:scatterPlot toPlotSpace:plotSpace]; } Configuring the Y-axis like this: NSMutableSet *yLabels = [NSMutableSet setWithCapacity:4]; NSMutableSet *yLocations = [NSMutableSet setWithCapacity:4]; NSArray *yAxisLabels = [NSArray arrayWithObjects:@"-50", @"33", @"117", @"200", nil]; NSArray *customTickLocations = [NSArray arrayWithObjects:[NSDecimalNumber numberWithUnsignedInt:-50], [NSDecimalNumber numberWithInt:33], [NSDecimalNumber numberWithInt:117], [NSDecimalNumber numberWithInt:200],nil]; for ( NSUInteger i = 0; i < [yAxisLabels count]; i++ ) { NSLog(@"%@",[yAxisLabels objectAtIndex:i]); CPTAxisLabel *label = [[CPTAxisLabel alloc] initWithText:[NSString stringWithFormat:@"%@",[yAxisLabels objectAtIndex:i]] textStyle:axisTextStyle]; label.tickLocation = CPTDecimalFromInteger([[customTickLocations objectAtIndex:i] integerValue]); label.offset = y.majorTickLength; if (label) { [yLabels addObject:label]; [yLocations addObject:[NSString stringWithFormat:@"%d",[[customTickLocations objectAtIndex:i] integerValue]]]; } label = nil; } y.axisLabels = yLabels; y.majorTickLocations = [NSSet setWithArray:customTickLocations]; Eric, I set the range as you said in CreateSctterPlot method. But In horizontal line on graph are not coming. Could you please help me what I am wrong. Thanks

    Read the article

  • Passing parameter map (list of values) to JQuery

    - by bsreekanth
    Hello, to initialize a javascript loaded grid, I need to pass a list of values from controller/gsp. Since the javascript is activated once the page is rendered/loaded, there may not be a direct way to do it. 2 possibilities 1. do an ajax call, and retrieve the list of values from the server 2. store the list in html as a hidden element, and read it from javascript. option 2 seems better as it avoids few calls back to server. So, which control should I use for a list of values? Any jQuery code snippet to read it back into array/list. thanks in advance.

    Read the article

  • Accessing Linq Values in ViewData

    - by Jemes
    I'm having trouble accessing the id, area and theme values in my ViewData. They are being set in my action filter but when I get to the Site.Master I don't have access to them. Any help or advice would be great. ActionFilter public override void OnActionExecuting(ActionExecutingContext filterContext) { int SectionID = Convert.ToInt32(filterContext.RouteData.Values["Section_ID"]); int CourseID = Convert.ToInt32(filterContext.RouteData.Values["Course_ID"]); if (CourseID == 0) { filterContext.Controller.ViewData["Styles"] = (from m in _dataContext.Styles where m.Area_ID == SectionID select new {theme = m.Area_FolderName }).ToList(); } else { filterContext.Controller.ViewData["Styles"] = (from m in _dataContext.Styles where m.Course_ID == CourseID select new { theme = m.Course_FolderName }).ToList(); } } } Site.Master <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" % <%@ Import Namespace="Website.Models" % <% foreach (var c in (IEnumerable<Styles>)ViewData["Styles"]) { Response.Write(c.Theme); }%>

    Read the article

  • .NET SortedDictionary But Sorted By Values

    - by Michael Covelli
    I need a data structure that acts like a SortedDictionary<int, double> but is sorted based on the values rather than the keys. I need it to take about 1-2 microseconds to add and remove items when we have about 3000 items in the dictionary. My first thought was simply to switch the keys and values in my code. This very nearly works. I can add and remove elements in about 1.2 microseconds in my testing by doing this. But the keys have to be unique in a SortedDictionary so that means that values in my inverse dictionary would have to be unique. And there are some cases where they may not be. Any ideas of something in the .NET libraries already that would work for me?

    Read the article

  • Objective-C initial values of created C-array

    - by kpower
    I create an array, similar to classic C (not NSArray or one of it's children) - something like BOOL i[5];. And I want to make all its values to be equal to NO. First of all, I didn't found any information about initial values of such arrays (I know that in classic C they will be undefined, but don't know exactly about Objective-C. I found info about classes and its inner data [after allocation, without initialization], but not about simple data types). And the second, if I should set array values manually - should I use memset(...); or something different? To prevent possible questions... I want to use this construction as array of temporary boolean flags and don't think that it is proved to use something like NSArray here.

    Read the article

  • Getting the median of 3 values using scheme's

    - by kristian Roger
    The problem this time is to get the median of three values (easy) I did this: (define (med x y z) (car(cdr(x y z))) and it was accepted but when testing it: (med 3 4 5) I get this error: Error: attempt to call a non-procedure (2 3 4) And when entering letters instead of number i get: (md x y z) Error: undefined varia y (package user) Using something besides x y z I get: (md d l m) Error: undefined variable d (package user) the question was deleted dont know how anyway write a function that return the median of 3 values Sorry for editing the question I got that I should put the values in order first not just a sill car and cdr thing so I did so 33> (define (med x y z) (if(and( (<x y) (<y z) y if(and( (<y x) (<x z) x z))))) Warning: invalid expression (if (and< (<x y) (<y z) y if (and ((<y x) (<x z) x z)))) but as u see Im getting a warning so what is wronge ?

    Read the article

  • Make page to tell browser not to cache/preserve input values

    - by queen3
    Most browser cache form input values. So when user refreshes page, the inputs have same values. Here's my problem. When user clicks Save, server validates POSTed data (e.g. checked products), and if not valid, sends it back to browser. However, as stated above, even if server clears selection for some values, they may still be selected because of browser cache! My data has invisible (until parent item selected) checkboxes, so user may be even not aware that some previous value is still selected, until clicks Save again and gets error message - even though user thinks it's not. Which is irritating. This can be resolved by doing Ctrl-F5, but it's not even a solution.Is there automatic/programmatic way to tell browser not to cache form input data on some form/page?

    Read the article

  • SQL Server: collect values in an aggregation temporarily and reuse in the same query

    - by Erwin Brandstetter
    How do I accumulate values in t-SQL? AFAIK there is no ARRAY type. I want to reuse the values like demonstrated in this PostgreSQL example using array_agg(). SELECT a[1] || a[i] AS foo ,a[2] || a[5] AS bar -- assuming we have >= 5 rows for simplicity FROM ( SELECT array_agg(text_col ORDER BY text_col) AS a ,count(*)::int4 AS i FROM tbl WHERE id between 10 AND 100 ) x How would I best solve this with t-SQL? Best I could come up with are two CTE and subselects: ;WITH x AS ( SELECT row_number() OVER (ORDER BY name) AS rn ,name AS a FROM #t WHERE id between 10 AND 100 ), i AS ( SELECT count(*) AS i FROM x ) SELECT (SELECT a FROM x WHERE rn = 1) + (SELECT a FROM x WHERE rn = i) AS foo ,(SELECT a FROM x WHERE rn = 2) + (SELECT a FROM x WHERE rn = 5) AS bar FROM i Test setup: CREATE TABLE #t( id INT PRIMARY KEY ,name NVARCHAR(100)) INSERT INTO #t VALUES (3 , 'John') ,(5 , 'Mary') ,(8 , 'Michael') ,(13, 'Steve') ,(21, 'Jack') ,(34, 'Pete') ,(57, 'Ami') ,(88, 'Bob') Is there a simpler way?

    Read the article

  • Accelerometer Values from Android/iPhone device

    - by mrlinx
    I'm trying to map my movements with a android device into an OpenGL scene. I've recorded accelerometer values for a simples movement: Moving the phone (lies flat on a table) 10cm forward (+x), and then 10cm backward (-x). The problem is that this values when used to calculate velocity and position, makes only the opengl cube go forward. Seems like the negative acceleration recorded was not enough to reduce the speed and invert its movement. What can be the problem? This is my function that updates the velocity and position every time new data comes in: void updatePosition(double T2) { double T = 0.005; Vec3 old_pos = position.clone(), old_vel = velocity.clone(); velocity = old_vel.plus(acceleration.times(T)); position = old_pos.plus(old_vel.times(T).plus(acceleration.times(0.5 * Math.pow(T, 2)))); } This is the X,Y,Z accelerometer values over the entire captured time:

    Read the article

  • Mapping Hilbert values to 3D points

    - by Alexander Gladysh
    I have a set of Hilbert values (length from the start of the Hilbert curve to the given point). What is the best way to convert these values to 3D points? Original Hilbert curve was not in 3D, so I guess I have to pick by myself the Hilbert curve rank I need. I do have total curve length though (that is, the maximum value in the set). Perhaps there is an existing implementation? Some library that would allow me to work with Hilbert curve / values? Language does not matter much.

    Read the article

  • SQL Server Import table keeping default values

    - by Chrissi
    I am importing a table from one database to another in SQL Server 2008 by right-clicking the target database and choosing Tasks Import Data... When I import the table I get the column names and types and all the data fine, but I lose the primary key, identity specifications and all the default values that were set in the source table. So now I have to set all the default values for each column again manually. Is there any way to get the default values with the import, or even after with a Query? I am VERY new to this and flailing in the dark, so forgive me if this is a really stupid question...

    Read the article

  • Jquery getting list of values of hidden inputs within a div

    - by RandyMarsh
    I am trying to get a list of values within a div that I will format later using the .each() method. They are input values which are hidden my html and jquery call looks like this. <div id="container_0"> <input type="hidden" id="check_data" value=10> <input type="hidden" id="check_data" value=20> </div> Jquery: var list = $('#container_0 input#check_data'); $(list).each( function() { alert($(this).val()); } ); This however is not returning any values. Any help would be greatly appreciated.

    Read the article

  • Creating matrix of maximum values indices in MATLAB

    - by Gacek
    Using MATLAB, I have an array of values of size 8 rows x N columns. I need to create a matrix of the same size, that counts maximum values in each column and puts 1 in the cell that contains maximum value, and 0 elsewhere. A little example. Lets assume we have an array of values D: D = 0.0088358 0.0040346 0.40276 0.0053221 0.017503 0.011966 0.015095 0.017383 0.14337 0.38608 0.16509 0.15763 0.27546 0.25433 0.2764 0.28442 0.01629 0.0060465 0.0082339 0.0099775 0.034521 0.01196 0.016289 0.021012 0.12632 0.13339 0.11113 0.10288 0.3777 0.19219 0.005005 0.40137 Then, the output matrix for such matrix D would be: 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 Is there a way to do it without catching vector of indices from max function and then putting ones in the right place using for loop?

    Read the article

  • Access Profile Provider property values in ASPX files

    - by AsM
    We have several companies using one web application. Companies may decide to display different values in Labels. e.g. CompanyA - ZipCodeCaption = "Zip Code" CompanyB - ZipCodeCaption = "Pin Code" CompanyA - USDSymbolCaption = "USD" CompanyB - USDSymbolCaption = "$" We are using profile provider to store each company's settings. We would like to access these profile values in ASPX to assign values to Label's text properties just like Web Config app settings are accessed in aspx. e.g. " Is this possible? Is there a better way to go about doing this?

    Read the article

  • MySQL: Count occurrences of known (or enumerated) distinct values

    - by Eilidh
    After looking at how to count the occurrences of distinct values in a field, I am wondering how to count the occurrences of each distinct value if the distinct values are known (or enumerated). For example, if I have a simple table - TrafficLight Colour ------------ ------ 1 Red 2 Amber 3 Red 4 Red 5 Green 6 Green where one column (in this case Colour) has known (or enumerated) distinct values, how could I return the count for each colour as a separate value, rather than as an array, as in the linked example. To return an array with a count of each colour (using the same method as in the linked example), the query would be something like SELECT Colour COUNT(*) AS ColourCount FROM TrafficLights GROUP BY Colour, and return an array - Colour ColourCount ------ ----------- Red 3 Amber 1 Green 2 What I would like to do is to return the count for each Colour AS a separate total (e.g. RedCount). How can I do this?

    Read the article

  • Naudio - putting audio stream into values [-1,1]

    - by denonth
    Hi all I need to put my audio stream into values of [-1,1]. Can someone tell me a good approach. I was reading byte array and float array from stream but I don't know what to do next. Here is my code: float[] bytes=new float[stream.Length]; float biggest= 0; for (int i = 0; i < stream.Length; i++) { bytes[i] = (byte)stream.ReadByte(); if (bytes[i] > biggest) { biggest=bytes[i]; } } and I don't know how to put values into stream. Because byte is only positive values. And I need to have from [-1,1] for (int i = 0; i < bytes.Count(); i++) { bytes[i] = (byte)(bytes[i] * (1 / biggest)); }

    Read the article

  • Create DataGridView columns from Table values

    - by fireBand
    Hi, I am using data grid view to display items as excel spread sheet in VB.NET. I got a table named CostTypes with column names [CostTypeID, CostType] and values [1,External] and [2,Internal] (These are constant but more values can be added to table). I want to create columns with names of the values[External , Internal] in DataGridView. If I use databiding directly I get columns [CostTypeID,CostType] which is not what I am looking for. If some one could explain how to create columns at runtime in datagridview or how to retrieve data from data base using LINQ so that [External , Internal] turn out to be columns that would be great. Thanks in advance.

    Read the article

  • Extract multiple values from one column in MySql

    - by Neil
    I've noticed that MySql has an extensive search capacity, allowing both wildcards and regular expressions. However, I'm in somewhat in a bind since I'm trying to extract multiple values from a single string in my select query. For example, if I had the text "<span>Test</span> this <span>query</span>", perhaps using regular expressions I could find and extract values "Test" or "query", but in my case, I have potentially n such strings to extract. And since I can't define n columns in my select statement, that means I'm stuck. Is there anyway I could have a list of values (ideally separated by commas) of any text contained with span tags? In other words, if I ran this query, I would get "Test,query" as the value of spanlist: select <insert logic here> as spanlist from HtmlPages ...

    Read the article

  • Implode and remove empty values

    - by binoy
    Hi, I have an array like this $arr = array('name' => 'John', 'address' => 'IInd Street', 'state' => '', 'country' => 'US'); I want to display the values as John, IInd Street, US (ie, If any value is empty, I don't want to display comma and break over there) I could able to display this with the following code $values = implode(',', $arr); echo $str = implode(',<br />',array_filter(explode(',', $values))); Is there any better way to do this ?

    Read the article

  • Html POST and return the same form with the values

    - by vtortola
    Hi, I'm learning web development, and I don't know how do this simple thing. I've a html form with "text", "radio" and "checkbox" controls, that POST the values to the server and it saves them, for example in a file. I save the POST in raw format: key=value&key=value&key=value&key=value and I'd like that when the user open the form back, return the form with the saved values already in the controls. Is there any neat way to do this? Or should I parse the POST string and set the values one by one in the controls at the server level? I think, I could return the saved data in a hidden input control, and after with a javascript I could do a getElementById(key) and set the value to each input control... but do I need to put the post string in a special format? How would you do it? Thank you in advance.

    Read the article

  • How To Query Many-to-Many Table (one table's values becomes column headers)

    - by CRice
    Given this table structure, I want to flatten out the many-to-many relationships and make the values in the Name field of one table into column headers and the quantities from the same table into column values. The current idea which will work is to put the values into a Dictionary (hashtable) and represent this data in code but im wondering if there is a SQL way to do this. I am also using Linq-to-SQL for data access so a Linq-to-SQL solution would be ideal. [TableA] (int Id) [TableB] (int id, string Name) [TableAB] (int tableAId, int tableBId, int Quantity) fk: TableA.Id joins to TableAB.tableAId fk: TableB.Id joins to TableAB.tableBId Is there a way I can query the three tables and return one result for example: TableA [Id] 1 TableB [Id], [Name] 1, "Red" 2, "Green" 3, "Blue" TableAB [TableAId], [TableBId], [Quantity] 1 1 5 1 2 6 1 3 7 Query Result: [TableA.Id], [Red], [Green], [Blue] 1, 5, 6, 7

    Read the article

  • Accommodating null values in a list?

    - by h259bws
    Hi, I'm new to Java and Groovy and am running into trouble with the following Groovy script. I created this whittled down version of a larger script to facilitate debugging. The script is iterating through a list trying to calc a running total of the values of all objects in the list. Some or all of these objects' values may be null. Script import org.apache.commons.lang.math.NumberUtils class Field { def name def value } def fields = [ new Field(name:'Annuities %', value:75), new Field(name:'Other %', value:null), ] //def totalFunding = fields.inject(0) {int total, Field myField - // total + NumberUtils.toInt(myField.value,0) as Integer def totalFunding = fields.inject(0) {int total, Field myField - total + myField?.value as Integer } It gets this error: Exception thrown: java.lang.NullPointerException java.lang.NullPointerException at Script3$_run_closure1.doCall(Script3:15) at Script3.run(Script3:14) What is the correct way to accomodate null values? Thanks, Betsy

    Read the article

  • How to concatenate int values in java?

    - by Shamli
    hi, I have the following values: int a=1; int b=0; int c=2; int d=2; int e=1; How do i concatenate these values so that i end up with a String that is 10221; please note that multiplying a by 10000, b by 1000.....and e by 1 will not working since b=0 and therefore i will lose it when i add the values up. Thnks you in advance.

    Read the article

  • Getting values from datagrid view column to list<>

    - by EvanRyan
    My main form in my application has a datagrid view that can have 1 to many user selected inputs. Column 8 of this grid is for the user to input "time in minutes." I have a separate class where I have built a timer that counts down from whatever time the user specifies down to 0. What I need is to create a series of alarms that go off as the timer counts down that are triggered by the user input values in column 8 of my datagrid. I think the best way to do this is to build a list< from the values in the datagrid. I for whatever reason can't quite figure out how to get the values from the datagrid in to a list< in my other class. Hopefully I explained in a way that makes sense.

    Read the article

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