w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Why can't I display data from four joined tables?
Problem 1) You have three columns with the same name "Article" Art.Article, AI.Article, AN.Article You may rename them like this: Art.Article AS Article1, AI.Article AS Article2, AN.Article AS Article3 And then you can use the appropriate column (1, 2 or 3): $Article = $Zext['Article1']; Problem 2) If the contents are plain text (not HTML), you should escape the output: echo htmlentities($Article);

Categories : PHP

Display nested-data in WPF
One option is to use DataGridTemplateColumn: <DataGrid ItemsSource="{Binding MyItems}"> <DataGrid.Columns> <DataGridTemplateColumn> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <!-- template for Address, Dependent or Awards types --> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Columns> </DataGrid> The second option is to use row details. The third option is to use some control for displaying selected row details: <DataGrid x:Name="myGrid" ItemsSource="{Binding MyItems}"> <!-- The rest of grid here --> </DataGrid> <ContentControl Content="{

Categories : C#

Rails - how to join/group nested tables and get joined values out?
You can make this little bit more prettier than raw sql by using rails AR querying methods: AccountGroup. select("account_groups.id, SUM(net_position), account_groups.name"). joins("LEFT JOIN accounts ON accounts.account_group_id = account_groups.id"). joins("LEFT JOIN positions ON positions.account_id = accounts.id"). group("account_groups.id,account_groups.name")

Categories : Ruby On Rails

How to display nested data items in FuelUX tree bootstrap plugin
I am actually in the process of writing a blog post on this very issue. The solution I have developed is not for the faint-of-heart. The problem is that the folder objects do not support instantiation with child data. Also, adding children is no trivial task. I spun up a quick fiddle that you can pick through to get an idea of how to accomplish your goal. I am using this same solution only that my addChildren function calls out to an MVC route via AJAX and gets back a JSON object to populate the children dynamically. You can literally, copy and paste the code from my fiddle and start using the addChildren function out-of-the-box.

Categories : Javascript

How to display joined entity columns in twig template
First and according to the entities you described, you should replace product.categories.description by product.category.description as "Every Product has One Category" Then, to make this call run, you should replace $categoryId by $category within your Product entity as follow, /** * @see Entity/Category * * @ORMManyToOne(targetEntity="Category", inversedBy="products") * @ORMJoinColumn(name="category_id", referencedColumnName="id") * */ protected $category;

Categories : Symfony2

How to optimise a nested pattern match with multiple repeated cases?
That's a good application for pattern guards: case action1 of Right a -> a Left f | Failure1 a <- f -> a | Failure2 a <- f , Right b <- action2 a -> b _ -> error "Unexpected failure"

Categories : Haskell

Calling order of link function in nested and repeated angularjs directives
On a single element the order of the linking functions is determined by the order of the Compile Functions which in turn is ordered according to the priority property of the directive definition object. Source : http://docs.angularjs.org/guide/directive On multiple elements with transclusion : the inner directives are evaluated before outer directives. Reason: Nature of transclusion. On multiple elements with siblings : Executed in order top to bottom. Reason: Parsing logic of $compile.

Categories : Angularjs

Joining data that exists in two tables and aggregating non joined data
How about this: Get the matched items and do a union with a second query. The second query would select name, 'others', sum(count) and would group on name where id is not in the ids from the first table (you can check that with a subquery). I can type it out if you want to, you look like you know what you are doing and just need a general idea about how to do it.

Categories : Asp Net

Repeated querys to a db with JDBC or dump data to ArrayList and iterate over list whenever I want some data?
You have different options based on how big your tables and how scalable you need your system to be. If you have a pattern in showing the daily appointments, then I suggest you extract that pattern to have a generic solution to show the appointments of a day. On top of this if you have validations to be running for a selected day, keep it simple and safe in your database, that way the whole point of persistence is not lost also. Have a look at in memory databases as well.

Categories : Java

joined query to return data
use LEFT JOIN instead of join select * from #__unis_faculties AS faculty join #__unis_subjects AS subject ON subject.faculty = faculty.id right join #__unis AS uni ON uni.id= subject.university where uni.id = 1

Categories : Mysql

Emacs Org-Mode: Clear non-repeated SCHEDULED time when DEADLINE is repeated
Here's the patch, if you want to apply it yourself. I'll send another copy to the org-mode mailing list. --- a/lisp/org.el +++ b/lisp/org.el @@ -12835,7 +12835,8 @@ This function is run automatically after each state change to a DONE state." (setq type (if (match-end 1) org-scheduled-string (if (match-end 3) org-deadline-string "Plain:")) ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0)))) - (when (string-match "\([.+]\)?\(\+[0-9]+\)\([hdwmy]\)" ts) + (if (not (string-match "\([.+]\)?\(\+[0-9]+\)\([hdwmy]\)" ts)) + (org-remove-timestamp-with-keyword org-scheduled-string) (setq n (string-to-number (match-string 2 ts)) what (match-string 3 ts)) (if (equal what "w") (setq n (* n 7) what "d"))

Categories : Emacs

How do I access data from a joined table in my index.html.erb?
First, you are not initialising @stat in show action, you could do this with: @stat = Stat.find(params[:id]) Second, you have to be sure @stat has campus associated with it. But as you are not having problems with index, it seems your stat has campus associated, it means that status has a column campus_id which value is a valid id of table campuses. Update After reading your comment your stat has not a campus associated, you can show an empty string in these cases with: <td><%= stat.campus.try(:name) %></td>

Categories : Ruby On Rails

How to migrate with data update on *one time* joined columns?
def up add_column :signups, :user_id, :integer, :default => nil add_index :signups, :user_id ActiveRecord::Base.connection.execute("UPDATE SIGNUPS S JOIN USERS U ON S.EMAIL=U.EMAIL SET S.USER_ID = U.ID") end

Categories : Ruby On Rails

Access repeated item inside ng-repeated directive
You should pass item as attribute to directive created a sample directive http://plnkr.co/edit/l5r6zIc7ncT1XldRuB98?p=preview

Categories : Angularjs

Select not binding to data ng-repeated data
It would be much easier if you added a jsfiddle link to play with, but it seems to me that you're trying to set the ng-model to a primitive (string) instead of an object and therefore every time you change it, the value no longer exists. selectedAction.value won't work in that case either, because selectedAction is a string. If inputDevice.selectedActions was an array of objects though, I think it would've worked fine. Another thing you could try (not sure if it will work because I don't have a jsfiddle :) ) is, set ng-model="foo{{$index}}" - then it should theoretically save the value into a new scope variable with the index in the loop.

Categories : Javascript

creating a joined matrix from a list of data in vba (like outer join)
so i have an idea, its not beautiful but it will probably work... copy your whole field column and paste it to a fresh sheet, use data tab and hit remove duplicates, if you transpose that so your top row is Field, a, b, c, d you can drop a formula thats something like this (untested) "=INDEX(Sheet1!B:B, MATCH($B$1,Sheet1!A1:A3,0))" the search range in match is intentionally small and left without $ to that if you drag this formula down it will search a little further(A2:A4,A3:A5,etc) once you get all of them just find/replace all the N/As remove blanks and your good if i have time i will try and put together a little macro that would be a lot cleaner...

Categories : Excel

How to grab data from joined tables in a list of values condition?
Not at a machine to test but you could try select I.Path from Images I left outer join Products P on P.ImageID = I.ID where CHARINDEX(convert(varchar, P.ID), @ids) > 0

Categories : SQL

Finding null field with two data tables and date table joined
I think you just want a left join from eval to hopkins and then a test on the field: select e.uid, max(case when h.name is null then 0 else 1 end) as isInHopkins from eval e left outer join hopkins h on year(e.month) = year(h.month) and month(e.month) = month(h.month) group by e.uid; If the hopkins.id is supposed to related to the user, then you would want to add and e.uid = h.id to the on clause. If this doesn't give you what you want, then please edit your question to provide sample results for the SQL Fiddle data.

Categories : PHP

SQL query gives more than one, repeated data
Can you share more about your data? Just looking at the query, I think that a "Group By" will help. Also, You're only doing a "SELECT TOP(1)" for the subquery. You may want to do this for the encompassing SELECT as well. Hope that helps.

Categories : SQL

how to not add repeated data using jquery
Create and fill a JavaScript object. Users as key, whatever remains in the end does not contain duplicate. Say we are looping over three different users The user 'Jack' with an ID of '42' appears twice When you iterate four times over the users, fill a JavaScript object while using user IDs as key var oUsers = {}; oUsers['42'] = 'Jack'; oUsers['43'] = 'Lucy'; oUsers['44'] = 'Fennel'; oUsers['42'] = 'Jack'; > oUsers > Object {42: "Jack", 43: "Lucy", 44: "Fennel"} >

Categories : Jquery

Getting repeated data - screenscraping using bs4
You are looping unnecessarily. What you need to do is following: from string import punctuation, whitespace import urllib2 import datetime import re from bs4 import BeautifulSoup as Soup today = datetime.date.today() html = urllib2.urlopen("http://www.99acres.com/property-in-velachery-chennai-south-ffid").read() soup = Soup(html) print "INSERT INTO Property (URL,Rooms, Place, Phonenumber1,Phonenumber2,Phonenumber3,Typeofperson, Name)" print "VALUES (" re_digit = re.compile('(d+)') properties = soup.findAll('a', title=re.compile('Bedroom')) for eachproperty in soup.findAll('div', {'class':'sT'}): a = eachproperty.find('a', title=re.compile('Bedroom')) pdate = eachproperty.find('i', {'class':'pdate'}) pdates = re.sub('(s{2,})', ' ', pdate.text) div = eachproperty.find('

Categories : Python

Repeated data in my spinner and ListView
Inside your DataBaseHandler.java , Make the following change public List<Shakhes> getAllShakhes() { List<Shakhes> shakhess = null; Cursor c = database.rawQuery("SELECT * FROM TBL_MAHRIE",null); //Cursor c = database.query("TBL_MAHRIE", new String[] { "ID", "COL_SAL", "COL_NERKH" }, null, null, null, null, null); shakhess = new ArrayList<Shakhes>(); if (c.moveToFirst()) { do { Shakhes p = new Shakhes(); p.setId((int) c.getLong(c.getColumnIndex("ID"))); p.setSal(c.getString(c.getColumnIndex("COL_SAL"))); p.setNerkh(c.getString(c.getColumnIndex("COL_NERKH"))); shakhess.add(p); } while (c.moveToNext()); return shakhess; } return shakhess; } } code the line

Categories : Java

getting repeated data from mysql select statement
Try this: SELECT tc.rollno, tc.english, ta.rollno, ta.StdNm FROM tbl_marks tc LEFT JOIN tbl_student ta ON ta.Cls = tc.Cid WHERE tc.Cid =22

Categories : Mysql

Error TabActionBarFragment repeated data [EDIT]
The problem is not in your ListView code, it is in your ActionBarcode in your MainActivity. You are not properly attaching, detaching, and replacing your fragments. I have had the same issue. Post the code for your MainActivity and I can help you You need to replace ft.add(android.R.id.content, mFragment, mTag); with ft.replace(android.R.id.content, mFragment, mTag).commit(); So your method inside onTabSelected(Tab tab, FragmentTransaction ft) should look like this public void onTabSelected(Tab tab, FragmentTransaction ft) { // Check if the fragment is already initialized if (mFragment == null) { // If not, instantiate and add it to the activity mFragment = Fragment.instantiate(mActivity, mClass.getName

Categories : Android

One-way repeated measures ANOVA with unbalanced data
For an unbalanced repeated-measures design, it might be easiest to use lme (from the nlme package): ## this should be the same as the data you constructed above, just ## a slightly more compact way to do it. datList <- list( bin1=c(0.37,0.00,0.00,0.16,0.00,0.00,0.08,0.06), bin2=c(0.33,0.21,0.000,1.00,0.00,0.00,0.00,0.00,0.09,0.10,0.04), bin3=c(0.07,0.41,0.07,0.00,0.10,0.00,0.30,0.25,0.08,0.15,0.32,0.18)) subject=c("S2","S3","S5","S7","S8","S9","S11","S12", "S1","S2","S3","S4","S7","S9","S10","S11","S12","S13","S14", "S1","S2","S3","S5","S7","S8","S9","S10","S11","S12","S13","S14") d <- data.frame(probability=do.call(c,datList), bin=paste0("bin",rep(1:3,sapply(datList,length))), subject) library(nlme) m1 <- lme(probabi

Categories : R

How can I bind data from nested List<> objects to nested ListView controls?
You can bind the datasource of your inner list view to a property of the items bound to your outer listview. However, to do that the inner listview as to be in the itemtemplate of the outer listview. See the code below and note the DataSource='<%# Eval("Labels_color") %>' attribute for the inner list view. <asp:ListView ID="ListView_Orp_Results" runat="server" ItemPlaceholderID="itemPlaceholder"> <LayoutTemplate> <div id="outer_result_container"> <div id="itemPlaceholder" /> </div> </LayoutTemplate> <ItemTemplate> <div id="result_photo">...</div> <div id="result_category">...</div> <div id="result_detector">...</div> <div id="inner_result_container" runat="server"

Categories : Asp Net

Parsing a flattly-written nested text template into a usable nested data structure for N levels
Replaces each ">" with a tab. Output is pretty much exactly as your brute force output. (file.txt is your template file as above) test = open("file.txt", "r") for line in test: print line.replace(">", " ") #print line

Categories : Python

Avoiding nested each loops when handling nested JSON data
JSON is "just" javascript object literals. You can skip the jQuery call, and just reference the objects and arrays directly after you parse it. obj.custom_sql_rule[0].something_else[0]; of course, your JSON is a bit oddly-formed. If at all possible, don't arbitrarily mix objects {} and arrays [] . Use the latter when you have lists of identical objects or primitive data, and the former when you have named properties. And once you have a valid javascript object, you can just iterate through its properties. for(var sqlProp in jsonObj) { if(jsonObj[sqlProp].error) { errorsContainer.append("<div>" + jsonObj[sqlProp].error + "</div>"); } }

Categories : Javascript

How to present massive amounts of repeated data to user
To limit the number of queries to the SQL Database, a good solution is to try group to group your multiple requests in one. An example : /* I'm supposing that $gardeners looks like that : * { * bob : { * tools: [{Id: 117,name: "Rake"}, {Id: 175,name: "Shovel"},[...]], * fruits : [...] * }, * Lisa : {tools: [...]} * } */ $toolIDs = array(); foreach ($gardeners as $gardener) { foreach ($gardener->tools as $tool) { $toolIDs[] = $tool->Id; // get Ids of all used tools } } $toolIDs = array_unique($toolIDs); // remove duplicate Ids // fetch the description of all the used tools in one go $result = mysqli_query(sprintf("SELECT id, description FROM tools WHERE id IN ('%d');", implode("','", $toolID))); Since we have a id-description couple, we can construct an arr

Categories : PHP

GAE: Error when downloading data, if ndb.KeyProperty(repeated=True)
When you are using repeated properties and exporting to a CSV, you should be doing some formatting to concatenate the list into a CSV understood format. Please check the example here on import/export of list of dates and hope it can help you. EDIT : Adding suggestion for import transform from an earlier comment to this answer For import, please try something like: `from google.appengine.api import datastore def stringToValue(delimiter): def string_to_key_list(value): keyvalueList = [] if value == '' or value is None or value == []: return None for val in value.split(';'): keyvalueList.append(datastore.Key.from_path('User', val)) return keyvalueList return string_to_key_list` if you have id i

Categories : Google App Engine

logic issue with spitting out data, variables being repeated
I see no errors here try this .. if it does not work past part of the json. var json = JSON.parse(xmlHTTP.responseText), message = "<table><tr id='head_table'><td>Name:</td><td>Rnd 1:</td><td>Rnd 2:</td><td>Rnd 3:</td><td>Rnd 4:</td><td>Rnd 5:</td><td>Rnd 6:</td><td>Options:</td></tr>"; for(var i=0; i<json.collection.length; i++){ message+="<tr><td>" + json.collection[i].customer.name + "</td>"; for(var j=0; j<json.collection[i].events.length; j++){ message+="<td>" + json.collection[i].events[j].time_stamp + "</td>"; } message+="</tr>"; } message+="</table>"; you don't need to write msg=msg+evntmsg it's confusing and lea

Categories : Javascript

Angularjs - Accessing shared service data from an ng-repeated directive
First and foremost, your binding are evaluated in context of $scope variable. You cannot have a service and direct bind to its data. So actually you need a wrapping element. So either you use div or any parent of the repeat element. I have updated you jsbin see here. You can still do it without the service, by using the controller.

Categories : Javascript

how to avoid repeated data is getting displayed in struts2 when I refresh the page,I am using S2 anchor tag ..not using form
<html> <head> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script> $(document).ready(function() { window.history.pushState("","", location.href); }); </script> </head> <body> <!-- STUFF --> </body> </html> It works on HTML5 browsers only, if you are targeting old Internet Explorers, it won't. Edit: added CDN for jQuery, in case it wasn't clear...

Categories : Jsp

Nested foreach to display over rows
u are going too complex on it try this : int row = 1; @foreach (var article in Model) { @if(row == 1) @:<div class="row"> <div class="spanthird col"> <div class="well"> <article> <h3>@article.UrlStringDisplay</h3> <div class="date">@article.Date.ToString("dd MMMM yyyy")</div> <a href="@Url.RouteUrl("PressReleases", new {id = article.UrlString, Action = "article", Controller = "PressReleases"})" class="btn btn-primary">Read more</a> </article> </div> </div> @if(row == 3)

Categories : C#

How to populate data into a nested table in Oracle when the nested table is within a record type
This document: http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#CIHIEBJC describes how to work with collection types in PL/SQL: Basic example: DECLARE TYPE N_TYPE IS TABLE OF VARCHAR2(350); TYPE TYPE1 IS RECORD ( FIELD_1 VARCHAR2(100) , FIELD_2 VARCHAR2(30) , FIELD_3 N_TYPE); v_n n_type; v_type1 type1; BEGIN v_n := n_type(); -- initialize an empty collection v_n.extend( 3 ); -- add 3 elements to the table v_n( 1 ) := 'First string '; v_n( 2 ) := 'Second string '; v_n( 3 ) := 'Third string '; v_n.extend; -- add 1 element at the end of the table v_n( v_n.last ) := 'Next string'; --assign the table to the field_3 of the record v_type1.field_3 := v_n; -- check values FOR i in v_typ

Categories : Oracle

Nested Repeater Puzzle: Using data returned from (outer) query, in a nested query
Couple of things that should be fixed here: The error "Server tag not well formed" was due to missed double quote after ConnectionString attribute. Remember that everything that goes inside <%# %> must be a valid C# code, which means that that if your are using a string - you should enclose it into double quotes. Typical pattern for quotes here is AttributeName='<%# Eval("Property")%>'. That was not the case in the SelectCommand value. When you need to manipulate with both literals and bound data, like in the select query here, it is better to enclose the whole expression in the servlet tags and perform necessary transformations inside. All in all, here is the result: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSourceGrantCategories"> <Ite

Categories : C#

Sencha nested json display in Dataview
Change your proxy setting in your store as follows. I removed 'rootProperty' and add 'record' proxy: { type: 'ajax', method:'post', url: 'resources/data/fullproperty.json', //url: apiurl+'PropertyList.ashx?switch=GetPIP&reoid=', reader: { type: 'json', record: 'items' } }

Categories : Extjs

Drupal Display Suite Nested Layouts
You could read the documentation about both the modules given.That might lead you in the right direction.Hope this tutorial link might help you with the necessary details. Display Suite https://drupal.org/node/644662 Panels https://drupal.org/node/496278 COMPARING PANELS AND DISPLAY SUITE SIDE-BY-SIDE http://buildamodule.com/video/advanced-site-building-in-drupal-7-how-to-use-panels-for-positioning-content-comparing-panels-and-display-suite-side-by-side#viewing

Categories : Drupal

What is the spurious block in the display of GWT nested TabLayoutPanel?
The spurious block is avoided when a VerticalPanel is used and the required nested TabLayoutPanel is placed within that Vertical Panel. In MainView.ui.xml instead of: <g:tab> <g:header>Teams</g:header> <g:TabLayoutPanel barHeight="2" barUnit="EM"/> </g:tab> use this: <g:tab> <g:header>Teams</g:header> <g:VerticalPanel/> </g:tab> and then in the UiBinder file for Teams: <g:VerticalPanel> <g:TabLayoutPanel ...> <g:tab> ... By adding the "extra" VerticalPanel one prevents GWT from adding an extra "ghost" TabLayoutPanel.

Categories : Gwt

how can i change display format in datawindow rather than display data in vertical
Maybe try the N-Up datawindow style otherwise you could flatten the data in SQL using one of the examples in this stackoverflow question on flattening data the method you would use might depend on if you know how many occurs there are. If you need the data to be update-able then you'll need to write some code to un-flatten on save.

Categories : Misc



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.