Search Results

Search found 5942 results on 238 pages for 'total starnger'.

Page 140/238 | < Previous Page | 136 137 138 139 140 141 142 143 144 145 146 147  | Next Page >

  • Delphi Clientdataset Lookup/Aggregate

    - by TheRoadrunner
    Hi, I need a little help with ClientDatasets in Delphi. What I want to achieve is a grid showing customers, where one of the columns shows the number of orders for each customer. I put a ClientDataset on a form and load Customers.xml from Delphi demo-data. Another ClienDataset is loaded with orders.xml. Relatively simple, I can define an aggregate on the orders CDS showing the total amount per customer (or the count). (See Cary Jensens article on this: http://edn.embarcadero.com/article/29272) The problem is getting this aggregate result from orders dataset into the customer dataset. It is kind of an reverse lookup, since there is a 1-n relationship between customers and orders, not an n-1 as normally in lookup scenarios. Any ideas ? Søren

    Read the article

  • Algorithmic trading software safety guards

    - by Adal
    I'm working on an automatic trading system. What sorts of safe-guards should I have in place? The main idea I have is to have multiple pieces checking each other. I will have a second independent little process which will also connect to the same trading account and monitor simple things, like ensuring the total net position does not go over a certain limit, or that there are no more than N orders in 10 minutes for example, or more than M positions open simultaneously. You can also check that the actual open positions correspond to what the strategy process thinks it actually holds. As a bonus I could run this checker process on a different machine/network provider. Besides the checks in the main strategy, this will ensure that whatever weird bug occurs, nothing really bad can happen. Any other things I should monitor and be aware of?

    Read the article

  • SQL: Find difference between dates with grouping

    - by ajbeaven
    I have a problem that seems similar to this fellow - I just want to display the data slightly differently. I'm pretty terrible with SQL so can't modify it to suit, but perhaps someone else can. My table looks similar to this (date format is dd/mm/yyyy): ID User Date_start Role 1 Andy 01/04/2010 A 2 Andy 10/04/2010 B 3 Andy 20/04/2010 A 4 John 02/05/2010 A I want to show the total number of days that anyone was in a certain role. Users stay in the role until there is another entry into the table. Users can only be in one role at a time. So the summary data would look like this (assuming that the date is 04/05/2010): A: 26 days B: 10 days Thanks for any help :)

    Read the article

  • LINQ expression precedence with Skip(), Take() and OrderBy()

    - by Robert Koritnik
    I'm using LINQ to Entities and display paged results. But I'm having issues with the combination of Skip(), Take() and OrderBy() calls. Everything works fine, except that OrderBy() is assigned too late. It's executed after result set has been cut down by Skip() and Take(). So each page of results has items in order. But ordering is done on a page handful of data instead of ordering of the whole set and then limiting those records with Skip() and Take(). How do I set precedence with these statements? My example (simplified) var query = ctx.EntitySet.Where(/* filter */).OrderBy(/* expression */); int total = query.Count(); var result = query.Skip(n).Take(x).ToList();

    Read the article

  • ideas for algorithm? sorting a list randomly with emphasis on variety

    - by Steve Eisner
    I have a table of items with [ID,ATTR1,ATTR2,ATTR3]. I'd like to select about half of the items, but try to get a random result set that is NOT clustered. In other words, there's a fairly even spread of ATTR1 values, ATTR2 values, and ATTR3 values. This does NOT necessarily represent the data as a whole, in other words, the total table may be generally concentrated on certain attribute values, but I'd like to select a subset with more variety. The attributes are not inter-related, so there's not really a correlation between ATTR1 and ATTR2. Any ideas for an efficient algorithm? Thanks! I don't really even know how to search for this :)

    Read the article

  • MySQL: Count two things in one query?

    - by Nebs
    I have a "boolean" column in one of my tables (value is either 0 or 1). I need to get two counts: The number of rows that have the boolean set to 0 and the number of rows that have it set to 1. Currently I have two queries: One to count the 1's and the other to count the 0's. Is MySQL traversing the entire table when counting rows with a WHERE condition? I'm wondering if there's a single query that would allow two counters based on different conditions? Or is there a way to get the total count along side the WHERE conditioned count? This would be enough as I'd only have to subtract one count from the other (due to the boolean nature of the column). There are no NULL values. Thanks.

    Read the article

  • SQL Complicated Group / Join by Category

    - by Mike Silvis
    I currently have a database structure with two important tables. 1) Food Types (Fruit, Vegetables, Meat) 2) Specific Foods (Apple, Oranges, Carrots, Lettuce, Steak, Pork) I am currently trying to build a SQL statement such that I can have the following. Fruit < Apple, Orange Vegetables < Carrots, Lettuce Meat < Steak, Port I have tried using a statement like the following Select * From Food_Type join (Select * From Foods) as Foods on Food_Type.Type_ID = Foods.Type_ID but this returns every Specific Food, while I only want the first 2 per category. So I basically need my subquery to have a limit statement in it so that it finds only the first 2 per category. However if I simply do the following Select * From Food_Type join (Select * From Foods LIMIT 2) as Foods on Food_Type.Type_ID = Foods.Type_ID My statement only returns 2 results total.

    Read the article

  • Hash Table: Should I increase the element count on collisions?

    - by Nazgulled
    Hi, Right now my hash tables count the number of every element inserted into the hash table. I use this count, with the total hash table size, to calculate the load factor and when it reaches like 70%, I rehash it. I was thinking that maybe I should only count the inserted elements with fills an empty slot instead of all of them. Cause the collision method I'm using is separate chaining. The factor load keeps increasing but if there can be a few collisions leaving lots of empty slots on the hash table. You are probably thinking that if I have that many collisions, maybe I'm not using the best hashing method. But that's not the point, I'm using one of the know hashing algorithms out there, I tested 3 of them on my sample data and selected the one who produced less collisions. My question still remains. Should I keep counting every element inserted, or just the ones that fill an empty slot in the Hash Table?

    Read the article

  • How to set the same column width in a datagrid in flex at runtime?

    - by Ra
    HI, In flex, I have a datagrid with 22 columns. I initially display all the columns. The width of each column right is uniform. Now when i change the visiblity of a few columns, the width of each column varies. How do i maintain a uniform column width for each column whether or not there are any invisible columns?... Also how do i get the count of number of visible columns. the ColumnCount property returns total number of columns and not the number of visible ones.

    Read the article

  • How would you sample a real-time stream of coordinates to create a Speed Graph?

    - by Andrew Johnson
    I have a GPS device, and I am receiving continuous points, which I store in an array. These points are time stamped. I would like to graph distance/time (speed) vs. distance in real-time; however, I can only plot 50 of the points because of hardware constraints. How would you select points from the array to graph? For example, one algorithm might be to select every Nth point from the array, where N results in 50 points total. Code: float indexModifier = 1; if (MIN(50,track.lastPointIndex) == 50) { indexModifier = track.lastPointIndex/50.0f; } index = ceil(index*indexModifier); Another algorithm might be to keep an array of 50 points, and throw out the point with the least speed change each time you get a new point.

    Read the article

  • Draw text on a loaded pdf file with Zend Framework

    - by Rick de Graaf
    Hello, I'm trying to load a existing pdf file, and fill this with database information. Loading the file and everything is working, except for writing data to the loaded page. It doesn't write text to the loaded page. If I add a new page en use a foreach to apply drawing to all pages, all added pages are written, except for the loaded one. Below is the code I'm using: $pdf = Zend_Pdf::load('./documents/agreements/_root/gegevens.pdf'); // Load pdf $pdf->pages = array_reverse($pdf->pages); // reverse pages $pdf->pages[] = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); // Add a page (A4) $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); // Set font foreach($pdf->pages as $page) // Apply settings+text to every page (total of 2) { $page->setFont($font, 36); $page->setAlpha(0.25); $page->drawText('LALALALALALALA', 62, 260, 'UTF-8'); } $pdf->save('./documents/agreements/Gegevens_'.$this->school_id.'.pdf'); // Save file

    Read the article

  • printing parent page and iframe contents from print button withing iframe.

    - by user329094
    I am using an iframe (I hate them by the way!) to call in a 3rd party checkout page into my parent page. The check out page doesn't allow me to pass any variables into it other than $total_amount. So, if an individual purchases 2 or more items they have no record of the items they purchase just the total amount. I have echoed the list of items purchased with php above the iframe for their reference. The final checkout step in the iframe allows you to print the receipt. However, it only prints the iframe content. Can you tell a print button within an iframe to print the parent page as well?

    Read the article

  • Include at text file as is in (Python) Sphinx Docs

    - by Gregg Lind
    (using Python-Sphinx Documentation tool) I have a .txt log file I'd like to build into _build/html unaltered. What do I need to alter in conf.py, index.rst, etc. Here is the layout: src/ index.rst some_doc.rst somefile.txt How do I get somefile.txt into the html build? I tried adding a line like this to index.rst: Contents: .. toctree:: :maxdepth: 2 some_doc "somefile.txt" hoping it would work by magic, but no magic here! Assuming this is even possible, what would I put in some_doc.rst to refer/link to that file? Note Yes, I'm aware I could put it in /static and just be done with it, but that seems like a total hack, and ugly.

    Read the article

  • nth smallest number among two databases of size n each using divide and conquer

    - by urfriend
    we have two databases of size n containing numbers without repeats. So, in total we have 2n elements. They can be accessed through a query to one database at a time. The query is such that you give it a k and it returns kth smallest entry in that database. we need to find nth smallest entry among all the 2n elements in O(logn) queries. the idea is to use divide and conquer but i need some help thinking through this. thanks!

    Read the article

  • cant start glassfish within netbeans

    - by noname
    when i click on Run it displays and error message: Starting GlassFish v3 Domain GlassFish v3 Domain start failed. /Volumes/Private/noname/Sites/projects/java/MyFirstServlet/nbproject/build-impl.xml:602: Deployment error: GlassFish v3 Domain start failed. See the server log for details. BUILD FAILED (total time: 2 minutes 0 seconds) but then i fire up Terminal in mac and use asadmin start-domain and it starts. and in netbeans i then Run the project and it fires up Safari and displays the content. but why cant glassfish start in netbeans? any idea?

    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

  • Best method to compress JSON string in term of performance and compress radio

    - by Eric Yin
    For a JSON string, contains all kinds of settings, numbers, string etc. Total JSON string fairly fall into 10k~50K range. I want to compress it before save to database. So I wonder which compress method should I choose, I am using c# 4, I know I can choose gzip and deflate but the compression radio is not good (although speed is good). More specific, compress can be a little slow (since only once) but should be small. Decompress should be lighting fast since decompress happens lots. Please give some advice.

    Read the article

  • recursion tree and binary tree cost calculation

    - by Tony
    Hi all, I've got the following recursion: T(n) = T(n/3) + T(2n/3) + O(n) The height of the tree would be log3/2 of 2. Now the recursion tree for this recurrence is not a complete binary tree. It has missing nodes lower down. This makes sense to me, however I don't understand how the following small omega notation relates to the cost of all leaves in the tree. "... the total cost of all leaves would then be Theta (n^log3/2 of 2) which, since log3/2 of 2 is a constant strictly greater then 1, is small omega(n lg n)." Can someone please help me understand how the Theta(n^log3/2 of 2) becomes small omega(n lg n)?

    Read the article

  • In Django, I want to insert a database record by sending myself an email?

    - by littlejim84
    Hello. I'm looking into a possible feature for my little to-do application... I like the idea that I can send an email to a particular email address, containing a to-do task I need to complete, and this will be read by my web application and be put in the database... So, when I come to log into my application, the to-do task I emailed will be there as a entry in the app. Is this possible? I have a slice with SliceHost (basically a dedicated server) so I have total control on what to install etc. I'm using Python/Django/MySQL for this. Any ideas on what steps to take to make this happen?

    Read the article

  • How to loop an executable command in the terminal in Linux?

    - by user1452373
    Let me first describe my situation, I am working on a Linux platform and have a collection of .bmp files that add one to the picture number from filename0022.bmp up to filename0680.bmp. So a total of 658 pictures. I want to be able to run each of these pictures through a .exe file that operates on the picture then kicks out the file to a file specified by the user, it also has some threshold arguments: lower, upper. So the typical call for the executable is: ./filter inputfile outputfile lower upper Is there a way that I can loop this call over all the files just from the terminal or by creating some kind of bash script? My problem is similar to this: Execute a command over multiple files with a batch file but this time I am working in a Linux command line terminal. Thank you for your help, Luke H

    Read the article

  • How to assign permissions for Copy/Paste on windows

    - by jalchr
    Well, as everyone knows there is no way you can assign permissions for Copy/Paste of files on windows platform. I need to control the copy process from a central file server, in a way that helps me know: which user performed the copy Which files were copied where did he pasted them Total size of data copied Time of copy operation If user exceeds the allowed "Copy-Limit", a dialog box requests him to enter administrative credentials or deny him (as it would be configured) Store all this data in a file for later review or send by email. I need to collect this data by putting a utility program on the server itself, without any other installation on client computers. I know about monitoring the Clipboard, but which clipboard would it be? the user's clipboard or the server's clipboard ? And what about drag-drop operation, which doesn't even pass through the clipboard? Any knowledge of whether SystemFileWatcher is useful in such case ? Any ideas ?

    Read the article

  • I have Following code but rest of it how?

    - by Hakan
    I have following code which is putting value of text box to table but i can't manage how to delete record. Can someone help me about it? Dim meter As DataTable = Me.DataSet1.Tables.Item("tblmeter") Dim row As DataRow = meter.NewRow() row.Item("No") = Me.txtno.Text row.Item("Turnover") = Me.txtturnover.Text row.Item("Total Win") = Me.txttotalwin.Text row.Item("Games Played") = Me.txtgamesplayed.Text row.Item("Credit In") = Me.txtcreditin.Text row.Item("Bill In") = Me.txtbillin.Text row.Item("Hand Pay") = Me.txthandpay.Text row.Item("Date") = DateTime.Today.ToShortDateString meter.Rows.Add(row) Me.TblMeterTableAdapter.Update(Me.DataSet1.tblMeter) meter.AcceptChanges() Dim table As DataTable = Me.DataSet1.Tables.Item("tblmeter") Dim defaultView As DataView = table.DefaultView Dim cell As New DataGridCell((defaultView.Table.Rows.Count - 1), 1) Me.DataGrid1.CurrentCell = cell txtno.Text = "" txtturnover.Text = "" txttotalwin.Text = "" txtgamesplayed.Text = "" txtcreditin.Text = "" txtbillin.Text = "" txthandpay.Text = "" txtno.Focus() I am using following code but it's not update records. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim current As DataRowView = DirectCast(Me.BindingContext.Item(Me.DataSet1.Tables.Item("tblmeter")).Current, DataRowView) current.Delete() Me.DataSet1.tblMeter.AcceptChanges() Me.TblMeterTableAdapter.Update(Me.DataSet1.tblMeter) End Sub Code deletes records from datagrid but not updating. Any help

    Read the article

  • Why setValue at not working on Jtable?

    - by Nitz
    Hey Guys I am doing project on java. In one of the class, I am working on jtable. Now what i am doing is, In the table data will be loaded from the database. Now i want to change some value at some exact row and column. so for that i am using jtable's setValue function. which is like this.... grayCardTbl.setValueAt(Float.valueOf(String.valueOf(pdiff)),1,4); I have checked the "pdiff" variable, it is perfect. i had total 5 columns and 10 rows. So now problem with rowindex and column index. and after this i have also refresh the table. but still it is not reflecting on table.

    Read the article

  • How to calculate real-time stats?

    - by Diego Jancic
    I have a site with millions of users (well, actually it doesn't have any yet, but let's imagine), and I want to calculate some stats like "log-ins in the past hour". The problem is similar to the one described here: http://highscalability.com/blog/2008/4/19/how-to-build-a-real-time-analytics-system.html The simplest approach would be to do a select like this: select count(distinct user_id) from logs where date>='20120601 1200' and date <='20120601 1300' (of course other conditions could apply for the stats, like log-ins per country) Of course this would be really slow, mainly if it has millions (or even thousands) of rows, and I want to query this every time a page is displayed. How would you summarize the data? What should go to the (mem)cache? EDIT: I'm looking for a way to de-normalize the data, or to keep the cache up-to-date. For example I could increment an in-memory variable every time someone logs in, but that would help to know the total amount of logins, not the "logins in the last hour". Hope it's more clear now.

    Read the article

  • Code coordinates to match compass bearings

    - by pinnacler
    Right now in Matlab (0,0) is the origin, 0 degrees / 2pi would be to the right of the cartesian plane and angles are measured counter clockwise with 90 degrees being at the top. I'm trying to write a simulator where the coordinates would match a compass bearing. 0/360 degrees or 2pi would be at the top and 90 degrees would be on the right. Any idea how to code in Matlab or c++? I'd imaging it'd be a matrix flipped about the x axis and rotated 90 degrees but I'm at a total loss. Phil

    Read the article

< Previous Page | 136 137 138 139 140 141 142 143 144 145 146 147  | Next Page >