Posts

Showing posts from June, 2011

if statement - Selecting data from 2 different tables depending upon the conditions; mySQL -

i have 2 tables; table , table b table has 3 columns; a, b, c table b has 2 columns; d , e i want select if a.b not null select a.b else if a.b null select b.d any please i made example, if required a.a , a.c unique ids. give try! // select data database select * table_a if((a.a != "") || (a.a != null)){ // select d table b } else { // echo records column b }

sql - Cross Database Queries vs Replication -

i have 2 sql 2008 database servers have database stored procedures cross database server queries (different physical servers. querying done through linked servers). i'm assuming not best practice want figure out way fix this. thought replication our database design prevents (some tables not have primary keys). is there other options have not have cross server queries? the problem not databases on server on server b. symmetricds can replication sql server (express, standard, or enterprise). not need have pks on tables. use columns tables without primary keys or have ability provide virtual keys use replication. symmetricds overview

angularjs - Angular UI Bootstrap - Popup Datepicker -

i have datepicker popup upon clicking button using angular ui bootstrap library's components. there examples of both on angular ui boostrap website don't see way combine them. don't idea of placing datepicker div attribute value popup directive's text. i tried use ng-show on datepicker div can't work either. here's code have @ moment. <div ng-controller="datepickerctrl" class="input-append"> <input class="input-small ng-pristine ng-valid" type="text" ng-value="dt" /> <button type="button" class="btn" popover-placement="right" ng-click"showdatepicker=true" // show when clicked strategy popover="on right!"> // don't see way make encapsulate div <i class="icon-calendar"...

Ruby: what's the difference between initializing a string using quotes vs colon? -

whats' difference between initializing string using quotes vs preceding colon? i.e "bobo" vs :bobo. when inspect them appear same when compare them result evaluates false. irb(main):006:0> r = "bobo" => "bobo" irb(main):007:0> puts r bobo => nil irb(main):008:0> t = :bobo => :bobo irb(main):009:0> puts t bobo => nil irb(main):010:0> puts r == t false => nil irb(main):011:0> s = "bobo" => "bobo" irb(main):012:0> puts r == s true => nil "bobo" string whereas :bobo symbol. :bobo.class # => symbol "bobo".class # => string string#== if obj not string, returns false. otherwise, returns true if str <=> obj returns zero. so according documentation "bobo" == :bobo # => false , "bobo" == "bobo" # => true . - expected. puts :bobo # >> bobo :bobo.to_s # => "bobo" this because puts ...

xgboost - xboost dmlc-submit eats command quotes (needed to run python job via scl enable) -

i use redhat 6.8 yarn cluster nodes, , uses python 2.6.6. in order python 2.7 in redhat 1 uses software collections. activate software collection 1 must scl enable. print python version example 1 scl enable python27 'python -v' problem when try submit python job yarn follows dmlc-submit --cluster=yarn scl enable python27 'python -v' it seems eat quotes , produces error (instead of expected python 2.7.8): unable open /etc/scl/prefixes/python! that same output 1 gets when doing following @ bash prompt on machine scl enable python27 python -v i'm trying figure out how fool argparse letting through. looked argparser (which dmlc-core , xgboost use) source code trying figure out possible escaping mechanism. couldn't find did find out dmlc-submit picks job submission node environment , recreates on each of execution nodes. looked @ scl enable , /opt/rh/python27/enable script , realized ld_library_path important one. path reason doesn't ...

php - Css support for safari browser in mobile devices -

i used below coding support safari browser. if(strtolower($browser->browser) == 'safari') { echo '<link href="<long_path>/safari.css" rel="stylesheet" type="text/css" />'; } its working fine safari in desktop.but not working mobile safari browser. here go use demo.mobiledetect.net test if works: click here

java - Include common config for multiple apps in Spring Cloud Config server -

i'm trying migrate our stable of app servers configuration spring cloud config server. each app has {my-app}.yml file on config server , can use profiles (either in files named {my-app}-{profile}.yml or using multi-profile yaml documents) have different configuration per environment each app, , can include 1 profile in using spring.profiles.include provide sort of inheritance - far, good. however, can include profiles from same app in each other , have several apps configured same config server share lot of config per environment - instance use same datasource config connect same database , likewise messaging, cache , on. that's lot of duplicated config , lot of places needs changed - precisely spring cloud config supposed avoid! is there way "include" (via profiles or otherwise!) shared config properties across apps in spring cloud config server? update in addition correct answer @vladsfl below, beware if you're using native profile on config ser...

visual studio - Hyper-V - 'VM name' failed to start on Azure -

i have vm on azure: windows server 2012 r2 vs 2015 community update 2 (with xamarin) when build android application (directly after creation template) have error: [window title] hyper-v manager [main instruction] error occurred while attempting start selected virtual machine(s). [content] 'vs emulator 5-inch kitkat (4.4) xxhdpi phone' failed start. failed start virtual machine 'vs emulator 5-inch kitkat (4.4) xxhdpi phone' because 1 of hyper-v components not running. [expanded information] 'vs emulator 5-inch kitkat (4.4) xxhdpi phone' failed start. (virtual machine id f03a58d7-beab-4fa2-a17f-facc465e8559) virtual machine management service failed start virtual machine 'vs emulator 5-inch kitkat (4.4) xxhdpi phone' because 1 of hyper-v components not running (virtual machine id f03a58d7-beab-4fa2-a17f-facc465e8559). [v] see details [close] an idea ? thx unfortunately won't work because azure doesn't support nested v...

java - Difference between the two methods of creating class objects in JSP -

i'm learning jsp came across 2 methods of creating class object in jsp method 1: <jsp:usebean id = "obj" class = "classname" /> <% obj.method(); %> method 2: <% classname obj = new classname(); obj.method(); %> can 1 please explain difference? which practice? in context method 1/method 2 relevant , not thank in advance method 1: the <jsp:usebean> standard action element used locate or instantiate javabean component. firstly <jsp: usebean> tries locate instance of bean class if found fine, if not instantiate class mentioned in class attribute. default object in page scope if scope attribute not specified.the name of bean same have given in id attribute of <jsp:usebean> . if object reference doesn't exist name have specify create instance , find scope of variable, class attributes defines bean class , type attribute defines parent class or interface of bean class. you can access be...

ms access - I get the following error "at most one record can be returned by this subquery" -

this code meant pull status projects, 2 recent dates , return projects 3 last report , recent report. keep getting error 1 record can returned sub query , query takes forever run. please help. select redprojecthistorical.[project name] ( select 'project name', max('report date') maxrd redprojecthistorical group redprojecthistorical.'project name' ) redprojecthistorical 3 = ( select t2.[internal project status value] redprojecthistorical t2 t2.[project name] = redprojecthistorical.[project name] , t2.[report date] = redprojecthistorical.maxrd ) , 3 = ( select top 1 t2.[internal project status value] redprojecthistorical t2 t2.[project name] = redprojecthistorical.[project name] , t2.[report date] <redprojecthistorical.maxrd order t2.[report date] desc ); ` try use exists condition this: exists(select 1 redprojecthistorical t2 t2.[project ...

php - simple_html_dom - read html page, two arrays -

this entire code // include scrapper include('simple_html_dom.php'); // connect page scrapping $html = file_get_html('http://www.niagarafallsreview.ca/news/local'); // make empty arrays $headlines = array(); $links = array(); // 'h' headings on page foreach($html->find('h1') $header) { $headlines[] = $header->plaintext; } // 'a' links start 'http://www.niagarafallsreview.ca/2016/04/' foreach($html->find('a[href^="http://www.niagarafallsreview.ca/2016/04/"]') $link) { $links[] = $link->href; } // trim headlines because 1 on top , bottom not needed $output = array_slice($headlines, 1, -1); // each header output nice list of headers foreach ($output $headers){ echo "< href='#'>$headers</a>" . "<br />"; } // make sure links unique , no doubles found $result = array_unique($links); // each link output in nice list foreach ($result $linkk){...

python - Use Panda's diff() against first column/row of data.frame -

assume have dataframe first column date , consecutive columns values adjusted on time. f.x. prognosis of wind specific date changes on time new information available. my task compute difference in regards first column. principle similar pandas.dataframe.diff reference value not preceding column first. so assuming dataframe looks this date forecast1 forecast2 forecast3 1/1/15 5 3 7 i want result this: date forecast1 forecast2 forecast3 1/1/15 nan -2 2 i hope explanation clear. thank efforts. just use pd.dataframe.sub : in [108]: df=pd.dataframe(np.random.randint(0,6,(3,3)), columns=['forecast'+str(i) in range(1,4)], index=pd.date_range('2016/1/1',periods=3)) in [109]: df out[109]: forecast1 forecast2 forecast3 2016-01-01 5 5 5 2016-01-02 0 3 0 2016-01-03 2 4 ...

bash - How to get the length of each word in a column without AWK, sed or a loop? -

this question has answer here: length of string in bash 8 answers is possible? have one-liner count number of words in file. if output have looks this: 3 abcdef 3 abcd 3 fec 2 abc this done in 1 line without loops , thinking if add column length of each word in column. thinking use wc -m count characters, don't know if can without loop? as seen in title, no awk, sed, perl.. old bash. what want: 3 abcdef 6 3 abcd 4 3 fec 3 2 abc 3 where last column length of each word. while read -r num word; printf '%s %s %s\n' "$num" "$word" "${#word}" done < file

java - PreInitialisation to initialisation error in Minecraft Forge -

i making mod , tried add crafting recipies. when tried launch it, crashed , left report. can please tell me need fix this? ---- minecraft crash report ---- // quite honestly, wouldn't worry myself that. time: 19/04/16 20:25 description: initializing game java.lang.stringindexoutofboundsexception: string index out of range: 5 @ java.lang.string.charat(unknown source) @ net.minecraft.item.crafting.craftingmanager.addrecipe(craftingmanager.java:232) @ cpw.mods.fml.common.registry.gameregistry.addshapedrecipe(gameregistry.java:250) at cpw.mods.fml.common.registry.gameregistry.addshapedrecipe(gameregistry.java:250) @ cpw.mods.fml.common.registry.gameregistry.addrecipe(gameregistry.java:245) @ com.abhijith.main.craftingmanager.addcraftingrec(craftingmanager.java:18) @ com.abhijith.main.craftingmanager.mainregistry(craftingmanager.java:13) @ com.abhijith.main.mainregistry.preload(mainregistry.java:23) @ lot of unneeeded lines follow... he...

.net - Editing Objects with PropertiesGrid (C#/WinForms) -

Image
i have class called ansfile wrote want make editable propertiesgrid. class has properties including list of ansjoints, class wrote. ansjoints class has property of type anspoint, third class wrote. i want able edit anspointof joint in ansfile's collection propertygrid. have form implemented: but anspoint property not editable. how can change anspoint class editable in grid? ansdistance source [typeconverter(typeof(expandableobjectconverter))] public class ansdistance { public double length { get; set; } //value of distance being stored public distancetype type { get; set; } //type of distance being stored public ansdistance() { this.length = 0.0; this.type = distancetype.inch; } public ansdistance(double passedlength, distancetype type = distancetype.inch) { this.length = passedlength; this.type = type; } public ansdistance(distance passeddistance, distancetype type = distancetype.inch) { ...

unicode - Understanding character encoding in PHP -

i struggling @ understanding character encoding in php. consider following script (you can run here ): $string = "\xe2\x82\xac"; var_dump(mb_internal_encoding()); var_dump($string); var_dump(unpack('c*', $string)); $utf8string = mb_convert_encoding($string, "utf-8"); var_dump($utf8string); var_dump(unpack('c*', $utf8string)); mb_internal_encoding("utf-8"); var_dump($string); var_dump($utf8string); i have string, € character, represented unicode code points. php 5.5 used internal encoding iso-8859-1 , hence think string encoded using encoding. unpack can see bite representation of string, , corresponds hexadecimal codes use define string. then convert encoding of string utf-8 , using mb_convert_encoding . @ point string displays differently on screen , byte representation changes (and expected). if change php internal encoding utf-8 , i'd expect utf8string displayed correctly on screen, doesn't happen. what mis...

date - Javascript calculate same weekday next year -

i have trouble calculate weekday of given date next year. example: tuesday, 19. april 2016 given date. calculate: tuesday, 18. april 2017. important weekdays same. my problem leap-years. hope me. $('.changeyear').click(function() { var appointments = []; (var = 1; <= 22; i++) { var date = $('#tr-fix-tag-' + i).val(); if (date !== "") { var splitteddate = date.substr(5).split('.'); appointments.push(new date(splitteddate[2], splitteddate[1] - 1, splitteddate[0])); } } var counter = 1; $.each(appointments, function() { var field = $('#tr-fix-tag-' + counter); var date = $(this)[0]; var newdate = new date(date.setfullyear(date.getfullyear() + 1)); if (isschaltjahr(newdate.getfullyear())) field.val(formatdate(new date(newdate.setdate(newdate.getdate() - 2)))); ...

sql server - SQL efficient solution for mutilple joins (could be 10 joins) on same table (lookup table) -

we've implemented lookup table contains id , text field. table consists of lookupid different field values. example... table tableid, statusid, typeid, docid values this 1, 2, 3, 4 lookuptable lookupid, text values this 1, somevalue 2, status text 3, type text 4, document text what need know if efficient solution query on these tables (creating sql view of data text displayed instead of id) select t.tableid, l1.text statustext, l2.text typetext, l3.text doctext table t left join lookuptable l1 on l1.lookupid = t.statusid left join lookuptable l2 on l2.lookupid = t.typeid left join lookuptable l3 on l3.lookupid = t.docid ... or subqueries work better solution? this. select t.tableid, (select l.text lookuptable l l.lookupid = t.statusid) statustext, (select l.text lookuptable l l.lookupid = t.typeid) typetext, (select l.text lookuptable l l.lookupid = t.docid) doctext table t ... or there better solution? keep in mind joined 3 times exam...

c - Segment Fault (Core Dump) Error -

#include<stdio.h> #include<stdlib.h> #include<string.h> void stringreverse(char* s){ char tmp; int = 0; int j = (strlen(s)-1); while(i>=j){ tmp = s[i]; s[i] = s[j]; s[j] = tmp; i++; j--; } } int main(int argc, char* argv[]){ file* in; /* file handle input */ file* out; /* file handle output */ char word[256]; /* char array store words input file */ /* checks command line has correct number of argument */ if(argc !=3){ printf("usage: %s <input file> <output file>\n", argv[0]); exit(exit_failure); } /* opens input file reading */ in = fopen(argv[1], "r"); if(in==null){ printf("unable read file %s\n", argv[1]); } /* opens ouput file writing */ out = fopen(argv[2], "w"); if(out==null){ printf("unable read file %s\n", argv[2]); exit(exit_failure); ...

Best merge or join function in r -

this question has answer here: how join (merge) data frames (inner, outer, left, right)? 12 answers i have 2 dataframes df1 , df2. both have common identifier column. df1 has unique lines each identifier. has identifier values not in df2. df2 has multiple lines each identifier value. i want merge 2 preserve number of rows of df2, map (repeating) relevant id rows df1 df2. is best use merge or join or else? arguments? thanks :) without input data, hard provide working code. but, dplyr package's join functions super efficient kinds of joins. in case, can try like: library(dplyr) newdf <- left_join(df1, df2) this keep id's in df1, while retaining duplicate rows in df2 long common column filed matches.

jquery - Dropdown doesnt refresh in angular js -

i have 2 drop downs when select first drop down second drop down should load based on selection. doing in angular js. used watch event load drop down event angular.module('myapp', ['']).controller('qmesaures', function ($scope) { $scope.$watch('ddldepartment', function (newval) { var departmentname = newval.departmentname $.ajax({ type: "post", data: json.stringify({ departmentname: departmentname }), url: "/qreport/getproviders", contenttype: "application/json; charset=utf-8", success: function (data) { alert(data); $scope.$apply(function () { $scope.providers = data; }); } }); }); }); <div ng-app="myapp" ng-controller="qmesaures"> <select ng-model="ddlpro...

python - Does multiple assignment make may code slower? -

my question simple one. using multiple assignments make code slower ? (even if slower, worth considering ? ) i need performance code. assignment in loop possibly executed many times. i made quick check of things. , not sure how analyse these results or conclusion should derive them. let me put here you. import timeit print(timeit.timeit("a = 1; b = 2", number=100000)) print(timeit.timeit("a = 1; b = 2", number=100000)) print(timeit.timeit("a = 1; b = 2", number=100000)) print print(timeit.timeit("a, b = (1, 2)", number=100000)) print(timeit.timeit("a, b = (1, 2)", number=100000)) print(timeit.timeit("a, b = (1, 2)", number=100000)) print print(timeit.timeit("a = (1, 2) ;b =a[0] ;c = a[1]", number=100000)) print(timeit.timeit("a = (1, 2) ;b =a[0] ;c = a[1] ", number=100000)) print(timeit.timeit("a = (1, 2) ;b =a[0] ;c = a[1] ", number=100000)) gives: 0.00271645813545 0.0031625012...

sql - mysql outer join - returning a complete list of records that don't always have entries in a correlated table -

this in mysql v. 4.x... i'm sure rookie question reason can't figure out sql work. here approximation of relevant tables: item --- itemid etc. itemperson -------- personid itemid timeaccessed let's have item id's of 1,2,3,4,5 let's have 1 record in itemperson: {'johndoe',1,'12:00pm'} i have personname input. want returned list of items, including time item accessed. if item not accessed given personname, want null time. i've tried following: select i.*, ip.timeaccessed item left outer join itemperson ip on i.itemid = ip.itemid (ip.personname = 'johndoe' or ip.personname null) i expected results 'johndoe'... items returned , itemid 1 has time. if change 'johndoe' 'janedoe', itemid's 2-5 want query return items, null times. left joins can tricky in these circumstances. you'll want move person condition on clause; otherwise getting items associated person or no 1 @ all. (lo...

Service Fabric spawn actor on startup -

is there way require system spawn actors on startup. currently activate set of actors need in program.cs after actor registration. this working ok, reminderloadinprogressexception because actor being activated needs register reminder not reminders have been loaded @ time tries that. is there standard way seed cluster? no, need activate actors. program.cs isn't best place because execution doesn't line service's lifecycle, you've noticed. if need activate actors when actor service starts up, place in runasync method of actor service. can customize actor service writing service derives it, same when write stateful service: edit: make sure call , await base.runasync() first! class myactorservice : actorservice { public myactorservice(statefulservicecontext context, actortypeinformation typeinfo, func<actorbase> newactor) : base(context, typeinfo, newactor) { } protected async override task runasync(cancellationtoken c...

ios - Objects not showing up in simulator -

i haven´t had issues before when drag , drop object viewcontroller not show in simulator if create programmatically works. tried restarting xcode, clearing auto layout , uninstalled app simulator without success. is there sort of global setting might have touched not enabling auto layout? checked view hierachy , saw object not there, when took in preview there. make sure set constraints correctly. see if there underlying problem simulator, place object in upper left-hand corner of view controller, clean (command - shift - k) , run (command - r) project.

two's complement concept of 1000(Binary) -

in two's complement suppose have 0000 1st step invert so, 1111 2nd step add 1 therefore, 10000 goes 5th bit , not anymore in nibble how keep in 4 bits -8(i.e. 1000 )?

javascript - How to change style of elements that aren't "(obj)" -

i have multiple items in row want change style of border based on selection. here html of row , of items in it: <div class="items"> <ul> <li class="item-hold"> <span class="item icon64x64"> <img class="item-img icon64x64" src="css/img/3001.png" alt="abyssal scepter" id="as"> </span> </li> <li class="item-hold"> <span class="item icon64x64"> <img class="item-img icon64x64" src="css/img/3020.png" alt="sorcerer's shoes" id="ss"> </span> </li> <li class="item-hold"> <span class="item icon64x64"> <img class...

php - Different host and routes in Symfony witho JMS i18n -

i want different host , different routes in multicountry web symfony 3. used jms i18n routing this. config yml file: jms_i18n_routing: default_locale: es_es locales: [es_es, fr_fr, en_gb] strategy: custom hosts: es_es: www.aaa.local fr_fr: www.aaa-fr.local en_gb: www.aaa-uk.local redirect_to_host: true with this, can use different host correctly, don't know how can "translate" routes, f.ex: /contacto /contact , /contact . i want load differents routing.yml depends on locale. when using jmsi18nroutingbundle routes being translated automatically based on route_name using routes domain (symfony translation component). so, assumed route_name contact, create translations this: id/source: contact domain: routes locale: en translation/target: /contact id/source: contact domain: routes locale: es translation/target: /contacto now routes using symfony router (which wrapped 1 bundle) return automatically tra...

java - How would I incorporate a tie counter in my tic tac toe code? I would like to put it at the end of my program -

this tic tac toe.i have method checks winner , go in there. think need search numbers on game board , if remain not tie , if there remain tie. public class tictactoe { //beginning of tictactoe static string[][] board = new string[3][3]; public static void main (string [] args) { // main routine string move; //user input string marker = "o"; //the character/marker starts @ o , switches x // asigning variables boolean computer = false; boolean done = false; boolean playagain = true; int wins[] = {0,0,0};//1st. p1 wins, 2nd. p2/comp wins, 3rd. ties system.out.println("do want play against computer (y/n)? typing no give 2 player board."); computer = textio.getlnboolean(); //option , input player 1 gets choose if want play against computer or player2 { //beginning of play again loop fillarrays();// fills arry values printboard(); // prints board { //beginning of loop runs board marker = switchmarker(marker); // turns o x { // error check...

.net - Search for a file in a specific directory C# -

this question has answer here: unauthorizedaccessexception cannot resolve directory.getfiles failure [duplicate] 7 answers searching file in directories recursively 8 answers i attempting(without luck) search specific file if exist in particular directory. for example: search test.txt if resides within directory structure of testfolder(does not have in testfolder have in 1 of subfolders of testfolder). location of testfolder not known. i have tried this, errors out when hits dir not have access too. string[] list = directory.getdirectories("c://", "testfolder", searchoption.alldirectories); the though find directory , search within directory file. any appreciated! the way describe should work (i.e. find directories , search within the...

c# - Get an Image that is the child of a Panel -

i have panel , added in window itemspanel of itemscontrol <grid x:name="outergrid" > <itemscontrol itemssource="{binding imagesourcescollection}"> <itemscontrol.itemspanel> <itemspaneltemplate> <view:custompanel /> </itemspaneltemplate> </itemscontrol.itemspanel> <itemscontrol.itemtemplate> <datatemplate> <image source="{binding}"/> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol> </grid> as can see in panel show series of images. works right, want access images inside custompanel change source 1 of them. if access them elements of base.children obtain contentpresenter, i.e.: var element = base.children[i]; //<- contentpresenter so question is: how can image? one solution, since know position of image, element @ position. pre...

android - Check which app is doing what -

is there way check app doing in android, application. mean if app reading call logs if app reading msg if app reading data server if app accessing gps, if app playing music please suggest idea, appreciated. the best can check if app has permissions required each task. following snippet retrieves permissions installed applications: packagemanager pm = getpackagemanager(); list<applicationinfo> packages = pm.getinstalledapplications(packagemanager.get_meta_data); (applicationinfo applicationinfo : packages) { log.d("test", "app: " + applicationinfo.name + " package: " + applicationinfo.packagename); try { packageinfo packageinfo = pm.getpackageinfo(applicationinfo.packagename, packagemanager.get_permissions); //get permissions string[] requestedpermissions = packageinfo.requestedpermissions; if(requestedpermissions != null) { (int = 0; < requestedpermissions.length; i++) { ...

apt - debianzing a python program to get a .deb -

aim to create installable .deb file(or package). when clicked install software on linux machine , icon put on gnome panel. launch application there. what have referred to i referred 2 debianizing guides. guide 1 guide 2 the first 1 had video impossible understand, partly because of accent , partly because hopelessly outdated.(it uploaded in 2007) and second 1 text. got till 4th step, builds package. when did got output did not match given in guide. what require i have simple python program. takes age , prints out if age below, equal to, or above 18 years. there 1 file , no other dependency program. , wanna build .deb . specs -python 2.7 -linux mint edit i followed exact directory structure instructed you. , replaced myscript cowsandbulls . build completed , got debian. when installed , ran command cowsandbulls terminal got following error: traceback (most recent call last): file "/usr/bin/cowsandbulls", line 9, in <module> load...

javascript - ng-if not catching updated $scope values -

i have been away angular 1.x long seem have forgotten important ng-if . have function updates scope value whenever carousel changes images tracking active index of carousel array. have ng-if set remove 1 element , insert when index reaches end of array, this: <span ng-if="activeindex < 4" class="back-button" ui-sref="app.profile.index({uid: user.uid})"> skip <i class="ion-chevron-right"></i> </span> <span ng-if="activeindex === 4" class="skip-button" ui-sref="app.profile.index({uid: user.uid})"> continue <i class="ion-chevron-right"></i> </span> but isn't working. believe ng-if creates new scope may why isn't catching updated values, if case, easy way update scope of ng-if ? or turned around? here's codepen showing problem: http://codepen.io/datatype_void/pen/zqjgor?editors=1001 ...

ios - Warning: Attempt to present View Controller on * which is already presenting <UISearchController: 0x142a1f7c0> -

i made view controller uisearchcontroller , uitableview . there 2 different kind of search can select search scope buttons : groups , people. both searches work , show results on table. however, if click on each cell should direct different dynamic pages (a dynamic group page or dynamic person profile page). 1 groups works, while 1 profiles doesn't. meaning whenever click on person cell results got, nothing happens , following warning printed on console : warning: attempt present <myproject.profileview: 0x13e9df000> on <myproject.searchpage: 0x142a1d8f0> presenting <uisearchcontroller: 0x142a1f7c0> if have idea why happening it'd appreciated if let me know. edit : here's function should link cell different view controllers : func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { if self.searchforgroups { let detailcell:pfobject = self.filteredgroups.objectatindex(indexpath.row) as! pfob...

cxf - Camel bean binding tries to convert the body to Exchange -

i have simple route looks this: <route handlefault="true" streamcache="true" id="routea"> <from uri="cxfrs://bean://simplecxf" /> <log message="the message body contains ${body}"/> <to uri="direct-vm:routeb" /> </route> <route handlefault="true" streamcache="true" id="routeb"> <from uri="direct-vm:routeb" /> <bean ref="requestvalidator" method="validaterequest" /> <log message="the input message ${body}" /> <bean ref="dbclient" method="querydatabase" /> </route> the cxf configuration pretty simple: <cxf:rsserver id="simplecxf" address="/test" loggingfeatureenabled="true" serviceclass="com.gogol.test.testresource"> </cxf:rsserver> this simple route fails below exception no ...

c++ While loops prints the couts twice -

in code, while loop prints cout twice when should print once, function's couts. don't understand why it's doing - supposed display what do? deposit withdraw cancel but, displays twice. while (yesno == 'y') { cout << "what do?" << endl << endl; menu(); getline(cin, bankchoice); if (bankchoice == "withdraw") { withdrawtotal = withdraw(bankamount); bankamount = withdrawtotal; cout << "you have $" << bankamount << " in account." << endl; cout << "would else?" << endl << "y/n: "; cin >> yesno; } if (bankchoice == "deposit") { deposittotal = deposit(bankamount); ...

reporting services - how to make drop-down lists in sql report -

Image
could help, please? i'm confused bit feature find in vs , docs in advance your screenshot showing feature called drilldown . with this, can show or hide report items setting toggleitem property textbox outside of item scope. you can see more information @ books online: hiding , showing report items adding drilldown . add expand/collapse action item .

c# - Pull 14 Records From One List to Another -

i have following lists created below. rsicalclist populated want need pull first 15 skipping first item rsicalclist firstrsicalculationhistinfo. have attached attempt comes error. have attached error below. guidance on how achieve goal private class rsicalclist { public string rsicalcsymbol { get; set; } public datetime rsicalcdate { get; set; } public decimal rsicalcclosechange { get; set; } } private class firstrsicalculationhistinfo { public string firstrsisymbol { get; set; } public datetime firstrsicalcdate { get; set; } public decimal firstrsiclosechange { get; set; } } irstrsihistinfo = rsicalclist .select(x => new firstrsicalculationhistinfo { firstrsisymbol = x.rsicalcsymbol, firstrsicalcdate = x.rsicalcdate, firstrsiclosechange = x.rsicalcclosechange }) .orderby(x => x.firstrsiclosechange) .skip(1) .take(15); error error cs0266 cannot implicitly convert type 'system.collections.generic.ienumerable<aftertr...

Yii form validation: variable containing the error -

i'm using gridview form in yii. if have validation error example textfield, how can access variable stores fact of error? because change background color of grid based on this. have in gridview's column (because a little trick ): array( 'value' => 'chtml::textfield("orderproduct[$row][pcs]", $_post["orderproduct"][$row]["pcs"], array("id" => "orderproduct_" . $row . "_pcs", "style" => "width: 20px; "))', 'type' => 'raw', ), but think error should there somewhere, , should have id or something, can't find it. lot!

SQL - fetch records based on a condition of two columns -

i need fetch records order no = abc has more 1 tracking number in large table can that? i'll assume you're fetching records orders , "large table" trackingnumbers . can group by orderno in sub-query , refine sub-query using having clause. sub-query return orderno s in table more once. example: select orderno orders orderno in (select orderno trackingnumbers group orderno having count(*) > 1) to identify duplicates in single table (as mentioned in comments): select * orders group trackingnumber having count(*) > 1

Communicate an Arduino with python -

i trying communicate arduino using python. able connect using serial module. code: import serial while true: print "opening port" arduinodata = serial.serial("com7", 9600) print "the port open" while (arduinodata.inwaiting()==0): #i wait data print "there no data" print "reading data" arduinostring = arduinodata.readline() print arduinostring it seems hanging when want read data, in line says arduinostring = arduino.readline() . what problem? instead using while loop inside of main while loop can use if else statement. also, read data can use read function arduinodata.inwaiting() paramater : arduinodata.read(arduinodata.inwaiting()) . hope code you: arduinodata = serial.serial("com7", 9600) while true: if arduinodata.inwaiting() > 0: # check if there data available print "reading data" arduinostring = arduinodata.read(arduinodata.inwaiting()) '...

android - Xamarin:Different between ConnectivityManager.ConnectivityAction and BluetoothAdapter.ACTION_STATE_CHANGED -

i wanted know different between connectivityaction , action_state_change. at moment, having broadcastreceiver listen connectivityaction check wifi enable/disable state. in addition, used connectivityaction listen bluetooth enable/disable state. in action_state_change, can same detect enable/disable bluetooth checking intent state_on. the difference have between connectivityaction , action_state_change is: when register connectivityaction in onstart , unregister in onstop in activity, when user select enable/disable in setting screen, receiver still receive message. on other hand, if used action_state_change, if user select enable/disable in setting screen, broadcast receiver action_state_change won't receive message. what different between 2 action filter. connectivity_action - change in network connectivity has occurred. action_state_change - broadcast action: state of local bluetooth adapter has been changed. the first applies network change, second ...

c - Allegro 5 Keyboard Interfering on Mouse Position? -

i making simple game using c , allegro 5. hiding mouse , swapping custom mouse icon. cursor icon's position altered whenever mouse movement detected. what bothers me if, example, have mouse cursor @ coordinates mouse_x = 100 , mouse_y = 200, , press key on keyboard, mouse cursor teleported coordinates mouse_x = 0 , mouse_y = 0 while key being pressed. i have no clue happens, whenever uninstall keyboard using al_uninstall_keyboard(), error gone. this code: #include <stdio.h> #include <stdlib.h> #include <allegro5\allegro.h> #include <allegro5\allegro_image.h> #include <allegro5\allegro_primitives.h> #include <allegro5\allegro_audio.h> #include <allegro5\allegro_font.h> #include <allegro5\allegro_ttf.h> #include <allegro5\allegro_acodec.h> enum gamemode{menu, farmgame, stdend}; enum soil{normal, wet}; enum soil2{unplow, plow}; enum croptype{none, tomato}; typedef struct gdisp //game display { int width; int h...

asp.net - how to bind selectlist to value using json in javascript -

i'm new web application development , need bind values retrieved json object. tried several ways couldn't able bind values combo box. <script type="text/javascript"> var viewmodel = { checkin : ko.observable(), checkout: ko.observable(), lunch: ko.observable(), rest: ko.observable(), workonproject: ko.observable(), projects: ko.observablearray() }; this.getprojects = function () { $.ajax({ type: "post", url: 'timerecord.aspx/returncomplextype', data: {}, contenttype: "application/json; charset=utf-8", datatype: "json", success: function (arg) { (var = 0; < arg.d.length ; i++) { var value = arg.d[i].projectcode; var option = new option(arg.d[i].projectcode, arg.d[i].projectcode); select1.add(option, null); } }, ...

javascript - Expand Image to container width when moving to next line -

is there way make width of image, when transitions line take room possible? for example, if images displayed next each other, 1 of them drops next line, image on next line expands container's width. i believe saw being achieved flexbox can't remember how , if there's alternate ways it, i'm ears. fiddle: https://jsfiddle.net/jzhang172/6kpyhpbh/ body,html{ padding:0; margin:0; } *{ box-sizing:border-box; } .grid img{ float:left; height:100px; } .grid{ display:flex; flex-grow:2; flex-wrap:wrap; } <div class="grid"> <img src="http://www.keenthemes.com/preview/metronic/theme/assets/global/plugins/jcrop/demos/demo_files/image1.jpg" alt=""> <img src="http://www.keenthemes.com/preview/metronic/theme/assets/global/plugins/jcrop/demos/demo_files/image1.jpg" alt=""> <img src="http://www.keenthemes.com/preview/metronic/theme/assets/global/plu...