Posts

Showing posts from February, 2010

c# - Windows indexing search - OleDbException Not Specified Error -

i'm getting exception (oledbexception: not specified error) when trying search in indexed files in folder on d-drive (d:\taaltipsdocumenten). know piece of code worked in past (2 months ago), when trying continue working on project, doesn't seem work anymore. during execution of following code, error on following line: adapter.fill(dt); i can datatable (dt) filled correctly, still error on line. when trying use oledbdatareader .next() function, runs on results , throws me error eventually. var query11 = @"select system.datecreated, system.itemname, system.itemurl, system.size, system.search.hitcount systemindex " + @"where scope ='file:d:/taaltipsdocumenten' , contains('" + word + "') "; fileoverviewmodel returnmodel = new fileoverviewmodel(); returnmodel.files

c# - How can m2mqtt subscribe two topic -

i'm using m2mqtt message ,but can't individual subscribe 2 topic i use client.subscribe subscribe 2 topic,and use client_mqttmsgpublishreceived(object sender, mqttmsgpublisheventargs e) message but 2 topic's message mixed . there meth divide it? just put if statement message handler branch based on incoming messages topic e.topic . you can write functions handle different message types , call these message handler , pass mqttmsgpublisheventargs object functions.

jqxgrid - Why checkRow not working in other than first page in jqxTreeGrid? -

i have jqxtreegrid, i’m selecting rows, selects rows on first page. on other pages, it’s not selecting. $scope.get_db_data_parent = function (rowdata) { if(rowdata == undefined){ var url = ‘api/bdi_pf_data’; } else{ var url = ‘api/bdi_pf_data_not_platform_id?platform_id=’ + rowdata.platform_id; } $http.get(url).success(function (data) { console.log(url, data.response); var view = 0; var ids = [] if (rowdata !== null && rowdata !== undefined) { view = 1; ids = rowdata.parent_platfoms.split(“,”); } var table_contents = []; (var = 0; < data.response.length; i++) { arr_list_parent.push(data.response[i]) data.response[i][‘select’] = false; var = data.response[i]; table_contents.push({ select: a[‘select’], platform_id: a[‘platform_id’], platform_name: a[‘platform_name’], platform_type: a[‘platform_type’], template_name: a[‘template_name’] }) } console.log(table_contents); var source = { datatype: “json”, datafields: [ { name: ‘select’, type: ‘bool’ }, { name: ‘platform_id’,

shell - How can I replace a specific line of a file in bash script? -

i have file inside 1 directory, want replace 1 specific line line. in case line - "password requisite pam_pwquality.so" , want make as "#password requisite pam_pwquality.so". i tried this: cat test1 | while read line if grep -q "$str" test1; echo "found" sed -i -e "s/${str}/${str1}/g" test1 fi but showing multiple found statements having 1 copy of line. $ x='password requisite pam_pwquality.so' $ sed -i "s/\($x\)/#\1/" file

java - Working with several RecyclerViews -

in android app, i've been using several recyclerviews different , requirements. number increased, thought of unifying them. question recyclerviews different requirements, should use different adapters (layout files can't same) or 1 universal adapter this: public class dataadapter extends recyclerview.adapter < dataadapter.viewholder > { variables... public dataadapter(context context) { } @override public dataadapter.viewholder oncreateviewholder(viewgroup viewgroup, int i) { // if(the_condition_to check_which_recycler_view) // inflate a; // else if(other_condition) // inflate b; // else ... return xyz; } @override public void onbindviewholder(final viewholder viewholder, int i) { // if(the_condition_to check_which_recycler_view) // this; // else if(other_condition) // this; // else ... } @override public int getitemcount() { return xyz; } public class viewholder extends recyclerview.viewholde

graph - get neighborhood of a node Arangodb -

i'm trying neighborhood of node in arangodb. when in nodes: v in protein_g_h filter v._to == "p2/9606.ensp00000326759" return v i result. doing out nodes for v in protein_g_h filter v._from == "p2/9606.ensp00000326759" return v i result doing this: for v in protein_g_h filter v._to == "p2/9606.ensp00000326759" filter v._from == "p1/9606.ensp00000326759" return v --or-- for v in protein_g_h filter v._to == "p2/9606.ensp00000326759" , v._from == "p1/9606.ensp00000326759" return v to in , out nodes nothing. problem? if want retrieve in and out nodes, need test if _from or _to property of edge equal node want neighbors for: for e in protein_g_h filter e._to == "p2/9606.ensp00000326759" or e._from == "p2/9606.ensp00000326759" return e i recommend use aql graph traversal retrieve neighbor vertices: for v in 1

javascript - Browser API: URL class is not recognized in Typescript -

i'm using url utility: https://developer.mozilla.org/en-us/docs/web/api/url , have problem using in typescript code. whereas can open console in browser , type: new url("http://stackoverflow.com/question/ask") and code successful, whenever write in typescript file , transpile it, following error: error ts2351: cannot use 'new' expression type lacks call or construct signature. does mean class doesn't exist in typescript? there way use in typescript code? that should supported typescript, that's included on lib.dom.d.ts included default if target es5. you can configure on tsconfig.json (that default config when using es5, can try add explicitly): "lib": [ "dom", "es5", "scripthost" ],

c# - access to the path 'c:\windows\system32\inetsrv\dotnetzip-uxoebj5p.tmp' is denied -

this question has answer here: asp.net getting error “access path denied.” while trying upload files windows server 2008 r2 web server 8 answers i trying save zip file web api throwing exception : access path 'c:\windows\system32\inetsrv\dotnetzip-uxoebj5p.tmp' denied. @ system.io.__error.winioerror(int32 errorcode, string maybefullpath) @ system.io.filestream.init(string path, filemode mode, fileaccess access, int32 rights, boolean userights, fileshare share, int32 buffersize, fileoptions options, security_attributes secattrs, string msgpath, boolean bfromproxy, boolean uselongpath, boolean checkhost) at system.io.filestream..ctor(string path, filemode mode, fileaccess access, fileshare share, int32 buffersize, fileoptions options, string msgpath, boolean bfromproxy @ system.io.filestream..ctor(string path, filemode mode) @ ionic.zip.s

Problems using drupal / console -

hie installed drupal console launcher described in documentation : curl https://drupalconsole.com/installer -l -o drupal.phar mv drupal.phar /usr/local/bin/drupal chmod +x /usr/local/bin/drupal it works fine , 'drupal' command works. after installed console in site folder : composer.phar require drupal/console:~1.0 \ --prefer-dist \ --optimize-autoloader when run 'drupal list' command in site folder have message : sqlstate[hy000] [2002] no such file or directory so edited 'host' in 'settings.php' file replacing 'localhost' '127.0.0.1' in case, have sqlstate [hy000] [2002] connection refused error , site no longer works! i tried installing drupal 8 composer have console. there have error sqlstate [hy000] [2002] connection refused it's been week try in directions without success! i'm on osx mamp server. would have idea ? je ne comprends pas comment résoudre ce problème. aidez-moi et merci beaucoup d'

php - Stripe custom checkout - form submit -

i'm trying out stripe api & functions, twisting head around 1 issue - how submit form after (test) payment successful? here's current code: <script> var handler = stripecheckout.configure({ key: 'pk_test_mykey', image: 'https://stripe.com/img/documentation/checkout/marketplace.png', locale: 'sv', token: function(token) { // can access token id `token.id`. // token id server-side code use. } }); document.getelementbyid('custombutton').addeventlistener('click', function(e) { stripe_spots = document.getelementbyid("spots").value; stripe_total = (stripe_spots) * 70; // open checkout further options: handler.open({ name: 'revy!', description: stripe_spots + " platser", zipcode: true, currency: 'sek', amount: stripe_total *

Python import protocol buffer definitions from a different repository -

i have repository contains protocol buffer messages , services, written golang project. need write python microservice i'm not 100% clued on how python dependency management works. need import definitions new python project , compile them python. how should import protocol buffer definitions repository python project , compile protobufs python? can't copy .pb files new project they're shared amongst number of other projects. protobufs installable via pip $ pip install protobuf read installing python modules in documentation if need on using pip.

listview - Share button doesn't work in android -

i have listview , in baseadapter want have popup menu 1 of items "share" item when user clicks on share window/dialog popup: this popup menu baseadapter of listview: mviewholder.optionmenubutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { //creating instance of popupmenu popupmenu popup = new popupmenu(context, mviewholder.optionmenubutton); //inflating popup using xml file popup.getmenuinflater().inflate(r.menu.share_menu, popup.getmenu()); //registering popup onmenuitemclicklistener popup.setonmenuitemclicklistener(new popupmenu.onmenuitemclicklistener() { public boolean onmenuitemclick(menuitem item) { toast.maketext(context, "you clicked : " + item.gettitle(), toast.length_short).show(); if (item.gettitle() == &quo

javascript - How to view 2nd page in paging on click numbers in bottom -

i trying search , grids shows me results of 20 records. if have applied allow paging true , page size 20 then on click on 2nd page in grid whole grid refreshing ans showing me whole grid once again 1st page. how view last 10 records 11 20 if records 20 , page size 10 client side code of grid <div id="divapplication" runat="server"> <asp:gridview id="gvapplication" runat="server" autogeneratecolumns="false" allowpaging="true" allowsorting="true" alternatingrowstyle-cssclass="alt" pagerstyle-cssclass="pgr" onpageindexchanging="onpageindexchanging" cssclass="table table-bordered table-striped" pagesize="10" width="50%"> <columns> <asp:templatefield headertext='application' headerstyle-verticalalign="middle">

Nuodb Memory and CPU usage reached high -

Image
while accessing nuodb database java application, in task manager tool getting cpu , memory usage reached 99% , tired nuodb 2.4 ,2.5 , 2.6 versions getting same issue. present windows server hardware configurations below. ram : 12 gb (3 processors ) , hard disk : 100 gb please give suggest come issue. thanks in advance i see task manager many "nuodb server" processes running (the picture shows 7 nuodb processes running on server), might having many tes or memory configured nuodb on single server potential problem or setting nuodb incorrectly. following link can understand how check system settings. http://doc.nuodb.com/latest/default.htm#mgr-show-domain.htm?highlight=--memory

c# - Microsoft Speech Recognizer speed is too slow? How to speed up recognition -

i trying make simple recognition program. works fine recognizing separate words, if want recognize sentence or command "turn off computer", fails recognize async speak. if speak 'turn off computer', receives it, doesn't handle until pause , input more speech, output along first one. there way force update? able register when receives no sound, ie. audio level 0, doesn't anything. tried searching, documentation , examples aren't broad. i using system.speech.recognition this piece of code use recognition: m_cultures = new system.globalization.cultureinfo(m_language); sre = new speechrecognitionengine(m_cultures); sre.recognizeasync(recognizemode.multiple); // in 'start' method. sre.speechrecognitionrejected += new eventhandler<speechrecognitionrejectedeventargs>(sre_speechrecognitionrejected); sre.speechrecognized += new eventhandler<speechrecognizedeventargs>(sre_speechrecognized); sre.recognizecompleted += new eventhandler<

java - unable to pass object as method parameter -

i trying pass person object test method below getting error when try run in postman. appreciated in postman, used following json in body { "name" : "aasd", "address" : "asd", "age" : "asdads", "sex" : "asdsad" } person model package com.test.model; import javax.xml.bind.annotation.xmlelement; import javax.xml.bind.annotation.xmlrootelement; import java.math.bigdecimal; import java.util.date; @xmlrootelement public class person{ @xmlelement private string name; @xmlelement private string address; public person() { } public void setname(string name) { this.name= name; } @xmlelement public string getname() { return name; } public void setaddress(string address) { this.address= address; } @xmlelement public string getaddress() { return address; } } controller package com.test2.con

sql server - Rollback to a previous save point in T-SQL -

read documentation seems cannot it. i have transactions this: begin transaction statement 1 statement 2 statement 3 commit what want this: begin transaction if statement 1 fails rollback beginning else create savepoint1 if statement 2 fails rollback beginning else create savepoint2 if statement 3 fails rollback beginning else create savepoint3 if executed commit any hints syntax? statements inserts , updates same table , current setup gave me deadlock. regards,

jquery - Zoom in zoom out on touch devices -

i try zoom in zoom out on touch devices (like phone, tablets...) function resizeimg(img) { var resize = 150; var origh = 61; var origw = 250; var mousex = event.x; var mousey = event.y; var newh = origh * (resize / 100); var neww = origw * (resize / 100); // set new width , height img.style.height = newh; img.style.width = neww; var c = img.parentnode; // work out new center c.scrollleft = (mousex * (resize / 100)) - (neww / 2) / 2; c.scrolltop = (mousey * (resize / 100)) - (newh / 2) / 2; } <div id="container"> <img alt="click zoom" onclick="resizeimg(this)" src="http://www.logiticks.com/wp-content/themes/logiticksv4-theme/images/2015/12/datatable.jpg"/> </div> firstly, i'm sorry limited knowledge problem. how can zoom in/zoom out img when run app on touch devices? mean, how can pinch gestures zooom in/out still in div tag (not zoom in/out pag

android - EasyMonkeyDevice touch sometimes tap on wrong coordinates -

my program trying establish vpn connection, thus, android message "connection request - software wants setup vpn connection ... accept if trust source". uiautomationviewer saw id id/button1. so, i've used this easy_device.touch(by.id('id/button1'), monkeydevice.down_and_up) the ok button according uiautomationviewer @ [810,1162][978,1288] , monkeyrunner taps on x=866, y=709 170725 15:43:i [main] [com.android.chimpchat.chimpmanager] monkey command: tap 866 709. what doing wrong?

Upload multiple aar 's to Nexus using jenkins - gradle release -

i need upload multiple aar's generated multi module project. project structure follows. project root |--main app |--sub-module1 |--sub-module2 |--sub-module3 each sub module generates aar files need upload release version of aars nexus not want apks uploaded nexus.i passing nexus url , cred jenkins. here root build.gradle release { failoncommitneeded = false failonpublishneeded = true failonsnapshotdependencies = true failonunversionedfiles = false failonupdateneeded = true revertonfail = true precommittext = '' pretagcommitmessage = '[gradle release plugin] - pre tag commit: ' tagcommitmessage = '[gradle release plugin] - creating tag: ' newversioncommitmessage = '[gradle release plugin] - new version commit: ' tagtemplate = '$version' versionpropertyfile = './gradle.properties' versionproperties = [] buildtasks = ['uploadallarchives'] scmadapters = [ net.researchgate.release.gitadapter ] git {

java - Android Failed to instantiate one or more classes -

i have running project , xml files showing me error message 'android failed instantiate 1 or more classes'. program still works. cleaned cache , used invalidate caches , restart. here full message: following classes not instantated - android.support.v7.widget.appcompattextview tip: use view.isineditmode() in custom view skip code or show sample data when shown in ide. java.lang.nullpointerexception @ android.content.res.resources_delegate.getvalue(resources_delegate.java:788) @ android.content.res.resources.getvalue(resources.java:1286) @ android.support.v4.content.res.resourcescompat.loadfont(resourcescompat.java:212) @ android.support.v4.content.res.resourcescompat.getfont(resourcescompat.java:206) @ android.support.v7.widget.tinttypedarray.getfont(tinttypedarray.java:119) @ android.support.v7.widget.appcompattexthelper.updatetypefaceandstyle(appcompattexthelper.java:208) @ android.support.v7.widget.appcompattexthelper.loadfromattributes

Mocha + Chai tests for ExtJs -

hello i'm stumbling upon issue while trying create tests extjs. getting ext not defined error my html report file <!doctype html> <html> <head> <title>mocha tests</title> <link type="text/css" rel="stylesheet" href="path/to/mocha/css" /> </head> <body> <div id="mocha"></div> <script type="text/javascript" src="path/to/mocha/js"></script> <script type="text/javascript" src="path/to/chai/js"></script> <script> mocha.setup('bdd'); </script> <script type="text/javascript" src="path/to/extjs/controller"></script> <script type="text/javascript" src="path/to/extjs/viewmodel"></script> <script type="text/javascript" src="path/to/extjs/view"></script>

php - Popular Post with wp_query and date_query wordpress -

i trying create popular post section on website show top 5 popular posts of past week. function popular post function shapespace_popular_posts($post_id) { $count_key = 'popular_posts'; $count = get_post_meta($post_id, $count_key, true); if ($count < 1) { delete_post_meta($post_id, $count_key); add_post_meta($post_id, $count_key, '0'); } else { $count++; update_post_meta($post_id, $count_key, $count); } } function shapespace_track_posts($post_id) { if (!is_single()) return; if (empty($post_id)) { global $post; $post_id = $post->id; } shapespace_popular_posts($post_id); } add_action('wp_head', 'shapespace_track_posts'); loop popular post <?php $popular = new wp_query(array( 'posts_per_page'=>5, 'date_query' => array( //set date ranges strings!

routing - Angular 2 configure routes dynamically -

i new angular 2. building application, menu needs rendered dynamically based on user's role. roles, menu items should hidden. the user's details (name, role) need fetched upon startup (bootstrap) web service. this presents problem. routes need specified in appmodule, whereas fetching of user's details done inside appcomponent, post routes can decided. how can setup routes dynamically post web service call? thanks in advance.

java - AspectJ doesn't weave an interface when the aspect is outside the interface -

Image
when implement interface via inner static aspect impl public interface eventspacesupplement { string geteventspace(); eventspacesupplement seteventspace(string name); ... static aspect impl { private string eventspacesupplement.eventspace; public string eventspacesupplement.geteventspace() { return this.eventspace; } public eventspacesupplement seteventspace(string eventspacename) { this.baseseteventspace(eventspacename); return this; } public eventspacesupplement baseseteventspace(string eventspacename) { this.eventspace = eventspacename; this.eventmanager = eventmanager.geteventlistenerforme(this.geteventspace(), this); return this; } ... } } it works fine. files woven properly. doesn't work i'm trying separate aspect , interface 2 files: public aspect eventspacesupplimenta { private stri

php - Image loading issue on Moodle 3.1 -

Image
we have setup new iis , moodle 3.1 , working fine. recently, have updated code , pulled on server git repo. images not displaying properly. might because of permission changes or encoding changes updated files. on loading page, getting encoding issue in console. what permanent solution this? difficult if face same issue on production server , difficult upload images again. it might similar https://moodle.org/mod/forum/discuss.php?d=316549 so please guide how can solve issue

ios - select week in FScalender in objective c -

i trying select complete week in fscalendarscopemonth had used fscalender : https://github.com/wenchaod/fscalendar/blob/master/moreusage.md #pragma mark fscalendar - didselectdate -(void)calendar:(fscalendar *)calendar didselectdate:(nsdate *)date { if(![date isequal:selecteddate]){ (int =0; i<[weekarray count]; i++) { [objcal deselectdate:[weekarray objectatindex:i]]; } weekarray = [self daysthisweek:date]; markdate = date; selecteddate = [weekarray objectatindex:0]; (int =0; i<[weekarray count]; i++) { [objcal selectdate:[weekarray objectatindex:i]]; } nslog(@"monday date week selected ==> %@",[weekarray objectatindex:1]); } }

java - why do we need to convert number value in string value to send it by bluetooth -

i know why need convert number value (int, double...) in string value send or bluetooth example. in java, use: byte[] buffer= new byte int bytes string strreceived=new string (buffer,0, bytes) but possbile value bluetooth type ? : int received = new integer(...) edit : want send data bluetooth, problem if need send string data bluetooth, 1 character = 1 bytes , data 10 digits convert in string 10 bytes. if can send/get directly data in double/int format, can win 6 bytes each data (int/double 4 bits). thanks !

How to change wordpress default login.php url using nginx rewrite rules? -

i trying change wordpress default logon url http://abc/wp-login.php http://abc/backend using rewrite rule nginx not working me. please check below code. location /backend { rewrite ^/backend/?$ /wp-login.php break; } and wordpress function is: add_action('init', 'init_login_rules' ); function init_login_rules() { $newurl='backend'; add_rewrite_rule( $newurl.'/?$', 'wp-login.php', 'top' ); } please me.

tsql - How to extract a value from Dynamic SQL result? -

i'm trying few values dynamic select this code: declare @sqlcommand varchar(1000) declare @colname varchar(20) declare @tablename varchar(20) declare @mynum int declare @vardate varchar(19) declare @mytime datetime2 set @vardate = getdate() set @colname = 'col1' set @tablename = 'table' set @sqlcommand = 'select top 1 @mytime=mytime, @mynum=' + @colname + ' ' + @tablename + ' mytime>=''' + @vardate + ''' order mytime' print @sqlcommand exec(@sqlcommand) when print sql command, get: select top 1 @mytime=mytime, @mynum=col1 table mytime>='jul 25 2017 4:40pm' order mytime when try exec it, error: must declare scalar variable "@mytime". if this: set @sqlcommand = 'select top 1 mytime, ' + @colname + ' ' + @tablename + ' mytime>=''' + @vardate + ''' order mytime' it works well, need use data. thanks in advance.

groovy - Setting up timeout in buildflow jobs jenkins -

i'm trying set timeout jenkins job build flow type , cannot figure out how to. found piece of code job('myjob') { wrappers{ timeout{ noactivity(180) failbuild() } } } but not know how include in job. please help. thank you.

drupal 7 - Add token on php page -

i need find user signed on can @ tags. plan write simple php code in page, start current user, find contact , @ tags sql. added token filter , token insert token [current-user:uid] is still not replaced. i have created basic page in drupal added text , token. expected token replaced uid see token. use following module https://www.drupal.org/project/token_insert . configure field inserting token. edit : you need download token_filter module. go token ui configure page link " admin/config/content/formats ". on page see different text formats viz (filtered html, full html, plain text), click on configure link in of these options. example if click on configure filtered html redirected on following link " admin/config/content/formats/filtered_html ". on page under enable filters there option says " replace tokens ". check , save settings. insert token in editor check view.

javascript - How to add hyperlink in the min.js function -

function(){i.image&&(s.cover.classlist.add(o+"-cover"),s.cover.style.width=i.imagewidth+"px", s.cover.style.backgroundimage="url("+i.image+")", s.cover.style.height=i.imagewidth+"px", i.rtl?s.toastbody.style.marginright=i.imagewidth+10+"px":s.toastbody.style.marginleft=i.imagewidth+10+"px",s.toast.appendchild(s.cover))}(), the outcome javascript above below: <div class="izitoast-cover" style="width: 70px; background-image:url”../img/123.jpg”);"></div> i add onclick function on become: <div class="izitoast-cover" **onclick="location.href='newurl.html';"** style="width: 70px; background-image: url”../img/123.jpg”);"></div> i have try s.cover.onclick.location.href='newurl.html', not working. can tell me should add on js code? so add event listener s.cover.addeventlistener("click", f

javascript - How to animate along a curved path using gravity -

i'm trying create simulation in ball follows motion path, similar this: https://bl.ocks.org/mbostock/1705868 however, instead of using tweening, ball's motion determined gravity , object's velocity - similar rollercoaster, this: https://www.myphysicslab.com/roller/roller-single-en.html this have far, there's small problem in roller coaster gaining energy, instead of losing it, each frame: https://jsbin.com/jidazom/edit?html,js,output x any suggestions on how fix appreciated! you can try js bin . modified code fit own understanding of effects of gravity. in calculations, use vertical component of slope, calculated @ current position (using small delta on each side, , not relying on previous position): function geteffectivegravityfactor() { // vertical component of slope @ current position var delta = 0.001; var pathpos1 = math.min(maxrange, math.max(delta, pathpos)); var pos1 = pathel.getpointatlength(pathpos1 - delta); var pos2

windows - How to change default value of AllUsersProfile environment variable. -

i want map default location of alluserprofile other folder. i following below link no luck far https://www.pcreview.co.uk/threads/changing-userprofile-and-allusersprofile.4047094/ i believe want registry key hklm\software\microsoft\windows nt\currentversion\profilelist . the easiest way is: when installing windows, create temporary user account admin rights. log in temporary account, change default user profile directory, , restart (i believe registry change doesn't take effect until restart); log in temporary account , create "real" / permanent user accounts. make sure @ least 1 of these has admin rights. log in "real" admin account , delete temporary / dummy account created during install. if have existing profiles want move, becomes more difficult, because the registry change not affect existing user profiles. iirc cannot move existing profiles while windows running. have boot recovery mode console , use robocopy move user pr

awk command (cygwin) is giving me empty file -

i'm trying compare data 2 files using awk command (cygwin). 1 file has names of transcription factors , other file (database) has genes(rows) different cells (columns). i'm using: awk -f, 'fnr==nr {a[$1]; next}; $1 in a' tf.csv db.csv > output.csv but it's gives empty file , when keep names of genes form database file works. if same command run on terminal of linux runs perfectly.

php - UTF-8 all the way through -

i'm setting new server, , want support utf-8 in web application. have tried in past on existing servers , seem end having fall iso-8859-1. where need set encoding/charsets? i'm aware need configure apache, mysql , php - there standard checklist can follow, or perhaps troubleshoot mismatches occur? this new linux server, running mysql 5, php 5 , apache 2. data storage : specify utf8mb4 character set on tables , text columns in database. makes mysql physically store , retrieve values encoded natively in utf-8. note mysql implicitly use utf8mb4 encoding if utf8mb4_* collation specified (without explicit character set). in older versions of mysql (< 5.5.3), you'll unfortunately forced use utf8 , supports subset of unicode characters. wish kidding. data access : in application code (e.g. php), in whatever db access method use, you'll need set connection charset utf8mb4 . way, mysql no conversion native utf-8 when hands data off applicati

Not able to Install python package libportaudio-dev via pip on Windows 10 -

Image
python version : 2.7.13 pip version: 9.0.1 error: not find version satisfies requirement libportaudio-dev(from version:) no matching distribution found libportaudio-dev pip installs packages pypi , there no libportaudio-dev @ pypi. it's not python package. a package in ubuntu. to install on w32 have download source code , compile it. see the instructions . there old precompiled binaries @ https://github.com/adfernandes/precompiled-portaudio-windows https://github.com/spatialaudio/portaudio-binaries — these ones more fresh.

java - Data model mapping from Json with Gson returns null -

i have json { "meta data": { "1: symbol": "stock", "2: indicator": "sma", "3: last refreshed": "2017-07-25 09:50:00", "4: interval": "daily", "5: time period": 3, "6: series type": "open", "7: time zone": "us/eastern" }, "technical analysis: sma": { "2017-07-25 09:50:00": { "sma": "266.6264" }, "2017-07-24": { "sma": "265.9137" }, "2017-07-21": { "sma": "265.3237" } }} and i've mapped these classes in order model filled directly gson library (stock, metadata, techanalysis, dayvalue): public class stock { private metadata metadata; private techanalysis tech; public metadata getmetadata() { return metadata; } public void setmetadata(metadata metadata) {

c++ - Gdiplus::Bitmap::FromHBITMAP memory leakage -

i call repeatedly code getting memory leakage: ulong_ptr gdiplustoken; int screen_height; int screen_width; cvcamstream::cvcamstream(hresult *phr, cvcam *pparent, lpcwstr ppinname) : csourcestream(lpcstr(filter_name),phr, pparent, ppinname), m_pparent(pparent) { hdc = getdc(null); gdiplus::gdiplusstartupinput gdiplusstartupinput; ulong_ptr gdiplustoken; gdiplusstartup(&gdiplustoken, &gdiplusstartupinput, null); screen_height = getsystemmetrics(sm_cyvirtualscreen); screen_width = getsystemmetrics(sm_cxvirtualscreen); } cvcamstream::~cvcamstream() { gdiplus::gdiplusshutdown(gdiplustoken); deletedc(hdc); } hresult cvcamstream::fillbuffer(imediasample *pms) { reference_time rtnow; reference_time avgframetime = ((videoinfoheader*)m_mt.pbformat)->avgtimeperframe; static clock_t refclock = clock(); double elapsed = (clock() - refclock) / (double)clocks_per_sec; rtnow = m_rtlasttime; m_rtlasttime += avgframetime;

php - Symfony2 custom access denied handler -

i'm trying restrict calls inside symfony 2.8 app localhost, far i've managed via security.yml problem cannot change access denied page. i followed symfony2 documentation link but no success, on debug toolbar not find firewall path. this security.yml providers: in_memory: memory: ~ firewalls: secured_area: pattern: ^/register access_denied_handler: app.security.access_denied_handler anonymous: ~ dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false access_denied_handler: app.security.access_denied_handler main: anonymous: ~ access_denied_handler: app.security.access_denied_handler access_control: - { path: ^/register, roles: role_admin, allow_if: "'127.0.0.1' == request.getclientip()" } i not understand how configure /register path go through secured_area firewall rule , use access_denied_handler: app.security.access_denied_handler ser

issue while installing the python in windows server 2016 in google cloud platform -

i want install python in windows server 2016 have created new instance of windows server 16 in google cloud platform . in installation sequence python window throwing error of (installation forbidden system policy) can 1 me on come barrier install python in terminal server , use . thank you

mysql - Update Whole Table adding value from previous row -

Image
table acc if edit "a" amount 100 total amount change whole table need update... mysql query updating whole table adding (credit) or subtracting (debit) previous total amount... as commented @gordon linoff, can archive goal using after update trigger , loop. wrote idea below example. delimiter // create trigger acc_after_update after update on acc each row begin declare done int default false; declare type varchar(10); declare total_amount default 0; declare name varchar(10) declare amount int; declare cur1 cursor select name, type, amount acc; declare continue handler not found set done = true; open cur1; repeat fetch cur1 name, type, amount; if not done case type when 'credit' = total_amount + amount; when 'debit' total_amount = total_amount - amount end case update acc set amount = total_amount name = @name --not sure syntax end if; until do

Python Tkinter GUI User Login Accepting any Username with Correct Password -

alright must missing silly or obvious here have created method check username , password inside of gui , weird things. can type in username long password correct, accept it. have looked @ other similar questions haven't seen answer accounts issue. see i'm doing wrong here? thanks def correct_login(text): stored_user = user_entry.get() if stored_user == "admin" or "admin": stored_pass = pass_entry.get() if stored_pass == "password": user_entry.delete(0, 'end') pass_entry.delete(0, 'end') pass_win.destroy() else: user_entry.delete(0, 'end') pass_entry.delete(0, 'end') mb.showwarning("incorrect credentials", "the username or password have entered incorrect.") else: user_entry.delete(0, 'end') pass_entry.de

javascript - Executing infinite scroll on dynamically created content -

i have page load content using mysql database. , users can filter content using few buttons , content replaced dynamically pulled data using jquery. link use in infinite scroll change. infinite scroll plugin seems take same old link , not newly loaded link trigger scroll. jquery infinity scroll plugin use https://cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.1.0/jquery.infinitescroll.js this code <div class="container" id="myposts"> <div class=”post”> <p>my content</p> </div> </div> <nav id="page-nav"><a href="myposts.php?page=2"></a></nav> //jquery code $('#myposts').infinitescroll({ navselector : '#page-nav', // selector paged navigation nextselector : '#page-nav a', // selector next link (to page 2) itemselector : '. post ', // loading: { finishedmsg: 'end of page&#

IOS/Objective-C: Deallocate web view in Detail View Controller -

i have master table , detail view controller. detail vc shows urls through web view. if using built in navigation of master/detail setup, if go , press different table cell, detail view update web view. true whether use uiwebview or wkwebview . however, within detail view, without having go table, want give user option view more 1 url through same web view. trying in viewwillappear changing url request. however, uiwebview (or alternatively wkwebview ) continue show same url. can't seem rid of first url. i've tried kinds of ways close or stop existing web view, clear cache, delete cookies etc. before reloading new 1 still see same url. appreciate suggestions. here code , of things i've tried don't work: -(void) changeurl: (nsnumber*)param { nsurl *testurl1=[nsurl urlwithstring:@"http://www.apple.com"]; nsurl *testurl2 =[nsurl urlwithstring:@"http://www.google.com"]; //if param 1 { _urltoload = testurl