Posts

Showing posts from June, 2015

c# - Wrong path to SQLiteDB (or copy) on WinPhone. Xamarin.Forms PCL -

have installed nuget packages xamarin.forms pcl. have 4 projects droid, ios, win 8.1 , winphone 8.1. tried connect database, encountered trouble: win , winphone projects don`t see or return me wrong path. followed official xamarin.forms forum. interface: public interface isqlite { string getdatabasepath(string filename); } winphone class: using system.io; using windows.storage; using baumizer.winphone; using xamarin.forms; [assembly: dependency(typeof(sqlite_winphone))] namespace baumizer.winphone { public class sqlite_winphone:isqlite { public sqlite_winphone() { } public string getdatabasepath(string filename) { return path.combine(applicationdata.current.localfolder.path, filename); } }} this class selecting info: public class database { sqliteconnection connection; public database() { connection= new sqliteconnection(dependencyservice.get<isqlite>().getdatabasepath("database.db")); } publ

java - how to use injection between MVP layers in android? -

i have been using using dagger 2 in project lately, the problem when try build project, presenter in login activity injected below is null , and when try build project presenter cannot provided without @inject constructor or @provides- or @produces-annotated method... i don't understand have done wrong??, please me this, thanks in advance. here login activity, presenter here null, shows that, i've not injected properly @inject loginpresenter presenter; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_login); injecthelper.getrootcomponent().injectpresenter(this); presenter.setprogressbarvisiblity(view.invisible); } this presenter module @module public class presentermodule { private final loginactivity activity; public presentermodule(loginactivity activity) { this.activity = activity; } @provides @singleton public loginactivity providesview() { return a

java - Insert with Select give sql-error (SQLCODE=-803, SQLSTATE=23505)(db2 z/os) -

i try insert values java application , values table1 table2. following error(db2 z/os): exception in thread "main" com.ibm.db2.jcc.am.sqlintegrityconstraintviolationexception: db2 sql error: sqlcode=-803, sqlstate=23505, sqlerrmc=1;db2t.tsoz360_wv_ausgang, driver=3.66.46 preparedstatement _prep = con.preparestatement("insert db2t.table2 (column1, column2, column3 , column4, column5, column6) select ?, ?, ?, ?, column5, column6 db2t.table1 column1 = ? column2 = ? , column3 = ?"); _prep.setstring(1,"hello"); _prep.setstring(2,"h"); _prep.setstring(3,"1234567890"); _prep.setstring(4,"hsdfdsffdssdfsdfd"); _prep.setlong(5,9876543210l); _prep.setint(6,1); _prep.setint(7,12345678); table1: column1, column2, column3 , column4, column5, column6 table2 column1, column2, column3 , column4, column5, column6 so want insert values generated in java application table2 , 2 values table1. without import 2 values application. i'

algorithm - in java we can use list.remove(int index) to remove the items in that index, what if the list is huge and we can only use long to store the index? -

when use "sieve of eratosthenes" generate prime number encountered problem. want create method takes in list , remove every 3rd list after 3: [2, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29...] -> [2, 3, 5, 7, 11, 13, 17, 19, 23, 25, 29...] .and here code: private static void removethird(list<long> l) { int = 1; int count = 0; while (i < l.size()) { // system.out.print(count + ":"); //debug // system.out.print(l.get(i) + " "); if (count == 3) { l.remove(i); count = 1; } ++; count ++; } } this code works, because want generate huge amount of prime numbers need long size list. therefore if want able access , modify each item in list need long type store index. changed int = 0 long = 0 , , code doesn't work. , viewed docs list class , realized can call list.remove(int index) . wonder if want call list.remove(long index) ? there way so? thanks! li

.htaccess - RewriteRule clearing post data -

<directory /var/www/website/html> options +symlinksifownermatch -indexes allowoverride rewriteengine on # enforce removal of trailing slash rewritecond %{request_filename} !-d rewriterule ^(.*)/$ /$1 [l,r=301] # if user performing search rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{query_string} ^query=([^&]+) rewriterule ^(.*)$ index.php?uri=$1&query=%1 [l,b] # if user has token set rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{query_string} ^token=([^&]+) rewriterule ^(.*)$ index.php?uri=$1&token=%1 [l,b] # if not existing file/directory, redirect index.php rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?uri=$1 [l,b] </directory> when posting data directory

Automatically generated region certificate in Azure -

Image
in azure portal when list of resource can see machine-generated resource of type microsoft.web/certificates (as admin) cant view details. @ point resource gets created , region specific? reason ask region name contains name of region itself. if region specific should have 2 of these automatically generated certificates because have resources in 2 region. resource have been generated visual studio publishing tool? how can know more resource? you can check activity log find out happens subscription: you can use filters , can who did what , when did it. not limited authenticated users, automated scripts service principals. p.s. activity logs located under "more services", not part of "all resources".

php - How do I let a user input a video url and have the video show on the same page upon submit? -

i've seen few similar questions, none of answers have worked me. ideally, user input video url form, hit submit, , video show below form. here's code that's not working (sorry if it's messy or confusing): <form id="rp_embed_video" name="rp_embed-video" method="post" action=""> <div class="rp_block"> <label><?php printf( __( 'add video link:' ) ); ?></label> <input type="url" id="rp_newvid" name="rp_newvid" value="" required /> </div> <div class="rp_block"> <label><?php printf( __( 'choose one:' ) );?></label> <input type="radio" name="rp_type" value="youtube" required checked /> <input type="radio" name="rp_type" value="vimeo" required /> </div>

javascript - How data will get selected on click of enter key with delimiter -

i have combobox , trying select value combo on click of enter , value should display dilemiter click on enter. right using mouse select combo value , delimiter coming after selection of next value. tried many methods not getting suceess. can please me. i created fiddle. my fiddler what understood question, need select combo when cursor focus on combo. need expand manually. can refer this. fiddle

php - Need help in array manipulation -

code language : php actually not expert in array manipulation have tried didn't success. please check following array want convert it. i have type of array [ { "user_id": "1", "name": "a", "product": "product a", "price": "456" }, { "user_id": "1", "name": "a", "product": "product b", "price": "255" }, { "user_id": "1", "name": "a", "product": "product c", "price": "111" }, { "user_id": "2", "name": "b", "product": "product d", "price": "888" }, { "user_id":

c++ - Boost bind return type difference -

i have looked through discussion on what return type of boost::bind? , see short answer don't need know. while have function taking "bind(...) result" argument , find following difference behaviour working case 1 void func(int a){}; myfunc(bind(&obj::func,this,_1)); not working case 2 ( when want bind func2 2 argument) void func2(int a, int b){}; myfunc(bind(&obj::func2,this,_1,_2)); made working case 3 void func3(int a, int b){}; myfunc(bind(&obj::func3,this,_1, 10)); so question what's differnt on retrun type of following 3? bind(&obj::func,this,_1)); bind(&obj::func2,this,_1,10)); //why 1 can passed same type above one? bind(&obj::func3,this,_1,_2)); as myfunc quite embedded in template , overloading functions, didn't yet find how defined take "bind(...)" argument. that's why didn't attach code myfunc as answer linked says, don't need know exact return type.

Python Client Server program gets stucked -

server code import socket server_socket = socket.socket(socket.af_inet, socket.sock_stream) server_socket.bind(("192.168.169.10", 9559)) server_socket.listen(5) import os import time client_socket, address = server_socket.accept() print "conencted - ",address,"\n" while(1): fp = open('img.jpg','wb+') start = time.time() while true: strng = client_socket.recv(1024) if not strng: break print 'loop ends' fp.write(strng) fp.close() print 'total time taken',time.time()-start,'secs' print "data received successfully" client_socket.send("hey looking face") exit() client code import socket,os client_socket = socket.socket(socket.af_inet, socket.sock_stream) client_socket.connect(("192.168.169.10", 9559)) fname = '/home/student/images/andrew1.jpeg' img = open(fname,'rb') while true: strng = img.readline(1024) if not strng: break

jboss7.x - \Favicon.ico error in Jboss 7.1.1 -

i want access application without context root in jboss 7.1.1 have renamed application root.war , deployed , updated stadalone.xml able access login page of application, moment enter credentials , login "http status 404 - /favicon.ico". i don't know going wrong. once remove /favicon url , reload it, works normal. please me resolve problem. favicon stands " favorites icon ". it's little icon beside site's name in favorites list, before url in address bar , bookmarks folder , bookmarked website on desktop in operating systems. the favicon.ico shows 404 means people browsers use favicon (internet explorer 5.0 +, firefox, opera , others) visiting site. while seeing 404 in log files means visitor got dreaded "404 page not found" error, in case doesn't. all means default icon shown instead of custom one. to favicon show there 2 different ways this: this easiest , show icon no matter page visitor adds favorites. uplo

javascript - Show and hide div based on the selection -

Image
i want hide div not active. when ever reload tab contents come one. below screenshot of the ui facing problem. below code. $('.tab a').on('click', function (e) { e.preventdefault(); $(this).parent().addclass('active'); $(this).parent().siblings().removeclass('active'); target = $(this).attr('href'); $('.tab-content > div').not(target).hide(); $(target).fadein(600); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="form animated fadeindown "> <ul class="tab-group"> <li class="tab active"><a href="#roles">roles</a></li> <li class="tab "><a href="#user">user</a></li> <li class="ta

android - How to change a Dialog's background overlay color -

i want change overlay color of dialog. first comes transparent gray. i tried: <item name="android:windowcontentoverlay">@color/customcolor</item> <item name="android:colorbackgroundcachehint">@color/customcolor</item> they did not work. when tried: <item name="android:windowbackground">@color/customcolor</item> the content background changing. i found 1 rule solution! d.getwindow().setbackgrounddrawableresource(r.drawable.menubackground); it works me normal dialog. dont know if works on alertdialog .

javascript - Add and remove div class -

i'm looking solution that: want add class (.hide) div (#menu) hide them, when body got class (.pp-viewing-page2) want remove class (.hide) i doesn't work ($("#menu").addclass("menuscroll")) , if ($("body").hasclass("pp-viewing-page2")) { $("#menu").removeclass("hide"); } adding class body works of course, body class after scrolldown please help i not sure of mean or achieve excatly, created little snippet you. hope helps. https://jsfiddle.net/1l81r7v3/ basically first add hide class "hides" display (css display:none;) , afterwards check wether #body has class pp-viewing-page2 or not. if #body has class remove class. for have manually add class in fiddle can understand, added few comments fiddle.

How to create TreeView in Angular 2 using Typescript? -

what should create treeview in angular 2 using typesscript? i trying find out on google still not working example etc. can please share me example achieve task? why not use ready made one, example angular2-tree-component? npm install angular2-tree-component

html - Django: Highlight current page in navbar -

in layout.html (sometimes called base.html) have navbar this: <li class="dropdown"><a href="{% url 'index' %}" >home </a></li> <li class="dropdown"><a href="{% url 'house_list' %}">your houses</a></li> <li class="dropdown"><a href="{% url 'agency_list' %}">agencies</a></li> <li class="dropdown"><a href="/admin">admin</a></li> <li class="dropdown"><a href="{% url 'logout' %}"><i class="fa fa-lock"></i> log ud</a></li> <li class="dropdown"><a href="{% url 'login' %}"><i class="fa fa-lock"></i> log ind</a></li> i highlight current page in navbar done changing <li class="dropdown"> <li class="

c# - Why it doesn't store unless when I trying to set a name for a radio button during change? -

i apologize newbie question. have 3 radio buttons in windows form application user selects 1 of them. have these 3 in group box , attempted identify string , use in message box later in code. string name; if (radiobutton1.checked == true){ name = radiobutton1.text; } else if (radiobutton2.checked == true) { name = radiobutton2.text; } then have button displays message: message box.show("welcome " + name + "how you?"); the output of welcome how instead of welcome bob how you? unless have selected 1 radio button changed , pressed different one. can please explain happening here , why displaying name if radio button changed? might code helps string value = ""; bool ischecked = radiobutton1.checked; if(ischecked ) value=radiobutton1.text; else value=radiobutton2.text; messagebox.show("welcome " + value + "how you?");

r - Why do columns in data frames change class when subsetted versus apply? -

this question has answer here: data frame changes numeric character 1 answer i trying add summary row data frame detailing levels of each column. ran problem applying levels function across frame. think reason columns treated individually treated factor vectors, when apply function used treated characters: a = c("a","b","c") b = c("d","e","f") m = cbind(a,b) df = as.data.frame(m) class(df[,1]) [1] "factor" apply(df, margin=2, class) b "character" "character" which think cause of problem: levels(df[,1]) [1] "a" "b" "c" apply(df, margin=2, levels) null i had @ documentation on apply, data frames, , around web. can explain why is? you can use lapply or sapply function know class of variables, understanding apply g

advanced custom fields - Use 'LIKE %word%' for ACF Query Wordpress -

i use acf plugin on wordpress site , want code custom research. have many products , want display products contain searched word. i query : $args = array( 'post_type' => 'product', 'meta_key' => 'brand', 'meta_value' => $word, 'compare' => 'like'); $the_query = new wp_query($args); but display products brand matches $word. exemple if search "yan" want display products brand "yanmar", "polyan", "tryanpo", etc. how please ? thank , have day ! try below code. $args = array( 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => 'brand', 'value' => $word, 'compare' => 'like' )

tycho - Specify name of OSX application file for Eclipse RCP app -

i have eclipse rcp application have been managing few years. updating luna neon base , have updated tycho 0.26 in process. one of new features in eclipse since luna on osx application packaged .app content inside app folder. build process working, resulting application named eclipse.app rather myrcp.app. how best handled? rename after build or can controlled maven/tycho configuration? figured out. need add configuration tycho-p2-director-plugin in product pom.xml here snippets file: <plugin> <groupid>org.eclipse.tycho</groupid> <artifactid>tycho-p2-repository-plugin</artifactid> <version>${tycho-version}</version> <configuration> <includealldependencies>true</includealldependencies> <profileproperties> <macosx-bundled>true</macosx-bundled> </profileproperties> </configuration> </plugin> <plugin> <groupid

c++ - How to judge the predict result of which SVM in opencv? -

for example have 2 svm objects svma , svmb, train different data set, , have sample sampc. int idx = svma.predict(sampc); int idx2 = svmb.predict(sampc); how judge svm return similar result ? thanks. this answered here , , in predict() doco (assuming have 2 class svm). if call predict() again, , set parameter returndfval=true decision function value (the signed distance margin). can use judge result "better". bigger distance margin, more sample belongs class has been assigned.

javascript - Get into the selected text div -

i have 1 mini question select text in selected div. i have created demo codepen.io . in demo can see there 1 blue button , text in textarea. want when select select text. , click blue button selected text should <div class="selected">select text.</div> after clicking blue button. how can that. can me in regard ? $(document).ready(function() { $("body").on("click", ".bold", function() { // code goes here... }); }); html, body { width: 100%; height: 100%; padding: 0px; margin: 0px; font-family: helvetica, arial, sans-serif; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; background-color: #fafafa; } .container { position: relative; width: 100%; max-width: 500px; margin: 0px auto; margin-top: 30px; } .editor { float: left; width: 100%; padding: 30px; box-sizing: border-box; -webkit-box-sizing: border-box; } .editbuttons

wordpress - How to allow IPS from range in htaccess? -

i want users 213.241.*.* ips access blog admin section. when add specific ip of pc 213.241.34.24 works. when set range not work. i have tried: order deny,allow allow 213.241.0 deny and: order deny,allow allow 213.241.*.* deny and order deny,allow allow 213.241. deny and also: order deny,allow allow 213.241.0.0 213.241.255.255 deny and: order deny,allow allow 213.241.0.0 - 213.241.255.255 deny and not work. i figured out works: order deny,allow allow 213.241.0.0/24 deny but allows 213.241.0.* , therefore need put lots of rules work wish like: order deny,allow allow 213.241.0.0/24 allow 213.241.1.0/24 allow 213.241.2.0/24 .... deny is there easier way allow 213.241. . ips access blog admin section? if using /24 cidr works you, why not /16? order deny,allow allow 213.241.0.0/16 deny

Java breaking minimum and maximum heap contract if both are set to same value of 2 mb in java 7 -

i testing gc out of memory simulation after setting min , max heap value equal 2.(-xmx2m -xms2m) the java program should take max memory value 2 mb . seen in logs , heap dump analyzer showing program has taken memory till 4 mb. why taking 4 mb instead of 2mb? code : vm flag used : -xmx2m -xms2m -xx:+printgcdetails -xx:+printgcdatestamps -xx:+heapdumponoutofmemoryerror public class gcflags { public static void main(string[] args) { list<humanbeing> humanbeings = new arraylist<humanbeing>(); system.out.println("avaliable memory before while loop :" + runtime.getruntime().freememory() / 1024); humanbeing anjelinajolie = null; humanbeing bradpitt = null; while (true) { anjelinajolie = new humanbeing("anjelina jolie"); bradpitt = new humanbeing("brad pitt"); humanbeings.add(anjelinajolie); humanbeings.add(bradpitt);

python - SQLAlchemy: engine, connection and session difference -

i use sqlalchemy , there @ least 3 entities: engine , session , connection , have execute method, if e.g. want select records table can this engine.execute(select([table])).fetchall() and this connection.execute(select([table])).fetchall() and this session.execute(select([table])).fetchall() result same. as understand if use engine.execute creates connection , opens session (alchemy cares you) , executes query. there global difference between these 3 ways of performing such task? a one-line overview: the behavior of execute() same in cases, 3 different methods, in engine , connection , , session classes. what execute() : to understand behavior of execute() need executable class. executable superclass “statement” types of objects, including select(), delete(),update(), insert(), text() - in simplest words possible, executable sql expression construct supported in sqlalchemy. in cases execute() method takes sql text or constructed sql expre

Method of sorted in python -

Image
the same code, run several times, different results. why following results not sorted? you put results dict – data structure not guarantee order of keys/values. seems you're aware of that, judging call sorted() . however, function doesn't work presume: rather modifying list (or iterable, in general), returns new one . documentation linked above states: return new sorted list items in iterable. and since result of function isn't assigned variable, perishes. alternately, result can used directly collection iterate on in for loop, this: for key in sorted(scores): print(scores[key] + ' had ' + key)

python - Parallelism inside of a function? -

i have function counts how list of items appears in rows below: def count(pair_list): return float(sum([1 row in rows if all(item in row.split() item in pair_list)])) if __name__ == "__main__": pairs = [['apple', 'banana'], ['cookie', 'popsicle'], ['candy', 'cookie'], ...] # grocery transaction data rows = ['apple cookie banana popsicle wafer', 'almond milk eggs butter bread', 'bread almonds apple', 'cookie candy popsicle pop', ...] res = [count(pair) pair in pairs] in reality, len(rows) 10000 , there 18000 elements in pairs , computing cost of list comprehension in count() , 1 in main function expensive. i tried parallel processing: from multiprocessing.dummy import pool threadpool import multiprocessing mp threadpool = threadpool(processes = mp.cpu_count()) res = threadpool.map(count, pairs) this doesn't run quickly, either. in fact, after 15 minute

php - How does empty() work with a boolean expression? -

a guy learning php sent me code has me scratching head. he's getting $_post input, putting in variables, , then: if( !empty($id && $name && $email) ) { //do } my first inclination passing multiple variables argument throw error, evaluates successfully. incorrect empty() should not take boolean expression? or - if i'm right - why work? you can pass expression empty rather variable (since php 5.5), expression lose half of benefit of using empty . empty checks variables set evaluating "truthiness". when give expression that, individual variables within expression not checked exist empty . expression evaluated boolean. so if used separate empty checks, check variables exist check != false if(!empty($id) && !empty($name) && !empty($email)) but when use if (!empty($id && $name && $email)) you still if block if variables set , have non-false values, you'll undefined variable notices

ios - Deleting Rows in UITableView Swift 3 -

okay im making app add items cart , updates add. adding fine, cant deleting work. in cart cell need remove 3 arrays, doesn't seem problem because keep getting error: "terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'invalid update: invalid number of rows in section 0. number of rows contained in existing section after update (1) must equal number of rows contained in section before update (1), plus or minus number of rows inserted or deleted section (0 inserted, 1 deleted) , plus or minus number of rows moved or out of section (0 moved in, 0 moved out).'" i'm not sure i'm doing wrong here. i've followed few tutorials , seem doing same thing. appreciated in advance. heres of code: //declaring arrays show in cell var cartkeys = [string]() var cartvalues = [string]() var deets = [[string]]() var count = 0 //populating arrays original arrays func populatecart(){ (key,value) in menustore.s

java - The Calendar setLenient method doesn't allow the check of the sanity of the year field -

i used method check id date entered user valid or not: private boolean isthisdatevalid(date datetovalidate) { calendar cal = calendar.getinstance(); if (datetovalidate == null) { return false; } cal.setlenient(false); cal.settime(datetovalidate); try { cal.gettime(); } catch (exception e) { return false; } return true; } the problem when user writes wrong year (big year) doesn't throw exception example : 12/09/2016666 should check sanity of year field in seperate method. even though far present, 2016666 still valid year. it's 2 million years now, can see why might not want in lots of contexts, strange date validator suggest not legitimate date. incorrect behavior. if want additional validation (such ensuring year field not exceed current year) need , throw proper exception.

python - Extremely slow writing speed when inserting rows into Hive table using impyla -

i'm experiencing extremely slow writing speed when trying insert rows partitioned hive table using impyla . this example of code wrote in python: from impala.dbapi import connect targets = ... # targets dictionary of objects of specific class yesterday = datetime.date.today() - datetime.timedelta(days=1) log_datetime = datetime.datetime.now() query = """ insert my_database.mytable partition (year={year}, month={month}, day={day}) values ('{yesterday}', '{log_ts}', %s, %s, %s, 1, 1) """.format(yesterday=yesterday, log_ts=log_datetime, year=yesterday.year, month=yesterday.month, day=yesterday.day) print(query) rows = tuple([tuple([i.campaign, i.adgroup, i.adwordsid]) in targets.values()]) connection = connect(host=os.environ["hadoop_ip"], port=10000, user=os.environ["hadoop_user"],

MouseHandler Events and Delegates c# -

i have been looking @ events , delegates on last few days , decided attempt make mousehandler class using both of these. basically have problem mouse clicks not registering , positions x , y axis coming 0, not registering mean displaying in output console through console.writeline(). have been researching while have had no luck wondering if of guys point me in right direction appreciated. thank in advance. mousehandler.cs class mousehandler { public delegate void mouseeventhandler(object source, mouseeventhandlerargs public event mouseeventhandler mouseleftclick; public event mouseeventhandler mouserightclick; public event mouseeventhandler mousemoved; public mousestate mousestate = mouse.getstate(); protected virtual void onmouseleftclick(mousestate m) { mousestate = m; if(mouseleftclick != null) { mouseleftclick(this, new mouseeventhandlerargs() { mousebutto

PSD files to XCode Free -

if have psd files, can export every layer png , add xcode, or there simpler way this? know there 3rd party programs, cost. there way free? cheers. you need add each image want use asset xcode, can´t import psd file xcode... export psd > import xcode.

php - Checking existence of file in same folder -

i'm sure i'm missing obvious here. want include php file need check if exists first , every time run it, failure message. can see file there ftp application. <? $man_file="/site/67/blog/612.php"; if (file_exists($man_file)){ include($man_file); } else { echo $man_file; } clearstatcache(); ?> am missing something? that did fred. i've never had before. post answer , i'll upvote , accept it. – richard young posting comment "the" answer: $man_file="/site/67/blog/612.php"; use full server path (an example): $man_file="/var/usr/public/site/67/blog/612.php"; or relative one.

tsql - Escaping an ampersand in SQL Server Full-Text Search query using CONTAINSTABLE -

i have peculiar case. asp.net page calls stored procedure of ours performs full-text search query on our database. of commonly searched strings include ampersand because few brands of our products (well-known brands, too) have & in name. it turns out in case no results unless escape ampersand ( \& ), , in other case no results only if escape ampersand . i don't know if relevant, (without giving out brand names) 1 ends in &b , other 1 in &c . is possible these strings ( &b or &c ) have special meaning of own? , escaping them i'm passing special string t-sql? edit additional info: after further testing, proved error in stored procedure itself. calling & or \& yields different results. i'll try post selected parts of stored procedures. won't post all, because of isn't relevant. the vparambuca parameter 1 causes troubles. values 'word&letter' or word\&letter . set @ricercaa = '''form

Spring Integration Control Bus message to change selector of a JMS Inbound Channel Adapter -

i'm implementing flow on spring integration-based (ver. 3.0.1.release) application requires store messages on jms queue picked later. that, i've been trying use spring integration jms inbound channel adapter custom selector, , picking message queue changing jms selector of jmsdestinationpollingsource matching id included header property. one of requirements cannot add new service or java method, i've been trying sort out using control bus, keep receiving same error when send message set messageselector different. inbound channel adapter definition: <int-jms:inbound-channel-adapter id="inboundadapter" channel="inboundchannel" destinationname="bufferqueue" connection-factory="connectionfactory" selector="matchingid = 'no value'"> <int:poller fixed-delay="1000&q

Xamarin.Forms: Button in TabbedPage -

how add button other page on code (this part of 1 card in tabbedpage): this.children.add(new contentpage { title = "text", content = new stacklayout { padding = 20, verticaloptions = layoutoptions.fillandexpand, children = { new image { source = imagesource.fromfile("image.png") }, new label { textcolor = color.fromhex("#5f5a5a"), fontsize = 16, text = "other text" } } } }); thanks help. is understood issue right, need button in tab? this.children.add(new contentpage { title = "text", content = new stacklayout {

linux - How can I get fuse mount options? -

i using small fuse filesystem bootstraps usual calling fuse_main(argc, argv, &fsoperations, null) in main(int argc, char *argv[]) function. fuse_main parse options etc. @ point in filesystem, need obtain mount options set passing -o process. way figured out far parse /proc/mounts (or /etc/mtab ) or manually parsing command line, both options far optimal. there fuse api or else can use obtain mount options?

qt creator - MainWindow from code from the main.cpp in Qt -

want understand difference in code between mainwindow , main.cpp . specifically, how chunk of code written exclusively in main.cpp needs modified part of mainwindow.cpp , mainwindow.h . as example, trying modify code fine answer work in mainwindow . main.cpp #include <qtwidgets> #include <qtnetwork> int main(int argc, char *argv[]) { qapplication a(argc, argv); //setup gui (you doing in designer) qwidget widget; qformlayout layout(&widget); qlineedit lineeditname; qlineedit lineeditgender; qlineedit lineeditregion; auto edits = {&lineeditname, &lineeditgender, &lineeditregion}; for(auto edit : edits) edit->setreadonly(true); layout.addrow("name:", &lineeditname); layout.addrow("gender:", &lineeditgender); layout.addrow("region:", &lineeditregion); qpushbutton button("get name"); layout.addrow(&button); //send request uinames

java - RxJava Multithreading with Realm - Realm access from incorrect thread -

background i using realm within app. when data loaded undergoes intense processing therefore processing occurs on background thread. the coding pattern in use unit of work pattern , realm exists within repository under datamanager. idea here each repository can have different database/file storage solution. what have tried below example of similar code have in foorespository class. the idea here instance of realm obtained, used query realm objects of interest, return them , close realm instance. note synchronous , @ end copies objects realm unmanaged state. public observable<list<foo>> getfoosbyid(list<string> fooids) { realm realm = realm.getinstance(foorealmconfiguration); realmquery<foo> findfoosbyidquery = realm.where(foo.class); for(string id : fooids) { findfoosbyidquery.equalto(foo.foo_id_field_name, id); findfoosbyidquery.or(); } return findfoosbyidquery .findall() .asobserv

java - Android No Activity found - STILL_IMAGE_CAMERA -

i getting following exception in android app. no activity found handle intent { act=android.media.action.still_image_camera (has extras) } i know device, mc70, has camera. bool hasfeature = packagemanager.hassystemfeature(packagemanager.feature_camera); int numcameras = android.hardware.camera.getnumberofcameras(); both hasfeature true , numcameras > 0 the device has sd card installed: boolean issdpresent = android.os.environment.getexternalstoragestate().equals(android.os.environment.media_mounted); in androidmanifest.xml file have: <uses-feature android:name="android.hardware.camera" android:required="true" /> <uses-permission android:name="android.permission.camera" /> final packagemanager packagemanager = context.getpackagemanager(); this list comes empty, bad sign: final intent intent = new intent(action); list<resolveinfo> list = packagemanager.queryintentactivities(intent, packagemanage