Search Results

Search found 7127 results on 286 pages for 'calculated columns'.

Page 213/286 | < Previous Page | 209 210 211 212 213 214 215 216 217 218 219 220  | Next Page >

  • DB management for Heroku apps

    - by zetarun
    Hi all, I'm fairly new to both Rails and Heroku but I'm seriously thinking of using it as a platform to deploy my Ruby/Rails applications. I want to use all the power of Heroku, so I prefer the "embedded" PostgreSQL managed by Heroku instead of the addon for Amazon RDS for MySQL, but I'm not so confident without the possibility to access my data in a SQL client... I know that in a well made app you have no need to access DB, but there are some situations (add rows to a config table, see data not mapped in a view, update some columns for debugging issues, performance monitoring, running queries for reporting, etc.) when this can be good... How do you solve this problem? What's you experience in a real life app powered by Heroku? Thanks!

    Read the article

  • Strategy for Storing Multiple Nullable Booleans in SQL

    - by Eric J.
    I have an object (happens to be C#) with about 20 properties that are nullable booleans. There will be perhaps a few million such objects persisted to a SQL database (currently SQL Server 2008 R2, but MySQL may need to be supported in the future). The instances themselves are relatively large because they contain about a paragraph of text as well as some other unrelated properties. For a given object instance, most of the properties will be null most of the time. When users search for instances of such objects, they will select perhaps 1-3 of the nullable boolean properties and search for instances where at least one of those 1-3 properties is non-null (OR search). My first thought is to persist the object to a single table with nullable BIT columns representing the nullable boolean properties. However, this strategy will require one index per BIT column to avoid performing a table scan when searching. Further, each index would not be particularly selective since there are only three possible values per index. Is there a better way to approach this problem?

    Read the article

  • How to get the real, actual duration of an MP3 file (VBR or CBR) server-side

    - by Cummander Checkov
    I used to calculate the duration of MP3 files server-side using ffmpeg - which seemed to work fine. Today i discovered that some of the calculations were wrong. Somehow, for some reason, ffmpeg will miscalculate the duration and it seems to happen with variable bit rate mp3 files only. When testing this locally, i noticed that ffmpeg printed two extra lines in green. Command used: ffmpeg -i song_9747c077aef8.mp3 ffmpeg says: [mp3 @ 0x102052600] max_analyze_duration 5000000 reached at 5015510 [mp3 @ 0x102052600] Estimating duration from bitrate, this may be inaccurate After a nice, warm google session, i found some posts on this, but no solution was found. I then tried to increase the maximum duration: ffmpeg -analyzeduration 999999999 -i song_9747c077aef8.mp3 After this, ffmpeg returned only the second line: [mp3 @ 0x102052600] Estimating duration from bitrate, this may be inaccurate But in either case, the calculated duration was just plain wrong. Comparing it to VLC i noticed that here the duration is correct. After more research i stumbled over mp3info - which i installed and used. mp3info -p "%S" song_9747c077aef8.mp3 mp3info then returned the CORRECT duration, but only as an integer, which i cannot use as i need a more accurate number here. The reason for this was explained in a comment below, by user blahdiblah - mp3info is simply pulling ID3 info from the file and not actually performing any calculations. I also tried using mplayer to retrieve the duration, but just as ffmpeg, mplayer is returning the wrong value. Now i ran out of options. If somebody knows how to get around this, any hints, tips, guides or corrections are welcome! Thank You!

    Read the article

  • Textbox is disabled after adding text dynamically in codebehind

    - by user1761348
    Can't quite work out what is happening but The background is that I am dynamically adding table rows in a web page and some of the cells hold controls such as dropdowns etc. One of the columns pulls a size into it. However the column I am having issues with is the next column which takes the text from teh previous dropdown and shows the appropriate price. On doing htis however the textbox which is being created appears to turn into a label as I cannot select or adjust the text that has been put in there. var gotPrice =(from a in getPrice.Sizes where a.Size1 == Size.SelectedValue select a).First(); TextBox Price = new TextBox(); Price.Width = 100; PriceField.Controls.Add(Price); PriceField.Text = gotPrice.RackRate.ToString(); I have tried then calling .Enabled but still the text box is not editable. any help appreciated.

    Read the article

  • own drawImage / drawLine in OpenGL

    - by Chrise
    I'm implementing some native 2D-draw functions in my graphics engine for android, but now there's another question coming up, when I observe the performance of my program. At the moment I'm implementing a drawLine/drawImage function. In summary, there are following different values for drawing each different line / image: the color the alpha value the width of the line rotation (only for images) size/scale (also for images) blending method (subrtract, add, normal-alpha) Now, when an imageLine is drawn, I put the CPU-calculated vertex-positions and uv-values for 6 vertices (2 triangles), into a Floatbuffer and draw it immediately with drawArrays, after passing information for drawing (color,alpha, etc.) via uniforms to the shader. When I draw an image, the pre-set VBO is directly drawn after passing information. The first fact I recognized, is: of course drawing Images is much faster, than imagelines (beacuse of VBOs), but also: I cannot pre-put vertex-data into a VBO for imageLines, because imageLines have no static shape like normal images (varying linelength, varying linewidth and the vertex positions of x1,y1 and x2,y2 change too often) That's why I use a normal Floatbuffer, instead of a VBO. So my question is: What's the best way for managing images, and other 2D-graphics functions. For me it's some kind of important, that the user of the engine is able to draw as many images/2D graphics as possible, without loosing to much performance. You can find the functions for drawing images, imagelines, rects, quads, etc. here: https://github.com/Chrise55/LLama3D/blob/master/Llama3DLibrary/src/com/llama3d/object/graphics/image/ImageBase.java Here an example how it looks with many images (testing artificial neural networks), it works fine, but already little bit slow with that many images... :(

    Read the article

  • How to move file pointer to a particular location using fseek()?

    - by Noge
    My intention is to read every elements in the 2nd column into a buffer[] from the following .txt file: 9992891234 09.920 15.771 11.909 9992345971 07.892 12.234 09.234 9992348971 64.567 70.456 50.987 9992348231 89.234 85.890 58.982 I have know of a way to do it by using fscanf(): for (int i=0;i<4;i++) { fscanf(pFile, "%lld", &junk); fscanf(pFile, "%f", &buffer[i]); fscanf(pFile, "%f", &junk); fscanf(pFile, "%f", &junk); } However, since I'm doing parallel programing which requires me to use different Windows Threads to read different columns, so I'll need to read the elements in the 2nd column directly using fseek(). The question here is, what should I put in the 2nd argument in fseek() in the code below to move my file pointer to read the 2nd element of the 2nd line? fscanf(pFile, "%llf", &junk);//<------this is used to skip the 1st data for (int i=0;i<4;i++) { fscanf(pFile, "%f", &buffer[i]); fseek ( pFile , ??, SEEK_CUR );//<----how do I calculate this offset? }

    Read the article

  • Clientside Javascript --> Serverside Java --> user is served a .doc

    - by ignorantslut
    I am helping someone out with a javascript-based web app (even though I know next to nothing about web development) and we are unsure about the best way to implement a feature we'd like to have. Basically, the user will be using our tool to view all kinds of boring data in tables, columns, etc. via javascript. We want to implement a feature where the user can click a button or link that then allows the user to download the displayed data in a .doc file. Our basic idea so far is something like: call a Java function on the server with the desired data passed in as a String when the link is clicked generate the .doc file on the server automatically "open" a link to the file in the client's browser to initiate the download Is this possible? If so, is it feasible? Or, can you recommend a better solution? edit: the data does not reside on the server; rather, it is queried from a SQL database

    Read the article

  • Rendering field data as a link in Ruby on Rails...

    - by bgadoci
    Ok, I think this is probably an easy question but for the life of my I can't figure it out. I have created a table called ugtags and in that table I have two columns (beyond the basics), 'name' and 'link'. I am trying to allow a user to add a link to a page. Ideally they would enter the link title (name) and the url (link) and in the view it would display the title as a link to the url that was entered in the link column. I there a way to do it by simply affecting the <%= link_to h(ugtag.name) %> code?

    Read the article

  • Is there a best practice for maintaining history in a database?

    - by Pete
    I don't do database work that often so this is totally unfamiliar territory for me. I have a table with a bunch of records that users can update. However, I now want to keep a history of their changes just in case they want to rollback. Rollback in this case is not the db rollback but more like revert changes two weeks later when they realized that they made a mistake. The distinction being that I can't have a transaction do the job. Is the current practice to use a separate table, or just a flag in the current table? It's a small database, 5 tables each with < 6 columns, < 1000 rows total.

    Read the article

  • how do I integrate the aspnet_users table that comes with asp.net membership into my existing databa

    - by ooo
    i have a database that already has a users table COLUMNS: userID - int loginName - string First - string Last - string i just installed the asp.net membership table. Right now all of my tables are joined into my users table foreign keyed into the "userId" field How do i integrate asp.net_users table into my schema? here are the ideas i thought of: Add a membership_id field to my users table and on new inserts, include that new field in my users table. This seems like the cleanest way as i dont need to break any existing relationships. break all existing relationship and move all of the fields in my user table into the asp.net_users table. This seems like a pain but ultimately will lead to the most simple, normalized solution any thoughts?

    Read the article

  • Where's the rest of the space used in this table?

    - by Eric H.
    I'm using SQL Server 2005. I have a table whose row size should be 124 bytes. It's all ints or floats, no NULL columns (so everything is fixed width). There is only one index, clustered. The fill factor is 0. After inserting a ton of data, sp_spaceused returns the following name rows reserved data index_size unused OHLC_Bar_Trl 117076054 29807664 KB 29711624 KB 92344 KB 3696 KB which shows a rowsize of approx (29807664*1024)/117076054 = 260 bytes/row. Where's the rest of the space? Is there some DBCC command I need to run to tighten up this table (I could not insert the rows in correct index order, so maybe it's just internal fragmentation)?

    Read the article

  • SSAS OLAP MDX and relationships

    - by Sonic Soul
    I new to OLAP, and still not sure how to create a relationship between 2 or more entities. I am basing my cube on views. For simplicity sake let's call them like this: viewParent (ParentID PK) viewChild (ChildID PK, ParentID FK) these views have more fields, but they're not important for this question. in my data source, i defined a relationship between viewParent and viewChild using ParentID for the link. As for measures, i was forced to create separate measures for Parent and Child. in my MDX query however, the relationship does not seem to be enforced. If i select record count for parent, child, and add some filters for the parent, the child count is not reflecting it.. SELECT { [Measures].[ParentCount],[Measures].[ChildCount] } ON COLUMNS FROM [Cube] WHERE { ( {[Time].[Month].&[2011-06-01T00:00:00]} ,{[SomeDimension].&[Foo]} ) } the selected ParentCount is correct, but ChildCount is not affected by any of the filters (because they are parent filters). However, since i defined a relationship, how can i take advantage of that to filter children by parent filter?

    Read the article

  • How to insert into a table with just one IDENTITY column (SQL Server CE)

    - by Hei
    Hello I am trying to insert a value in a one IDENTITY column Table in SQL Server CE 3.5. I Tried the following: INSERT Target DEFAULT VALUES INSERT Target (ID) VALUES (DEFAULT) INSERT Target (ID) VALUES () But none of them worked. This is the SQL command I used to create the table (Using SQL Server Management Studio): CREATE TABLE Target( ID int NOT NULL IDENTITY (1, 1) PRIMARY KEY ); Microsoft help site (http://msdn.microsoft.com/en-us/library/ms174633%28SQL.90%29.aspx) mentions that DEFAULT values are not valid for identity columns however they do not mention any alternative. They mention something about uniqueidentifier and ROWGUID but I have not been able to make it work. I would appreciate any pointers on how to solve this problem or links to documentation about valid sql commands for sql server CE. Thank you

    Read the article

  • How to enable an AdventureWorks database in a web application?

    - by salvationishere
    I am developing a C#/SQL ASP.NET web application in VS 2008. I want the users to be able to select an Adventureworks table and then an input file. The user is then able to map columns from the file with the selected table. This app works fine now in VS. But when I Browse in IIS, it doesn't show any of the tables. I think this is because currently Adventureworks connection string is integrated security (Windows authentication). If I want users to be able to select a table, do I have to change connection to SQL Server authentication? And if so, is the only way to do this to reinstall SQL Server? Or can I just reinstall Adventureworks? And if I reinstall SQL Server, do I need to reinstall VS also for this to work? This could be painful...

    Read the article

  • What is the reason not to use select * ?

    - by Chris Lively
    I've seen a number of people claim that you should specifically name each column you want in your select query. Assuming I'm going to use all of the columns anyway, why would I not use SELECT *? Even considering the question from 9/24, I don't think this is an exact duplicate as I'm approaching the issue from a slightly different perspective. One of our principles is to not optimize before it's time. With that in mind, it seems like using SELECT * should be the preferred method until it is proven to be a resource issue or the schema is pretty much set in stone. Which, as we know, won't occur until development is completely done. That said, is there an overriding issue to not use SELECT *?

    Read the article

  • multi-row update table with "different" data

    - by kralco626
    I think the best way to explain this is to tell you what I have. I have two tables A and B both have columns Field1 and Field2. However Field 2 is not populated in table B I want to populate field 2 of table B with field 2 of table A where field 1 of table A matches field 1 of table B. something like update tableB set Field2 = tableA.field2 where tablea.field1 = tableb.field1. The reason this may seem so odd and obscure is that I'm tyring to do an inital data load form an old database to a new one. please let me know if you need clarification

    Read the article

  • What's causing "NoMethodError: undefined method `include?' for nil:NilClass"

    - by NudeCanalTroll
    I have a Book model in my Rails application, with various properties (aka columns in the book db table). One of these properties is "ranking". Recently, may app has started to throw NoMethodError: undefined method 'include?' for nil:NilClass for the following code: def some_method(book, another_arg) return book.ranking unless book.ranking.blank? ... end However, it's not consistent. The vast majority of the time, accessing book.ranking works -- the error is thrown maybe 2-4% of the time. If I change the code to book[:ranking] or book['ranking'] instead of book.ranking, it works 100% of the time. Any ideas?

    Read the article

  • MS SQL Server Dates Excel

    - by KillerSnail
    I have data this is linked from SQL Server into an excel document. The column format on the SQL Server is datetime2. When I get the data via an ODBC connection it comes across as a string? I tried using CAST(column AS DATE ) but that didn't work. I tried reformatting via CONVERT(VARCHAR(10), column, 103) as well but that didn't work. I tried retrieving the data via Microsoft query as well but that didn't work. At the moment I am using VBA code like: While (ActiveCell.Value <> "") ActiveCell.Value = DATEVALUE(ActiveCell.Value) ActiveCell.Offset(1,0).Activate Wend and looping through each column that needs this treatment but 100000 rows in multiple columns takes forever to loop through. Are there any alternatives?

    Read the article

  • Specify fields in a recursive find with cakephp

    - by Razor Storm
    Suppose I have a table Recipe that hasmany ingredients. I do a recursive find to grab recipes with their associated ingredients: $this->Recipe->find('all', array('fields' => array('id','title','description'))); Here I can use the 'fields' attribute to specify that I only want it to return id, title, and description. However, despite this, cakephp still returns ALL columns from the ingredients table. How do I tell cakephp that I only want ingredient table's id and name fields? btw ingredient model is "Ingredient" and the table is ingredients, and the aggregation table is recipes_ingredients.

    Read the article

  • how do I do this UPDATE in sqlite?

    - by Jason S
    I have a table assoc containing columns local_id, remote_id, cachedData I can successfully run an SQLITE query that looks like SELECT a1.local_id, a1.remote_id FROM assoc a1 LEFT JOIN .... so that I identify certain rows of the assoc table that meet my criteria. What I would like to do is to set cachedData to null in those rows. How can I do this? Sqlite doesn't support UPDATE with joins; you can issue subqueries but I can't figure out how to get the syntax correct; it seems nonintuitive to me.

    Read the article

  • Conditional CellRenderCombo in pyGTK TreeView

    - by Präriewolf
    I have a two column TreeView attached to a ListStore. Both columns are CellRenderCombo combo boxes. When the user selects an entry in the first box, I need to dynamically load a set of options in the second. For example, the behavior I want is: On row 0, the user selects "Alphabet" in the first column box. The second column box is populated with the letters "A-Z". On row 1, the user selects "Numbers" in the first column box. The second column box is populated with the numbers "0-9". On row 2, the user selects "Alphabet" in the first column box. The second column box is populated with the letters "A-Z". etc. Does anyone know how to do this, or seen any open source pygtk or gtk projects that have similar behavior which I can analyze?

    Read the article

  • Convert Date with characters to mm/dd/yyyy

    - by peter
    I have a columns called Submit_Date in table Tickets and the datatype of it is Varchar(200) and I am trying to convert it to MM/DD/YYYY format and when i do that i get the following error: Msg 242, Level 16, State 3, Line 1 The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. Sample Data of the table is: Submit_Date 27-09-2013 16:15:00 CST 30-09-2013 16:30:24 CST 27-09-2013 10:03:46 CST 30-09-2013 14:35:55 CST 25-09-2013 16:28:48 CST 24-09-2013 09:29:45 CST I tried doing the following: Select Convert(datetime,Submit_date,101) from dbo.Tickets Let me know where I am doing wrong.

    Read the article

  • Changing the value of datagridComboBoxColumn on checking/unchecking of check boxes in datagridcheckb

    - by MD
    I have a wpf data grid,where there are two data template columns One of which ahs check box as the data template adn teh other has combo box as the data template. Now my requirement is,i need to disable few of the options in the combo boxes depending on the check box checked or unchecked for each individual rows... With the cod etaht i ahve tried,i am able to change teh values of teh combo boxes,but it changes for the whole column and not fro individual rows.. Please let me kneo how to determine the combo boxes for the corresponding check boxes in a particular row.

    Read the article

  • Sorting issues in flexigrid with "json" data

    - by John Sieber
    I'm currently using flexigrid to display data in a current project, but am running into issues with its ability to properly sort certain columns that contain dates or numbers. The data is being sent from a ColdFusion CFC that selects the appropriate data and then delivers it in the proper "json" format. As the date/time stamps and other fields containing numbers are sent as "strings" they do not sort properly in the data grid. Is this a limitation of Flexigrid or am I sending the data improperly to Flexigrid? I can provide examples of my code if that is helpful.

    Read the article

  • "Othello" game needs some clarification

    - by pappu
    I am trying to see if my understanding of "othello" fame is correct or not. According to the rules, we flip the dark/light sides if we get some sequence like X000X = XXXXX. The question I have is if in the process of flipping 0-X or X- 0, do we also need to consider the rows/columns/diagonals of newly flipped elements? e.g. consider board state as shown in above image(New element X is placed @ 2,3) When we update board, we mark elements from 2,3 to 6,3 as Xs but in this process elements like horizontal 4,3 to 4,5 and diagonal 2,3 to 4,5 are also eligible for update? so do we update those elements as well? or just the elements which have starting as 2,3 (i.e update rows/column/diagonal whose starting point is the element we are dealing with, in our case 2,3?) Please help me understand it

    Read the article

< Previous Page | 209 210 211 212 213 214 215 216 217 218 219 220  | Next Page >