Posts

Showing posts from June, 2015

python - pyinstaller no predefined compiler for raspberry pi -

i want convert myscript.py exexutable file. using raspberry pi(raspbian) , python 2.7. i issuing following command sudo pip install pyinstaller sudo pyinstaller myscript.py after processing provides error fatal error: pyinstaller not include pre-compiled bootloader platform. see <http://pythonhosted.org/pyinstaller/#building-the-bootloader> more details , instructions how build bootloader. i go online build compiler not understand process. how solve problem? suspect path compilation of bootloader wrong platform may mentioned in forum here cd /usr/local/lib/python2.7/dist-packages/pyinstaller/bootloader sudo mv linux-32bit linux-32bit-arm for rpi need bootloader... may cloned pyinstaller v3.1.1 rpi same thing, change directory name arm platform after have build pyinstaller cd /path/to/pyinstaller/pyinstaller/bootloader cp -r linux-32bit linux-32bit-arm

networking - Locate pc on local network -

we have 10000 or more computers in our network. want find computer ip. there way learn switch computer connected to? have 1 router in our network. i try , mac address computer then. depending on kind of switches have telnet switch , find out if mac address connected through there. idea comment not have privilege to.

c - How to show bytes of float -

i use function show_bytes follows: #include<stdio.h> typedef char *byte_pointer; void show_bytes (byte_pointer x) { int length = sizeof(float); int i; for(i = 0;i <length;i++) { printf("%2x",*(x+i)); printf("\n"); } } int main() { float obj; printf("please input value of obj:"); scanf("%f",&obj); show_bytes((byte_pointer) &obj); } when input 120.45,which should 0x42f0e666 please input value of obj:120.45 66 ffffffe6 fffffff0 42 why many 'f' before e6 , f0 while use %.2x. your function should be: void show_bytes (byte_pointer x) { int i; for(i = 0; <sizeof(float); i++) { printf("0x%2x\n", (unsigned int)(*(x++) & 0xff)); } } or typedef uint8_t *byte_pointer; void show_bytes (byte_pointer x) { int i; for(i = 0; <sizeof(float); i++) { printf(

How to speed up this ElasticSearch query? -

i'm trying build auto suggest based on docs title. if user types 'south', auto suggest suggest 'south korea' example. used shingle filter break title 2 words. here mapping : { "settings":{ "analysis":{ "filter":{ "suggestions_shingle":{ "type":"shingle", "min_shingle_size":2, "max_shingle_size":2 } }, "analyzer":{ "suggestions":{ "tokenizer":"standard", "filter":[ "suggestions_shingle" ] } } } }, "mappings":{ "docs":{ "properties":{ "docs_title":{ "type":"multi_field", "fields":{

javascript - pass value to function in form of <select> -

this question has answer here: get selected value in dropdown list using javascript? 17 answers all want pass <select> </select> value javascript function. here code: function test() { var gender = document.getelementbyid("gender").value; } html <form action="" method="post" onsubmit="test()"> <select name="gender" id="gender"> <option selected="" value="default">select</option> <option value="male">male</option> <option value="female">female</option> </select> </form> try this var element = document.getelementbyid("gender"); var gender = element.options[element.selectedindex].value;

python - Finding if any element in a list is in another list and return the first element found -

it easy check if element of list in list using any() : any(elem in list2 elem in list1) but there anyway idiomatic way return first element found? i'd prefer one-line solution rather than: for elem in list1: if elem in list2: return elem this answer similar an answer on a similar question , @jamylak goes more detail of timing results compared other algorithms. if want first element matches, use next : >>> = [1, 2, 3, 4, 5] >>> b = [14, 17, 9, 3, 8] >>> next(element element in if element in b) 3 this isn't efficient performs linear search of b each element. create set b has better lookup performance: >>> b_set = set(b) >>> next(element element in if element in b_set) if next doesn't find raises exception: >>> = [4, 5] >>> next(element element in if element in b_set) traceback (most recent call last): stopiteration you can give default return instead, e.g. none . c

Highcharts add several series with PHP array -

i'm using highcharts display database informations, when use 1 series haven't problems, when want add several series on chart, it's little bit difficult. first php script : foreach ($informationslier $keyfille => $fille) { $grafdata = array(); foreach ($fille['information'] $keyinfos => $information) { $mois = $information['created']->format('m'); $mois = $mois - 1; $timestamp = strtotime($information['created']->format('j').'-'.$mois.'-'.$information['created']->format('y')); //multiply 1000 seconds in js $timestamp = $timestamp * 1000; $grafdata[$keyinfos] = array($timestamp, (float)$information['valeur']); //$grafdata[$keyinfos] = implode(', ', $grafdata[$keyinfos]); //$grafdata[] = "[date.utc(".$information['created']->format('y').','.$mois.','

r - CFA or higher order factor model or SEM -

Image
i have questions regarding cfa , sem. i have developed conceptual model , collected data it. i'm struggling actual analysis because haven't study statistics. whats in post based on few days reading. basically, want use r rather other software such mplus modelling. because r requires me model step step means learning magnified. initially went down wrong track of using efa realised isn't needed because developed model prior. now cfa i'm trying understand whether conceptual model below can viewed third order factor model? variables on far left mediator variables(observed) of manifest variables in middle. how should go doing in r? saw cfa examples of second order 3 factor model haven't seen 1 mine there mediator variables. in advance!

php - Magento 2 How to get category by url_key -

i try category in magento 2.0 url_key. now i've got : $objectmanager = \magento\framework\app\objectmanager::getinstance(); $categoryfactory = $objectmanager->create('magento\catalog\model\categoryfactory'); $category = $categoryfactory->create() ->addattributetofilter('url_key','my_category_url_key'); it returns me error : error filtering template: invalid method magento\catalog\model\category\interceptor::addattributetofilter(array ( [0] => url_key [1] => my_category_url_key ) ) thanks. /** * @var \magento\catalog\model\categoryfactory ****** inject in constructor ****** */ protected $categoryfactory; --------- --------- --------- $categorys = $this->categoryfactory->create() ->getcollection() ->addattributetofilter('url_key','devops') ->addattributetoselect(['entity_id']); echo "<pre>&q

orbeon - Is it possible in orben to hide or disable the "send" button until a form is finished? -

Image
the default behavior of button enabled always, , if field mandatory or incorrect, error shown. but if use wizard, , have fill different sections, not normal submit form if still @ beginning of form. must navigate sections fill questions (at least mandatory ones) until reach last section. when in last section, can submit form. @ least, force user read form. i know little annoying behaviour, specially user no experience orbeon, inclined press button when have finished first section. then question is: there way of hide or disable "send" button until last section reached? edit as shown in documentation page new version 2016.1 of orbeon hides "submit" button. @ least, text shown: wizard improvements. wizard's table of contents indicates pages errors more clearly. in validated mode, pages cannot navigated indicated better. last not least, in validated mode, save, submit, send, , other buttons appear within wizard show when user reaches last page o

How do I send connection objects using Pipe() in python? -

i not able send pipe objects between processes. pipe_i.send(diff_connection_object) i know connection objects not pickalable. send() takes argument picklable objects not able send connection object. how can ? if use fork of multiprocessing called multiprocess should work connection object want send. fork uses dill instead of pickle , provide better serialization. example, here's sqlite3.connection object. >>> import sqlite3 >>> c = sqlite3.connect(':memory:') >>> c <sqlite3.connection object @ 0x1046134b8> >>> import multiprocess >>> p1,p2 = multiprocess.pipe() >>> p1.send(c) >>> c_ = p2.recv() >>> c_ <sqlite3.connection object @ 0x104af8200> it's unclear connection object the connection object being asked about. here's _multiprocess.connection object being passed pipe multiprocess . >>> c = p1.__class__ >>> p1.send(c) >>>

c++ - QML: how to use Date function -

i trying develop first qml application. have control returns integer supposed year. check if value leap year. the qdate class has isleapyear() static method wonder how can use within qml file. something below using javascript/qml should work, assuming on qt5: // myitem.qml item { function isleap(hyear) { return ((hyear % 100 != 0) && (hyear % 4 == 0)) || (hyear % 400 == 0); } } if want value , use in c++, need type cast values methods outlined in http://doc.qt.io/qt-5/qtqml-cppintegration-data.html

ios - Best way to giving ipa file for testing to several user -

i have exported ipa file using adhoc. want give file multiple user without testflight. if update version, user must notification update avaiable same. any body tell me how use that. thanks if not use test flight (why not?), might prepare own private ipa-distribution channel: manually emailing link new build if create new build. as off-site resources offering same functionality of pre-apple-test flight, question off-topic; google helps. please note ios users have accounts test flight works using apple id.

html - DIV BOX I want it to not affect the keywords on site -

hope can help, website host has been bit sneaky, have added user agreement filled name 32 times in fact. it's thrown keyword analytics nearest closest keyword ranking 10th popular after user, agreement 'host name' , on. the button situated on footer under user agreement, there no way can take off there html code box can override (but don't see code). lewisfackrell.co.uk could please @ me , block being seen or read google, better rid of together. have added everyone's website frustrating. cheers lewis basing on this answer , this document can block google crawler crawling specifig portion of website <!--googleoff: index--> , example: <p>this normal (x)html content indexed google.</p> <!--googleoff: index--> <p>this (x)html content not indexed google.</p> <!--googleon: index> hope helps.

jqgrid - how to change theme of grid using jqwidgets -

i using jqgrid display data. new have tried how change theme of jqgrid? not working me. can tell me how change theme of grid? for jqwidgets grid, should 2 things: include css theme file , set widget's theme property theme's name. example: styling , appearance

sql - Need Help To Create DataBase? -

i going create database in sql server 2014 have problem . a need use option : when user want register , select country , city of country display , select . for example : when user select u.s.a , display (newyourk , washington , . . . ) pic of prog create table orders ( orderid int identity (1,1) not null primary key, fname varchar(50) not null, lname varchar(50) not null, tel varchar(15), counts int not null, daysid int not null, countryid int not null, cityid int not null, address varchar(1024) not null, foreign key (daysid) references weekdays(daysid), foreign key (countryid) references country(contryid), foreign key (cityid) references city(cityid) ) go create table weekdays ( daysid int identity (10000001,1) not null primary key, daysname varchar(50) not null ) go create table country ( countryid int identity (2000000,1) not null primary key, countryname varchar(100) ) create table city ( cityid int

angularjs - How to declare and use modules, controllers, services and bootstrap manually in Angular? -

i'm trying build angularjs app has 1 controller, 1 service , bootstraps manually (no ng-app ). problem keep having error : argument 'appcontroller' not function, got string html <!doctype html> <html xmlns:ng="http://angularjs.org"> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0-rc.0/angular.min.js" type="text/javascript"></script> <script src="inc/bootstrap.js" type="text/javascript"></script> <script src="inc/controllers.js" type="text/javascript"></script> <script src="inc/services.js" type="text/javascript"></script> </head> <body ng-controller="appcontroller"> [...] </body> </html> bootstrap.js angular.element(document).ready(function() { angular.bootstrap(document, ['htmlcon

bash - "Invalid Argument: dirname" in Terminal -

i noticed issue when first went run defaults write com.apple.finder appleshowallfiles yes in macos terminal (10.11.2) returned bash: /usr/bin/defaults: invalid argument i'm not sure going on defaults, have similar issue brew: /bin/bash: /usr/bin/dirname: invalid argument i broke something, not sure how did or when happened. causing sorts of issues. thoughts on fixing it? i reinstalled el capitan recovery partition (restart holding command-r), , solved issue. guess xcode command tools blame.

netweaver - Java editor of Web Dynpro is not found in SAP NWDS -

i moved webdyn pro nwdi 7.0 7.3, , since can't open java editor webdyn pro program in 7.3 release. please help. thanks. the java editor of web dynpro view cannot opened when there errors in view. please check eclipse views "problems" or "markers" , try fix errors can fixed view editor . expand subnodes of view context , errors (red x) there.

java - Spring JpaRepository using generic entity -

i'm trying implement generic dao use x entities quite similar (id, code, description): @repository public interface genericdao<t> extends jparepository<t, long> { t findbycode(string code); t findbyid(long id); } one of entities this: @getter @setter @entity @table(name = "test") public class test {...} i've got service need use dao: @service public class testserviceimpl implements testservice { private genericdao<test> testdao; @autowired public testserviceimpl(genericdao<test> testdao) { this.testdao = testdao; } } when start application using springboot application doesn't start , error is: caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'genericdao': invocation of init method failed; nested exception java.lang.illegalargumentexception: not managed type: class java.lang.object @ org.springframework.beans.factory.support.abstracta

android - Negative margin bigger than view's height on pre lollipop devices -

it seems not possible assign negative value bigger view's dimensions. example, lets have following layout: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:background="@color/colorprimary" android:layout_height="match_parent" android:orientation="vertical"> <relativelayout android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="56dp" android:background="@color/colorprimary" android:layout_margintop="-2dp"> <imageview android:id="@+id/closeiv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centervertical="tru

laravel 4 - When using "find" on relation it gives me the pivot id -

i have organization model , when try retrieve specific user organization gives me user, id on user object pivot-id many-to-many relation table. class organization extends eloquent { public function users() { return $this->belongstomany('user', 'organizations_users', "organization_id" ,"user_id"); } } and user model class user extends eloquent implements userinterface, remindableinterface { use remindabletrait; protected $table = 'users'; protected $hidden = array('password'); protected $fillable = array('email', 'password'); public function organizations() { return $this->belongstomany('organization', 'organizations_users'); } } but when retrieve specific organizations users method $org = organization::find(12); $org->users()->find(4); it returns pivot-table id on user-object instead of users own id. &

linux - How can I redirect my grep to a txt file, located in another directory? -

grep -n '[0-9]' test.txt > output.txt i redirect above grep results on new file (not yet created, output2.txt ), needs located in directory directory of test.txt . example, maybe @ nothome/labs/output2.txt . how can this? you can put absolute path output, this: grep -n '[0-9]' test.txt > /path/to/output/output.txt

Vue.js, Visual Studio 2015 and .less styles syntax highlighting -

i using visual studio 2015 , vue.js implement frontend web app. as known, vue.js comes quite special approach declare components - each component should declared in single .vue file, contains required code (template, script , style) , looks this: <template> <!-- component template goes here. --> </template> <script> <!-- component code goes here. --> </script> <style> <!-- component style goes here. --> </style> there no official support .vue files in msvs @ moment, use html editor edit files , works fine me. so, problem... vue-files allows set required language script or style (just add lang attribute script or style tags , here go). so, using less, style tag looks this: <style lang="less">...</style> visual studio, of course, know nothing special lang attribute, add well-known attributes in order enable less syntax highlighting , style tag looks this: <style lang="

c - Compiler doesn't show any errors or warnings but the program doesn't work -

i tried build , run following program, breaks down executing. thought maybe made mistake 0 errors , 0 warnings shown. after researching such behavior on stackoverflow, saw misplaced semicolons or forgotten address-operators, not see in source code or overlooking something? c or gcc guru tell me wrong , why? operating system windows 7, , compiler had enabled: -pedantic -w -wextra -wall -ansi here source code: #include <stdio.h> #include <string.h> char *split(char * wort, char c) { int = 0; while (wort[i] != c && wort[i] != '\0') { ++i; } if (wort[i] == c) { wort[i] = '\0'; return &wort[i+1]; } else { return null; } } int main() { char *in = "some text here"; char *rest; rest = split(in,' '); if (rest == null) { printf("\nstring not devided!"); return 1; } printf("\nerster teil: "); puts(in);

clojure - in datomic, how is it possible to find out what keys are available for reverse lookup? -

the following uses simplified datomic setup: :account/user -> string :account/email -> ref :email/name -> string :email/type -> keyword if have entity containing account information, easy know has email information (keys <account entity>) ;; => [:account/user :account/email] (:account/email <account entity>) ;; => <email entity> but on flipside, if @ keys of email entity, not know has linked account information. (keys <email entity>) ;; => [:email/name :email/type] (:account/_email <email entity>) ;; => <account entity> how 1 find out :account/_email valid key without trial , error? to check if key valid can use: (.containskey <email entity> :account/_email) ;; => true in order valid entity keys including reverse ones : (.touch <email entity>) (keys (.cache <email entity>)) note (keys) called directly on entity returns forward keys. tested on similar schema. s

eclipse emf - How to use EMF Databinding for an implicit inverse relationship -

i have ecore model classes , b. model can not changed. has many-to-one reference b. b has no reference a. display tree bs @ root , as leaves. use emf data binding. examples have seen assume there list feature of root observe. however, in scenario, there no feature direction (i.e. b_to_a), 1 reverse direction. how create observable observes b , notifies of changes of as? there no mechanism doing this. have received response tom schindl: http://tomsondev.bestsolution.at/2009/06/06/galileo-emf-databinding-part-1/ unfortunately there’s no way. you’d have define eopposites

xml - if else condition is not working in XSLT? -

i trying try this link else if condition without sucess. my code <xsl:choose> <xsl:when test="//./actionparams/@txt_sid = '110'"> <xsl:for-each select="ext"> <config type="2" localserver="newxyz.com" liveserver="newxyz.com" httpuri="/etmailregistration/ok/unsubfrmapp?sendmail=1" params="txt_id,txt_sid" readtimeout="39000" retry="3"/> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:for-each select="ext"> <config type="2" localserver="oldxyz.com" liveserver="oldxyz.com" httpuri="/etmailregistration/unsubfrmapp.aspx?sendmail=1" params="txt_id,txt_sid" readtimeout="39000"

java - Tomcat installation fails with JRockit -

i can't install tomcat on windows server 2008 using apache-tomcat-7.0.67.exe jrockit jvm. i'm able install tomcat oracle jvm. chose "c:\program files (x86)\java\jrockit-jdk1.6.0_45-r28.2.7-4.1.0\jre\bin" path of jre.it shows message says "no java virtual machine found in folder" , tomcat setup quits. from https://svn.apache.org/repos/asf/tomcat/tc8.0.x/trunk/res/tomcat.nsi : ${if} $javahome == "" ${orifnot} ${fileexists} "$javahome\bin\java.exe" ifsilent +2 messagebox mb_ok|mb_iconstop "no java virtual machine found in folder:$\r$\n$javahome" detailprint "no java virtual machine found in folder:$\r$\n$javahome" quit ${endif} strcpy "$javaexe" "$javahome\bin\java.exe" ; need path jvm.dll configure service - uses $javahome call findjvmpath pop $5 ${if} $5 == "" ifsilent +2 messagebox mb_ok|mb_iconstop "no java virtual machine

Trouble Counting Subseq of a String Common Lisp -

i trying use function count tell me how many occurrences of "<script>" tag there can't seem working. code: (count "<script>" "<p>hello world</p><script>javascript goes here</script>" :key #'string :test #'equal) i can't seem find examples of did find 1 remove , figured similar. how can return 1 not 0? count counts single elements match (so use count #\a characters example, not substrings). counting substrings you'll want this: (defun count-substrings (substring string) (loop sub-length = (length substring) 0 (- (length string) sub-length) when (string= string substring :start1 :end1 (+ sub-length)) count it)) of course counting html tags pretty error prone. you'll want use actual parser.

javascript - Async.ParallelLimit callback already called -

i using request module downloading reports.i using parallellimit method limit number of simultaneous tasks. code iterate array is: _.each(strs,function(str){ _.each(experiences,function(selectedexperience){ asynctasks.push(function(callback){ downloadreport(name,inp.btime,inp.etime,selectedexperience,callback); }); }); }); }); code async task function is: var downloadreport = function(name,starttime,endtime,selectedexperience,callback){ request.post({ headers: myheaders, uri: strurl, form: formobject, method: 'post' }, function (err, res, body) { if(err){ downloadreport(kpiname,starttime,endtime,selectedexperience,callback); } else if(res) { if(body.indexof("some string")>=0){

symfony - Class Not Found Exception Error -

i upgraded project's symfony framework 2.3 2.7 but ran error: class not found exception in appdevdebugprojectcontainer.php line 4227: attempted load class "twig_extensions_extension_text" global namespace. did forget "use" statement? i pretty new symfony , lot of stuff still quite overwhelming me. can please me out this? thank you this class doesn't come twig/twig package, twig/extensions package ( docs ). make sure have package installed running composer show -i , searching (or using grep) in output package name. if haven't, install package: $ composer require twig/extensions

sql server - Setting up a Foreign Key - transact SQL -

i'm experiencing issue following tsql in sql server 2014 when assigning foreign key. can me in understanding incorrect? - jt create table dbo.tbl_util_cost ( chr_grade nchar(10) not null primary key, pct_target decimal(18, 2) not null, mon_cost_per_hour money not null, dec_daily_hours decimal(18, 1) not null ); create table dbo.tbl_team_details ( num_personal_number numeric(18, 0) not null, chr_name nchar(30) not null, chr_employee_grade nchar(10) not null , dt_start_date date not null, dt_end_date date not null, foreign key fk_team_details1 ( chr_employee_grade) references dbo.tbl_util_cost (chr_grade) ); i getting following error on foreign key - msg 102, level 15, state 1, line 11 incorrect syntax near 'fk_team_details1' please advice! your syntax wrong. here example of correct syntax: constraint fk_team_details1 foreign key (chr_employee_grad

ios - Navigation Bar change color when running -

when switch screen, navigation bar (white) turns gray (if put color took darker shade of same color) this code choose color self.navigationcontroller!.navigationbar.bartintcolor = uicolor.whitecolor() self.navigationcontroller!.navigationbar.titletextattributes = [nsforegroundcolorattributename: uicolor.blackcolor()] self.navigationcontroller!.navigationbar.translucent = false any idea prevent happening , keep color want try below, surely works. self.navigationcontroller!.navigationbar.translucent = false; self.navigationcontroller!.navigationbar.bartintcolor = uicolor.whitecolor() self.navigationcontroller!.navigationbar.titletextattributes = [nsforegroundcolorattributename: uicolor.blackcolor()] while going other screen navigation bar turns gray because, on ios7 , later, translucent property of uinavigationbar true default.

c# - Multiclient udp server handling error code 10054 properly -

i've got udp server can handle multiple clients, main thing udp is connection less quite suprised when got following error: an existing connection forcibly closed remote host. i learned because trying send ipendpoint closed. later learned because network layer send icmp message saying port closed , icmp message why error thrown. started solutions problem but, although i've found many questions on stack overflow, not find 1 correct answer. (some have 0 answers). when got error wouldn't receive anymore because beginreceivefrom method in try part after exception thrown. placed in catch part result in same error being thrown again. so problem, once error: "an existing connection forcibly closed remote host." thrown cannot use socket anymore (or seems me) and question is: how handle exception server can keep running? this code: public void listen() { if (mdisposing == true) { throw new objectdisposedexception(null, "this inst

sql - Mysql foreign key constraint is incorrectly formed? -

i receiving error when attempting create tables in mysql foreign key create table session ( code char(2) not null, date date, room varchar(30) null, constraint session_pk primary key (date), constraint session_fk foreign key (code) references module(code)); create table module ( code char(2) not null, name varchar(30) not null, cost decimal(8,2) not null, credits tinyint not null, course_code char(3) not null, constraint module_pk primary key (code)); here 2 tables trying create, syntax i've used matches w3 schools , both data types same cannot see how incorrect, appreciated :) you're trying create foreign key on table before creating referencing table. interchanging order of query work : create table module ( `code` char(2) not null, name varchar(30) not null, cost decimal(8,2) not null, credits tinyint not null, course_code char(3) not null, constraint module_pk primary key (`code`)); create table `session` ( `code` char(2) not null, `date` date, r

javascript - cannot stop/remove/destroy datetimpicker function (jquery) -

i have condition need datetimepicker , stop datetimepicker function, code: $('.berdasarkan').on('change', function(){ thisval = $(this).val(); if(thisval == 'klien'){ $('input[name="search"]').datetimepicker('remove'); console.log('1'); }else if(thisval == 'tanggal'){ $('input[name="search"]').datetimepicker({ format:'dd-mm-yyyy' }); console.log('2'); }else if(thisval == ''){ console.log('3'); } }); but datetimepicker still running when choose first condition, code wrong ? [solved] i using code : $('input[name="search"]').data('datetimepicker').destroy(); if need remove datetimepicker, need remove class "berdasarkan" using.

c# - Linq query is not executing properly -

i'am trying sum datatable column's in linq. when program running foreach loop not executing. checked milion times if column names equal datatable. resultdatatable.columns.add("user id"); resultdatatable.columns.add("amount"); resultdatatable.columns.add("order number"); var query = row in result.asenumerable() group row row.field<string>("user id") grp select new { id = grp.key, sum = grp.sum(r => r.field<int>("amount")), sum2 = grp.sum(r => r.field<int>("order number")) }; foreach(var item in query) { resultdatatable.rows.add(item.id, item.sum, item.sum2); } the result datatable 3 columns. first 1 name , last name, second 1 number , third number also. any ideas why doesn't work? i assume have created source table in same way destination table, addi

android - Pass arraylists from fragment to root activity -

Image
i building order receiving app waiter in half page activity layout contains listview , half viewpager contains json arraylist in fragment. want add menu data fragment when clicked on + button number of quantity add on root activity's listview <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <framelayout android:id="@+id/my_container_1_id" android:layout_width="fill_parent" android:layout_height="wrap_content"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar