Posts

Showing posts from July, 2013

php - Get data from Magento and Wordpress -

i have idea here how access data in magento , wordpress in same time user doesn't need log in magento backend or wordpress backend, needs log in 1 app using codeigniter. here simulation: enter image description here if 1 have idea can happy me share program when finish :). , hope can growing programs , warm regards

angular - module resolution with angular2 / ASP.NET5 (cannot find angular2/core) -

i have started new asp.net5/mvc6 project. attempt 1 problem when set moduleresolution classic in tsconfig.json receive error follows: cannot find module 'angular2/core' attempt 2 if change tsconfig.json use node resolution, exclude node_modules in tsconfig.js not work, this bug? , closed, though still seems problem, , multiple errors encountered when studio 2015 trolls through node_modules folder including every .d.ts in entire tree. there hundreds of errors, in rxjs . attempt 3 if remove tsconfig.json completely, can application executing, , files compiled, alas, error in browser. error: (systemjs) require not defined i cannot think angular2 / typescript support in visual studio is complete mess , , should go angular 1 , mvc5 . record, using typescript 2.0.6, , visual studio date. is there combination of package.json , tsconfig.json works out of box visual studio 2015 angular2. package.json has following dependencies. { &quo

jquery - if this attribute value is enclosed in quotation marks the quotation marks must match error -

i trying design responsive image slider thumbnails. here code. <div class="cycle-slideshow" data-cycle-timeout=0 data-cycle-pager="#pager2" data-cycle-pager-template="<span><img src={{firstchild.src}}/></span>" > <span class="cycle-pager"></span> <span class="cycle-prev">&#9001;</span> <span class="cycle-next">&#9002;</span> <img src="images/backgroundalternate.jpg" /> <img src="images/logout.jpg" /> <img src="images/backgroundalternate1.jpg" /> <img src="images/backgroundalternate2.jpg" /> <img src="images/backgroundalternate.jpg" /> </div> while adding span tag attribute data-cycle-pager-template , getting error if attribute value enclosed in quotation marks quotation marks must match why that? in advance.

javascript - redux get input text value -

i have following reactjs component. class login extends component { render() { if (this.props.session.authenticated) { return ( <div></div> ); } return ( <div> <input type="text" placeholder="username" /> <input type="password" placeholder="password" /> <input type="button" value="login" onclick={() => this.props.loginaction("admin", "password")} /> </div> ); } } the login component makes use of prop set via redux, named "session.authenticated". if user session not authenticated, present couple of input fields (one username , password) , login button. if press on login button want emit action username , password values, passed parameters. now, how values of 2 input fields parameters ?

android - click on empty space in fragment executes activity event -

i have activity consists of 4 images , onclick of image i'm opening fragment . also, have navigation drawer profile option opens fragment . since fields in profilefragment few there allot of empty space. , if user clicks on empty space, click event of image placed in activity executed , particular fragment opens up. have tried set background color of profilefragment white , did not work. profilefragment class : public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment view view = inflater.inflate(r.layout.fragment_profile, container, false); butterknife.bind(this, view); view.setbackgroundcolor(color.white); return view; } profile_fragment.xml <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" androi

Replacing a section of text in one file with text from another using python -

first bit of background: yes, new python, dabble , learn things. the goal this: have intranet website here @ work , have on static server no server side scripting allowed, meaning no php. add new pages, must update every freakin page's menu new link. fortunately, have application called arcgis installed on computer , came installation of python. thinking nice put script read file called "menu.txt" , search recursively in directory (and subdirectories) files ".html" , replace text between comment tags, <!--begin menu--> , <!--end menu--> , text in "menu.txt" so started looking , found snippet of code: with open('menu.txt', 'r') f: # read entire file file1 # assuming 'file1.txt' relatively small... file1 = f.read() open('test.html', 'r') f: # assuming 'file2.txt' relatively small... file2 = f.read() # read file file2 # index() raise error if not found... f1_st

Normalize numpy array columns in python reading that array from other csv file -

whenever trying perform normalization on array obtained csv file . code wont work because have n't provided custom file. i getting error message : x = np.myarray attributeerror: 'module' object has no attribute'myarray' as new python ,can please me how normalized matrix if read matrix csv file ? import numpy np import csv open('csvk.csv', 'rb') f: reader = csv.reader(f) data_as_list = list(reader) print data_as_list myarray = np.asarray(data_as_list) print myarray x = np.myarray x_normed = x / x.max(axis=0) print x_normed what trying np.myarray ? attribute call, , python rightly informs module numpy not have attribute myarray . if you're trying make copy of myarray want x=myarray , although same in more pythonic way x_normed=myarray/myarray.max(axis=0)

c# - how to get fields list of view fields from SPSiteItemCollection -

i want fields list of spsiteitemcollection limited spquery view fields. example limited view field caml query this: spquery.viewfields="<fieldref ='testfieldname' />"; and executed query code , splist.getitem(spquery) passed result function , want current view fields list in context expect "testfieldname" don't know how. know can find fields list codes this: list<spfield> fields=listitem.fields.cast<spfield>().tolist(); or geting specific view code: list<spfield> fields=list.views["viewname"].fields.cast<spfield>().tolist(); my question is: how can fields list of specific spquery view field? have try use viewfieldsonly ? should return fields specified in query spquery.viewfields="<fieldref ='testfieldname' />"; spquery.viewfieldsonly = true;

php - Display Two row data in one table TD -

hello please me following problem mysql data table sno name subject marks 1 test1 sub1 20 2 test1 sub2 20 3 test1 sub3 20 4 test1 sub4 20 5 test1 sub5 20 6 test2 sub1 30 7 test2 sub2 30 8 test2 sub3 30 9 test2 sub4 30 10 test2 sub5 30 11 test3 sub1 40 12 test3 sub2 40 13 test3 sub3 40 14 test3 sub4 40 15 test3 sub5 40 i want display this sno name marks 1 test1 100 sub1 20 sub2 20 sub3 20 sub4 20 sub5 20 2 test2 150 sub1 30 sub2 30 sub3 30 sub4 30 sub5 30 3 test3 200 sub1 40 sub2 40 sub3 40 sub4 40 sub5 40 is possaible in mysql php. two ways of doing this 1) find unique names , sum of marks select name heading, sum(marks) total table group name and iterate through results , query records matching name select * table name = $result[

How to access html content of AccessibilityNodeInfo of a WebView element using Accessibility Service in Android? -

i'm trying access textual content of app built using non-native(js+html) based framework. hence, figured i'll try access data accessibility node corresponding webview element. however, i'm unable grab textual/html data using usual methods since methods gettext() work if native android element such textview, button etc. public class myaccessibilityservice extends accessibilityservice { @override public void onaccessibilityevent(accessibilityevent accessibilityevent) { accessibilitynodeinfo accessibilitynodeinfo = accessibilityevent.getsource(); if (accessibilitynodeinfo == null) { return; } int childcount = accessibilitynodeinfo.getchildcount(); (int = 0; < childcount; i++) { accessibilitynodeinfo accessibilitynodeinfochild = accessibilitynodeinfo.getchild(i); myrecursivefunc(accessibilitynodeinfochild); } } @override public void oninterrupt() { } private void myrecursivefunc(accessibilitynodeinfo accessibility

datetime - Displaying local time from ISO 8601 string with Momentjs -

i want display local time iso 8601 string using momentjs. there discrepancy of minutes when convert iso string using different date formats. if use 'mm/dd/yyyy hh:mm', minutes correctly displayed. if use 'ddd, mmm hh:mma', 11 minutes added (in case). my sample js (babel) code: let today = moment('11/09/2016 00:00', 'mm/dd/yyyy hh:mm').toisostring(); //today = 2016-11-09t08:00:00.000z let formatted = moment(today, moment.iso_8601).format('mm/dd/yyyy hh:mm'); //formatted = 11/09/2016 00:00 let formatted2 = moment(today, moment.iso_8601).format('ddd, mmm hh:mma'); //formatted2 = wed, nov 9th 00:11am i prefer using second format. can explain why there discrepancy? please see fiddle: https://jsfiddle.net/anudhagat/8fgtjbc7/3/ i caught silly mistake. have capitalized minutes in second format, using mm makes display months instead of minutes.

c++ - type of reference-captured object inside lambda -

the following code works gcc #include <map> int main() { std::map<int, double> dict; const auto lambda = [&]() { decltype(dict)::value_type bar; }; } but msvc have additionally use std::remove_reference #include <map> #include <type_traits> int main() { std::map<int, double> dict; const auto lambda = [&]() { std::remove_reference_t<decltype(dict)>::value_type bar; }; } otherwise an error : error c2651: 'std::map<int,double,std::less<_kty>,std::allocator<std::pair<const _kty,_ty>>> &': left of '::' must class, struct or union which compiler shows correct behaviour according standard? update: for msvc decltype(dict) reference, following code #include <map> int main() { std::map<int, double> dict; const auto lambda = [&]() { decltype(dict) foo; }; } errors with error c2530: 'foo&#

PHP does not connect to localhost MongoDB and fails silently -

i have php script this: try { $conn = new mongoclient("mongodb://localhost:27017"); var_dump($conn); } catch (mongoconnectionexception $e) { var_dump($e); } when visited page, showed nothing. mongod shows no connection attempt, shell client works normally. i'm running mongodb 2.4 on debian. any appreciated, thanks!

Android crash "Activity has been destroyed" -

i'm facing crashes in application following stacktrace: fatal exception: java.lang.illegalstateexception: activity has been destroyed @ android.support.v4.app.fragmentmanagerimpl.enqueueaction(fragmentmanager.java:1560) @ android.support.v4.app.backstackrecord.commitinternal(backstackrecord.java:696) @ android.support.v4.app.backstackrecord.commitallowingstateloss(backstackrecord.java:667) @ ....activities.myactivity.replacecontentfragment(myactivity.java:293) this happens activities load content asynchronously web , replace according fragment. don't understand how activity can gone user cannot change fragments/activities while loading. guess must have leaving/starting app while loading (although may wrong this). my activities have launchmode = singletask , maybe that's related well. the crashes appear on android 6.0.1, maybe that's due fact users have version...

ios - By fetching Date using this struct getting nil value even i have manually set date on having nil in swift 3 -

this question has answer here: what “fatal error: unexpectedly found nil while unwrapping optional value” mean? 4 answers struct apiversioncheck { static let nsobject: anyobject? = bundle.main.infodictionary!["cfbundleshortversionstring"] anyobject static let date = userdefaults.standard.value(forkey: "versiondateparameter") static let checkdevicetoken = "" static let checkappversion = nsobject as! string static let checkdevicetype = 1 static let checkcustomerid = "1055" static let checkdate = validator.sharedvalidation().checkblankstring(apiversioncheck.date as! string) == false ? "2016-08-03 11:20:53.957" : (apiversioncheck.date as! string) } in last line of struct checkdate getting nil value , therefore prevents other codes run crashing app. contribute precious opinion fix issue ? pl

linux - Chef: Error executing action `start` on resource 'service[mysql-foo]' and undefined method -

could me resolve problem "error executing action start on resource 'service[mysql-foo]' , "undefined method `[]' nil:nilclass". installed last version cookbook "mysql" official site , created simple recipe how can see below in detailed log. thank attention matter. creating new client app-srv creating new node app-srv connecting 127.0.0.1 127.0.0.1 -----> existing chef installation detected 127.0.0.1 starting first chef client run... 127.0.0.1 starting chef client, version 12.15.19 127.0.0.1 resolving cookbooks run list: ["mysql"] 127.0.0.1 synchronizing cookbooks: 127.0.0.1 - mysql (8.1.1) 127.0.0.1 installing cookbook gems: 127.0.0.1 compiling cookbooks... 127.0.0.1 converging 1 resources 127.0.0.1 recipe: mysql::default 127.0.0.1 * mysql_service[foo] action create 127.0.0.1 * mysql_server_installation_package[foo] action install 127.0.0.1 * apt_package[mysql-server-5.5] action install (up date) 127.0.0.1 *

ln - Need to control access to my files in unix -

a front end utility calls unix script through putty copy/edit/tar files user. each user has specific roles i.e. copy or edit files , controlled same unix script itself. i face security issues if user logs on putty himself , tries perform operations not authorized do.(backdoor) i looking way can in script when gets called frontend records activity whenever file gets updated/edited/deleted through backdoor.

c++ - Why do std::future<T> and std::shared_future<T> not provide member swap()? -

all kinds of classes in c++ standard library have member swap function, including polymorphic classes std::basic_ios<chart> . template class std::shared_future<t> value type , std::future<t> move-only value type. there particular reason, don't provide swap() member function? member swap massive performance increase prior std::move support in c++11. way move 1 vector spot, example. used in vector resizes well, , meant inserting vector of vectors not complete performance suicide. after std::move arrived in c++11, many sometimes-empty types default implementation of std::swap : template<class t> void swap( t& lhs, t& rhs ) { auto tmp = std::move(rhs); rhs = std::move(lhs); lhs = std::move(tmp); } is going fast custom-written one. existing types swap members unlikely lose them (at least immediately). extending api of new type should, however, justified. if std::future wrapper around std::unique_ptr< future_impl

Securing a DMG installation of ArangoDB -

i installed arangodb 3.0.0 dmg , after launching cli, tried secure installation running: /applications/arangodb-cli.app/contents/macos/arango-secure-installation --database.directory /applications/arangodb-cli.app/contents/macos/opt/arangodb/var/lib/arangodb3 --javascript.startup-directory /applications/arangodb-cli.app/contents/macos/opt/arangodb/share/js --javascript.app-path /applications/arangodb-cli.app/contents/macos/opt/arangodb/share/js/apps but keep getting error: fatal unable initialize rocksdb: io error: lock /applications/arangodb-cli.app/contents/macos/opt/arangodb/var/lib/arangodb3/rocksdb/lock: resource temporarily unavailable how resolve error or secure database?

Rails, Devise. Disallow User actions unless AdminUser -

i have user model created devise, type:string attribute , adminuser model ( adminuser < user ). in application controller defined :require_admin method: def require_admin unless current_user == adminuser flash[:error] = "you not admin" redirect_to store_index_path end end on products controller set before_action :require_admin, except: :show now create adminuser via console (with adminuser id) , when log in app, still can not use actions (create, edit etc.). any ideas? with current_user == adminuser you check whether current_user object is equal adminuser class. what want instead check whether current_user 's class adminuser : current_user.class == adminuser # or current_user.is_a?(adminuser) # or current_user.kind_of?(adminuser) # or current_user.instance_of?(adminuser) # or adminuser === current_user

java - Java8 CompletionStage content -

so here's problem: how content of this: rxclient<rxcompletionstageinvoker> newrxclient = rxcompletionstage.newclient(); completionstage<response> stage = newrxclient .target("somelink") .request() .rx() .get() .tocompletablefuture(); instead of: java.util.concurrent.completablefuture@5ba3f27a[completed normally] edit: found solution in case else stumbles upon problem: stage.tocompletablefuture().get() i guese called: system.out.println(stage); which calls stage.tostring() prints (compatiblefuture) object, not content. content of future object use stage.get() . following should give representation of response object (and json string if returned response#tostring() ) system.out.println(stage.get()); i hope looking for

java - Unable to sent message into apache qpid jms 6.0.5 queue -

i using apache qpid jms 6.0.5 server , getting below exception. suggestion or ... exception in thread "main" org.apache.qpid.amqprotocolexception: protocol: 0.0 required broker not supported client library implementation [error code 543: client unsupported protocol] @ org.apache.qpid.client.amqconnection.initdelegate(amqconnection.java:679) @ org.apache.qpid.client.amqconnection.makeconnection(amqconnection.java:568) @ org.apache.qpid.client.amqconnection.(amqconnection.java:490) @ org.apache.qpid.client.amqconnection.(amqconnection.java:294) @ org.apache.qpid.example.listsender.main(listsender.java:47) caused by: java.lang.classnotfoundexception: org.apache.qpid.client.amqconnectiondelegate_0_0 @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ j

python - match template which crop non-rectangular region and get wrong -

Image
the code here can crop image choose. i want match template image , roi image,but code can crop non-rectangular region.(other area black.) like picture,you can see black area. so when match image roi image,i wrong. any idea ? # -*- coding: utf-8 -*- import cv2 import numpy np drawing = false ix,iy = -1,-1 def getimage(drawline): print drawline image = cv2.imread('op1.jpg', -1) mask = np.zeros(image.shape, dtype=np.uint8) roi_corners = np.array([drawline], dtype=np.int32) channel_count = image.shape[2] ignore_mask_color = (255,)*channel_count cv2.fillpoly(mask, roi_corners, ignore_mask_color) masked_image = cv2.bitwise_and(image, mask) gti(masked_image) def gti(masked_image): iii = 0 while not np.sum(masked_image[iii,:,:]): resized_top = masked_image[iii+1:,:,:] iii = iii + 1 size_img = resized_top.shape iii = size_img[0] while not np.sum(resized_top[iii-2:iii-1,:,:]): r

android - Recycler view reach on top after add some data on scroll in adapter -

Image
i have added notifydatasetchange still reach @ top of recycler view if see mistake in code please reply. loading data on scrolling form server bt set in adapter on bottom reach, here veglist list contain old data newly added data. i have seen related endless recycler view no need such type of suggestions, not fresher. you having issue because creating new adapter each time loadmore called. you need rewrite code this. initialize adapter in oncreate this vegadaper = new vegadapter(this,veglist); recycleview.setadapter(vegadapter); please remove code temp arraylist creation vegadaper.notifydatasetchanged() and change single line vegadaper.notifyiteminserted(veglist.size() -1); // notify new items in veglist.. not entire view. also please post actual code instead of image.

Creating release from bamboo to nexus oss -

we push maven project code bit bucket bamboo.it gets build in bamboo , generates artifact war file(which includes bamboo build number ).we have used curl command push these artifacts bamboo nexus oss. 1.whether nexus after getting artifacts uploaded bamboo creates release number 2.can create release number in nexus? 3.how can create release in nexus bamboo ? 4.is possible? plugins available or can use kind of scripts? i'd recommend configuring maven build use maven-deploy-plugin upload artifacts nexus in consistent manner. here's short blog post describes pushing war file: http://www.sonatype.org/nexus/2015/02/27/setup-local-nexus-repository-and-deploy-war-file-from-maven/

angular - Unhandled Promise rejection: Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'input' -

this question has answer here: angular2 , observables: can't bind 'ngmodel' since isn't known property of 'select' 2 answers i error can't bind 'ngmodel' since isn't known property of 'input'. if try use this: <div *ngif="guide" class="form-group"> <label for="guidename">name: </label> <input class="form-control" name="guidename" [(ngmodel)]="test" required id="guidename"> <button (click)="saveguide(guide)"></button> </div> my app.module.ts looks this: import {ngmodule} "@angular/core"; import {routing} "./app.routing"; import {browsermodule} '@angular/platform-browser'; import {formsmodule} "@angular/forms"; import {guidemodule} "./gui

php - Databrowser with move function -

i have written little databrowser, can create folders, created on server , in sql table 'folder', in 'folder' table userid saved too. now want code move function moving files around folders, function gets folder names created user, , puts them input form. in last query doesnt gets folderid, cant put folder id imglinks table. hope understand, , can me. thanks. move.php <form action="move.php" method="post"> <label>move to: <select name="folders" size="5"> <?php include "config.php"; session_start(); $uid = $_session['username']; $dir = "uploads/" . $uid; $dir_inhalt = scandir($dir); $moveimg = $_get['moveimg']; foreach($dir_inhalt $folder){ if($folder != "." && ($folder != "..")){ $sql = "select * folder uid='$uid' , foldername='$folder'";

android - Can we use single FutureTask with Executor with different purposes -

i used newsinglethreadexecutor executors executor msessionexecutor = executors.newsinglethreadexecutor(); here future task returns list futuretask<list<string>> listfuturetask = new futuretask<list<string>>(new callable<list<session>>() { @override public list<string> call() throws exception { return getsessions(); } }); for getting o/p using below code msessionexecutor.execute(listfuturetask); list<string> sessions= listfuturetask.get(); so question can use same future task multiple time listfuturetask.get(); returns same value exist while running first task so can use ? msessionexecutor.execute(listfuturetask); msessionexecutor.execute(listfuturetask); .. multiple times after calling listfuturetask.get(); updated list always

C# Xamarin Android . ButtonClick event help needed -

Image
i tired doing simple a+b addition program using xamarin every time error system.nullreferenceexception occurs button click. button button = findviewbyid<button>(resource.id.button1); button.click += delegate { edittext number1 = findviewbyid<edittext>(resource.id.edittext1); edittext number2 = findviewbyid<edittext>(resource.id.edittext2); textview res = findviewbyid<textview>(resource.id.textview1); int result = convert.toint32(number1.text) + convert.toint32(number2.text); res.text = result.tostring(); }; you commented out line: setcontentview(resource.layout.main); this "binds" current activity content view. if dont bind program cant find elements button. gives object reference error. so remove // infront of setcontentview , should work.

Google Indoor Maps availability in Poland -

does knows google indoor maps available in poland soon? according article https://support.google.com/maps/answer/1685827 unfortunately still not available.

tfs - git bash cloning incorrect url with Visual Studio Team Services (VSTS) -

i have weird issue 1 of guys in office here moved on of repos 1 project in tfs (i use tfs here mean visual studio team services, tfs in cloud). so our repo used live somewhere like: https://somewhere.visualstudio.com/projects/_git/something then copied project , old 1 removed, lives at: https://somewhere.visualstudio.com/project_two/_git/something when 1 of guys here tries clone new repo url: git clone https://somewhere.visualstudio.com/project_two/_git/something he gets error: remote: tf401019: git repository name or identifier not exist or not have permissions operation attempting. fatal: repository ' https://somewhere.visualstudio.com/projects/_git/something ' not found its there cache somewhere seems redirecting new repo url old one, no longer exists. doesn't happen me on computer. so there behind scenes in git cause repo url cached somewhere, or in tfs cause behavior? == verbose output == somename@cf-l-003242 mingw64 /d/repos $ git

android - Get list of Firebase notifications? -

is there way see notifications sent via firebase? i can't find in docs or anywhere else. it'd cool if possible on console, http well! ideas? unfortunately, there no available api of moment retrieve gcm/fcm logs. as might know, notifications sent via console visible in firebase console itself. in left-side panel, select on notifications , see list of notifications sent using console. one approach make use of google play developer console, app should @ least in alpha testing. kinda similar posts: firebase cloud messaging statistics api firebase notification records/log api

Jenkins 2 ui layout stretches horizontally in job configuration page, text no longer wrapped -

Image
jenkins 2 has ui problem in job configuration page. ui layout stretches horizontally in job configuration page. if there long lines in text area, whole page stretched width of longest text line. makes job configuration page hard use. the problem has been reported in jenkins version 2.26, lts 2.19.3 , above this has been fixed. issue report: https://issues.jenkins-ci.org/browse/jenkins-27367 github pr: https://github.com/jenkinsci/jenkins/pull/2575 jenkins version below 2.26, lts 2.19.3 for can not upgrade latest jenkins version, here fix: install simple-theme-plugin . create css file ( theme.css ) in <jenkins_home>/usercontent/ . add following css file. td.setting-main .codemirror { display: table; table-layout: fixed; width: 100%; } point theme css (for example http://<yourjenkins>/usercontent/theme.css ) in jenkins system configuration page, section "theme"

javascript - Select multiple id's with almost same name -

this question has answer here: jquery or css selector select ids start string [duplicate] 4 answers i have of form automatically generated js provider unfortunately can't change... but know if there's solution allows me select id's begin same string : easi_fielddiv_lastname, easi_fielddiv_firstname, easi_fielddiv_email etc... because idea select of them , apply them class more eficient css. here's form code : <div id="easiformarea"> <form name="easiform" id="easiform" class="easiform"> <div id="easi_fielddiv_salutation"> <span id="easi_labelspan_salutation"><label id="easi_fieldlabel_salutation">civilité</label></span> <span id="easi_fieldspan_salutation"> <select id="fld_s

php - mcrypt_get_iv_size() working in some scripts but returning undefined in others -

i have service defined in symfony encrypt , decrypt works fine in files return "call undefined function mcrypt_get_iv_size()" in 1 case. $encrypter = $this->container->get('app.encrypt_controller'); $token = $encrypter->decrypt($this->container->getparameter('key'), $booking->getlink()->gettokenplatform()); after that, controller makes call external api , service decrypt works , controller execute php command: $process = new process('php '.$this->container->getparameter('console_path').' airbnb:getmessages ' . $booking->getlink()->getid() . ' ' . $booking->getid() . ' 0'); this script use decrypt service again: $encrypter = $this->getcontainer()->get('app.encrypt_controller'); $token = $encrypter->decrypt($this->getcontainer()->getparameter('key'),$this->link->gettokenplatform()); but in case script return undefined exception funct

c# - AutoCompleteExtender suddenly stopped working -

i have implemented ajaxcontroltoolkit autocompleteextender in 1 of projects , working fine. 1 day when opened project, autocompleteextender stopped working. other features of toolkit calendar control working fine. to investigate issue, tried creating new web application , copied same code in new application worked fine. can sombody this. i using version 4.1.50731 of ajaxcontroltoolkit , below code have written. register assembly: <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="cc1" %> aspx page: <form id="form1" runat="server"> <div> <span class="span-formitem"> <asp:label id="lblname" runat="server" text="name"></asp:label><br /> <cc1:toolkitscriptmanager runat="server" id="toolkitscriptmanager1" enablepagemethods="true"></cc1:to

java - save checkbox value to sqlite database -

i have insert method on dbhelper class working , on mainactivity.java have: if (mydb.insertitem(userinput.gettext().tostring(), userdesc.gettext().tostring(), checked)) { toast.maketext(getapplicationcontext(), "done", toast.length_short).show(); } the third parameter on insert boolean value checkbox, problem how value on strings using sometext.gettext().tostring(). how work on booleans? please on adapter class have: itemviewsholder.getcheckbox().setchecked( item.ischecked() ); itemviewsholder.cbdone.setonclicklistener( new view.onclicklistener() { public void onclick(view v) { checkbox cb = (checkbox) v ; items itm = (items) cb.gettag(); itm.setchecked( cb.ischecked() ); if(cb.ischecked()){ string s = itm.getname(); system.out.println(s); } } }); use instead of check: string.valueof(checke

ios - SFSafariViewController : Overlay is not appearing sometimes -

i using sfsafariviewcontroller, , did not wanted show status bar of safari , have hidden adding overlay. have own button on overlay , working fine. safari status bar hidden , shows overlay somehow overlay disappears , safari status bar visible. doubt because link being reloaded automatically how? calling once. not sure why overlay disappear only. below code - self.navigationcontroller?.presentviewcontroller(sfcontroller!, animated: true, completion: { let bounds = uiscreen.mainscreen().bounds let overlay = uiview(frame: cgrect(x: 0, y: 0, width: bounds.size.width, height: 65)) overlay.backgroundcolor = uicolor(nethex: 0x275e37) let completedbtn = uibutton() let favbtn = uibutton() let image = uiimage(named: "home.png") uiimage? let homebtn = uibutton(type: uibuttontype.custom) uibutton homebtn.frame = cgrectmake(20, 25, 35, 35) homebtn.setimage(image, forstate

sql - soft delete or hard delete good for eCommerce -

i have read this post concerned best solution ecommerce site our scenario: product table productid name price orderdetails table orderid productid orderdetails table has fk productid referrenced productid of product table once product has been deleted, how going display historical order report? options: soft delete disadvantage - affects db storage performance hard delete disadvantage - need join query while taking report any great. i go soft delete. if in e-commerce context. how storing deleted products in archivedproduct table , doing following: select * orderdetails right join product on orderdetails.productid = product.productid union select * orderdetails right join archivedproduct on orderdetails.productid = archivedproduct.productid when say it affects db storage performance yes, there overhead in terms of performance entirely dependent upon size of 3 tables. if @ later stage wanted increase performance of query, either wipe

vb.net - SQL query in Visual Basic -

private sub button3_click(sender object, e eventargs) handles button3.click dim con new oledbconnection("provider=microsoft.ace.oledb.12.0;data source=c:\users\blackhat\documents\travel.accdb") dim qry string = "update login set username='" & textbox1.text & "',password='" & textbox2.text & "' id=" & val(textbox3.text) dim cmd new oledbcommand(qry, con) con.open() cmd.executenonquery() msgbox(qry) con.close() end sub i passing in correct values variables, keep getting following error - what's issue? an unhandled exception of type 'system.data.oledb.oledbexception' occurred in system.data.dll additional information: syntax error in update statement. try this: dim qry string ="update login set username='" & textbox1.text & "',password='" & textbox2.text & "'

oracle - SQL Query - Multiple Joins -

i'm having difficulty in joining same table(s) twice because of results returned incorrect. the query below works fine. however, want change can return column of requirement type using value returned in requirement traced to column. select r.rq_req_id "requirement traced from", r.rq_req_name "requirement name", rty.tpr_name "requirement type", rtr.rt_to_req_id "requirement traced to" req r left join req_trace rtr on r.rq_req_id = rtr.rt_from_req_id, req_type rty r.rq_type_id = rty.tpr_type_id , rty.tpr_name in ('tom', 'business process map', 'work instruction', 'functional', 'customer journey', 'business') order 1 when add req , req_type tables in second time different aliases hundreds of rows returned instead of 28 expecting. any appreciated. never use commas in from clause. always use explicit joi

Add image elements in DOM using Javascript -

i have image files in folder named imagefolder. file names in form of number_of_suit.png (eg 7_of_diamond.png) , want add them html body. think have syntax issues. example in vanilla js.. var addimage = document.getelementsbytagname("body"); addimage.appendchild(img src = "imagefolder/ + number + "_of_" + suit.png"); thank you. the basics you've got couple of issues. start, document.getelementsbytagname returns nodelist , not node there no appendchild element. around that, either first item of collection, or document.body : var addimage = document.getelementsbytagname("body"); // nodelist var bodyone = addimage[0]; // <body> element var bodytwo = document.body; // <body> element secondly, if see syntax highlighting in example, can see you're missing couple of quotation marks. var string = "imagefolder/" + number + "_of_" + suit + ".png"; finally, gottz has pointed out

python - ValueError: dictionary update sequence element while implementing Breadth First Search -

i trying port breadth first search input graph dictionary of dictionary values: input graph: graph = {'a': {'b':'b', 'c':'c'}, 'b': {'a':'a', 'd':'d', 'e':'e'}, 'c': {'a':'a', 'f':'f'}, 'd': {'b':'b'}, 'e': {'b':'b', 'f':'f'}, 'f': {'c':'c', 'e':'e'}} python program def dictsub(d1,d2): return {key: d1[key] - d2.get(key, 0) key in d1.keys()} def bfs_paths(graph, start, goal): queue = [(start, [start])] while queue: (vertex, path) = queue.pop(0) next in dictsub(graph[vertex], dict(zip([path,path]))): # print graph[vertex] - set(path) print graph[vertex] print set(path) print vertex raw_input() if

Rails, Devise - send user back after submitting form -

when user adds products cart not mandatory him logged in. when goes created cart , hits "checkout" check if logged in: <%= link_to_if(current_user.nil?, "checkout", new_user_session_path) link_to( "checkout", new_order_path, method: :get) end %> so if not logged in, redirect new_user_session_path. problem after logging in being redirected index_path. , want him redirected cart. same logging up. i using devise, should generate devise controllers , there? how should done? note: using module current cart: module currentcart private def set_cart @cart = cart.find(session[:cart_id]) rescue activerecord::recordnotfound @cart = cart.create session[:cart_id] = @cart.id end end i think code you: class applicationcontroller < actioncontroller::base def after_sign_in_path_for(resource) #place route here end end

c# - Add decimal point & set cursor position to DataGridView cell text on KeyPress event -

Image
the following code used adding decimal point after 5 digits in datagridview cell , set cursor positions last, code work first datagridview cell. in advance. grid editingcontrolshowing event code: private void grdcharges_editingcontrolshowing(object sender, datagridvieweditingcontrolshowingeventargs e) { datagridview grd = sender datagridview; e.control.keypress -= new keypresseventhandler(grdcharges_row0_column2_keypress); e.control.keypress -= new keypresseventhandler(grdcharges_row1_column2_keypress); e.control.keypress -= new keypresseventhandler(grdcharges_column3_keypress); if (grdcharges.currentrow.index == 0) { if (grdcharges.currentcell.columnindex == 2) //desired column { textbox r0c2 = e.control textbox; if (r0c2 != null) { r0c2.keypress += new keypresseventhandler(grdcharges_row0_column2_keypress); } } } if (grdcharges.currentrow.index == 1)

angularjs - How to make gulp wiredep work on bower scss libraries like susy or normalize? -

i'm trying wireup bower sass libraries susy , normalize-scss don't know how given project structure (meanjs). i'm using standard mean.js yeoman generator. gulp wiredep sends dependencies /config/assets/default.js looks this: module.exports = { client: { lib: { css: [ // bower:css 'public/lib/angular-ui-notification/dist/angular-ui-notification.css', 'public/lib/ng-img-crop/compile/minified/ng-img-crop.css', // endbower ], js: [ // bower:js 'public/lib/angular/angular.js', 'public/lib/angular-animate/angular-animate.js', 'public/lib/angular-messages/angular-messages.js', 'public/lib/angular-mocks/angular-mocks.js', etc etc. now whenever gulp wiredep , js files , css files correctly go //bower:js or //bower:css . usually, i've worked on scaffolding .scss resides in app/main.scss , bower inject there properly. kind of