Posts

Showing posts from May, 2011

linux - How can i send command to screen using php? -

i'm using code send command via rcon game server, this library. this actual code: <?php require __dir__ . 'sourcequery/bootstrap.php'; use xpaw\sourcequery\sourcequery; define( 'sq_server_addr', 'my ip' ); define( 'sq_server_port', 27015 ); define( 'sq_timeout', 1 ); define( 'sq_engine', sourcequery::source ); $query = new sourcequery( ); try { $query->connect( sq_server_addr, sq_server_port, sq_timeout, sq_engine ); $query->setrconpassword( 'my pass' ); var_dump( $query->rcon( 'the command' ) ); { $query->disconnect( ); } ?> but example if want stop server can send command "quit" through rcon, how starting server? idea can send command once press button (the server on same machine website), piece of code not work: exec('screen -p 0 -s csgo -x eval \'stuff "./scds_run other para

cluster analysis - clustering on geo points using R -

i have set of lat, long points city. want cluster these points based on 500m radius or 1km radius using r. precisely, want find find out centroids points within 500m radius particular cluster. ps: 1.i have used k means. cant fix radius in k - means. 2. tried using leadercluster package in r. after map clusters points, , find distance centroid, found out there lot points tagged cluster more specified radius in leadercluster package. my question 1 in link: https://gis.stackexchange.com/questions/146701/convert-eps-to-geographic-distance-using-dbscan looking r solution please suggest nice way cluster these points based on radius. thanks in advance use hierarchical clustering. with maximum linkage, cut @ desired height, can ensure maximum distance in each cluster. with centroid linkage, distance center should bounded, may limited euclidean distances?

c++ - Deducing type of a global variable -

let's have global variable declared in header: extern long global_var; it reasonable let compiler deduce type when variable defined in source: auto global_var; i see @ least pros: avoiding code duplication, ie when change type in header not have change in source file less error prone, if variable not declared previously, not compile similar work static members of class. but not seem possible. there cons outweigh benefits? one way avoid having remember type name of global_var , still right type compiler use decltype . extern int global_var; ... decltype(global_var) global_var; the downside of approach you'll have make declaration of variable available compiler before definition. of course, works static member variables of classes too. see working @ http://ideone.com/w1wtov .

angular - angular2 cannot read property 'validator' of undefined when use ngFormModel (ES6) -

i got problem when use ngformmodel directive form said "typeerror: cannot read property 'validator' of undefined in form_one (i write code ng-book 2 tutorial it's not work!) import {component} 'angular2/core' import { form_directives, formbuilder, controlgroup, validators } 'angular2/common' @component({ selector: 'demo-form-sku-builder', directives: [form_directives], template: ` <div class="ui raised segment"> <h2 class="ui header">demo form: sku formbuilder</h2> <form class="ui form" [ngformmodel]="myform" (ngsubmit)="onsubmit(myform.value)"> <div class="field"> <label for="skuinput">sku</label> <input type="text" id="skuinput" placeholder="sku" [ngformcontrol]="myform.controls['sku']">

maven: building a war with uncompressed jars -

i trying have project packacking war jars uncompressed. thought done this: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <version>2.6</version> <configuration> <recompresszippedfiles>true</recompresszippedfiles> <archive> <compress>false</compress> </archive> </configuration> </plugin> however recompresszippedfiles parameter seems ignored, jars in web-inf/lib folder orginal, , compressed, ones (no matter if remove archive element or not). i know default of recompresszippedfiles true . no matter if specify or not, jars original ones. don't fresh ones. any ideas? i asked use case : war used on several machines virus scanners (e.g. kaspersky) looking every file, in archives. need redu

Error when building Mesos -

i've been trying build apache mesos on centos 7. when run make following error: downloading: https://repo.maven.apache.org/maven2/org/apache/apache/11/apache-11.pom [error] [error] problems encountered while processing poms: [fatal] non-resolvable parent pom org.apache.mesos:mesos:0.28.2: not transfer artifact org.apache:apache:pom:11 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: unknown error , 'parent.relativepath' points @ no local pom @ line 18, column 11 @ [error] build not read 1 project -> [help 1] [error] [error] project org.apache.mesos:mesos:0.28.2 (/home/mesos-0.28.2/build/src/java/mesos.pom) has 1 error [error] non-resolvable parent pom org.apache.mesos:mesos:0.28.2: not transfer artifact org.apache:apache:pom:11 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: unknown error , 'parent.relativepath' points @ no local pom @ line 18, column 11: unknown host repo.maven.apache.org:

netbeans - Getting a running error while running some code to import X3D into Java -

i'm trying make project loads x3d files java , java display them, i'm using xj3d when run code, seem getting error. i've downloaded jars listed here . i've made library that's called 'xj3d' , in project properties, in libraries section, i've put xj3d library , in vm options, i've put -xmx450m -djava.library.path='c:\users\matt\downloads\xj3d-sai_2.0.0.jar' , code have in java is: package xj3dtest; import java.awt.borderlayout; import java.awt.component; import java.awt.container; import static java.lang.boolean.true; import javax.swing.jframe; import org.web3d.x3d.sai.browser; import org.web3d.x3d.sai.browserfactory; import org.web3d.x3d.sai.x3dcomponent; import org.web3d.x3d.sai.x3dscene; import java.util.hashmap; public class xj3dtest extends jframe { public xj3dtest(string title) { super(title); setdefaultcloseoperation(jframe.exit_on_close); // setup browser parameters hashmap requestedpara

c - How to share a linked list to all process with MPI -

im kinda new mpi , im having troubles this. lets have list struct list{ int number; int process; list *next; } i created linked list in main process, dont know how send linked list process every process can operation in portion of list. if manually send list around, have traverse , send each , every element of queue, creating massive communication overhead. the best way convert list contiguous array of structs , distribute processes via mpi_scatter (or mpi_scatterv if size of list not divisible number of ranks). if must, can locally convert linked list on each rank. without knowing rest of program i'd there strong chance using linked list bad choice anyway , should use array data in first place.

ios - UIButton in PaintCode (Swift) -

so i've been playing around paintcode , stylekits in xcode. made button, created uiview it's own subclass, , shows fine in viewcontroller , on device. however, want transform uiview uibutton, want code execute when it's tapped. how go doing this? thanks guys , have 1 :) i use paintcode's uiimage method, , use uiimage uibutton's image. here's code use, in objc, should converted swift. paintcode's generated code - stuff don't need write (pretend class called paintcodeclass): + (uiimage*)imageoficon { if (_imageoficon) return _imageoficon; uigraphicsbeginimagecontextwithoptions(cgsizemake(30, 30), no, 0.0f); [paintcodeclass drawicon]; _imageoficon = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return _imageoficon; } and code: uiimage *image = [paintcodeclass imageoficon]; uibutton *button = (initialize, set frame, etc) [button setimage:image forstate:uicontrolstatenormal]

.net - Checking the datatype in every line in vb.net -

i want know how possible check type of data ( integer / char ) first letter in every line of inputfile is. wasn't able find answered question, because didn't know how i'm supposed search after this. for example in inputfile built this: birthdate;name 19920711;john 19801106;alex 19950327;sam now want filter out dates without names , headline. how possible?. you can use char.isdigit , or char.isletter for example: using sr new streamreader("c:\myfile") until sr.endofstream dim line = sr.readline if line.length > 0 if char.isletter(line(0)) debug.writeline("first char letter") elseif char.isnumber(line(0)) debug.writeline("first char number") end if end if loop end using

javascript - How to animate a child element with dynamic width content to the center of its parent div, jquery, greensock, css -

i trying animate child span center of parent container regardless of width of span. below code: html <div class="btn btn--large "> <a href=""> <span> next case study </span> </a> </div> css .btn { display: inline-block; text-transform: uppercase; position: relative; letter-spacing: 1px; font-size: 13px; border: 2px solid #0c315d; } .btn--large { padding: 16px 60px 16px 16px; display: block; } .btn span { font-weight: 700; position: relative; } jquery greensock jquery(document).ready(function($) { // vars $btnspan = $('.btn span'); // animate button text $(".btn a").bind("mouseenter",function(){ $(this).find($btnspan).stop(true, false).animate({left: 50% -$btnspan.width()/1.5, ease: "bounce",}, 600); }).bind("mouseleave",function(){ $(this).find($btnspan).s

spring - Calling service layer directly from main class -

i have project structure controller -> response builder -> service layer. here service layer call repository layer(database layer). everything ok when follow structure. but,for testing want call service layer directly java main class. how can this?????? my controller: @restcontroller @requestmapping("/ishmam") public class ishmamaddresscontroller { @autowired @qualifier("ishmamaddressbuilder") ishmamaddressbuilder ishmamaddressbuilder; @requestmapping("/getaddress") public iresponsedto<webbcustomeraddressdto> getalladdress(){ return ishmamaddressbuilder.getalladdress(); } } my builder class is: @component("ishmamaddressbuilder") public class ishmamaddressbuilder { @autowired @qualifier("ishmamaddressserviceimpl") ishmamaddressinterface ishmamaddressservice; public iresponsedto<ishmamaddressresponsedto> getalladdress(){ iresponsedto<webbcusto

Chrome Extension error: “Unchecked runtime.lastError while running browserAction.setIcon: Icon invalid." -

i trying change chrome extension icon dynamically following documentation . unfortunately, not working following code: chrome.browseraction.seticon({path: 'my_icon.png'}); in console, failing following error: unchecked runtime.lasterror while running browseraction.seticon: icon invalid. after reading elsewhere on web, found need specify images size either (or both) of 19x19 px or 38x38 px . so resized icon image, , made 2 copies of follows: my_icon-19.png my_icon-38.png now when tried following code, worked expected: chrome.browseraction.seticon({ path: { "19": "/images/my_icon-19.png", "38": "/images/my_icon-38.png" } }); you not need both of versions make work, following work well: chrome.browseraction.seticon({ path: "/images/my_icon-38.png" });

ios - How to remove SFSafariViewController as a child view controller correctly? -

i using technique provided this answer preload url in sfsafariviewcontroller this: addchildviewcontroller(svc) svc.didmovetoparentviewcontroller(self) view.addsubview(svc.view) and try remove safari view controller following code: svc.willmovetoparentviewcontroller(nil) svc.view.removefromsuperview() svc.removefromparentviewcontroller() now can preload url , show safari view without problem. however, after repeat process (preload/show/remove) several times (probably 30+ times) , app crash due memory issue because log shows memory level not normal or app killed jetsam when app crashes. before crash, saw logs possible-leak warnings: <warning>: notify name "uikeyboardspringboardkeyboardshow" has been registered 20 times - may leak <warning>: notify name "com.apple.safariviewservice-com.apple.uikit.viewservice.connectionrequest" has been registered 20 times - may leak am doing correctly when removing safari view controller? missing somet

performance - Python - Print script running time: each 1 or 10 minute -

i'm running scripts take 10-80 minutes. able print script running time each 1/5/10 minutes ( choose). for example have script i'm creating tables , inserting data db , want measure time through script. so lets have printing msgs "table 1 has been created" , "data inserted table 2" etc. between msgs want add like: the script running 1 minutes the script running 2 minutes the script running 3 minutes etc... someone know best practice ? thanks in advance ! you can use datetime : from datetime import datetime #at start of script: start_time = datetime.now() # ... stuff ... # when want print time elapsed far: now_time = datetime.now() print(now_time - start_time) (of course can reformat printing wish)

MySQL alternative to union? -

i'm trying think of alternative method use instead of union . i have 20 queries this, plan connect via union , prevent multiple mysql connections. $data = $db2->query("select parent.*,link.tag_id tag_id items parent join relations link on link.item_id=parent.id join tags child on child.id=link.tag_id child.handle='$handle' limit ".$limit.",1"); instead of doing query 20 times , connecting them via union , there alternate method simplify full query or union best method? both handle , $limit dynamic each select query. how solve? alternatively, instead of using limit $data = $db2->query("select parent.*,link.tag_id tag_id items parent join relations link on link.item_id=parent.id join tags child on child.id=link.tag_id child.handle='$handle' , parent.`no`='$limit' limit 1"); if don't have different limit amoun

javascript - Angularjs Cannot read property 'id' of undefined -

i new angularjs, i'm trying create webapp can access data server , post data server. i'm facing issues, did in application, have created module,service,view , controller in separate files. i'm unable access , post data server. can me. home.js(controller file) var myapp = angular.module('demo').controller("homecontroller", function($scope,myservice){ var userarray = { id:$scope.user.id, model:$scope.user.model, name:$scope.user.name, color:$scope.user.color, price: $scope.user.price }; myservice.async().then(function(d){ $scope.hello=d; }); $scope.push = function(userarray){ myservice.saveuser(userarray).then(function(response){ console.log("inserted"); }); } }); userservice.js(service file) myapp.factory('myservice',function($http){ var myservice={ async : function(){ var promise= $http.get('http://jsonplaceholder.typicode.com/posts/1').then(function(response){ cons

java - Filter nullable values from stream and updating nullable property -

if have stream<@nullable object> , can filter null-elements that: stream<@nullable object> s = str.filter(objects::nonnull); this, however, returns stream of nullable objects. there elegant way return stream of nonnull elements? @ place know elements can't null. this i've come with, it's long, imo: stream<@nonnull object> s = str.map(optional::ofnullable).filter(optional::ispresent).map(optional::get) (this implies optional::get return nonnull-values) well, solutions based on optional or objects assume checker knows semantics of methods, don’t have explicit annotations. since filter never changes type, require deep support checker model stream<@nullable x> → stream<@nonnull x> transition, if understands semantics of filter function. the simpler approach use map allows changing element type: stream<@nonnull object> s = str.filter(objects::nonnull).map(objects::requirenonnull); here, filter operation ens

Getting console error : mysql_real_escape_string() when used ignited datatable codeigniter -

this console error got mysql_real_escape_string(): mysql extension deprecated , removed in future: use mysqli or pdo instead. error got in datatable library file.anybody knows issue? my controller public function manageuser() { $tmpl = array ( 'table_open' => '<table id="big_table" border="1" cellpadding="2" cellspacing="1" class="mytable">' ); $this->table->set_template($tmpl); $this->table->set_heading('first name','last name','email'); $this->load->view('moderator/manageuser'); } public function datatable() { $this->datatables ->select("mro_id,mro_name,mctg_name,mctg_id") ->from('jil_mroproducts') ->join('jil_mrocategory', 'jil_mroproducts.mro_category=jil_mrocategory.mctg_i

Android Studio Method doc for jar file -

i created jar file using android studio exposing methods , using jar file in android project. accessing method when type first letter of method, android studio intellisense shows me different option of method names along parameters expected these methods. parameters names appear (string s1, string s2) , on instead of original parameters (string name, string address) not gives proper meaning. can change behavior?

Downloading zip file from website using excel vba (if also able to extract the csv from zip file and open it in excel, then even better) -

after quite searching i've not been able make macro download .zip file specific website. mean i've been able find similar problems have not been able apply changes necessary in order problem solved. website contains zip files is: https://nio.gov.si/nio/data/prvic+registrirana+vozila+v+letu+2014+po+mesecih , under table header "priponke" files. example: december 2014 (959 kb), november 2014 (1061 kb), ... url downloads zip file december 2014 "cms/download/document/a7605005b6879fe5f7dbab6d60d4ae787dbced6b-1422453741279". thank in advance , awaiting reply. my current code is: public sub downloadfile() dim objwhttp object dim strpath string dim arrdata() byte dim lngfreefile long on error resume next set objwhttp = createobject("winhttp.winhttprequest.5") if err.number <> 0 set objwhttp = createobject("winhttp.winhttprequest.5.1") end if on error goto 0 strpath = "https://nio.gov.si

triggers - How to update the owner name in custom object based on the mobile no -

i need update owner name based on mobile no present in custom object. in custom object have field called "referral id". it's contain mobile no,the mobile no present in user details.in custom object need change owner name based on referral id(name). for example custom object created myself put referral id manager mobile automatically change lead owner manager not me. i try following trigger trigger ownerupdate on broker__c (before insert,before update) { //instantiate set hold unique deployment record ids set<id> deplomentids = new set<id>(); for(broker__c s : trigger.new) { deplomentids.add(s.referral_id__c); } //instantiate map hold deployment record ids corresponding ownerids map<id, referral_id__c> deploymentownermap = new map<id, referral_id__c>([select id, phone user id in: deplomentids]); (broker__c s : trigger.new) { if (s.owner__c == null && deploymentownermap.conta

multithreading - Python: what did I wrong with Threads or Exceptions? -

i have following function: def getsuggestengineresult(suggestengine, seed, tablename): table = gettable(tablename) keyword_result in results[seed][suggestengine]: = 0 while true: try: allkeywords.put_item( item={ 'keyword': keyword_result } ) break except provisionedthroughputexceededexception pe: if (i > 9): addtoerrortable(keyword_result) print(pe) break sleep(1) = + 1 print("provisionedthroughputexceededexception in getsugestengineresult") the function gets started in more 1 thread. have process , if process works, function should ready in thread. otherwise should try again 9 times. problem: "print("provisionedthroughputexceededexception in getsugestengineresult&qu

docker build with Dockerfile, but the image has no name or tag -

i installed docker mac , version 1.12.0-rc4-beta19 when use docker build -t self/centos:java8 . the image has no name or tag repository tag image id created size <none> <none> 1581ffcbfd7f 5 minutes ago 196.8 mb what's wrong build command? is image building correctly? name not set when there error in build. because every step in build new image created , error won't last step correctly named image btw can set manually tag command https://docs.docker.com/engine/reference/commandline/tag/

windows - Excel VBA to get UNC from cell and open it in explorer.exe -

i have file list of pc hostnames want able connect c drive of specific 1 clicking in cell or button or something. let's have hostname in column a. use concatenate turn proper network path \\hostname\c$ , put in column b. now how can make can click on cell in column b open location in explorer.exe? have 450 pcs need able specify range, feed network path vba , open in explorer.exe make sense? :p would really, appreciate help. thanks. wrap concatenated value in "hyperlink()". on clickable , open explorer. =hyperlink(concatenate("\\";a1;"\c$");a1) or put code in worksheet code pane , double click cells, links stand. mustnt use in combination hyperlink. private sub worksheet_beforedoubleclick(byval target range, cancel boolean) if target.column <> 2 exit sub dim sh object set sh = createobject("wscript.shell") sh.run ("explorer " & target.value) cancel = true end sub

OpenCV C++ ,Collision for Retangle and line -

Image
please click! image pedestrians , line hello, guys guys can see pedestrians rectangle , line middle on video. used cascade training detecting pedestrian.(cascadeclassifier). i want detect collison rectangle(pedestrian) , line. when collision detected, want change rectangle's color. here code wrote. please check , let me know how detect collsion. i'm using c++ , opencv 2.4.9. appreciate. cv::size min_obj_sz(47,65); cv::size max_obj_sz(80,100); int width,height; cv::mat frame,gray_frame; __int64 freq,start,finish; ::queryperformancefrequency((_large_integer*)&freq); videocapture >> frame; frameimage = imageformat::mat2qimage(frame); origin_videoframelabel->setpixmap(qpixmap::fromimage(frameimage)); cvtcolor(frame, gray_frame, cv_bgr2gray); ::queryperformancecounter((_large_integer*)&start); cv::vector<cv::rect> found; detector.detectmultiscale( gray_frame, found, 1.1, 1, cv_haa

android - Fragment.replace doesn't remove one fragment, works with multiple others -

Image
edit: problem below occurs on samsung galaxy s3, however, when run same app on sony xperia z3+ doesn't display wifi list @ all. :-/ i have weird situation app. have 5 different fragments. of them work expected when doing fragmenttransaction s except one. initially, when started app used 1 of android studio templates, seemed serious overkill used fragments instead of listview listing wifi items. it's been while since i've developed android, i'm playing catch-up. i left code in place , carried on developing interface. trouble came along when decided remove code populated main container fragment "items" , replace fragment containing listview . all fragments work expected , replaced expected when select new item menu except new listview fragment , remains in background once select it. after select it, if select other fragments change should, first 1 stays in place. the closest question i've found situation this one , didn't me. t

sql server - Is there a way to set my default as the number of seconds since 1970? -

in tables setting current date/time as: [modifieddate] datetime default (getdate()) not null, but there way set number of seconds since 1970. unix epoch (or unix time or posix time or unix timestamp) number of seconds have elapsed since january 1, 1970 i realize need have field integer not sure how set default value? though suggest it's better store datetime2 value or datetime , can use alex k's suggestion: declare @t table ( unixtime int default(datediff(second, '1970-01-01 00:00', getdate())), createdate datetime default(getdate()) ) test: insert @t default values select * @t result: unixtime createdate ----------- ----------------------- 1468930170 2016-07-19 12:09:30.380 another option, damien_the_unbeliever suggested, use computed column: declare @t table ( createdate datetime default(getdate()), unixtime datediff(second, '1970-01-01 00:00',createdate) )

java - Howto extract data from the JSON body of REST request inside a WSO2 ESB Synapse handler -

i'm writing custom handler wso2 esb construct authentication credentials based on input request content. right have this: public boolean handlerequest(messagecontext context) { // todo: extract relevant information (clientid) json request body string clientid; map<string, string> headers = (map<string, string>) ((axis2messagecontext) context).getaxis2messagecontext().getproperty( org.apache.axis2.context.messagecontext.transport_headers); setauthorization(headers, clientid); return true; } i can't find documentation regarding howto access rest json request body inside synapse handler. ideas? possible define property before handler runs , capture string clientid = (string)context.getproperty("clientid") ? you can try following; // getting json payload string string jsonpayloadtostring = jsonutil.jsonpayloadtostring(((axis2messagecontext) context).getaxis2messagecontext()); // make json object jsonobject

configuration - How to apply Apache server config to multiple paths? -

i have set of apache configuration settings (in apache.conf) contained within <directory /srv/*/public> block intended apply public directory. however, of sites hosted on server, public directory nested 1 level deeper (so required path /srv/*/app/public ), , directives in directory block failing applied these, though i'd them be. i don't want duplicate contents of whole directory block (it contains quite lot of directives), can't find way apply 2 separate paths, , apache's docs suggest no use of wildcards can match paths of different depths (since * doesn't match / ). what's best way this?

php - cakphp 2.0 file browser/uploader with CKEditor -

Image
i using ckeditor in cakephp 2.0 application. have installed in app/webroot/js/ckeditor directory. ckeditor showing image upload option , configured these lines in config.js config.filebrowserimagebrowseurl = '/app/webroot/ckeditor/pictures/'; config.filebrowserimageuploadurl = '/app/webroot/ckeditor/pictures/'; now, image upload interface looks fine, when click on "send server" button, image doesn't upload folder path ? note :what next step upload images folder? you must link them uploder like this config.filebrowserbrowseurl = base_url + 'filebrowser/browse.php?type=files'; config.filebrowserimagebrowseurl = base_url + 'filebrowser/browse.php?type=images'; config.filebrowserflashbrowseurl = base_url + 'filebrowser/browse.php?type=flash'; config.filebrowseruploadurl = base_url + 'filebrowser/upload.php?type=files'; config.filebrowserimageuploadurl = base_url + 'filebrowser/upload.php?type=im

Session created by one project is also accessible by other project in PHP -

in 1 of project on localhost session created user login. stored in $_session['uname'] . other project using same session name variable. problem when have logged first project admin area , go other project admin area, doesn't ask me enter credentials login window; instead directly takes me admin panel. know happening due use of same $_session['uname'] in various projects. wondering how can force other project display log in window although have logged first project? it might possible other project has different login credentials never offer me login screen if have logged first project. i thinking how professional websites keep session name unique other can never use it? in case session name accessible everywhere. looks using localhost every projects in local. create separate virtualhost each project, session unique each project - cookie's domains different. if want keep localhost (i'd not recommend), should think namespace session of eac

save - How to invoke Ctrl + S by code in a Form? -

i need invoke code control ctrl + s , it's possible? look element.task(2839) ctrl + f5 . thanks all, enjoy! look in \macros\task . it's #tasksave . as fh-inway said, it's 272. #task element.task(#tasksave)

visual foxpro - VFP. Deleted records – indexing - re-creation of records -

i have table of sales order lines (sdetail); there index on records candidate index key of order reference plus str( line number). used retrieving lines of particular order. there primary index on sdetail table sequential id. the order may amended. if order line deleted user mark record deleted in table; when processing run set deleted on, user not see these deleted records. if re-creates line, liable create error ‘uniqueness of index violated’ understand that. avoid creating error, can see 2 possible approaches : either : include filter expression on index ‘for !deleted()’ these records invisible @ run time or : when wish test existence of record particular line, set deleted off, test existence of record, , recall if necessary. revert set deleted on. what other developers do? or there better way? thank you there isn't 1 rule carved in stone. recalling 1 of ways use (i seldom need recall). don't !deleted() type indexes (if use create bit

css - What's a @media rule without a media type do? -

i inherited , wondering media query without "media type" do? @media (min-width: 768px) { .commentlist-item .commentlist-item { padding: 0 0 0 2em; } } standard syntax per www.w3schools.com/css/css3_mediaqueries.asp @media not|only mediatype , (expressions) { css-code; } if media type not explicitly given all . ~ w3c media queries in other words, @media rule without media type shorthand syntax, all implied. more spec: 2. media queries a shorthand syntax offered media queries apply media types; keyword all can left out (along trailing and ). i.e. if media type not explicitly given all . example 5 i.e. these identical: @media , (min-width: 500px) { ... } @media (min-width: 500px) { ... } as these: @media (orientation: portrait) { ... } @media , (orientation: portrait) { ... } ... example 7 i.e. these equivalent: @media { ... } @media { ... } source: https://www.w3.o

android - Can,t access selectedCategoryId value outside the method -

im getting value selectedcategoryid defined in select method, in method initcat, getting 0 value selectedcategoryid, there way value 1 method method in same class, me out here code package com.panaceasoft.mypack.fragments; public class businessregisterfragment extends fragment implements view.onclicklistener { private arraylist < pcitydata > cityarraylist; private arraylist < psubcategorydata > subcatarraylist; private arraylist < pcitydata > citydataset; public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment view = inflater.inflate(r.layout.fragment_business_register, container, false); initdata(); initui(); initcat(); return view; } private void initdata() {} public void initui() { citypopupcontainer = (linearlayout) view.findviewbyid(r.id.choose_city_container); citypopupcontainer

javascript - How to get source code of html page -

this link example of edit source code: http://neokoenig.github.io/jquery-gridmanager/demo/tinymce.html the button value </> . he code html if changes content of grid. how source code html using javascript or jquery? thanks. you can use html method jquery, i.e whole page html this: $( document ).ready(function() { console.log($("html").html()); })

android - BroadcastReceiver java.lang.ClassNotFoundException -

i try show simple toast message on phone startup. wasted day trying figure out why code did not work. here full error: unable instantiate receiver com.debug.receivebootcomplete.debug.broadcastreceiverclass: java.lang.classnotfoundexception: com.debug.receivebootcomplete.debug.broadcastreceiverclass manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versioncode="1" android:versionname="1.0" package="com.debug.receivebootcomplete.debug"> <uses-sdk android:minsdkversion="10" /> <uses-permission android:name="android.permission.receive_boot_completed" /> <application android:allowbackup="true" android:icon="@mipmap/icon" android:label="@string/app_name"> <receiver android:name=".broadcastreceiverclass" android:exported="true

angularjs - show progress when httprequest in Angular -

i've created (using plunkers other users) feature users can search movie title causes app httprequest themoviedb.org , serve results in list. using promise images served @ once dodging waterfall effect , shows "loading" update while images getting being served browser. http://plnkr.co/edit/y01giyn9e3g92kjvekua?p=preview pretty great. it's not enough! want show users progress of search action. prefered method show progress bar fills during httprequest i'm having trouble getting started. this controller: angular.module("app", []) .controller("main", ["moviesearchfactory", "$scope", "$q", function(moviesearchfactory, $scope, $q) { $scope.createlist = function(searchquery) { $scope.loading = true; moviesearchfactory.getmovies(searchquery) .then(function(response) { $scope.movies = response; $scope.images = []; $scope.movies.foreach(function(movie)

ios - UICollectionview Reuse Existing cell -

i want generate collectionview 100 number of cells, should not reallocate @ every time of scrolling, in code creating cells newly. any 1 me avoid issue, please find code below, func collectionview(collectionview: uicollectionview, numberofitemsinsection section: int) -> int { return colorarray.count } func collectionview(collectionview: uicollectionview, cellforitematindexpath indexpath: nsindexpath) -> uicollectionviewcell { let collecell: colorcell = collectionview.dequeuereusablecellwithreuseidentifier("cell", forindexpath: indexpath) as! colorcell collecell.bgcolor.backgroundcolor = uicolor(red: colorarray[indexpath.row].valueforkey("red") as! cgfloat/255, green: colorarray[indexpath.row].valueforkey("green") as! cgfloat/255, blue: colorarray[indexpath.row].valueforkey("blue") as! cgfloat/255, alpha: 1.0) return collecell } func collectionview(collectionview: uicollectionview, didselectitematindexpat

sql server - SQL querying data -

i have data set - names of companies (very long list). task go through list , check if company exist in our databases (db) , retrieve relevant information then. list external, data dirty , e.g. star ltd in list , star in db. run sql query using clause like . my problem - process slow if query 1 name one. possible automate process going through list? practical ideas? example: enter image description here data excel , compared data in sql.

c++ - TensorFlow, why was python the chosen language? -

i started studying deep learning , other ml techniques, , started searching frameworks simplify process of build net , training it, found tensorflow, having little experience in field, me, seems speed big factor making big ml system more if working deep learning, why python chosen google make tensorflow? wouldn't better make on language can compiled , not interpreted? what advantages of using python on language c++ machine learning? the important thing realize tensorflow that, part, the core not written in python : it's written in combination of highly-optimized c++ , cuda (nvidia's language programming gpus). of happens, in turn, using eigen (a high-performance c++ , cuda numerical library) , nvidia's cudnn (a optimized dnn library nvidia gpus , functions such convolutions ). the model tensorflow programmer uses "some language" (most python!) express model. model, written in tensorflow constructs such as: h1 = tf.nn.relu(tf.matmul(l1,

ios - Background Location Update Not Working -

i trying implement background fetch location, works perfect inside of ios simulator, when build on phone, not appear work. here current code: import uikit import corelocation class currentconditonsviewcontroller: uiviewcontroller, cllocationmanagerdelegate { lazy var locationmanager: cllocationmanager! = { let manager = cllocationmanager() manager.desiredaccuracy = kcllocationaccuracyhundredmeters manager.delegate = self manager.requestalwaysauthorization() manager.distancefilter = 2000 if #available(ios 9.0, *) { manager.allowsbackgroundlocationupdates = true } else { // fallback on earlier versions }; return manager }() var seenerror : bool = false var locationfixachieved : bool = false var locationstatus : nsstring = "not started" var userlocation : string! var userlatitude : double! var userlongitude : double! var usertemperaturecelsius : bool! override func viewdidload() { locationmanager.startupdating