Posts

Showing posts from March, 2012

GDI+ WinForms Program works differently on different computer -

i wrote vb 2015 gdi+ winforms program on desktop. works there. involves 600x600 image, , clicking on image changes color of 10x10 box on image mouse clicked. but, on laptop, clicking on image changes 10x10 box , 3 other boxes outside image, right, right lower, , lower ( i.e. east, southeast, , south) areas of form outside image. example, clicking on desktop gives: ------- | x | | | ------- while clicking on laptop gives: ------- | x | x | | ------- x x . both machines windows 7 pro 64-bit sp1. doesn't matter screen resolution used - work correctly on desktop, , work incorrectly on laptop. it doesn't matter whether

mysql - SELECT list is not in GROUP BY clause and contains nonaggregated column -

this question has answer here: error related only_full_group_by when executing query in mysql 15 answers receiving following error: expression #2 of select list not in group clause , contains nonaggregated column 'world.country.code' not functionally dependent on columns in group clause; incompatible sql_mode=only_full_group_by when running following query: select countrylanguage.language, country.code, sum(country.population*countrylanguage.percentage/100) countrylanguage join country on countrylanguage.countrycode = country.code group countrylanguage.language order sum(country.population*countrylanguage.percentage) desc ; using mysql world test database ( http://dev.mysql.com/doc/index-other.html ). no idea why happening. running mysql 5.7.10. any ideas??? :o as @brian riley said should either remove 1 column in select select countrylan

ios - Setting NavigationController as an initial controller -

i have 2 navigation controllers. how can set second 1 - stopwatch initial navigation controller? - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; self.window.backgroundcolor = [uicolor whitecolor]; self.swipebetweenvc = [swipe new]; [self setuprootviewcontrollerforwindow]; self.window.rootviewcontroller = self.swipebetweenvc; [self.window makekeyandvisible]; return yes; } - (void)setuprootviewcontrollerforwindow { uistoryboard *storyboard1 = [uistoryboard storyboardwithname:@"main" bundle: nil]; stopwatch *controller1 = (stopwatch *)[storyboard1 instantiateviewcontrollerwithidentifier:@"stopwatch"]; uinavigationcontroller *stopwatch = [[uinavigationcontroller alloc] initwithrootviewcontroller:controller1]; name

f# - ASP.NET WebAPI unable to post -

i unable post data asp.net webapi server. i can data webapi server. however, unable post. the following code fails post: response = await client.postasync("api/cars", content); error: statuscode: 415, reasonphrase: 'unsupported media type', version: 1.1 client: [testclass] public class unittest1 { // http://www.asp.net/web-api/overview/advanced/calling-a-web-api-from-a-net-client [testmethod] public async task testmethod1() { using (var client = new httpclient()) { client.baseaddress = new uri("http://localhost:48213/"); client.defaultrequestheaders.accept.clear(); client.defaultrequestheaders.accept.add(new mediatypewithqualityheadervalue("application/json")); // http var response = await client.getasync("api/cars"); if (response.issuccessstatuscode) { var result = await response.conte

c# - IdentityServer3 - Exception handling -

is there way handle exceptions ourselves. have custom user service code inside our identityserver project , know without diving through logs when errors occur. we have centralized error logger our apps. i'd imagine similar needed if using 3rd party exception lib (airbrake etc). is there possible @ moment or ticket solving problem https://github.com/identityserver/identityserver3/issues/2012 if care error logging - event service log unhandled exceptions. the issue mentioned allow have more control on direct error handling (e.g. setting custom http response) - that's backlog right now.

How to update avatar from SoundCloud API in ruby? -

how can update user's avatar on soundcloud? soundcloud.new( { :client_id => client_id, :client_secret => client_secret, :access_token => user.all[1].code }).put('/me', :user => {:avatar_url => file.new(rails.root.join('test.jpg').to_s, 'rb')}) i tried code not working. tried fields :avatar, :image

ruby - How can I display a default message while running rails migrations? -

we moving our table data different database archival. so, when users add migrations in main db want display default message reminding them perform same migration table in archived db. how can without having add message manually in migration ? prakash proposes elegant solution. original question overriding default tasks add message believe. maybe try this. courtesy: http://metaskills.net/2010/05/26/the-alias_method_chain-of-rake-override-rake-task/ rake::taskmanager.class_eval def alias_task(fq_name) new_name = "#{fq_name}:original" @tasks[new_name] = @tasks.delete(fq_name) end end def alias_task(fq_name) rake.application.alias_task(fq_name) end def override_task(*args, &block) name, params, deps = rake.application.resolve_args(args.dup) fq_name = rake.application.instance_variable_get(:@scope).dup.push(name).join(':') alias_task(fq_name) rake::task.define_task(*args, &block) end now can override rake db:migrate this.

how to split the series of no using php -

array([0] => 1,2,3,4,5) this input pattern have in code. have split value , need output below array ( [0] => 1, [1] =>2, [2] => 3, [3] =>4, [4] =>5 ) try like $avalues="1,2,3,4,5"; $myarray = explode(',',$avalues); print_r($myarray);

c# - ASP.NET: How to end session when the user clicks log-out? -

i ask on how end session in asp.net when user clicks log-out because 1 of professors found out when clicks log-out , click button on browser, session still active , wants specific session ended, , happen when click log-out. thank you. the abandon method should work (msdn): session.abandon(); if want remove specific item session use (msdn): session.remove("youritem"); edit: if want clear value can do: session["youritem"] = null; if want clear keys do: session.clear(); if none of these working fishy going on. check see assigning value , verify not getting reassigned after clear value. simple check do: session["yourkey"] = "test"; // creates key session.remove("yourkey"); // removes key bool gone = (session["yourkey"] == null); // tests remove worked this kelsey's answer click here

java - Hibernate - Property being many-to-one and component at the same time? -

i'm new hibernate, migrating mybatis. i've customer bean, i'm trying save (insert) using xml mapping. shorter version of code: beans: public class customer { private integer id; private string code; private systemobject systemobject = new systemobject(); } public class systemobject { private integer objectid; private integer useridcreate; private integer useridupdate; private date createdate; private date updatedate; private workspace workspace = new workspace(); } public class workspace { private integer id; private string code; private string name; } as can see, customer has systemobject. systemobject general object, beans across code has one. systemobject has workspace. the problem is, table customer, has reference object, , workspace too . in "objects world", workspace id doing getsystemobject().getworkspace().getid(), don't know how in hibernate tables (currently on postgresql

sql - In SSRS Need Optional Union Query or Equivalent -

i've inherited ssrs report doesn't work correctly. report meta report of document management system. fwiw, monthly destruction report -- documents destroyed per retention policy. kicker in application there special "stack_location" values represent content status, e.g. 86/86/86 meaning document checked out not returned. given document can have 1 stack location, or 1 special stack location value. the basic query returned appropriate documents. original designer, created filter list excluded special values. intended. however, designer apparently assumed these special value exclusions toggled clicking on radio button in options section. this, of course, not work. indeed, whole approach seems off. i think need default query includes , not in ('86/86/86', '96/96/86'...), somehow optional unions special values. @ sea, however, on how accomplish this. it seems relatively straight forward if using vb, or c#, write different dynamic queries based on v

android - How to customise Media controller in exoplayer -

i'm searching 2 days find out how change media controller in exoplayer , resources refer link http://www.brightec.co.uk/ideas/custom-android-media-controller . please correct me if i'm wrong think in tutorial can customize old media player in android not exoplayer. reference from: http://google.github.io/exoplayer/doc/reference/ a playbackcontrolview can customized setting attributes (or calling corresponding methods), overriding view's layout file or specifying custom view layout file, outlined below.

computer science - Induction on String? (automata related) -

honestly, know mathematical induction follow: 1. prove p(0) - base step 2. n ≥ 1, prove (p(n − 1) -> p(n)) - inductive step and here image of induction problem struggling (please click) i trying solve problem above image, can't. new kind of thing, have no idea , cannot infer little knowledge. i don't know how start , don't know how can apply little knowledge described above problem. thank if can me on above problem careful explanation.. as hint, let p(k) statement "any language k strings regular." using induction idea, you'd need following: prove language 0 strings in regular. can language no strings in it? can build dfa, nfa, or regex such language? assume language n-1 strings regular, prove language n strings regular. if language has n strings in it, can split language n-1 strings in , language 1 string in it. can first language? if had regex it, adapt regex language 1 more string in it?

scala - Spark : Error Not found value SC in spark1.2.1 -

getting below error in spark shell 1.2.1 scala> sc.textfile("/user/cloudera/departments").collect().foreach(println) <console>:11: error: not found: value sc sc.textfile("/user/clouderadepartments").collect().foreach(prenter code hereintln) below how starting spark-shell [cloudera@quickstart ~]$ cd spark-1.2.1-bin-hadoop2.4 [cloudera@quickstart spark-1.2.1-bin-hadoop2.4]$ bin/spark-shell --master local

sockets - Continue to use the same connection after receiving [FIN, ACK] -

i see servers stop connection once single request done sending [fin, ack] from wiki, a connection can "half-open", in case 1 side has terminated end, other has not. side has terminated can no longer send data connection, other side can. terminating side should continue reading data until other side terminates well. in case want speed requests avoiding repeating handshake per request. possible client keep communicating server terminated end? there response server or server read request without responding? usually, when terminate write half of tcp connection, means you're done communicating , wait partner (whether it's server, client or equal counterpart) finish it's transmissions. when partner ready, terminates write half , tcp connection closed. so if server has terminated end, you're still able send data reliably, aren't able receive result. if don't want handshakes in tcp, why not taking protocol without handshakes? examp

asp.net core - Purpose of options.AutomaticAuthenticate with UseJwtBearerAuthentication -

after updating codebase asp 5 beta 7 rc1-final, began receiving exception jwtbearer middleware unable cast object of type 'newtonsoft.json.linq.jarray' type 'system.iconvertible'. the determining factor can see far appears setting of options.automaticauthenticate. if it's true , exception, otherwise, not. what automaticauthenticate , why need enable it? app.usejwtbearerauthentication(options => { options.automaticauthenticate = true; } here full stack trace: at system.convert.toint32(object value, iformatprovider provider) @ system.identitymodel.tokens.jwt.jwtpayload.getintclaim(string claimtype) @ system.identitymodel.tokens.jwt.jwtpayload.get_nbf() @ system.identitymodel.tokens.jwt.jwtsecuritytokenhandler.validatetoken(string token, tokenvalidationparameters validationparameters, securitytoken& validatedtoken) @ microsoft.aspnet.authentication.jwtbearer.jwtbearerhandler.<handleauthenticateasync>d__1.m

javascript - How to pass angular value when input type file changed -

i'd create thumbnail when choose new image review. ng-change doesn't work input type file in angular , use onchange instead. <div ng-repeat="images in listimages"> <img id="imageid{{$index}}" ng-src="images.filelocation"> <input type="file" onchange="angular.element(this).scope().imagepreview(this, imageid{{$index}})" accept="image/*" /> </div> $scope.imagepreview = function(fileinput, imageid) { if (fileinput.files && fileinput.files[0]) { var reader = new filereader(); reader.onload = function (e) { $('#' + imageid).attr('src', e.target.result); } reader.readasdataurl(fileinput.files[0]); } } using code above, there's error. couldn't read imageid{{$index}}. there ways pass imageid index imagepreview method? if don't misunderstand why don't use "ng-file-upload" directive u

php - wordpress get_categories function not working -

i trying retrieve categories category taxonomy of custom post type below codes : $categories = get_categories(array( 'type' => 'ad_listing', 'child_of' => 0, 'parent' => '', 'orderby' => 'name', 'order' => 'asc', 'hide_empty' => 1, 'hierarchical'=> 1, 'exclude' => '', 'include' => '', 'number' => '', 'taxonomy' => 'ad_cat', 'pad_counts' => false )); echo"<pre>"; print_r($categories); echo"</pre>"; but not showing nothing in category though there 3 categories. think doing wrong :( can check post assing in category or not.if post not assing category no category show. if want show category w

css - default margin a4 print -

im creating div wich can printed. it going printed on 1 laying a4 paper. i use in css width: 297mm; height: 210mm; but if want print there margins on sides (by default). now if user going print div going spread on 2 pages cause of margins. are there default sizes margins it's printable on every printer default. does ony know these margins user can print in on 1 page? do have block defined display style, think cover problem. defining width , height may float element outside container. try doing this: display: inline-block; block. think work.

javascript - jquery: listing out ready handlers -

i'm trying trace slowdown on load of web page in our application , there's ton of javascript go through i'd rather not process them individually. i'm trying see if there's way list out event handlers added $(document).ready() through handlers see might causing problem. is there way this? i able overriding jquery's ready function store references handlers, i.e. var readylist = []; var origready = jquery.fn.ready; jquery.fn.ready = function() { if ((arguments.length) && (arguments.length > 0) && (typeof arguments[0] === 'function')) { readylist.push(arguments[0]); } origready.apply(this, arguments); }

php - i uploaded my site to hostinger but i encountered the following problems -

warning: mysql_connect(): access denied user 'root'@'10.2.1.12' (using password: no) in /home/u749031689/public_html/enrollment/includes/dbcon.php on line 8 access denied user 'root'@'10.2.1.12' (using password: no)not <?php $server="localhost"; $unamedb ="root"; $passdb =""; $dbname="u749031689_enrol"; $sqlcon = mysql_connect($server, $unamedb, $passdb) or die (mysql_error(). "not connected"); mysql_select_db($dbname, $sqlcon); ?> you have create database hostinger server , need replace '$server', '$unamedb', '$passdb' , '$dbname' values per hostinger database details. your code follows. <?php $server="your hostingers database server name"; $unamedb ="your hostingers database user name"; $passdb ="your hostingers database password"; $dbname="u749031689_enrol"; $sqlcon = mysql_connect($server, $

Remote deploy artifact to Jboss AS using JRebel -

just trying setup remote deployment of projects jboss 4.2.1 using jrebel. after enabling jrebel project in eclipse along remoting feature, asks deployed app's url in server. how know url of project can mention in jrebel remoting section? i thought of looking in jmx console project jar reside in lib folder of ear that's deployed server, wasn't able locate there. can me out? jrebel remoting requires http facing component function. makes use of http protocol using same port web container. means 0 conf (sort of) , no holes poke firewall, downside won't work apps no war module in them (yet :)). i assume app jar file inside ear. needs war module in ear. war not need have rebel.xml nor rebel-remote.xml in it. create war if 1 not exist. the url address have enter in web browser access webapp. example http://example.org:8080/mywar/ also make sure have rebel.xml , rebel-remote.xml in deployed library project (simply creating them in eclipse not enough, 2 xm

php - how to search filter multipe relation table and groupping in yii2 -

i have 3 tables riderspoint (id, namerider, serie_id, point) , series (serie_id, nameserie, location, date, season_id) , season (season_id, nameseason, year) . attribute serie_id in riderpoint table have relation serie_id in series table, , attribute season_id in series table have relation season_id in season table. how make search season_id in riderpoint ? , how groupping point when have data table in same season ? please me.. search (filter , sort) related field in gridview base series of action.. can find sample in doc http://www.yiiframework.com/wiki/653/displaying-sorting-and-filtering-model-relations-on-a-gridview/ in brief.. in model define active relation in (main/pivot) model , add getter related field in modelsearch in dataprovider add var fo related field, set proper sort sorting new related field, add relation in search function , adding proper filter in modelsearch condition add new attribute gridview.. take deep scenario 2 in link p

javascript - Add info window to placemarks -

i using geoxml3 in order parse kml files. question how able extract description kml file each placemark , place in info window? till following code: function displaykml() { initialize(); parser = new geoxml3.parser({ map: map, processstyles: true, createmarker: addmymarker, createoverlay: addmyoverlay }); parser.parse("uploads/" + document.getelementbyid('<%= text2.clientid %>').value); } function addmymarker(placemark) { // marker handling code goes here parser.createmarker(placemark); } function addmyoverlay(groundoverlay) { // overlay handling code goes here parser.createoverlay(groundoverlay); } geoxml3 creates infowindows placemarks default in default createxxx functions. if override them have create infowindows in version if want them. start copying code in default function, changing a

Bash, grep between a line with specified string till a character (not include) -

example: > header abc , blablabla some_lines1 some_lines2 some_lines3 > header bcf , blablabla some_lines4 some_lines5 > header abc , blablabla some_lines6 >...... here want grep line ' abc ' , lines after before ' > ', result should like: > header abc , blablabla some_lines1 some_lines2 some_lines3 > header abc , blablabla some_lines6 > ... since number of lines in between not fixed, can't apply grep -a i've tried using sed, doesnt work well: sed -n '/abc/,/>/p' file unwanted result: > header abc , blablabla some_lines1 some_lines2 some_lines3 > header bcf , blablabla > header abc , blablabla some_lines6 another sed: sed -n '/abc/,/>/{/abc/b;/>/b;p}' file unwanted result: some_lines1 some_lines2 some_lines3 some_lines6 you can use awk : awk '/^>/{p=0} /abc/{p=1} p' file > header abc , blablabla some_lines1 some_lines2 some_lines3 > header abc , blabl

entity framework - WebApi OData: $filter 'any' or 'all' query not working -

first, using asp.net webapi tutorials i've created basic apicontroller exposes entity framework model through odata . service works return json odata $filter queries. when perform odata $filter queries include "any" or "all" queryies on multi-value property throws odataexception here's odata query i'm trying use ~/api/blogs?$filter=any(tags,name+eq+'csharp') my apicontroller looks this: public class blogcontroller : apicontroller { public blogscontroller() { this.entities = new blogentities(); } public contactentities entities { get; set; } [queryable(pagesize = 25, allowedqueryoptions = allowedqueryoptions.all)] public iqueryable<blog> get() { return this.entities.blogs; } } the blog entity has contract public blog { public guid id { get; set; } public string title { get; set; } public tag tags { get; set; } } public tag { public guid id { get; set; }

AngularJS: ng-repeat list is not updated when a model element is spliced from the model array -

i have 2 controllers , share data between them app.factory function. the first controller adds widget in model array (pluginsdisplayed) when link clicked. widget pushed array , change reflected view (that uses ng-repeat show array content): <div ng-repeat="plugind in pluginsdisplayed"> <div k2plugin pluginname="{{plugind.name}}" pluginid="{{plugind.id}}"></div> </div> the widget built upon 3 directives, k2plugin, remove , resize. remove directive adds span template of k2plugin directive. when said span clicked, right element shared array deleted array.splice() . shared array correctly updated, change not reflected in view. however, when element added, after remove, view refreshed correctly , previously-deleted element not shown. what getting wrong? explain me why doesn't work? there better way i'm trying angularjs? this index.html: <!doctype html> <html> <head> <script sr

android - TextInputLayout not reverting original edit text background on setError(null) -

Image
i using textinputlayout appcompatedittext having custom xml shape based background appcompatedittext . my textinputlayout is: where @drawable/edittext_bg : when set error on textinputlayout , background turns red ok. on removing error using seterror(null) , background turns grey, not original one.

c# - IIS combined with WatiN system.nullreferenceexception -

so im having bit off problem, when creating new instance off firefox watin. some info might find important! i able run code on iis exspress, , in winform. .net trust level on full(internal) admin credentials. i set references copy local = true (i did after exeption started taking place) the error happens here: public string msg(string username, string password, string msg, string group, list<string> id, bool test) { using (firefox _ff = new firefox())//nullreferenceexception { lot of code } } this calls msg: else if (radiobutton1.checked) { msgbot.setapartmentstate(apartmentstate.sta); msgbot.start(); msgbot.join(); } blocker = true; } server.transfer("done.aspx", true); } protected void sendmsgtobot() { msger.msg("username", "password", textbox1.text , &quo

android - Is it possible to save file programatically in internet modem/dongle? -

i know question pretty different & possibly not being posted here. still asking & want know that is possible save file programatically in internet modem/dongle? for example, i have modem connected laptop. now, want store file pdf android app modem. just want know clues this.

android - RESTfull web service using oAuth for mobile application -

i building application consists of 2 main parts: web application rest api. mobile application(android, iphone). web application has database stores data users (like posts, events , similar). mobile application uses web application's rest api access data, need kind of authentication (user must authenticate in order access/modify data). i know done in such way mobile application provides username , password in each request towards web api, , web application authenticates username , password against database before serving request. however, use oauth (so user can login using google, facebook, ...) , things complicated, , not sure best way this. my first idea : mobile app sends oauth provider (for example facebook) credentials (username , password) web app, authenticates them against oauth provider. realized not ok because means user has trust site not abuse given credentials, not way done. not good my second idea : mobile app uses web application api tell web app w

objective c - iOS - Pass data from one viewcontroller to use in the init method of another viewcontroller -

i'm able pass data between 2 view controllers using prepareforsegue method. in way, passed data cannot used in second view controller's init method. also, i'm using xlform. accessing data inside init method necessary. can me solve problem. here's first view controller's prepareforsegue method: - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([[segue identifier] isequaltostring:@"sessiontoworkout"]) { workoutsviewcontroller *vc = [segue destinationviewcontroller]; nsindexpath *indexpath = [self.tableview indexpathforselectedrow]; uitableviewcell *selectedcell = [self.tableview cellforrowatindexpath:indexpath]; cellname = selectedcell.textlabel.text; nsstring *sectiontitle = [self tableview:self.tableview titleforheaderinsection:indexpath.section]; sectionname = sectiontitle; vc.sectionname = sectionname; vc.cellname = cellname; } } and

Haskell Space Leak -

Image
all. while trying solve programming quiz: https://www.hackerrank.com/challenges/missing-numbers , came across space leak. main function difference , implements multi-set difference. i've found out list ':' , triples (,,) kept on heaps -ht option profiling. however, big lists difference 's 2 arguments, , shrinks difference keeps on tail recursion. memory consumed lists keeps increasing program runs. triples ephemeral array structure, used bookkeeping count of multiset's each element. memory consumed triples keeps increasing, , cannot find out why. though i've browsed similar 'space leak' questions in stackoverflow, couldn't grasp idea. surely have study. i appreciate comments. thank you. p.s) executable compiled -o2 switch. $ ./difference -ht < input04.txt stack space overflow: current size 8388608 bytes. $ ghc --version glorious glasgow haskell compilation system, version 7.6.3 . import data.list import data.array -- arra

actionscript 3 - as3 scaleX by percent of mc size -

how scale x of mc percentage? for example have var percent. starts @ 0 , goes 100. mx.scalex = 33; not work needs .33 or .3 again numbers working 0 though 100 , need percentage of written in ways scalex can handle it. // other code correct percent; // result 0 through 100 yellowprogress.scalex = percent; if percent 100, scalex should 1 - so: 1 (as percent ) 1% of 100 (maximum percent ), need 1% of 1 (maximum scalex ) 0.01. 1% of something, divide 100. so yellowprogress.scalex = percent / 100; trick.

php - mysql LOCK TABLE - no "commit" of data until UNLOCK -

i have curious problem - have php (5.5.9) script writes mysql (5.6.27) database. pseudocode looks this: lock table write, b write, ... , c write; -- inserts/updates unlock tables; if script runs fine. if stop script half-way operations performed not committed (i not using transactions). i baffled, thought there no transaction-like logic when comes lock, no other sessions able access tables. can please me understand going on under hood prevent data being persisted in scenario? thank :)

c# - How to use GL.Ortho in OpenTK correctly? -

i paint figures using glcontrol (opentk) in windows forms. however, problem cannot figure out, how use gl.ortho() method. here code have written: public partial class form1 : form { public form1() { initializecomponent(); } private void glcontrolpaint(object sender, painteventargs e) { glcontrol.makecurrent(); gl.clear(clearbuffermask.colorbufferbit | clearbuffermask.depthbufferbit); gl.viewport(150, 150, 300, 300); //gl.ortho(0, 1, 0, 1, -1, 1); gl.clearcolor(color.white); paintsquareorborder(beginmode.quads, color.cyan, 0.2, 0.2, 0.45, 0.2, 0.45, -0.2, 0.2, -0.2); paintsquareorborder(beginmode.quads, color.cyan, 0.1, -0.1, 0.1, 0.1, 0.2, 0.2, 0.2, -0.2); paintsquareorborder(beginmode.quads, color.cyan, -0.2, -0.2, -0.45, -0.2, -0.45, 0.2, -0.2, 0.2); paintsquareorborder(beginmode.quads, color.cyan, -0.1, 0.1, -0.1, -0.1, -0.2, -0.2, -0.2, 0.2); paintsquareorborder(b

php - Issues with Wordpress URL -

i've installed wordpress on 2 websites on 2 different domain. xyz.com 123.com both website has installed same version of wordpress. now, i've moved files of xyz.com 123.com , changed url 123.com xyz.com wordpress settings. but there still showing base url 123.com . how can replace url permanently xyz.com ? thanks here steps can follow: 1) open phpmyadmin or other mysql client. 2) open wp_options table. 3) search siteurl & home , change url there. 4) dump sql file , search replace occurrences of url new url, , upload new changes. (make sure have backup of sql dump). you done..

phpbb3 - How can I mass edit mysql tables in one field ONLY WHEN another field meets exact requirements? -

a situation looks that: want make mass edit in mysql database phpbb 3. have seen mysql queries here told me how can such mass edit (for example) post_text , change links. i know can way: update phpbb_posts set post_text='new_link.eu' post_text 'old_link.eu'. and know change of links old_link.eu new_link.eu. but situation different. want make edit posts meet exact requirements. there simple - want query change posts have specific forum_id field (they belong proper subforum, want see change). i believe thing helpful many people using different scripts. thanks in advance! unless there's complexity requirement can't see here, should able easily. update phpbb_posts set post_text='new_link.eu' post_text = 'old_link.eu' , forum_id = <<whatever>> you should table contents before this. if fat-finger in query, hard recover unless have backup. you might try select * phpbb_posts

ios - How can I use a singleton model to manage CoreBluetooth? -

okay, have been checking out singleton model past couple of days , find singleton model need implement manage bluetooth current app. put in central manager , peripheral functions corebluetooth api in singleton defined. when tried call function viewcontroller, kept getting multiple errors "cannot invoke central manager argument list of type ((cbcentralmanager, diddiscoverperipheral: cbperipheral, advertisementdata: [string : anyobject], rssi: nsnumber).type) bluecoremanager.shared.centralmanager(cbcentralmanager, diddiscoverperipheral: cbperipheral, advertisementdata: [string : anyobject], rssi: nsnumber) this 1 of many errors got. bluecoremanager singleton in above line. so did more digging , found outdated source code on github used singleton model bluetooth management. saw singleton defined each function (select peripheral, connect peripheral, read peripheral etc) protocol defined each one. best practice? need write specific commands multiple peripherals. also, in sou

networking - NRF24L01 and arduino does not communicate correctly -

Image
i trying exchange data between 2 atmega328p through nrf24l01. 1) library , sketch use tmh20 library here . , use getting started sketch start here . i send first arduino witht code bool radionumber = 0; , second bool radionumber = 1; but getting nothing ( 5 weird character on serial console). 2) schema , electronic this image of schematic , picture of have on breadboard also plug ce -> d7 csn -> d8 sck -> d13 mosi ->d11 miso ->d12 i add 10 micro farad capacitor between gnd , vcc of nrf24l01. my voltage supply come power generator ( current consomption 0.6 2 arduino 2 nrf24l01 ). power supply provide 5 v , derive 3.3 v using lm3940 using first schema (simplied ) on datasheet here 3) symptom nothing appear on serial console except 5 weird characters.i can't see light activity on nrf24 module. if have idea debug thing ? all best vincent if not see written setup part of code: serial.begin(115200); serial.println(f("rf24/

linux - grep and tee to identify errors during installation -

in order identify if installation has errors should notice, using grep command on file , write file using tee because need elevate permissions. sudo grep -inw ${logfolder}/$1.log -e "failed" | sudo tee -a ${logfolder}/$1.errors.log sudo grep -inw ${logfolder}/$1.log -e "error" | sudo tee -a ${logfolder}/$1.errors.log the thing file created if grep didn't find anything. there way can create file if grep found match ? thanks you may replace tee awk , won't create file if there nothing write it: ... | sudo awk "{print; print \$0 >> \"errors.log\";}" but such feature of awk used. i'd rather remove empty error file if nothing found: test -s error.log || rm -f error.log and, way, may grep multiple words simultaneously: grep -e 'failed|error' ...

html - Apply automatically apply cell-spacing or padding based on "margin" given for IE -

o have polyfill ie7 transforms display:table actual tables , i'm using ie7.js ( ie9.js file). both working wonderfully , both doing great job allowing devs think less on ie7. this have (join of main sheet , ie7 specific sheet): /*ie7*/ .sidebyside{ display:table; } .sidebyside > *{ display:table-cell; } /*main*/ .a{ margin-left: 20px; } <li> <div class="sidebyside"> <img class="img" src="img"> <div class="sidebyside"> <div class="a">info a</div> <div class="a">info b</div> </div> <div>ok</div> </div> </li> this polyfills generate: <style> ........ .a{ /* css overrides , invalidates set */ } .newclassa{ margin-left: 20px; } .newclassa > /*etc*/{ /* properties relative class */ } </style>

voip - Screen Sharing using OPensips ,Blink and Sylk server -

i want implement screen sharing using opensips , blink , sylk server utilities. when use msrp relay , opensips setup following errors: debug: session y2tmlofhnqha3mbuxg50ize0ntmyody3otcuntqzoje5mi4xnjguny4xnzu= 1009@192.168.5.178 (unbound): auth succeeded, creating new session debug: session y2tmlofhnqha3mbuxg50ize0ntmyody3otcuntqzoje5mi4xnjguny4xnzu= 1009@192.168.5.178 (unbound): connection lost: connection closed cleanly. debug: session y2tmlofhnqha3mbuxg50ize0ntmyody3otcuntqzoje5mi4xnjguny4xnzu= 1009@192.168.5.178 (disconnected): bytes sent: 408, bytes received: 0 i suspect if can use msrp relay screen sharing found im , file share features in documentation. can me implementation? can use sylk server in server setting option of blink client instead of msrprelay 5061 port?

c++ - For type modification traits, should I provide a template-typedef (aka using) convenience wrapper for typename::transform<...>::type? -

i wondering availability of template-typedefs should provide convenience wrappers classes transform types. consider (useless) example: template< t > struct whatever { typedef typename std::conditional< sizeof(t) <= sizeof(void*), int, long >::type type; }; here, std::conditional transform title, used typename transform<...>::type . also, whatever transform , used in same way. with availability of template-typedefs (aka using ), change interface to: template< t > using whatever = typename std::conditional< sizeof(t) <= sizeof(void*), int, long >::type; which simplifies usage. done cases, due required (partial) specialization, end implementation class , wrapper. in case of std::conditional , you'd end moving std::impl::conditional<...> , provide wrapper as namespace std { namespace impl { // "classic" implementation of s

java - Retrofit + Robospice JSON return POJO with Null for nested field -

in project use robospice+retrofit exchange data remoute server, work perfect 1 litle problem, - 1 of pojo objects have nested field null every time. pojo class public class snapshot { @serializedname("records_count") private integer recordscount; @serializedname("created") private string created; @serializedname("modified") private string modified; @serializedname("records") private records records; @serializedname("database_id") private string databaseid; @serializedname("revision") private integer revision; @serializedname("size") private integer size; public integer getrecordscount() { return recordscount; } public void setrecordscount(integer recordscount) { this.recordscount = recordscount; } public string getcreated() { return created; } public void setcreated(string created) { this.created = created; } public string getmodified() { return modified; } public void setmodi

wpf - XAM Data Grid change order of filter drop down list -

Image
can change order of filter drop down list. there blank option @ end of list i've put @ first position. to solve searched treeview being displayed , reassociate itemsource @ runtime. have used recordfilterdropdownopening event of xamdatagrid . code: void datapresenter_recordfilterdropdownopening(object sender, infragistics.windows.datapresenter.events.recordfilterdropdownopeningeventargs e) { recordfiltertreecontrol rftc = null; try { rftc = (e.menuitems[e.menuitems.count - 1] fieldmenudataitem).header recordfiltertreecontrol; if (rftc != null) { rftc.loaded += new routedeventhandler(rftc_loaded); } } catch (exception ex) { loginfo.logtolisteners(ex); } { rftc = null; } } void rftc_loaded(object sender, route

How do I retrieve data from database? (SAPUI5) -

Image
the graph shown want achieve (i hard-coded values) in database, status has 1 of 3 possible category values: pending, available , completed this think logic is: delivery request (count(reqid)) fulfilled (status= completed) notfulfilled (status=pending + available) i want retrieve values database , have. now, can display bar indicates delivery request. (however 2 lines not showing.) the following section of code xml file: <mvc:view controllername "sap.ui.urbanlogi.backoffice.controller.linechart" xmlns = "sap.m" xmlns:core = "sap.ui.core" xmlns:form="sap.ui.layout.form" xmlns:mvc = "sap.ui.core.mvc" xmlns:l= "sap.ui.layout" displayblock = "true" > <app> <page title = "total delivery request"> <panel id = "idlinechar

XSLT for-each, iterating through text and nodes -

i'm still learning xslt, , have question for-each loop. here's have far xml <body>here great url<link>http://www.somesite.com</link>some more text</body> what i'd if for-each loop iterate through these chunks 1. here great url 2. http://www.somesite.com 3. more text this might simple, or impossible, if can me out i'd appreciate it! thanks, michael you should able following: <xsl:for-each select=".//text()"> <!-- . have value of each chunk of text. --> <sometext> <xsl:value-of select="." /> </sometext> </xsl:for-each> or may preferable because allows have single template can invoke multiple different places: <xsl:apply-templates select=".//text()" mode="processtext" /> <xsl:template match="text()" mode="processtext"> <!-- . have value of each chunk of text. --> <sometext> <xsl:v

Django - include template tags -

currently i'm using template include in main template display form , submit back. problem none of submit buttons work inside template if placed inside main template. my code is: {% csrf_token %} {{ exampleform.management_form }} {% form in exampleform %} <form onsubmit="return false;" method="get" class="exasubmit" enctype="multipart/form-data"> <div id="example1" type="hidden"> {{ exampleform.management_form }} ( {{ form.letterofword }} + {{ form.keytouse }} ) mod 26 = {{ form.lettertofill }} <button name="action" class="validatebutton" value="validate"> validate </button> <br> </div> </form> {% endfor %} the validate button not anything. works when call in main template , not inside include template. tips? this might help {% csrf_token %} {{ exampleform.management_form }} <

multithreading - Android UI thread update from web service -

if want update ui background thread when message received web service call, below considered safe option? i'm worried potential memory leaks having handler in application class public class myapplication extends application { private static long uithreadid; private static handler uihandler; @override public void oncreate() { super.oncreate(); uithreadid = thread.currentthread().getid(); uihandler = new handler(); } public static void customrunonuithread(runnable action) { if (thread.currentthread().getid() != uithreadid) { uihandler.post(action); } else { action.run(); } } } and in class deals messages received in separate threads: new thread( new runnable() { @override public void run() { // make web service call myapplication.customrunonuithread(new runnable() { @override p