Search Results

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

Page 143/286 | < Previous Page | 139 140 141 142 143 144 145 146 147 148 149 150  | Next Page >

  • combine 2 files with AWK based last colums

    - by mohammad reshad
    i have two files file1 ------------------------------- 1 a t p b 2 b c f a 3 d y u b 2 b c f a 2 u g t c 2 b j h c file2 -------------------------------- 1 a b 2 p c 3 n a 4 4 a i want combine these 2 files based last columns (column 5 of file1 and column 3 of file2) using awk result ---------------------------------------------- 1 a t p 1 a b 2 b c f 3 n a 2 b c f 4 4 a 3 d y u 1 a b 2 b c f 3 n a 2 b c f 4 4 a 2 u g t 2 p c 2 b j h 2 p c

    Read the article

  • How to use another type of EditingControl in a single C# 3.5 DataGridView column ?

    - by too
    Is this possible to have two (or more) different kinds of cells to be displayed interchangeably in single column of C# .Net 3.5 DataGridView? I know one column has specified single EditingControl type, yet I think grid is flexible enough to do some tricks, I may think of only: Adding as many invisible columns to grid as required types of cells and on CellBeginEdit somehow exchange current cell with other column's cell Create custom column and custom cell with possibility of changing EditingControl for single cell Which approach is better, are there any examples ?

    Read the article

  • True or False: Good design calls for every table to have a primary key, if nothing else, a running i

    - by Velika
    Consider a grocery store scenario (I'm making this up) where you have FACT records that represent a sale transaction, where the columns of the Fact table include SaleItemFact Table ------------------ CustomerID ProductID Price DistributorID DateOfSale Etc Etc Etc Even if there are duplicates in the table when you consider ALL the keys, I would contend that a surrogate running numeric key (i.e. identity column) should be made up, e.g., TransactionNumber of type Integer. I can see someone arguing that a Fact table might not have a unique key (though I'd invent one and waste the 4 bytes, but how about a dimension table?

    Read the article

  • SQL - First row inserted every day for the past X days

    - by okie.floyd
    A tough SQL question (I'm using postgres by the way). I need the first row inserted every day for the past X days. one of my columns is a timestamp, which i hold the time inserted, and another column is the row id. If it's not possible to get the first row inserted every day, i at least need a unique one; a single row for every day for the past x days. Any suggestions? Thanks okie

    Read the article

  • qx.ui.table.Table hangs my browser...

    - by W55tKQbuRu28Q4xv
    Hi all, I have a strange bug. I create a qx.ui.table.Table and if not all specified columns fit into window (horizontal scroll appear) my browsers (firefox 3.5.6 and chrome 5.0.344) hangs. If i just set width for window large (e.g. from 600px to 800px) - all works fine. May be I'm doing something wrong? Or how can I fix/avoid this 'strange' behaviour?

    Read the article

  • How to define 'Attached property' as 'SelectedValuePath' in ComboBox?

    - by SpudCZ
    Hi, I have a problem with binding in ComboBox. I'd like to bind ComboBox items to ListView columns and as a selected value return value of attached property defined on the selected column. In example bellow you can see working sample that displays width of selected column. If you try to change SelectedValuePath in ComboBox into (loc:SampleBehavior.SampleValue) you get binding error: BindingExpression path error: '(u:SearchableListView.SearchMemberPath)' property not found on 'object' ''GridViewColumn' <Window x:Class="Problem_Sample1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:loc="clr-namespace:Problem_Sample1" WindowStartupLocation="CenterScreen" Title="Window1" Height="300" Width="300"> <DockPanel> <ComboBox DockPanel.Dock="Top" x:Name="combobox" ItemsSource="{Binding Path=View.Columns, ElementName=listview}" DisplayMemberPath="Header" SelectedValuePath="Width"> </ComboBox> <StatusBar DockPanel.Dock="Bottom"> <TextBlock> <TextBlock Text="Selected column (value): " /> <TextBlock Text="{Binding Path=SelectedValue, ElementName=combobox}" /> </TextBlock> </StatusBar> <ListView x:Name="listview"> <ListView.View> <GridView> <GridViewColumn Header="Name" Width="101" loc:SampleBehavior.SampleValue="201" /> <GridViewColumn Header="Surname" Width="102" loc:SampleBehavior.SampleValue="202" /> </GridView> </ListView.View> </ListView> </DockPanel> </Window>   SampleBehavior.cs using System.Windows; using System.Windows.Controls; namespace Problem_Sample1 { public static class SampleBehavior { public static readonly DependencyProperty SampleValueProperty = DependencyProperty.RegisterAttached( "SampleValue", typeof (int), typeof (SampleBehavior)); [AttachedPropertyBrowsableForType(typeof(GridViewColumn))] public static int GetSampleValue(GridViewColumn column) { return (int)column.GetValue(SampleValueProperty); } [AttachedPropertyBrowsableForType(typeof(GridViewColumn))] public static void SetSampleValue(GridViewColumn column, int value) { column.SetValue(SampleValueProperty, value); } } }   Thanks for any help or suggestion.

    Read the article

  • Avoid duplication of values in a SELECT query in PostgreSQL

    - by Shyam Solanki
    I have a table named product which contains two columns: id name 1 p1 2 p2 3 p1 4 p3 5 p4 I run the following query: SELECT DISTINCT id, name FROM product; As a result, PostgreSQL gives me the following output: id name 1 p1 2 p2 3 p1 4 p3 5 p4 I want to avoid duplication of values in the name field, so the desired output should look like this: 1 p1 2 p2 4 p3 5 p4 How should I go about achieving this?

    Read the article

  • Multi-Column Primary Key in MySQL 5

    - by Kaji
    I'm trying to learn how to use keys and to break the habit of necessarily having SERIAL type IDs for all rows in all my tables. At the same time, I'm also doing many-to-many relationships, and so requiring unique values on either column of the tables that coordinate the relationships would hamper that. How can I define a primary key on a table such that any given value can be repeated in any column, so long as the combination of values across all columns is never repeated exactly?

    Read the article

  • Command line CSV viewer?

    - by Benjamin Oakes
    Anyone know of a command-line CSV viewer for Linux/OS X? I'm thinking of something like less but that spaces out the columns in a more readable way. (I'd be fine with opening it with OpenOffice Calc or Excel, but that's way too overpowered for just looking at the data like I need to.) Having horizontal and vertical scrolling would be great.

    Read the article

  • asp:Button is not calling server-side function

    - by Richard Neil Ilagan
    Hi guys, I know that there has been much discussion here about this topic, but none of the threads I got across helped me solve this problem. I'm hoping that mine is somewhat unique, and may actually merit a different solution. I'm instantiating an asp:Button inside a data-bound asp:GridView through template fields. Some of the buttons are supposed to call a server-side function, but for some weird reason, it doesn't. All the buttons do when you click them is fire a postback to the current page, doing nothing, effectively just reloading the page. Below is a fragment of the code: <asp:GridView ID="gv" runat="server" AutoGenerateColumns="false" CssClass="l2 submissions" ShowHeader="false"> <Columns> <asp:TemplateField> <ItemTemplate><asp:Panel ID="swatchpanel" CssClass='<%# Bind("status") %>' runat="server"></asp:Panel></ItemTemplate> <ItemStyle Width="50px" CssClass="sw" /> </asp:TemplateField> <asp:BoundField DataField="description" ReadOnly="true"> </asp:BoundField> <asp:BoundField DataField="owner" ReadOnly="true"> <ItemStyle Font-Italic="true" /> </asp:BoundField> <asp:BoundField DataField="last-modified" ReadOnly="true"> <ItemStyle Width="100px" /> </asp:BoundField> <asp:TemplateField> <ItemTemplate> <asp:Button ID="viewBtn" cssclass='<%# Bind("sid") %>' runat="server" Text="View" OnClick="viewBtnClick" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> The viewBtn above should call the viewBtnClick() function on server-side. I do have that function defined, along with a proper signature (object,EventArgs). One thing that may be of note is that this code is actually inside an ASCX, which is loaded in another ASCX, finally loaded into an ASPX. Any help or insight into the matter will be SO appreciated. Thanks! (oh, and please don't mind my trashy HTML/CSS semantics - this is still in a very,very early stage :p)

    Read the article

  • FIND TIME DIFFERENCE

    - by RUBAN
    HI, I HAVE THREE COLUMNS. COLUMN A COLUMN B COLUMNC 2.43 2.45 00:02:00 WHAT I WANT IS COLUMN A HAVE START TIME, AND COLUMN B HAVE END TIME.I NEED THE TIME DIFFERENCE OF START AND END TIME IN COLUMN C FORMAT LIKE(HH:MM:SS) SOMEBODY CAN HELP ME PLEASE!!!!!!!!!!!!!

    Read the article

  • How can you replicate each row of an R data.frame and specify the number of replications for each ro

    - by wkmor1
    df <- data.frame(var1=c('a', 'b', 'c'), var2=c('d', 'e', 'f'), freq=1:3) What is the simplest way to expand the first two columns of the data.frame above, so that each row appears the number of times specified in the column 'freq'? In other words, go from this: >df var1 var2 freq 1 a d 1 2 b e 2 3 c f 3 To this: >df.expanded var1 var2 1 a d 2 b e 3 b e 4 c f 5 c f 6 c f

    Read the article

  • What database table structure should I use for versions, codebases, deployables?

    - by Zac Thompson
    I'm having doubts about my table structure, and I wonder if there is a better approach. I've got a little database for version control repositories (e.g. SVN), the packages (e.g. Linux RPMs) built therefrom, and the versions (e.g. 1.2.3-4) thereof. A given repository might produce no packages, or several, but if there are more than one for a given repository then a particular version for that repository will indicate a single "tag" of the codebase. A particular version "string" might be used to tag a version of the source code in more than one repository, but there may be no relationship between "1.0" for two different repos. So if packages P and Q both come from repo R, then P 1.0 and Q 1.0 are both built from the 1.0 tag of repo R. But if package X comes from repo Y, then X 1.0 has no relationship to P 1.0. In my (simplified) model, I have the following tables (the x_id columns are auto-incrementing surrogate keys; you can pretend I'm using a different primary key if you wish, it's not really important): repository - repository_id - repository_name (unique) ... version - version_id - version_string (unique for a particular repository) - repository_id ... package - package_id - package_name (unique) - repository_id ... This makes it easy for me to see, for example, what are valid versions of a given package: I can join with the version table using the repository_id. However, suppose I would like to add some information to this database, e.g., to indicate which package versions have been approved for release. I certainly need a new table: package_version - version_id - package_id - package_version_released ... Again, the nature of the keys that I use are not really important to my problem, and you can imagine that the data column is "promotion_level" or something if that helps. My doubts arise when I realize that there's really a very close relationship between the version_id and the package_id in my new table ... they must share the same repository_id. Only a small subset of package/version combinations are valid. So I should have some kind of constraint on those columns, enforcing that ... ... I don't know, it just feels off, somehow. Like I'm including somehow more information than I really need? I don't know how to explain my hesitance here. I can't figure out which (if any) normal form I'm violating, but I also can't find an example of a schema with this sort of structure ... not being a DBA by profession I'm not sure where to look. So I'm asking: am I just being overly sensitive?

    Read the article

  • How to find if dataTable contains column which name starts with abc

    - by VilemRousi
    In my program I have a dataTable and I´d like to know if is there a column which name starts with abc. For example I have a DataTable and its name is abcdef. I like to find this column using something like this: DataTable.Columns.Constains(ColumnName.StartWith(abc)) Because I know only part of the column name, I cannot use a Contains method. Is there any simple way how to do that? Thanks a lot.

    Read the article

  • Help with MySQL date operation

    - by jartaud
    Hello i have two columns: duration (int) and dateCol (date) in a table. How should i proceed if i want to know when CURDATE() - dateCol will iqual to duration. ie: CURDATE() - dateCol (2010-05-08) = duration (14 days), and then send an e-amil?

    Read the article

  • NET USE command And Network Provider interface.

    - by Benjamin
    When we command "net use" on command prompt, the result has four columns. Status Local Remote Network OK Z: \\10.x.x.x\Public Microsoft Windows Network X: \\10.y.y.y\Public My Network Redirector The Microsoft Windows Network(SMB)'s Status has OK value, but we don't. It's just empty. We implemented NPEnumResource function in our Network Provider dll. But I don't know how can I set the value(OK). How can I do that? Thanks

    Read the article

  • UpdatePanel Full Postback

    - by Korivo
    Greetings, here is the scenario. I have and .aspx page with and updatepanel like this <asp:UpdatePanel id="uPanelMain" runat="server"> <ContentTemplate> <uc:Calendar id="ucCalendar" runat="server" Visible="true" /> <uc:Scoring id="ucScoring" runat="server" Visible="false" /> </ContentTemplate> The control ucCalendar is loaded first and it contains a grid like this <asp:DataGrid CssClass="grid" ID="gridGames" runat="server" AutoGenerateColumns="False" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridScoringRow" GridLines="None" ItemStyle-BackColor="#EEEEEE" AlternatingItemStyle-BackColor="#F5F5F5" OnEditCommand="doScoreGame" OnDeleteCommand="doEditGame" OnCancelCommand="printLineup" OnItemDataBound="gridDataBound"> <Columns> <asp:TemplateColumn > <ItemTemplate> <asp:CheckBox ID="chkDelete" runat="server" /> </ItemTemplate> </asp:TemplateColumn> <asp:BoundColumn DataField="idGame" Visible="false" /> <asp:BoundColumn DataField="isClose" Visible="false" /> <asp:TemplateColumn HeaderText="Status"> <ItemTemplate> <asp:Image ID="imgStatus" runat="server" ImageUrl="~/img/icoX.png" alt="icoStatus" /> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn> <ItemTemplate> <asp:LinkButton ID="linkScore" runat="server" CommandName="Edit" Text="Score" /> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> So when i click the "linkButton", the codebehind of the userControl calls a public method in the .aspx as this: From the userControl protected void doScoreGame(object sender, DataGridCommandEventArgs e) { ((GM)this.Page).showScoring(null, null); } From the .aspx page public void showScoring(object sender, EventArgs e) { removeLastLoadedControl(); ucScoring.Visible = true; } So, here comes the problem: There are two postbacks taking place when I change the visible attribute of the ucScoring control. The first postback is fine, it's handled by the updatePanel. The second postback is a full postback, and i really don't understand why it is happening. I'm really lost here, please help! Thanks Mat

    Read the article

  • Sum values in a DataTable by a given criteria

    - by šljaker
    Which is the most effective way to sum data in the DataTable by a given criteria? I have the following table: KEY_1 KEY_2, VALUE_1, VALUE_2 Input: 01101, P, 2, 3 01101, F, 1, 1 01101, P, 4, 4 10102, F, 5, 7 Desired output (new DataTable): 01101, P, 6, 7 01101, F, 1, 1 01101, SUM, 7, 8 10102, F, 5, 7 10102, SUM, 5, 7 I need efficient algorithm, because I have 10k rows and 18 columns in a DataTable. Thank you.

    Read the article

  • SQLite If Column Exists

    - by Nathan
    I was wondering if there is a nice IF NOT EXISTS for checking columns and indexes in SQLite, or do I need to bring back the entire database schema and validate against that?

    Read the article

  • Grid 960 bug in Internet Explorer 8?

    - by mg1075
    If you go to the "Variable Grid System" generator and have: column width = 20 number of columns = 12 and gutter width = 60 ...the system provides a content width of 900 and a full width of 960. http://www.spry-soft.com/grids/ Now, this is all fine and dandy in Firefox, Chrome, and even IE6, but when you load those settings in IE8, you end up with the actual full width as 1000px, not 960px. Has this issue been encountered before?

    Read the article

  • Can't Show image in gridview using templates

    - by n10i
    i am trying to load images from the northwind database (categories table, images that are stored in the database) into grid view control. But it dosenot seems to work. Plz! have a look... Default.aspx <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="CategoryID" DataSourceID="NorthWindSQLExpressConnectionString" EnableModelValidation="True"> <Columns> <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" /> <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" /> <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> <asp:TemplateField HeaderText="Picture" SortExpression="Picture"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Picture") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Image ID="Image1" runat="server" ImageUrl='<%# RetriveImage(Eval("CategoryID")) %>' /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:SqlDataSource ID="NorthWindSQLExpressConnectionString" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindSQLExpressConnectionString %>" SelectCommand="SELECT [CategoryID], [CategoryName], [Description], [Picture] FROM [Categories]"> </asp:SqlDataSource> </div> </form> [Partial] Default.aspx.cs protected string RetriveImage(object eval) { return ("ImageHandler.ashx?CategoryID=" + eval.ToString()); } [Partial] ImageHandler.ashx public void ProcessRequest(HttpContext context) { if (context.Request.QueryString == null) { } else { try { using (var sqlCon = new SqlConnection(conString)) { const string cmdString = "Select picture from Categories where CategoryID=@CategoryID"; using (var sqlCmd = new SqlCommand(cmdString, sqlCon)) { sqlCmd.Parameters.AddWithValue("@CategoryID", context.Request.QueryString["CategoryID"]); string trmp = sqlCmd.ToString(); sqlCon.Open(); using (var sqlDr = sqlCmd.ExecuteReader()) { sqlDr.Read(); context.Response.BinaryWrite((byte[])sqlDr["Picture"]); } } } } catch (Exception ex) { context.Response.Write(ex.Message); } } }

    Read the article

< Previous Page | 139 140 141 142 143 144 145 146 147 148 149 150  | Next Page >