Posts

Showing posts from May, 2015

sql server - Insert data into temporary table from dynamic query table output -

i have below dynamic query run in sql server, connecting olap server using linked server, returns table result. set @nsql = execute ('select non empty { [coded season].[coded season].[coded season] * [season].[season].[season] * [product].[subclass].[subclass] * [product].[subclass id].[subclass id] } on rows,{ [measures].[pl no of range opts] } on columns rp_c0') @ as_t_rp_5900_admin i executing in sql server this: exec sp_executesql @nsql; it returns table of values. want insert data temporary table. have tried below code, not working. insert ##subclass_season_as exec sp_executesql @nsql; also tried, set @strnewquery ='select '+@nsql+' ##temptablename ' exec @strnewquery could please on this? thanks! you may want try put statement in dynamic query. set @nsql = execute ('select non empty { [coded season].[coded season].[coded season] * [season].[season].[season] * [product].[subclass].[subclass] * [product].[subclass id].[sub

javascript - How to invoke uft script present in ALM using java script? -

my requirement execute uft scripts based on input given in html page. came know of blogs microsoft has stopped vbs script usage in html. reason want invoke qtp scripts using java script. searched same , didnt find information. if can provide equivalent code in javascript helpful. in short of time experiment client demo near. dim objqtpapp set objqtpapp=createobject("quicktest.application") objqtpapp.launch objqtpapp.visible=false 'true varusername=document.getelementsbyname('username').value varpassword=document.getelementsbyname('password').value call qc_connect(varusername,varpassword) sub qc_connect(varusername,varpassword,varcustomson) ' objqtpapp.tdconnection.connect "http://dddd.fed.test.com:7117/qcbin", "domain", "project", varusername, varpassword,false if objqtpapp.tdconnection.isconnected objqtpapp.open "[qualitycenter] subject\automated test case development\test",

How does Hyperledger Fabric implement private data sharing among related parties? -

how hyperledger fabric share private data among intended parties without revealing data other network participants? is similar r3's corda? current version of fabric v0.6 not provide such possibility, i.e. every peer can see same other peers. there intention implement feature in 1.0 http://hyperledger-fabric.readthedocs.io/en/latest/abstract_v1/

performancecounter - Use linux perf utility to report counters every second like vmstat -

there perf command-linux utility in linux access hardware performance-monitoring counters, works using perf_events kernel subsystems. perf has 2 modes: perf record / perf top record sampling profile (the sample example every 100000th cpu clock cycle or executed command), , perf stat mode report total count of cycles/executed commands application (or whole system). is there mode of perf print system-wide or per-cpu summary on total count every second (every 3, 5, 10 seconds), printed in vmstat , systat-family tools ( iostat , mpstat , sar -n dev ... listed in http://techblog.netflix.com/2015/11/linux-performance-analysis-in-60s.html )? example, cycles , instructions counters mean ipc every second of system (or of every cpu). is there non- perf tool (in https://perf.wiki.kernel.org/index.php/tutorial or http://www.brendangregg.com/perf.html ) can such statistics perf_events kernel subsystem? system-wide per-process ipc calculation resolution of seconds? ther

facebook messenger - How to answer back with images in wit.ai? -

i trying create fb_messenger bot using wit.ai.in wit.ai,i can answering , question text.but want answering user showing images.how it?please guide me. thank much. you need send image in wit action using messenger bot: example if you're using node js: const actions = { /** * used "bot sends" action in wit * @param sessionid * @param text * @returns {promise.<t>} */ send({sessionid}, {text}) { // our bot has say! // let's retrieve facebook user session belongs const recipientid = sessions[sessionid].fbid; if (recipientid) { // yay, found our recipient! // let's forward our bot response her. // return promise let our bot know when we're done sending //bot simple wrapper messenger node code provided [here][1] return bot.sendtextmessage(recipientid, text) .catch((err) => { console.error( 'oops! error occurred while forwarding re

sql server - Two columns into one using alternate rows -

i have table 2 columns this: a 1 b 2 c 3 d 4 e 5 etc. i want them 1 column, each column's data in alternate rows of new column this: a 1 b 2 c 3 d 4 e 5 etc. i use union all here unpivot alternative: create table #table1(letter varchar(10),id varchar(10)) insert #table1(letter ,id ) select 'a',1 union select 'b',2 union select 'c',3 union select 'd',4 union select 'e',5 select [value] #table1 unpivot ( [value] [column] in ([id], [letter]) ) unpvt drop table #table1;

Transaction timedout after 300s Websphere , Spring batch, DB2 -

i have need execute 5000 select statements on datasource , pull results , insert 5000 values table of different data source. for 5000 select statements(all different sqls) exeuting 1 one (this taking more time) for 5000 inserts doing jdbctemplate.batchupdate() the above job needs executed every 30mins. have configured spring batch job triggered every 30 mins cron. once method called complete 5000 select statements it's taking more 300s complete websphere throwing timeout exception. says global transaction time exceeded 300s. i know can increase timeout in websphere can't since in production server profiles configured default. can suggest me better way handle this. you can increase transaction timeout on current thread using transaction.settransactiontimeout(int seconds) on usertransaction before calling transaction.begin() http://docs.oracle.com/javaee/6/api/javax/transaction/usertransaction.html

what data type to store a json array in mysql (5.6) database -

what data type should use store json encoded array in mysql version 5.6 json data type not available? far i'm thinking store text or varchar. how have store it? it depends on length of json data going store. if it's not long can use varchar, have limit of 64k: manual says: length can specified value 0 65,535. effective maximum length of varchar subject maximum row size (65,535 bytes, shared among columns) , character set used. so if expect have huge objects, use text. since mysql 5.7.8 you're able use native json data type, though.

ruby on rails - Showing the data received from db in radio_button_tag -

versions: rails 4.2.5 & ruby 2.2. using radio_button_tag in form_tag. - options = ['yes', 'no'] - options.each |option| = radio_button_tag 'val[0]', '#{option}', false = label_tag( "#{option}") while saving, data saved properly(we saving data hash) & retrieved properly. data not reflected in radio_button_tag. for have added radio_button_tag as: = radio_button_tag 'val[0]', '#{option}', @value[:val][0] its selects 'no' radio button. html generated has both checked='checked'. how can fix this? we changed code this: = radio_button_tag 'val[0]', 1, @value[:val][0] == '1' %label{for: 'val_0_1'} yes = radio_button_tag 'val[0]', 0, @value[:val][0] == '0' %label{for: 'val_0_0'} no we getting strings database, unable process further & in html, both comes checked, selects last one.

extra attribute to backend order in Magento -

how can add a multiline textfield a dropdown for manuel created orders in magento backend. it's not onlineshop order, it's phone or email order. in case of phone or email order need add information order in backend , magento note field not perfect todo this. and how can bring 2 attributes pdf invoice? customer need see on pdf to. working magento 1.9.2.4.

Why does Tesseract fail to recognize a clean screenshot? -

Image
i'm using tesseract (3.04.01 leptonica-1.73 ) segment clean screenshot of web page. here command use: tesseract screen.png output.txt screen.png: output.txt: a css regwstratmnfi x c (d localnostr accoum dexans eu pine: 5" fifi/(‘3’ 22pm; j. , km?“ ”9 persuna‘ dexaus funhev \muvmanun «m s , (35‘ m :6 ms fms, emms' (u v jaruawy *1: \(uax y , chum terms , mamng m ‘ ‘ regwsley» w lc‘asehe :avicxflza \zh»,:\':\e mm , (ism-ye i/exzavheilédgémzéi the output complete garbage except few words "terms and". thanks!

java - Quote marks when concatenating string with a single character -

what kind of quote marks should choose single character when concatenate string? string s1="string"; should use string s2=s1+'c'; or string s2=s1+"c"; ? you can use both! give try! "why?" ask. magic here + operator. when + used strings, automatically turns other operand string! that's why can used 'c' , character literal. can used "c" because of course, "c" string literal. not that, can add integers string: string s2=s1+1;

ios - how to get path in sandbox by CFRef,not bundle resource -

to cfurlref in bundle resource ,as follow cfurlref pdfurl = cfbundlecopyresourceurl(cfbundlegetmainbundle(), (__bridge cfstringref)self.filename, null, null); cgpdfdocumentref pdfdocument = cgpdfdocumentcreatewithurl((cfurlref)pdfurl); cfrelease(pdfurl); i want how cfurlref in sandbox

sql - ERROR: there is no unique constraint matching given keys for referenced table "fruit" -

create table gruppelærer( brnavn varchar(8), emnekode varchar(8), år int, vh char(4), antallgr int, constraint larer_id primary key(brnavn, emnekode, år, vh) ); create table søknad( brnavn varchar(8), emnekode char(4), år varchar(8), vh int, antallgr int, prioritet int, foreign key (brnavn, emnekode, år, vh, antallgr) references gruppelærer(brnavn, emnekode, år, vh, antallgr), unique (brnavn, emnekode, år, vh, prioritet) ); error: there no unique constraint matching given keys referenced table "fruit" why not work? either, need remove [vh] field primary_key or add in foreign_key : create table fruit( fruitname varchar(128), fruitid varchar(8) not null, yearplanted int, vh char(4), numberoffruits int, constraint fruit_id primary key(fruitname, fruitid, yearplanted, vh) ); create table instore( fruitname varchar(8), fruitid int, yearplanted char(4), quantity int, foreign key (fruitname, fruitid, year

c++ - Performance difference in between Windows and Linux using intel compiler: looking at the assembly -

i running program on both windows , linux (x86-64). has been compiled same compiler (intel parallel studio xe 2017) same options, , windows version 3 times faster linux one. culprit call std::erf resolved in intel math library both cases (by default, linked dynamically on windows , statically on linux using dynamic linking on linux gives same performance). here simple program reproduce problem. #include <cmath> #include <cstdio> int main() { int n = 100000000; float sum = 1.0f; (int k = 0; k < n; k++) { sum += std::erf(sum); } std::printf("%7.2f\n", sum); } when profile program using vtune, find assembly bit different in between windows , linux version. here call site (the loop) on windows block 3: "vmovaps xmm0, xmm6" call 0x1400023e0 <erff> block 4: inc ebx "vaddss xmm6, xmm6, xmm0" "cmp ebx, 0x5f5e100" jl 0x14000103f <block 3> and beginning of erf function called on windows block 1:

javascript - Ajax form $_POST blank return data -

var name = jquery('[data-field="name"]').val(); var email = jquery('[data-field="email"]').val(); var inumber = jquery('[data-field="inumber"]').val(); var rnumber = jquery('[data-field="rnumber"]').val(); var date = jquery('[data-field="date"]').val(); var amount = jquery('[data-field="amount"]').val(); var feedback = jquery('[data-field="name"]').val(); var file_attach = new formdata(jquery('input[name^="media"]')); jquery.each(jquery('input[name^="media"]')[0].files, function(i, file) { file_attach.append(i, file); }); jquery.ajax({ type: 'post', data: { func: "sendmail", name,email,inumber,rnumber,date,amount,feedback,file_attach}, url: 'billing-information-mailer.php', cache: false, contenttype: false, processdata: false, success: function(data){

python 3.x - How to create a categoried tagged corpus reader -

Image
i have bunch of files , categories listed in cats.txt in same folder. want create categorizedtaggedcorpusreader this. this how files look. tried many ways in nltk , failed create categorizedtaggedcorpusreader, inside cats.txt have filename , category name space apart, each filename can have multiple categories. for instance : mail_1_adapter adapter mail_1_alert alert messagebody_24862499 others etc... can please show me better way can create corpus , make of it. your file format fine. how did try create reader , didn't work? don't show code, there's no telling you're doing wrong. need tell reader should read categories file cats.txt , e.g. this: nltk.corpus.reader import categorizedtaggedcorpusreader reader = categorizedtaggedcorpusreader(<path>, r"^[^.]*$", cat_file="cats.txt") your categories file cats.txt not part of corpus, used regexp ^[^.]*$ matches not containing dot. if doesn't correctly de

c# - How to Export data into MS Excel from ASP.NET MVC -

Image
this question has answer here: how export excel? 3 answers i trying export data excel mvc. don't understand why; public void downloadasexcelorderreports() { try { var list = _reportwork.getlist(); gridview gv = new gridview(); gv.datasource = list; gv.databind(); response.clearcontent(); response.buffer = true; response.contentencoding = system.text.encoding.utf32; response.addheader("content-disposition", "attachment; filename=marklist.xls"); response.contenttype = "application/ms-excel"; response.charset = ""; using (stringwriter sw = new stringwriter()) { using (htmltextwriter htw = new htmltextwriter(sw)) { gv.rendercontrol(htw); response.output.write(sw.tostri

r - How to set different scales for each group/factor in tile plot -

Image
i have code given below d = data.frame(sites=rep(paste("s", 1:31),each=12), value=runif(31*12), panel=c(rep("group 1",16*12), rep("group 2", 12*12), rep("group 3", 3*12))) ggplot(d, aes(x = sites, y = factor(0))) + geom_tile(aes(fill = value)) + scale_fill_gradient(low = "green", high = "blue") + facet_wrap(~ panel, ncol = 1) now instead of single scale, want separate gradient scales each group. there's no way within ggplot2 , gridextra rescue! library(ggplot2) library(gridextra) n <- length(unique(d$panel)) l <- vector(mode = "list", length = n) (i in 1:n) { dd <- d dd[d$panel!=unique(d$panel)[i], "value"] <- na l[[i]] <- ggplot(dd, aes(x = sites, y = 0)) + geom_tile(aes(fill = value)) + scale_fill_gradient(low = "green", high = "blue", na.value = na) } g

locale - Investigating a Java bug regarding String.valueOf(float) -

in java possibility string.valueof(float) format float number differently based on operating system code run on, version of java and/or operating systems locale. for example, float number 4.5 ever formatted "4,5" instead of "4.5"? string.valueof(float) calls float.tostring() . float.tostring() calls intern sun.misc.floatingdecimal.tojavaformatstring(float) the result string never contain sign , bacause of hard-coded '.' (ascii: 46) inside binarytoasciibuffer.getchars(chars[]) you can see if decompile sun.misc.floatingdecimal class (in case java 8 jdk) or see (similar) implementation in openjdk.

Android camera2api preview size stretches -

i m trying recording using camera2 api in android , my preview size stretches . can me why preview stretches here code: private void setupcamera(int width, int height) { cameramanager = (cameramanager) getsystemservice(context.camera_service); try { (string camid : cameramanager.getcameraidlist()) { cameracharacteristics = cameramanager.getcameracharacteristics(camid); if (cameracharacteristics.get(cameracharacteristics.lens_facing) == cameracharacteristics.lens_facing_front) { continue; } streamconfigurationmap map = cameracharacteristics.get(cameracharacteristics.scaler_stream_configuration_map); //handling rotation of screen int deviceorientation = getwindowmanager().getdefaultdisplay().getrotation(); totalrotation = devicerotation(cameracharacteristics, deviceorientation); boolean swaprotation = totalrotation == 90 || totalrotation == 270;

angular - Error directives declaration if minification angular2 bundle -

if minified bundle, error: unhandled promise rejection: template parse errors: can't bind 'seterror' since isn't known property of 'http_result'. (" <http_result [error ->][seterror]="error"></http_result> <div class="popup-body-wrapper"> http_popup_errors.directive.ts import { component, directive, elementref, hostlistener, input,output, eventemitter, renderer, viewchild, afterviewinit } '@angular/core'; import { determinationerrorservice } './determination_errors.service'; //import * $ 'jquery'; @component({ selector: 'http_result', template: `<div class="http-result-wrapper"> <p class="success-notice" *ngif="notice.state == 'notice'">{{ notice.message }}</p> <p class="error-notice" *ngif="notice.state == 'error'">{{ notice

javascript - Why does a browser need a polyfills file while I compile ES6 to ES5 with babel -

if babel translates es6 es5 , outputs es5 file why browser need include polyfill file if app output file contains es5 code ? babel translates es6 (and newer) code es5 code. example, rewrites arrow functions ( () => {} ) es5 functions ( function() {} ). however, es6 more new syntax. https://babeljs.io : since babel transforms syntax (like arrow functions), can use babel-polyfill in order support new globals such promise or new native methods string.padstart (left-pad). uses core-js , regenerator. check out our babel-polyfill docs more info. all new functions need implemented polyfill. , these polyfills must included globally project. otherwise every usage of es6 function replaced implementation of function in es5 code. if use e.g. array#findindex ten times, transpiled code contain implementation ten times. why polyfills have added globally , not added transpilation step.

what is the use of defining a variable on a method inside a square brackets in VB.net? -

i looking @ method in vb.net , quite knew vb.net. trying understand why integer "[to]" , "[step] "is defined in square brackets ? can 1 please explain me. why can these defined to/step. have attached code below. in advance. ''' <summary> ''' write runtime output loop information ''' expected use when loop counter incremented ''' </summary> public sub writetoruntimeoutput(counter integer, [to] integer, [step] integer) dim message new stringbuilder message.appendformat("loop counter incremented. loop {0}/{1}", counter, [to]) if loopstep <> 1 message.appendformat(" step {0}", [step]) end if message.append(".") return message.tostring() end sub square brackets used create variable has same name keyword. for example dim [integer] integer

The Cython module is not an IPython extension -

when trying load cython extension jupiter notebook %load_ext cython i below message: the cython module not ipython extension i did not have problem couple of weeks ago, when wrote cython extension on nb. have tried upgrade ipython , cython both regular environment (i using mac running 10.11) , anaconda, no success. tips? thanks lot! cython not ipython extension, %load_ext won't work on it. can still use import cython .

java - Cant import project in Android studio(Could not find method compile() for arguments) -

sorry english. cant understand why cant import project android studio. have file build gradle buildscript { repositories { jcenter() } dependencies { compile 'com.android.tools.build:gradle:2.2.2' classpath 'com.google.gms:google-services:1.5.0-beta2' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { maven { url "https://jitpack.io" } jcenter() } } task clean(type: delete) { delete rootproject.builddir } but have error: error:(9, 0) not find method compile() arguments [com.android.tools.build:gradle:2.2.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.defaultdependencyhandler. open file why mean? you using wrong build.gradle file. in top-level file can't define android block. just move part inside module/build

javascript - Unable to access an object in json(array of object) -

i have gulp task trying read json file(array of objects) , want write single object file. json: { "files": [{ "dev": { "poibasepath": "poi", "basepathsearch": "search-v1", "contenttype": "application/json", "timeout": 10000 } }, { "qa": { "poibasepath": "poi", "basepathsearch": "search-v1", "contenttype": "application/json", "timeout": 10000 } }] } gulp task: gulp.task('readfile', function() { return gulp.src('app/dataconfig.json') .pipe(fs.readfile("app/dataconfig.json", "utf-8", function(err, data){ console.log(data);//getting total json object here fs.writefile('app/scripts/apiconfig.

c# - Grid Checkbox Select -

i made grid checkbox. can select 1 value @ time want select more. how can select more values @ time in checkbox? (i using telerik:radgrid) try code : allowmultirowselection="true" <telerik:radgrid rendermode="lightweight" id="radgrid1" runat="server" datasourceid="sqldatasource1" allowmultirowselection="true"> <clientsettings> <selecting allowrowselect="true" enabledragtoselectrows="true" /> </clientsettings> </telerik:radgrid>

jquery - Double click word JavaScript window.getSelection in two INS tag -

Image
my html is: <p><ins data-id="1">111</ins><ins data-id="2">222</ins></p> the output of code is: if double click word, it's selecting complete word, this: but want select letters based on ins tag data-id ex:- if double click 111 want select 111 this: how modify default double click selection javascript selection? i tried following code: var containerid = $(e.currenttarget); if (window.getselection) { var range = document.createrange(); range.selectnode(containerid); var sel = window.getselection() sel.removeallranges(); sel.addrange(range); } but it's not working expected. <p><ins data-id="1">111</ins>&#8203;<ins data-id="2">222</ins></p> you put zero-width space between them: &#8203;

Php contact form keeps going to spam and has an html attachement -

i experiencing problem php contact form normal use on our products sites. <?php $to = "martin@puritech.co.za"; $subject = "reverse osmosis"; $name = $_post['name']; $email = $_post['email']; $number = $_post['tel']; $mail = $_post['message']; $headers = "from: $name \r\n"; $headers .= "email: $email \r\n"; $headers .= "mime-version: 1.0 \r\n"; $headers .= "content-type: text/html charset=iso-8859-1 \r\n"; $message = "<html><body style='font-family: arial;'>"; $message .= "<h1>hello guys! have request ".$name."</h1>"; $message .= "<p>".$mail."</p>"; $message .= "<p><span style='font-weight:bold;'>from:</span> ".$name."</p>"; $message .= "<span style='font-weight:bol

php - Invalid parameter number: number of bound variables does not match number of tokens in Doctrine -

using doctrine 2 want users contacts of user. table user contains mapping between users. query in function return following error: invalid parameter number: number of bound variables not match number of tokens. however best understanding $str is set "b" , $ownerid set "2" , both assigned setparameters function. protected function getcontactbysubstring($str, $ownerid) { echo $str; echo $ownerid; $em = $this->getdoctrine()->getentitymanager(); $qb = $em->createquerybuilder(); $qb->add('select', 'u') ->add('from', '\paston\verbundle\entity\user u, \paston\verbundle\entity\contact c') ->add('where', "c.owner = ?1 , c.contact = u.id , u.username '?2'") ->add('orderby', 'u.firstname asc, u.lastname asc') ->setparameters(array (1=> $ownerid, 2=> '

python 2.7 - Implementing MQTT in flask -

i want ask question regarding on how implementing mqtt in flask. wrote code when go specific page, receive message, storing inside database , output message in table in specific page. below snippet of code. 'views.py' from flask import render_template, request, url_for, redirect, flash flask_wtf import form flask_login import login_user, logout_user, login_required import paho.mqtt.client mqtt app import app, db models import user, data ...other @app.route... @app.route('/table') @login_required def table_data(): def on_connect(client, userdata, flags, rc): flash("connected") client.subscribe("abc123") def on_message(client, userdata, msg, message): message = data(temperature=msg.temperature, ph=msg.ph, time=msg.time) db.session.add(message) db.session.commit() client = mqtt.client(client_id = "my_visualise", clean_session = true) client.username_pw_set("mosquitto", &

debian - port and ip forwarding from local machine to googel.com -

i want see google main page when type virtual machine's ip address in browser. want type in windows browser 192.168.132.131:8080 , redirected google's main page (173.194.122.198:80). 192.168.132.131 ip address of debian virtual machine. how should open port 8080 , configure iptables? did tutorial suggested didn't wanted. http://www.debiantutorials.com/port-forwarding-with-iptables/ please ... to see happens made tests debian-behind-a-linux instead of debian-behind-a-windows because have no windows. (i think) because i'm not in usa ip in example doesn't work me. used ip ping google.com i can tell exemple in tutorial still works, , if try hand on windows telnet 192.168.132.131 8080 connect google, assuming made correctly (what giving rules iptables-save ? ) what doesn't work (anymore?) http request: http embeds ip address , sends google doesn't know url , redirect http 301 google without ip in url. alas http redirection kept port 8080. si

Error Code: 2013. Lost connection to MySQL server during query -

i got error code: 2013. lost connection mysql server during query error when tried add index table using mysql workbench. noticed appears whenever run long query. is there away increase timeout value? new versions of mysql workbench have option change specific timeouts. for me under edit → preferences → sql editor → dbms connection read time out (in seconds): 600 changed value 6000. also unchecked limit rows putting limit in every time want search whole data set gets tiresome.

android - Linear layout below the ListView, Some portions not visible? -

i have problem linearlayout below listview. tried give listview weight , layout above, set layout_height 0dp nothing wotked. here xml code: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:weightsum="100" android:background="#00c4ff"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="application № - " android:layout_weight="50"/> <textview android:i

javascript - Form without value can't receive zero value -

i'm have form more or less 5 inputs, in determinate moment them go stay without value , want descover smaller value between them, has 1 or more inputs empty returns 0 value , indicate smaller number. with inputs i'm forming string: document.queryselectorall("input"); to received values of input, has input empty location of strings received 0 , math.min() calc value smaller. there way ignorate empty input , don't put @ string?

android - Where is my logcat ? can I know my logcat storage path when thre is no stdout in cmd shell? -

i'm trying filter logcat package result get: c:\users\user>adb shell logcat -s my.package.name --------- beginning of system --------- beginning of main so, possible know android storing output if it's not visible on stdout?

Can't search for a record in sqlite database using tkinter as a gui to enter the name of the record I am searching for (Python) -

i making program library using database store details books, tkinter gui. feature of program user can enter name of book , search database , return records books containing name. here code have feature: def booksearch(event): top = toplevel() top.title("book search") label(top, text = "enter name of book searching for: ").grid() booksearchentry = entry(top) booksearchentry.grid(row = 0, column = 1) getrecord = c.execute("select * booklist bookname = (?)", booksearchentry.get()) def printrecords(event): row in getrecord: t = text(top, height = 400, width = 50) t.pack() t.insert(end, getrecord) booksearchbutton = button(top, text = "search", command = printrecords) booksearchbutton.grid(row = 0, column = 1) i getting error message: getrecord = c.execute("select * booklist bookname = (?)", booksearchentry.get()) sqlite3.programmingerror: incorrect number of bindings supplied. current statemen

c++ - ld exe in MINGW can not find library -

i trying build c++ code using mingw 64 bit 4.8.0 , msys2. using windows 7 x64 netbeans 8.2 ide. getting below error while building code c:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lldscripts c:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -l6to4svcl i search entire msys/mingw folder these 2 library did not find , there tool chain need installed ? there wrong netbeans, switch codeblocks , same code works.

jdbc - Cannot connect R to DB2 -

i want connect r 3.2.3 db2 . tried code : library(rjdbc) jcc = jdbc("com.ibm.db2.jcc.db2driver","c:/installed/sqllib/java/db2jcc4.jar") i error : error: not find function "jdbc" any ideas ? tantaoui, suggest take @ ibmdbr, dedicated r data frame api db2 , dashdb data: https://cran.r-project.org/web/packages/ibmdbr/ibmdbr.pdf

C++ requires a type specifier for all declarations -

i getting error "c++ requires type specifier declarations" on "const max = 10;" line. here code: //a program adds maximum of 10 numbers ( 1,2,3,4,5,6,7,8,9,10 ) #include <iostream> #include <cmath> using namespace std; const max = 10; //the error here! int main() { int sum, num; sum = 0; num = 1; { sum = sum + num; num++; } while (num <= max); { cout << "sum = "; } return 0; } as error says, c++ requires type specifier declaration. instance, change const max = 10; const int max = 10; .

What Should I Use (Notification/Events) To Send Data From Application Server To End Points (Devices) and vice versa Using KAA Middleware -

as per kaa references, understand once should use notification feature, when required send data server (external apps) endpoints , events used when there need endpoint endpoint communication (kind of device binding requirement) so, achieve request/response functionality using kaa. need implement hybrid solutions below. 1) in server, can run 1 kaa sdk instance , use event feature request endpoint , response endpoint. or 2) server, use notification rest api request , response through data logger feature using in-build appender configuring "loguploadstrategy" uploads every log record created. notes point 1 as per andrew, solutions architect of kaa iot platform "you can embed sdk standalone application , host in on same server kaa-node present. application may receive rest api calls , forward them particular endpoints via kaa events feature. however, useful test purposes. not recommend solution in production because hard scale , has potential security is

Mapping the grails/groovy enum to Mysql enum -

here environment grails version: 3.1.6 groovy version: 2.4.6 jvm version: 1.8.0_51 the hibernate version in build.gradle compile "org.hibernate:hibernate-core:5.1.1.final" compile "org.hibernate:hibernate-ehcache:5.1.1.final" i expected map enum mysql this: | field | type | null | key | default | | | logtype | enum('debug','info'| no | | null | | but didn't work. googled suggestions didn't them working. this code: package xxxx class template { enum logtype { debug("debug"), info("info") string name logtype(name){ this.name = name } } integer tplid logtype lt static constraints = { tplid(nullable: true) lt(nullable: true) } static mapping = { table "template" id name: "tplid" tplid column: "tplid", com

How to write a file in a mac machine from an ios application using Objective C -

i new mobile app development. i have hybrid application uses objective c code printer integration. running on ios device. now need create file , write while app running. file must in particular machine(say local mac machine) , not created in sandbox of application. because @ later point need open file , view locally. how do this. please possible.

android - How to add AdMob under floating action button -

Image
i have problem position of floatingactionbutton . when put ad admob , want put ad under fab button method try not work. image of current postion: main_activity: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:ads="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:cliptopadding="false"> <com.google.android.gms.ads.adview android:id="@+id/adview" android:layout_width="ma

android - How to make RecyclerView fix header when scrolling -

Image
i have recyclerview has been filled data. it's when scroll, header not fix toolbar position , results go up. how hide toolbar header when scrolling? or more create fixed scroll on recyclerview when scrolling? all code runs well, it's problem header goes when scroll activitymain layout : <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:context="com.bertho.gmyl.mainactivity"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_widt

Change CSS values based on user selection -

i have dynamic web-app using mysql, php, jquery, javascript , twitter bootstrap. i've created few color theme options users, i'd offer them ability setup own color schemes. i'm not entirely sure of best way go this. i'm guessing allow users save key colors database table , use generic css file can replace values. i'm not sure how last part of that. how write css file replacing "tokens" or variables, before it's loaded website? or should use jquery replace css @ runtime? thanks

php - Forgot password not updated plus password hash -

am creating application... fine far. in registration system have used prepared statement , password hashing , have try validate user input in form fields well. in order system completed need create forgot password system means user can request new password. what have done have testing site files, means can test if works before adding production site. with forgot password have used mysqli once working fine update prepared, because still learning prepared statement , doing way me understand don't judge. the problem having forgot password password not updating once change. see screenshot: http://prntscr.com/d5hage also mentioned above have used http://prntscr.com/d5hbg1 in register , verify in log-in. how used hashing in forgot password or how update it. in code below have used md5 aware broken. please coding below. reset_password.php <?php // include connection require_once('include/connection.php'); if(isset($_post['subm

javascript - Correct symbol for check hyphen -

i use same method lines div finding line-wraps but.... method not take text hyphens. what do... i split word hyphens inter-na-tional (u+00ad) ['inter','na','tional'] , check each piece next line simple dash(minus)."-" u+002d but...seems not correct, because has different can see in screenshot: http://prnt.sc/d5h3t7 which symbol shell use able check correct?

android - Alipay payment testing site not working -

i used alipay android api i'm checking alipay testing environment wap.docx sms auth not working... docs guide me move https://sandbox.alipaydev.com/sms/outmessagelist.htm?mobile=13122443313 (download link : https://global.alipay.com/product/mobilepayments.htm ) but site empty... i'm in korea. another cellphone number working what should do? please me.

Pass data between independent components in Angular 2 -

i'm beginner in angular 2 , developing small spa. in component login receive data via http service, set data class user , need data available in other components. problem components independent (don't have parent-child relation). there mechanisms in angular 2 pass data in way? first of recommends use service pass data between components. here example how components can communicate using 3 diff. ways, angular2-playground demo code available on github suppose if creating service s1 , providing service in app.module.ts file create singleton instance of service , if make changes in service component 1 , can modified data in component 2 . or can add service in separate module separate functionality, service can accessible in module only. summary: can use services passing data between components, helpful.

ios - Type '(String, AnyObject)' has no subscript members in swift -

i using line data let productdict = arrproductcart[sender.tag] as! [string: anyobject] and want filter data dictionary using code let filteredsubitems = productdict.filter{ $0["groupid"] as!string != "1" } it giving me error type '(string, anyobject)' has no subscript members do need convert [string: anyobject] [string: string]? do. most want filter arrproductcard array instead of productdict , doesn't make sense. try this: let filteredproducts = arrproductcard.filter{ guard let groupid = $0["groupid"] as? string else { return false } return groupid != "1" } you should avoid forced unwrapping whenever can. note code inside filter closure crash if there no groupid value in dictionary or if not string. edit: if you're using nsmutablearray reason, can filter predicate: let mutablearray = nsmutablearray(array: [["groupid": "1"], ["groupid": "

How to keep Java Swing action handler in one place? -

i writing swing interface multiple panels distributed in multiple classes. want implement mouse , key listener multiple of these panels. wander if there way keep user interaction in 1 place (possibly listener class). my current code similar this: class panel1 extends jpanel{ public panel1() { addmouselistener(new mouselistener() { @override public void keypressed(keyevent e) { do_something(); } }); } void do_something(){ ... } } class panel2 extends jpanel{ public panel2() { addmouselistener(new mouselistener() { @override public void keypressed(keyevent e) { different } }); } } class panel3 ...

xamarin camera app does not want to run as a default camera app -

i have xamarin custom camera application, need run camera app default camera. trick camera works when try access default camera, doesn't appear. have check online without luck. , manifest file seems ok, not want appear, when want choose default camera on device. xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installlocation="auto" package="meniko_cam.meniko_cam" android:versioncode="1" android:versionname="1.0"> <!--suppress usesminsdkattributes--> <uses-sdk android:minsdkversion="15" /> <uses-permission android:name="android.permission.internet" /> <permission android:name="android.permission.read_external_storage" /> <permission android:name="android.permission.write_external_storage" /> <permission android:name="android.permission.camera&quo

reactjs - Can't add multiple lines of components into variable -

i want save content in variable depending on result of if statement. when add multiple lines doesn't work. let content = null if(this.props.group.name != null){ content = <text>just line works</text> <text>this doesn't work</text> } i can't find out do. can't add + @ end of line in javascript. components need wrapped in parent containing component, unless create array keys. // work because it's wrapped inside parentheses , has parent component content = ( <view> <text>just line works</text> <text>this doesn't work</text> </view> ) // works because components array content = [ <text key="1">just line works</text>, <text key="2">this doesn't work</text> ]

html - Right fixed column table - background color of fixed column not working -

i need table describred in fixed right column table scales responsive design when define background color using css rule doesn't apply fixed column jsfiddle: https://jsfiddle.net/3ckvkr1f/2/ thanks! html <div class="table-responsive"> <table class="table-striped" cellpadding="9"> <thead> <tr> <th> col1 </th> <th> col2 </th> <th class="crud-links"> options</th> </tr> </thead> <tr> <td> r1col1 alçkfjalçkfjalkjflaksjflaksj </td> <td> r1col2 aslkfjasklçfjaklçfjasklfjasçklfjas </td> <td class="crud-links"> x </td> </tr> <tr> <td style="white-space: nowrap;"> r2col1 alçkfjalçkfjalkjflaksjflaksj slkfjsçklafjaslfkjsldk

c# - how access connectionstring in a web.config in other project from a WCF -

Image
i'm having difficulty access connectionstrings in web.config wcf "web services" cenario: solution inside visual studio 2010 2 web projects, placement , wcfplacement. web.config has connectionstings inside placement project. the wcfplacement not have web.config can see in picture, when build it, generates one. from placement project can access connection strings using configurationmanager.connectionstrings["xx"].connectionstring; - ok. but if i'm inside service, gives me error when try access, forcing me have connection string declared inside each class want database access, , that's not good. how can access connectionstrings in th web.config inside placement project wcf ? i tried: sqlconnection conn = new sqlconnection(configurationmanager.connectionstrings["webv"].connectionstring); but gives me error: system.nullreferenceexception: object reference not set instance of object. @ wcfplacement.prospect.dologin(string logi