FAQ Database Discussion Community


SQL: How can I delete a row when a unix time is reached?

mysql,sql,unix,row
Sorry, don't really know much about this stuff! I have a table with a few columns, one of them is called 'expirationday' and every row has its unix timestamp for this column. I would like to know, if at all possible, how to delete a row when the time in...

Filter rows according to a string match, when i am unsure of specific column [duplicate]

sql,database,oracle,filter,row
This question already has an answer here: Search All Fields In All Tables For A Specific Value (Oracle) 12 answers Can someone help me on SQL Query to filter rows according to a string. Consider i want to display all rows which contains a string = 'PARIS'. No speicific...

Python/Pandas: counting the number of NaN in each row

pandas,count,row,dataframes,nan
I've got a dataset with a big number of rows. Some of the values are NaN, like this: In [91]: df Out[91]: 1 3 1 1 1 1 3 1 1 1 2 3 1 1 1 1 1 NaN NaN NaN 1 3 1 1 1 1 1 1...

How to delete or terminate rows in matlab

matlab,row,break
hi guys i want to delete or terminate rows containing d>8, here's my code fileID = fopen('d.csv','w'); fprintf(fileID, ' a, b, d \n'); for a = -3:3 for b= -3:3 d = a^2 + b^2; if d > 8 break; else fprintf(' %d, %d, %d, \n',a,b,d); end end end fclose(fileID);...

Pandas: Find empty/missing values and add them to DataFrame

python,pandas,row,add
I have dataframe where column 1 should have all the values from 1 to 169. If a value doesnt exists, I'd like to add a new row to my dataframe which contains the said value (and some zeros). I can't get the following code to work, even tho there are...

SQL Server : Sum by Row to output

sql-server,sum,row
Trying to display sum of same rows as output. Here is SQL code SELECT replace(replace(replace(replace(dbo.IDENTITY_MAP.Name,'My Company\',''),'-VLAN2',''),'.VLAN2\',''),'.Instr\','') as Site, Count (CASE WHEN dbo.SEM_AGENT.AGENT_VERSION LIKE '11.%' AND dbo.SEM_COMPUTER.OPERATION_SYSTEM LIKE 'Windows%' THEN 1 END) AS 'Windows-SEP-11', Count (CASE WHEN dbo.SEM_AGENT.AGENT_VERSION LIKE '11.%' AND dbo.SEM_COMPUTER.OPERATION_SYSTEM LIKE 'Mac%' THEN 1 END) AS 'Mac-SEP-11', Count(CASE WHEN...

Rows to Columns

linux,python-2.7,row,multiple-columns
I have my text file as follows: TOPIC: 0 161416.0 the 10758.0 . 6330.0 , 5043.0 <unknown> 4591.0 in 4521.0 be 4476.0 of 3759.0 TOPIC: 1 93549.0 the 6957.0 , 4170.0 of 3624.0 . 3468.0 <unknown> 2321.0 be 2121.0 a 2073.0 in 1998.0 and so on. I have about 2000...

Get p:dataTable row data via p:selectOneMenu

jsf-2,primefaces,datatable,row,selectonemenu
I have a dataTable which one of the columns contains a selectOneMenu (a.k.a dropDownList). Basically each row has a selectOneMenu which has a list of values. Is there a posibility to pass the row data or key whenever the selectOneMenu value has been selected? This way I can loop through...

How to get dynamic created table's total column and row using Request.Form in vb.net

vb.net,table,model-view-controller,controller,row
I am doing my project in Vb.net using MVC 4.0 I have created dynamic table and in that textboxes in td using javascript and now i want to get that table's total row and column as well for further process in Controller function. How I can get using above using...

javascript - DataTables - updating row using fnUpdate replaces different row

javascript,jquery,datatables,row,edit
I have Edit buttons in each row, on click data from row is passed to modal, where a user can change it, then on Save in modal it should update that row. I am using fnUpdate, however instead of updating (replacing) intended row, different row is replaced... var uId =...

Oracle SQL - Concat rows with specific properties

sql,oracle,row,concat
I wrote a SQL - Statement to export the results to an excel sheet for analytics. At the moment I have the problem: Some data which are split in 2 rows but need it as 1 row. Reason for that is one column, with different values. I explain the structure:...

adding row automatically based on user input

java,swing,row
what i want to do is my table should automatically add row depends on the number of rows i input in a textbox. example if the user input 3 in the textbox and i click he clicked the jbutton the table will automatically have 3 rows with null values.. i'm...

MySql x rows with x-1 similar columns, combine last column

mysql,sql,database,table,row
I have a mysql table that has several values like this id name number value ------------------------------------ 1 John 3 blue 1 John 3 red 1 John 3 green 2 Aly 2 red 2 Aly 2 blue 3 Sam 1 green 4 Tiad 6 white 5 Krix 5 orange Is there...

Displaying repeated names from month list just once in excel (2010)

excel,indexing,row,formula,names
I have a Leaves Table on sheet 1 that has the following headers Column A = Months ; Column B = Names ; Column C = ... Now on Sheet 2, I have a months data validation list in Cell H59. QUESTION: When I select a particular month from the...

Python Pandas add rows based on missing values

python,pandas,row
I'm new to python and struggling to manipulate data in pandas library. I have a pandas database like this: Year Value 0 91 1 1 93 4 2 94 7 3 95 10 4 98 13 And want to complete the missing years creating rows with empty values, like this:...

How to reduce the value of a column in a row with?

sql,sql-server,row
I have a table with two columns: No Value 1 20 2 10 3 50 4 35 5 17 I also have a variable or parameter where the variables will reduce the value of a column in a row. So, if my variable V = 5 then my column will...

VBA: How to color a duplicate row?

vba,excel-vba,row
im new to vba and i need help to color the duplicate row instead of only the cell that this do, anyone that can help me out here. Sub FindDuplicate() Dim cel As Variant Dim myrng As Range Dim clr As Long Set myrng = Range("S2:S" & Range("S65536").End(xlUp).row) myrng.Interior.ColorIndex =...

Get an array of rows from a MySQL query?

php,mysql,multidimensional-array,row,multiple-columns
I have this code... $results_query = "SELECT * FROM profile WHERE string LIKE '%" . $search_deliminator . "%'"; $results_result = $database->query($results_query); $result = mysql_fetch_array($results_result); What I'm trying to do is pull all the rows in which the string column contains my search deliminator. Further, I would like to get the...

Getting index of clicked row that's dynamically created

jquery,events,table,dynamic,row
I've created a table with three rows that can be expanded with the use of an add button. I want to know the index of every row I click. I have a piece of code that works just fine on the three automatically generated rows, but not on the rows...

How to add the rows dynamically on gridpane in Java FX?

java,dynamic,javafx,row,gridpane
I have a DB log in form on a single row as below, // Hostname Input Label hostName = new Label("Host:"); grid.add(hostName, 0, 2); final TextField host = new TextField(); host.getText(); GridPane.setConstraints(host, 1, 2); grid.getChildren().add(host); // Port Input Label portName = new Label("Port:"); grid.add(portName, 2, 2); final TextField port =...

R row-wise sort then concatenate across specific columns of data frame

r,sorting,row,string-concatenation,mapply
(Related question that does not include sorting. It's easy to just use paste when you don't need to sort.) I have a less-than-ideally-structured table with character columns that are generic "item1","item2" etc. I would like to create a new character variable that is the alphabetized, comma-separated concatenation of these columns....

How to add rows to a responsive grid

html,css,responsive-design,row,grid-layout
I am new to all of this web stuff so please bare with me. I am trying to create a responsive grid layout. However I have so far got to a 4x2 grid which keeps going wrong when I try to add more rows. I have managed to get the...

Add row below using jquery

php,jquery,ajax,row,clone
I would like to add row exactly all the same as before, with all the elements as well. Here i have two select options. First, i choose the category, then the product will show up and also i choose product too. After that i choose the quantity, and then the...

MYSQL fetching rows to different tables

php,mysql,row,fetch
I'm here with following problem. I have table with multiple records. Each row represents news of some kind, so I need to distinguish one from the another. The way to do that, is to make a table for each of these news(or a wrapper of some kind), however I encoutred...

loop to delete table rows through numerous worksheets based on a cell value

excel,vba,loops,row,listobject
working on a loop to delete stock info from numerous worksheets in a workbook. Each sheet is named, "Client_ClientFirstName", and each table in each worksheet is the same as the worksheet name. here is the code ive come up with so far, any and all advice is appreciated. Sub RemoveTickerFromAccounts()...

Adding rows to top of TableLayoutPanel

c#,row,tablelayoutpanel
I'm trying to add new rows to my tablelayoutpanel at the top of it. For that purpose I use the following code: Initialization TableLayoutPanel panel = new TableLayoutPanel(); panel.ColumnCount = 1; panel.RowCount = 1; panel.AutoScroll = true; panel.Location = new System.Drawing.Point(280, 52); panel.Size = new System.Drawing.Size(308, 189); panel.Visible = true;...

Mulitple row selection on click

java,swing,onclick,jtable,row
I was wondering if the following case is possible with jtable: R4 and R6 are "sub rows" and they reference R1, so whenever I click on R1, it should auto-select R4 and R6. ...

Uncaught TypeError: Cannot read property 'value' of null Javascripting

javascript,dynamic,row
var i = 0; function addLine() { i++; var div = document.createElement('div'); div.innerHTML += '<input type="text" name="description['+i+']" id="description['+i+']"/>'; div.innerHTML += '<input type="text" name="quantity['+i+']" id="quantity['+i+']" onkeyup="sum();"/>'; div.innerHTML += '<input type="text" name="price['+i+']" id="price['+i+']" onkeyup="sum();"/>'; div.innerHTML += '<input type="text" name="lineTotal['+i+']" id="lineTotal['+i+']" readonly/>'; div.innerHTML += '<input type="button"...

How to compare columns of a binary matrix and compare elements in matlab?

matlab,matrix,row
i have [sentences*words] matrix as shown below out = 0 1 1 0 1 1 1 0 0 1 1 0 1 1 0 0 0 0 1 0 i want to process this matrix in a way that should tell W1 & W2 in "sentence number 2" and "sentence...

Display different information in activity when listview is clicked

android,arrays,android-intent,android-listview,row
I want listview to open a new activity and display certain information when clicked in certain row of listview. So far i am only able to display same information when clicked on every row . i dont know how to set these information for particular row so that for example...

Adding Rows & Removing Gaps From Responsive Grid Layout

html,css,row,grid-layout
I am new to all of this web stuff so please bare with me. I am trying to create a responsive grid layout. However I have so far got to a 4x5 grid which keeps going wrong when I try to add more rows. I have managed to get the...

List of Rows from Data Frames as Vector in R

r,list,row,dataframes,atomic
How can I convert rows into vectors in a list across multiple data frames? I've been having the issue that after converting my rows into list form using: pck <- list(NB[1,],NY[1,],AZ[1,],TB[1,]) I get the error Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) : 'x' must be atomic...

Can't delete a row from a Database using a img PHP

php,mysql,row
i was doing a backoffice for my website, and to show the data i brought a table from database to show all the upgrades requested from users, and i was thinking about putting 2 images , one for update and another for deleting that same row.. # Table from Database...

Excel vba how to repeat an if then else condition on rows

loops,excel-vba,if-statement,row,repeat
I want to repeat my 'if then else' condition on the 30 rows that follow. This is my code (I am new to this). Dim score As Range, result As Double If Range("A2") = "2a" Then Range("C2") = 20 Else If Range("A2") = "3c" Then Range("C2") = 23 So at...

preg_replace specific sql columns in php

php,mysql,preg-replace,row
So I have code that goes something like this: $sql = "SELECT * FROM LIST" $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "<div class=\"leftcol\"><p>".preg_replace('/\b0\b/', 'NA', $row["info"])."</p></div> <div class=\"rightcol\"<p>".preg_replace('/\b0\b/', 'NA', $row["stuff"])."</p></div>"; That works for them rows fine. But then I run into the problem where...

how to select rows of a matrix on the basis of occurrence of elements in matlab?

matlab,matrix,row,matrix-indexing
i have a [sentence cross words] matrix as follows. x = [ 0 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 0 1 1 0 0 0 0 0 ]; 0 shows a word is present in respective sentence and 1 shows...

R - How to re-order row index number

r,vector,indexing,data.frame,row
Simply put, I have the following data frame: Signal 4 9998 3 549 1 18 5 2.342 2 0.043 and I want to reset the index numbers to be like : Signal 1 9998 2 549 3 18 4 2.342 5 0.043 ...

Programmatically Push VC on Table Row Tap

ios,objective-c,iphone,uitableview,row
I am attempting to do a onRowTap method without using a storyboard segue to push to a new View Controller, however when tapped it only displays information from the first item of the indexPath no matter which row is tapped. Here is my code: - (void)tableView:(UITableView *)theTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {...

I get the following error ExecJS::ProgramError in Posts#index How do I fix this?

javascript,ruby-on-rails,row
Here is a link to the image of my exact error: http://puu.sh/fHXJf/f714496a53.png Here is the rest of my code that may be the issue This is in my Gemsfile: source 'https://rubygems.org' gem 'rails', '4.2.0' gem 'sqlite3' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.1.0' gem 'jquery-rails'...

find row indices of different values in matrix

matlab,find,row,cell,indices
Having matrix A (n*2) as the source and B as a vector containing a subset of elements A, I'd like to find the row index of items. A=[1 2;1 3; 4 5]; B=[1 5]; F=arrayfun(@(x)(find(B(x)==A)),1:numel(B),'UniformOutput',false) gives the following outputs in a cell according to this help page [2x1 double] [6]...

jQuery for each div build some rows

javascript,jquery,html,foreach,row
I really need some help with the following: I have an HTML grid, in which at the left side the objects are shown and for each object a row on the right: What I want is with jQuery: for each object on the left, 8 items should be added in...

Rally: Collapse rows of rallygridboard

row,rally,collapse
I create an rally taskboard app by using the following source code: https://github.com/RallyApps/app-catalog/tree/master/src/apps/taskboard Now I want to set default value for collapsed property in rowConfig but it is not working. otherwise when I use setCollapsed for all rows by using this code: var rows = this.down('rallycardboard').getRows(); rows[0].setCollapsed(true); It's not working...

Tkinter Radiobutton fills multiple rows when using widget.grid()

python,tkinter,grid,row
I'm having some trouble properly gridding these Radio Buttons alongside other widgets. The Radio buttons never go into the row specified, sometimes being placed in the middle of several rows. I'm trying to get Radio buttons "One" and "Two" in line with Buttons "Quit1" and "Quit2". from Tkinter import *...

How to populate columns in mysql depending on a condition in data?

mysql,select,group-by,row
I have data in mysql tables in the following format id order_id state time_stamp 1 1 created 1:15 6/2/2015 2 2 created 1:17 6/2/2015 3 1 ack 1:18 6/2/2015 4 1 shipped 1:20 6/2/2015 5 1 delivered 1:25 6/2/2015 6 2 ack 1:25 6/2/2015 7 2 shipped 1:26 6/2/2015 8...

How do i get the rowposition for an Select

sql,sql-server-2008,select,row
Hi my Table looks like Id Header Mo RefId 1 Header2 45 1 4 Header2 10 1 7 Header1 1 5 8 Header2 2 5 9 Header3 77 5 12 Header5 11 2 13 Header9 55 5 14 Header2 22 2 if i select all records where RefId 5 My...

setCellStyle - apply cell style (percent) to matrix using XLConnect

r,row,col,xlconnect,rep
My question is based on an issue mentioned in a previous question Formatting of numbers using Mirai's XLConnect. I have trouble implementing this solution from @joran and I think I might not be the only person with this problem. I want to export a correlation matrix(10x10) to excel. It is...

How to get text elements of the same row as selected checkboxes on submiting form?

javascript,jquery,arrays,row
I want to store(in array) the values of the all text elements which are in the same row as selected checkbox. But I can't get those text elements. I know only thing is that I need to work on javascript to get those text. But HOW? I'm using this code...

RowLeave event called when DataGridView loads

vb.net,datagridview,row
I am using a datagridview to populate an Access Database to a form in VB.net. I want to perform certain actions (validation/updating database) when a user changes values in a row. I want to wait until the row loses focus to perform the changes. I am using the RowLeave event...

Display multiple rows in html

php,mysql,mysqli,row
I am having an issue with pulling info from the database and displaying it on the page. In the table I have multiple entries in each column. So I need to pull that info and display it in a descending order from the column id. But with this it displays...

How to order Data from a row properly

php,mysql,order,row
How can i order results from a mysql row. Currently my code is as such: require 'dbconnect.php'; // Query the database $resultSet = $conn->query("SELECT * FROM wp_wppizza_orders"); if($resultSet->num_rows != 0){ // Turn the results into an Array while($rows = $resultSet->fetch_assoc()) { $id = $rows['id']; $klantgegevens = $rows['customer_details']; $bestelling = $rows['order_details'];...

conditional insertion of a new row in a data.frame with R

r,insert,row
I have a data frame like this: ID Exp1 Exp2 Value1 AAA 5 6 7 AAA 4 8 8 BBB 3 5 9 BBB 6 7 4 CCC 2 5 6 .... and I would like to create a new row after every repetition of an ID,and do summation of...

COUNTA in current row in an array formula (Google Sheets)

arrays,excel,count,google-spreadsheet,row
I have a Google sheet with fixed number of columns and dynamic rows. I like to use countA to count fields with a value (non-blank) in the current row. I found a formula here but don't understand it, neither can get it to work. ArrayFormula(MMULT( LEN(A1:E)>0 ; TRANSPOSE(SIGN(COLUMN(A1:E1))))) Sheet gives...

Splitting single rows data into multiple rows

r,split,row
I have a set of data with co-authorships of 3k authors. I have columns with Sender and Receiver (or Source and Target) and a column with Journal name and Publication year. If some authors have more than one common article, the results gonna be comma-separated in one row. What I'm...

How to delete row in html based on cell value

javascript,php,jquery,html,row
I am trying to delete a row based on a table's cell value. In my HTML page I have a simple search function. It would send the values in the text box to the database through ajax then PHP and then PHP would create a table dynamically based on what...

R table manipulation

r,table,data.frame,row
I have a data.frame as below PRODUCT=c(rep("A",4),rep("B",2)) ww1=c(201438,201440,201444,201446,201411,201412) ww2=ww1-6 DIFF=rep(6,6) DEMAND=rep(100,6) df=data.frame(PRODUCT,ww1,ww2,DIFF,DEMAND) df<- df[with(df,order(PRODUCT, ww1)),] df PRODUCT ww1 ww2 DIFF DEMAND 1 A 201438 201432 6 100 2 A 201440 201434 6 100 3 A 201444 201438 6 100 4 A 201446 201440 6 100 5 B 201411 201405 6...

jquery table find closest tr containing and get td text

jquery,row,html-table
This datatables has row-reordering so its drag and drop. What I am trying to do is find the Parent this row is dropped into and get the Parent id. Hopefully someone can tell me where I am going wrong... This line successfully gives me the tr id var line =...

html - make every tr change color on hover

html,css,row
I have a table with a lot of table rows. Every table row have a 2px solid grey border. My problem is that the table is a link and to show that to the user I will make the border black when hovering. But adding :hover to tr does only...

Extract data in every chunk of data.frame depending on variable

r,data.frame,row,extract
I am trying to extract the first record for each chunk (layer) of my data. I want to extract the first appearance of negative value (Mag) in each chunk together with corresponding time. Then I want to compare those "times" from each chunk and find min and max values. (this...

MySql - getting if the row count = 0

java,mysql,row
I am trying to check if the row count 0 is but i looked into the java docs but i found something that was getrowid but that dit not work i did not find any more ways to get the row count public boolean isFriends(ProxiedPlayer inviter, ProxiedPlayer invited) { try...

ngGrid - edit a row on button click (ASP.NET Gridview edit equivalent)

row,edit,ng-grid
Is there a straightforward way to enable an entire row of ng-grid to edit mode, in the click of a button. I know if you set gridOptions for enableCellEditOnFocus or enableCellEdit, you can click/doubleclick to edit a particular cell. But what I want is to have a button in each...

FooTable.js Insert Row(s) with input field… unique name for array

insert,attributes,row,footable
I have a fairly large form that has has a lot of basic form inputs, nothing fancy. But the users are in locations with spotty internet so the form has to be filled out all at once and then submitted. I'm adding two sections to this form. One is a...

How to add numbers to grouped rows in postgresql group by clause

postgresql,group-by,row
I have a PostgreSQL table, containing duplicate values in a text column. It looks like this: gid, capt 1, foo 2, foo 3, bar 4, bar 5, bar 6, buz 7, buz I need to add a column with distinct numbers for each value in a group, so my table...

Increment Row value in excel on each button click

excel,vba,row,increment
in excel macro I need to increment row each time I click the button. Sort of Next value function that should be read from the datasheet. Also this value needs to be returned to a cell in a different sheet. This is the code I have, how do I increment...

R select multiple rows by conditional row number

r,data.frame,row
Sorry if my question is really easy but I simply can't find an easy way to do this! I have a R dataframe like this one: a<-c(1,2,3,4,5) b<-c(6,7,8,9,10) df<-data.frame(a,b) colnames(df)<-c("a","b") df a b 1 1 6 2 2 7 3 3 8 4 4 9 5 5 10 I would...

MySQL - make row and update if already exists

php,mysql,date,row
I have table with 4 columns: Date, John, Frank, Anthony I want to make a form which can be filled in by these 3 people everyday and store these values in the database. When John fills in the form today, a new row should be created with the date of...

Java Changing the color of a certain row in JTable [duplicate]

java,swing,colors,jtable,row
This question already has an answer here: Change the background color of a row in a JTable 5 answers ANSWER: Im not allowed to post answers... thumbs up stackoverflow!!! But here it is: Holy freakin'.... I made it, actualy it was easier than i have thought.... Here's my solution:...

Swift: UIPickerview selecting row-id / Index

swift,row
im tried to get the selected row-id / Index from the pickerview, but i get only the name of the selected row. I've search on the web and documentation without results. How can i get the ID of the selected row ? thanks...

Edit row in listView, ArrayAdapter - Android

android,listview,row,android-arrayadapter
How can I change color of text in single row? Here is the code where I set adapter and call listView: ArrayAdapter<String> adapter = new ArrayAdapter<String>(getListView().getContext(), R.layout.row, rez); getListView().setAdapter(adapter); ...

Do not add border first time HTML

html,css,row,border,html-table
Not sure how to go about this piece of code (CSS): td { border-bottom: solid 2px lightgray; } (featured in the jsfiddle below), to not function but only for the first button click. The reason behind this is because then there would be 2 bottom borders. http://jsfiddle.net/julianbuscema/yqh2rqh0/38/ Pretty much on...

How to display a specific row in my database through another activity?

java,android,android-activity,row,android-sqlite
I wanted to display a specific row in my table. I have two Activities the first activity is to input the ID passed to the 2nd Activity which is going to display the row in my table based on the ID that I inputed. Hope you can help with my...

Adding new row in DataGridView doesn't add to BindingList

c#,datagridview,row,bindinglist
I've a little problem using a DataGridView with AllowUserToAddRows set to True that is binding to a list (BindingList<State>). When adding a new row through the GUI, the row isn't added to the BindingList. I've a entity which contains a collection with other entities. For example: Country contains States. So,...

In reference to “Copy a row in excel if it matches a specific criteria into a new worksheet”

excel-vba,dynamic,row,copy-paste,worksheet
In reference to: Copy a row in excel if it matches a specific criteria into a new worksheet I attempted applying the above hyperlink code to the needs of my own workbook. The only notable differences are: Object names, My data begins in "A2" instead of "A1", and my data...

Android gridview row height according to the display

android,gridview,row
and sorry for my english. A simple question (if you know the answer :-D): I have a GridView with only images, all the images are same size. I have set the numbers of colums in xml. Here is the code: <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/grid_view_bambini14" android:layout_width="fill_parent" android:layout_height="wrap_content" android:numColumns="@integer/grid_columns" <!-- grid_colums value is...

Count number of unique values per row in R

r,count,row,unique
I want to count the number of unique values per row. For instance with this data frame: example <- data.frame(var1 = c(2,3,3,2,4,5), var2 = c(2,3,5,4,2,5), var3 = c(3,3,4,3,4,5)) I want to add a column which counts the number of unique values per row; e.g. 2 for the first row (as...

Mysql PDO : get row with “dynamic” fields in query

php,mysql,pdo,row,fetch
I have a query with a dynamic field, how do I access this field without knowing its name? define('FIELD_NAME',"name"); $stmt = $connexion->query('SELECT '.FIELD_NAME.' from mytable); while ($rs=$stmt->fetch(PDO::FETCH_OBJ)){ echo $rs->FIELD_NAME; // DOESN'T WORK echo $rs->name; // WORK } ...

Calculate difference from a reference row in pandas (python)

python,pandas,row,dataframes,calculated
In Pandas I have a data frame of this type: value SampleGroup sample Group1 ref 18.1 smp1 NaN smp2 20.3 smp3 30.0 smp4 23.8 smp5 23.2 What I want do do is to add a new column where the reference (ref) has been subtracted from all samples (smp). Like this:...

Thread and sum of bidimensional matrix

multithreading,matrix,terminal,sum,row
I have to calculate the sum of the elements in a bidimensional matrix, using a separate thread to calculate the sum of each row. Then the main thread adds up these sums printing the final result. Can you guys see what's wrong? (I'm all new to the threads stuff) #include...

Javascript random number in function onclick

javascript,table,insert,onclick,row
Need some help. with the below javascript. On inserting a row I need the random number t to generate a new number on each click (insert). I have to send each row to the processor as an array so that needs to be a unique number on each insert. I...

Update result based on many fields condition in excel

excel,field,row,cell
I currently have raw data as below OID Version Type RAW RESULT 6064 2842 154 failed 6064 2843 154 passed 6064 2844 154 failed 544448 837 154 failed 544448 838 154 failed 544448 839 154 passed 544448 840 154 failed 544448 841 154 failed I'd like to have following result...

Talend iterate on tTikaExtractor

java,row,talend,tika,filelist
I'm trying to use tTikaExtractor component to extract the content of several files in a folder. It is working with a single file but when I add a tFileList component, I don't understand how to get the content of the 2 different files. I think it is something related to...

How to access a Row Type within an Array Type in DB2 SQL PL

arrays,stored-procedures,types,db2,row
I have a java front end that has a table of data. We need to save this data to the Database via stored procedure. If the passed parameter is a just an array, I am able to access the contents easily. But if the contents of the array is a...

Divs not aligning properly on website (work fine in CodePen though)

html,css,alignment,row
My site consists of green boxes (divs) that are aligned side-by-side in rows. There are 3 divs per row, and their heights are suppose to be the same. Everything works perfectly except for some reason there are 3 divs not aligning properly at the bottom of the page. The problem...

Substract last cell in row from first cell with number

excel,find,row,difference,subtract
I have the following Excel sheet In column J i need the final difference between the first cell in the row and the last cell (with a number). Numbers can appear from column C until column I. Numbers do not always start in column C and do not always end...

How to set dynamic height for rich:extendedDataTable rows?

css,jsf,richfaces,row
In my web application, I have extendedDataTable which shows records. <rich:extendedDataTable id="tableID" ...> <rich:column width="110px"> ... </rich:column> <rich:column width="110px"> ... </rich:column> </rich:extendedDataTable> The issue is that Some records have column value may be in multi-lines And the row height is not increased dynamically so some of data is not viewed...

Subtracting Columns in R

r,row,calculated-columns
I have two columns I am trying to subtract and put into a new one, but one of them contains values that read '#NULL!', after converting over from SPSS and excel, so R reads it as a factor and will not let me subtract. What is the easiest way to...

UITableView: automatically set height for the row and fix it with max height constant

swift,height,row,tableview,cell
I need automatically set the height for the row. I use theTable.estimatedRowHeight = 60 theTable.rowHeight = UITableViewAutomaticDimension but the height is not fixed. I need fixed height something like MAX 60 height, by default height is 40. With estimatedRowHeight the height is not fixed and when the string is long...

Add a new table row every 24 hours

php,html,table,row,add
my question is fairly simple as I am quite new to dynamic coding languages. Basically, I want to add a new table row to my table, every 24 hours. The new table row should be added at 00:00 every day and the table data is going to be a pre...

Joining tables and LEFT JOIN as new Columns in tsql

sql,sql-server,tsql,table,row
In this sample I have two tables containing data for my Customer and Products that a office supply shop has. which is seen below: The Above tables primarily functions to supply the required data for the third table which is the Orders table Using the orders table, I can get...

Getting the length of a row in excel

c#,excel,row
I want to put some rows of excel in a list in c#. At the moment I use this: private static Microsoft.Office.Interop.Excel.ApplicationClass appExcel; private static Workbook newWorkbook = null; private static _Worksheet objsheet = null; for (int j = 1; j < 3000; j++) { list.add(excel_getValue("A"+j)); //ROW A in excel...

Creating an index variable in R based on row index

r,indexing,row,data.table
I think it's time to ask for help. Suppose I have this data.frame or data.table State Date Event CA Oct27 1 CA Oct28 0 CA Oct29 0 CA Oct30 0 CA Oct31 1 TX Oct27 0 TX Oct28 1 TX Oct29 1 TX Oct30 0 TX Oct31 0 TX Nov1...

Bootstrap small device order of the grid row

html,css,twitter-bootstrap,mobile,row
On desktop the order of the grid row is: Text | Picture Picture | Text Text | Picture On mobile this becomes: Text Picture Picture Text Text Picture Is there any way to change this order on mobile? to for example: Text Picture Text Picture Text Picture Thank you!...

Python: count if items in a row appears in previous rows together

python,count,row
I'm having a CSV file and when I read it in python, it looks like this: Column A B C ['2002.09.11', 'a', 'b'] ['2002.09.11', '', 'b,c'] ['2002.09.19', 'd', 'e'] ['2002.10.02', 'a,b', 'c'] I want to add a column that counts as 1 if any two elements in the last two...

SQL Case When - delete 'empty' rows from output

sql,row,sql-server-2014,case-when
I'm having difficulties with a query that I'm writing. The query looks like this: SELECT case when Year(LOAN_START_DATE) = 2010 then max(LOAN_RES_BANK_CODE) else 0 end as '2010', case when Year(LOAN_START_DATE) = 2011 then max(LOAN_RES_BANK_CODE) else 0 end as '2011', case when Year(LOAN_START_DATE) = 2012 then max(LOAN_RES_BANK_CODE) else 0 end as...

python tkinter tree get selected item values

python,tkinter,tree,row
I'm just starting with a small tkinter tree program in python 3.4. I'm stuck with returning the first value of the row selected. I have multiple rows with 4 columns and I am calling an a function on left-click on a item: tree.bind('<Button-1>', selectItem) The function: def selectItem(a): curItem =...

delete row from matrix given an id- Matlab

matlab,matrix,delete,row
How can I delete a certain row from a matrix depending on the 1st column value? for example: A=[1 2 3;3 4 5;5 6 7] where the values of the first column represent the ids and I want to delete the row that has 5 as an id. I already...

Copying rows into one cell VBA

excel,vba,excel-vba,row
I've a worksheet with various values in only one column like: A B C D E F ... And I need a write a simple code that will put this all together in one cell (for example D2) and that cell I want to have a value: A;B;C;D;E;F;... I think...

Random row selection using MySQL returns NULL

php,mysql,random,row,sql-limit
I am trying to get a random row from MySQL table but all three attemps: $query = "SELECT cid FROM table LIMIT 1 OFFSET ".rand(1,$num_rows); $query = "SELECT cid FROM table OFFSET RANDOM() * (SELECT COUNT(*) FROM table) LIMIT 1"; $query = "SELECT * FROM table ORDER BY RAND() LIMIT...

Transpose Column to Rows using SQL Server

sql,sql-server-2008,row,transpose
Could you help me one case, below I have an original table, like this: MONTH | YEAR | PO1 | PO2 | PO3 +++++++++++++++++++++++++++++++++++++++++ 01 2010 100 20 10 then I want a result is like this: DESCRIPTION | VALUE +++++++++++++++++++++++++++++++++++++++++ PO1 100 PO2 20 PO3 10 How should i...

Jquery equation for each table row

jquery,table,row,each
I'm having a bit of trouble with the code below and I'm too new to jQuery to figure it out. function calcExpiration(){ var getState = jQuery( "#state" ).text(); var getcalldate = jQuery( "#date" ).text(); var date = new Date( getcalldate ); if (getState == "KY" || getState == "IN"){ date.setDate(date.getDate()...