Posts

Showing posts from April, 2013

winapi - Bounding Box for a string in C++ -

winapi - Bounding Box for a string in C++ - i have string me , wanted find size of box bounding string.is there c++ api can help me it? know can done gdi+.but wanted more improve way using basic apis using gdi+ overhead have start gdi+ , close it..so if can obtain straight without using gdi+ the lowest level function 1 can think of gettextextentpoint32 in win32/gdi (c/c++ api). c++ winapi visual-c++ gdi+

mysql - Delete all rows in all tables which aren't used in any FK relation anymore -

mysql - Delete all rows in all tables which aren't used in any FK relation anymore - in order trim production database loading in test system, we've deleted rows in many tables. left cruft in couple of tables, namely rows aren't used in fk relation anymore. want accomplish garbage collection in java. or set way: if have m tables in database. n of them (i.e. not all) have foreign key relations. i've deleted couple of high level rows (i.e. have outgoing fk relations) via sql. leaves rows in related tables alone. does have sql stored procedure or java programme finds n tables , follows fk relations delete rows no longer needed. if finding n tables complex, provide script list of tables scan or, preferably, negative list of tables ignore. also note: we have tables used in many (>50) fk relations, i.e. a , b , c , ... utilize rows in z . all fk relations utilize technical pk column single column. even simple stored procedures little ugly, , int

MySQL query takes long to execute if using ORDER BY String Column -

MySQL query takes long to execute if using ORDER BY String Column - so query on table contains 4 million records executes instant if dont utilize order by . want give clients way sort results name field , show lastly 100 of filtered result. add together order name takes 100 seconds execute. my table construction similar this: create table test( id int primary key auto_increment, name varchar(100), statusid int, key (statusid), <-- index on statusid key (statusid, name) <-- index on statusid, name key(name) <-- index on name ); my query like: explain select id, statusid, name test statusid = 113 order name desc limit 0, 100 above explain when order name gives result: statusid_2 composite index of statausid, name now if alter order name desc order id this: how can create examines 100 rows when using order name ? you can seek 1 thing, seek letters in 100 rows expected in result like select * test *** joins fi

wordpress - Remove meta box from taxonomy editing screen -

wordpress - Remove meta box from taxonomy editing screen - i've been adding/removing meta boxes code similar to: function mw_remove_postboxes() { // remove metaboxes woocommerce screens remove_meta_box( 'wp-display-header', 'product', 'normal' ); remove_meta_box( 'wp-display-header', 'shop_order', 'normal' ); remove_meta_box( 'wp-display-header', 'shop_coupon', 'normal' ); remove_meta_box( 'wp-display-header', 'acf', 'normal' ); // remove metaboxes banners post type management remove_meta_box( 'wp-display-header', 'banners', 'normal' ); remove_meta_box( 'wpseo_meta', 'banners', 'normal' ); } add_action( 'do_meta_boxes' , 'mw_remove_postboxes' ); now have different need, need remove meta box edit-tags.php screen /edit-tags.php?action=edit&taxonomy=featured&tag_id=22&po

Get String from one jsp to another jsp? -

Get String from one jsp to another jsp? - i first create html file input username & passwword: <body> <center> <h1>login section</h1> <form method="post" action ="getinfo.jsp"> username <input type="text" name="userid"><br> password <input type="password" name="pass"><br> <input type="submit" name="submit"> </form> </center> </body> then first.jsp file receive username & password (check cookie also, runs fine): <form method="get" action="showinfo.jsp"> <% string name = request.getparameter("userid"); string pass = request.getparameter("pass"); cookie pie = new cookie(name, "nothing_to_do_here"); pie.setmaxage(60 * 60 * 7); response.addcookie(pie); cookie[] c

javascript - Require user to choose 'boy' or 'girl' -

javascript - Require user to choose 'boy' or 'girl' - i trying user respond question "are boy or girl?" 1 of 2 choices , forcefulness them take 1 or other. i think heading in right direction whenever run code, hiccups if choosing sec option. what doing wrong? var gender = prompt("are boy or girl?").tolowercase(); while (gender !== ("boy" || "girl")) { gender = prompt("please respond boy or girl. now, boy or girl?"); } the proper status be while (gender !== 'boy' && gender !== 'girl'){ that's because ("boy" || "girl") end "boy", hence while while(gender !== 'boy') . || in case called "default" operator, clever utilize of logical or . if value on left side truthy, utilize left side value. otherwise, evaluate (hence "default") right side. javascript prompt

vim - Copy and Paste using System clipboard without using Paste mode? -

vim - Copy and Paste using System clipboard without using Paste mode? - i'd able re-create , paste using scheme clipboard without having toggle paste mode every time. there way that? if matters @ all, i'm using vim terminal on mac. if mean want able safely paste or re-create raw text in terminal without having type :set paste beforehand , :set nopaste afterwards, have few options. set 'pastetoggle' option. see :help 'pastetoggle' , gives usage example: :map <f10> :set paste<cr> :map <f11> :set nopaste<cr> :imap <f10> <c-o>:set paste<cr> :imap <f11> <nop> :set pastetoggle=<f11> create mappings :set paste , :set nopaste , in above code. install plugin unimpaired.vim. provides mappings yo , yo :set paste , o or o , , automatically :set nopaste when exit insert mode. if mean want commands y , p re-create , paste scheme clipboard default, see existing question how c

android - how to get value from countdowntimer and display into toast -

android - how to get value from countdowntimer and display into toast - i have countdown timer 1 9999 if click start button count start, if click stop button need current value countdown , display value in toast countdown not stop if click stop button please help me private countdowntimer countdowntimer; private boolean timerhasstarted = false; private button startb; public textview ; private final long starttime = 9999 * 1; private final long interval = 1 *1 ; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); startb = (button) this.findviewbyid(r.id.button); startb.setonclicklistener(this); text = (textview) this.findviewbyid(r.id.timer); countdowntimer = new mycountdowntimer(starttime, interval); text.settext(text.gettext() + string.valueof(start

android - koush AndroidAsync Socket.IO : Looks like ConnectCallback() is not triggered on Google Glass -

android - koush AndroidAsync Socket.IO : Looks like ConnectCallback() is not triggered on Google Glass - im trying allow google glass , android phone connect nodejs server im running on computer, can send messages android phone google glass. for i'm using koush's androidasync library, works great on android phone , have absolutely no problem connecting phone nodejs server library. however, same code doesnt seem work on google glass. google glass connect, because on connection eventhandler of nodejs server triggered, doesn't seem trigger of connectcallback functions on google glass. here code i'm using in google glass app: socketioclient.connect(asynchttpclient.getdefaultinstance(), "http://192.168.1.229:5000", new connectcallback() { @override public void onconnectcompleted(exception ex, socketioclient client) { log.i("socket", "connection completed"); if (ex != null) {

Smallest encoding for JSON containing binary data (and gzip compression) -

Smallest encoding for JSON containing binary data (and gzip compression) - what smallest (number of bytes) encoding distributed binary info encapsulated in json , character encoding containing json should used in conjunction? encoding provides smallest result when compressed gzip? { "data" : "########-this-is-alot-of-binary-data-##############...", "some-normal-data" : ... } e.g. base64, base85, uri-encoded, escaped \" json encoding escaping base64 binary-data

git - How to merge all branches with the master branch? -

git - How to merge all branches with the master branch? - i have few branches locally , want update them. how merge stuff master branch other branches? #!/bin/bash git checkout master git pull branches=() eval "$(git for-each-ref --shell --format='branches+=(%(refname))' refs/heads/)" branch in "${branches[@]}"; branch=`expr substr $branch 12 100` git checkout $branch git merge master done git checkout master git

.htaccess - Question mark in htaccess -

.htaccess - Question mark in htaccess - i'm trying create search results url google. site.com/search?q=blabla tried this rewriterule ^search\?q=(.*)$ index.php?q=$1 i used \ before ? still doesn't work, question mark makes problem. right way that? you need simple rule in root .htaccess: rewriteengine on rewritebase / rewriterule ^search/?$ index.php [l,qsa,nc] query string ?q=foobar automatically carried on index.php . .htaccess

C++: program returns different JSON result than if url is accessed manually -

C++: program returns different JSON result than if url is accessed manually - i'm working on project manipulating roomba. roowifi microcontroller i'm using writes sensor info json file every often, , i'm trying fetch json, parse it, , base of operations actions off of output. i'm having issue grabbing info json @ url. file @ address, http://10.0.0.1/roomba.json and can manually come in address chrome , see data. however, when grab json file programmatically, info values zero. the format of json, , how see in chrome, is: { "response": { "r13": { "name": "angle", "value": "0" }, "r14": { "name": "charging state", "value": "4" }, "r18": { "name": "charge", "

php - Use an array in AJAX jquery -

php - Use an array in AJAX jquery - use array in ajax jquery function json-encode(); hi, i'm new ajax i have united nations page want phone call ajax request add together on page. export.php <div class="row"> <div class="span12"> <select id="listtable" name="listtable"> <option value="appel">appels</option> <option value="dossier">dossiers</option> <option value="commande">commandes fournisseur</option> </select> </div> </div> <div class="row"> <div class="span12"> <button class="btn btn-primary" onclick="selecttable()">select</button> </div> </div> <div id ="columns" class="row" style="display:none;"> <div class="span12"&

java - Problems assigning variable to the return of a function -

java - Problems assigning variable to the return of a function - i have been searching online solutions problem hours, cannot find one. beginner java don't understand many of errors , why wasn't able right myself. anyway, trying assign value variable , add together int value variable another. when compiling getting errors: "this not statement" , error missing semicolon suspect cleared if prepare statement. here error, in case need it: hw8_ex2_jm2rv.java:61: error: ';' expected int sumofgames += value; ^ hw8_ex2_jm2rv.java:61: error: not statement int sumofgames += value; ^ 2 errors this code: public static int onegame() { int truevalue = 1; int falsevalue = 0; int total = sumtwodice(); if((total == 7) || (total == 11)) { //system.out.println(truevalue + " " + total); return(truevalue); } else if((total == 2) || (total == 3

java - value from properties file is returning null -

java - value from properties file is returning null - i have variable beingness set in external .properties file, when seek phone call value, keeps returning null. have project importing external .properties file works fine, using model can't figure out why 1 isn't working. relevent files below. specifically returning null propertiesutil.getproperty("property.file.variable"); web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <display-name>project</display-name> <servlet> <servlet-name>jersey rest service</servlet-

java - Spring integration router configuration -

java - Spring integration router configuration - i struggling find examples using @router annotation. if understanding javadocs correctly: @service public class agentserviceimpl implements agentservice { @override @router(inputchannel = "agentlogin", defaultoutputchannel = "agentserviceresponse") public agentloginresponse login(agentloginrequest request) { } } in xml examples router there service-activator, getting hung on trying figure out how fit in. actually wrong way. see @router javadocs: * indicates method capable of resolving channel or channel name * based on message, message header(s), or both. so, login method target router component must homecoming channel name or entire messagechannel object. java spring spring-integration

array formulas - google sheets - Arrayformula -

array formulas - google sheets - Arrayformula - i have created form using google forms, , want automatically check answers when new submit done. when user submit his/her question, new line added in responses sheet. need add together magic ;) so, in responses sheet, have right answers in sec line...something this b c 1 2 rightanswer1, rightanswer2, rightanswer3.... using arrayformula function, have added new colums (column d,e,f,g , on) on every row checking against right reply on line 2. the formula goes this; =if(arrayformula(a3:a=a2),1,0) and works charm :) but, want add together column @ end of each row sum of right answers, lets column z on every row...this want sum 1's (correct answers). i have tried this; =if(arrayformula(<any kind of check true>),sum(d3:z3),0) this homecoming sum of d3:z3 on every line, , not want. want sum columns on line-number added. have tried alter look in several ways , having

audio - Intel XDK HTML Android app, run in background? -

audio - Intel XDK HTML Android app, run in background? - so i've created 'sound app' needs run when phone locked.. after min of beingness locked sound cuts out. suggest fix? the app created out of basic html5, css & js. sound needs go on playing when phone locked. thanks in advance! :d you'll need utilize plugin provides background service. in order preserve battery, mobile devices not allow applications go on run 1 time lose focus. after short period of time paused, , if ram required run other apps, might stopped entirely. see pause/resume events little more info: http://cordova.apache.org/docs/en/3.5.0/cordova_events_events.md.html#pause here's project devgeeks, accomplished cordova developer, regarding background sound on ios: https://github.com/devgeeks/examplehtml5audiostreaming -- also, blog andrew trice may of value, experienced cordova developer: http://www.tricedesigns.com/2012/01/25/low-latency-polyphonic-audio-in-phonegap y

javascript - Why is my vanilla JS code slower than jQuery equivalent and how to profile it? -

javascript - Why is my vanilla JS code slower than jQuery equivalent and how to profile it? - after using heavily jquery, have found out, basic operations much faster in vanilla js (duh!) , hence improve write in pure js using heavyweight jquery everything. but vanilla js slower , slower lot equivalent in jquery. right now, have scenario. jquery's delegated .on() function against simple version. code much simpler , doing "less things" expecting result in favor of vanilla js. using jsperf see code 60%+ slower. code illustration below. can explain why? can show me practical way how profile code , find reply myself next time ? can see bottleneck or inefficience ? have tried using built-in profilers both in chrome , firefox didn't help me much, showing function phone call takes 1ms of time , nil useful. there improve tools or using them wrong ? my illustration scenario 3 nested divs. hear event @ top div delegate handler attached catches events on nest

Android delete all files starting with particular word -

Android delete all files starting with particular word - i have problem , hope can help me out. in wallpaper app, saving image sdcard user can share online via actionbar share function. here code saving: uri bmpuri = null; seek { file file = new file(environment.getexternalstoragepublicdirectory( environment.directory_downloads), "share_image_" + system.currenttimemillis() + ".png"); file.getparentfile().mkdirs(); fileoutputstream out = new fileoutputstream(file); bmp.compress(bitmap.compressformat.png, 90, out); out.close(); bmpuri = uri.fromfile(file); } grab (ioexception e) { e.printstacktrace(); } homecoming bmpuri; now, trying delete image when user leaves activity (which means shared image or decided not share. either way, not needed anymore.) i trying delete code (its on button click method atm, alter later) case r.id.btn_delete: // f

How to implement this JavaScript in HTML -

How to implement this JavaScript in HTML - this javascript showing time hour, min , seconds seconds ticking minutes alter it's not static have problem.how implement in html page ? <script type="text/javascript"> function starttime() { var today = new date(); var h = today.gethours(); var m = today.getminutes(); var s = today.getseconds(); m = checktime(m); s = checktime(s); document.getelementbyid('txt').innerhtml = h + ":" + m + ":" + s; t = settimeout('starttime()', 500); } function checktime(i) { if (i < 10) { = "0" + i; } homecoming i; } </script> edit body tag <body onload="starttime()"> <span id="txt">10:26:07</span> than add together bellow code want clock appear javascript html time

javascript - Auto close browser window -

javascript - Auto close browser window - i want auto close window in firefox opened window.open() function. have searched stack overflow forum , found these links: 1) how close automatically webpage 2) automatically close current window , open new window new url address but not much used javascript, not implement code appropriately. please find below code opens window - needs auto closed. inserting in resulting html file makes invalid. <script language="javascript" type="text/javascript"> function clickheretoprint(vpid,vage,vroom,vname,vsex,vdoc,vdat) { var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; disp_setting+="scrollbars=yes,width=300, height=200, left=100, top=25 resizable=yes"; //var content_vlue = document.getelementbyid("t_pid").value; var docprint=window.open("","",disp_setting); docprint.document.open(); docprint.document.write('<ht

Custom MySQL Order By depending on a PHP function value -

Custom MySQL Order By depending on a PHP function value - i have database this http://i.stack.imgur.com/mhewr.jpg i have php function compute distance { get_distance ($person_location) } of address user (web user). i need have query utilize function , homecoming info database order distance user [using { get_distance ($person_location) } function of php]. can help me please? you can't sort sql results on serverside result of php function.* there 2 approaches general problem: 1. move calculation sql your distance computation relies on geo-coordinates (latitude , longitude). save info every address in database , distance computation in sql well. find more on how in mysql here: fastest way find distance between 2 lat/long points your todo list this. next things once: get addresses db calculate geo coordinates each address php api update database , set geo coordinates in columns do next things on: every time add together row table, calcul

c# - Compare/match two columns using approximate string matching (fuzzy string matching, levenshtein) -

c# - Compare/match two columns using approximate string matching (fuzzy string matching, levenshtein) - first of allow me explain i'm trying achieve. application i'm making should have ability compare 2 columns of 2 different tables eachother. every cell of column first table should linked best matching cell column of sec table. this: this can achieved using levenshtein's algorithm. wrote test programme in c# see if can recreate same results image showing us. made 2 array's, 1 containing first column of image , 1 containing sec column of image. every cell of first column compared every cell of sec column, means 4 iterations on every cell (16 in total). highest match (the 1 lowest levenshtein distance) of sec column linked cell of first column. the problem: allow have 2 big columns 100k rows each, should serious performance issues. because every cell first column need matched every cell of sec column highest possible match, have iterate 100k * 100k =

java - I keep getting out of bounds error how do i fix this? -

java - I keep getting out of bounds error how do i fix this? - scanner scan = new scanner(system.in); system.out.println("enter word"); string line = scan.nextline(); string pig = ""; int = line.length(); int x = 0; int y = 0; while (y < a) { int b = line.indexof(" "); if (line.substring(x, x + 1).equals("a") || line.substring(x, x + 1).equals("e") || line.substring(x, x + 1).equals("i") || line.substring(x, x + 1).equals("o") || line.substring(x, x + 1).equals("u")) { pig = line.substring(x, b - 1); } else { pig = line.substring(b - 1, x + 2) + line.charat(x); } line = line.substring(b + 1); y++; } system.out.println(pig); i'm suppose convert words in sentence pig latin if word starts vowel add together way @ end if starts consonant bring first letter , add together way stacktrace:

logging - Logstash Filter to Parse Nested Jsons -

logging - Logstash Filter to Parse Nested Jsons - is there way parse nested json objects in logstash? next filter works me doesn't parse nested json objects: filter{ json{ { source => "message" } } } so if input json {"event":23 , "fact":"yes" , "data":{"node1":"a1", "flag":"y"}} this converts (from logstash logs) "event" => 23 "fact" => "yes" "data" => "\"{\\\"node1\\\":"\\\a1\\\", "\\\flag\\\":"\\\y\\\"}} logging logstash grok

spring - How many HandlerMapping class is there in SpringMVC? -

spring - How many HandlerMapping class is there in SpringMVC? - i want know how many numbers of handlermapping class in spring3.o, new in spring waiting response thanks 1)abstractcontrollerurlhandlermapping 2)abstractdetectingurlhandlermapping 3)abstracthandlermapping 4)abstractmapbasedhandlermapping 5)abstracturlhandlermapping 6)beannameurlhandlermapping 7)controllerbeannamehandlermapping 8)controllerclassnamehandlermapping 9)defaultannotationhandlermapping 10)handlermapping 11)parameterhandlermapping 12)requestmappinghandlermapping 13)requestmappinginfohandlermapping 14)simpleurlhandlermapping spring spring-mvc

python - Unable to install gittle library without root privileges -

python - Unable to install gittle library without root privileges - i followed link install gittle library. when run command $ pip install gittle i error: command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_victor /gittle/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-aoypet-record/install-record.txt --single-version-externally- managed --compile failed error code 1 in /tmp/pip_build_victor/gittle storing debug log failure in /home/victor/.pip/pip.log my python version 2.7.6 . you need root privileges since installing sistem-wide libraries, these placed in directories need root privileges writing in them (for illustration under /usr/lib). hence need either run command root: class="lang-html prettyprint-override"> # pip install gittle or can utilize sud

Javascript variable scope when dynamically referencing functions -

Javascript variable scope when dynamically referencing functions - i'm trying create function creates "proxy" around object's method. "proxy" used handle web requests , phone call target method. proxy function looks similar this: var proxy = function(c) { var proxy = {}; for(var fellow member in c) { var args = c[member].tostring().match (/function\s*\w*\s*\((.*?)\)/)[1].split (/\s*,\s*/); proxy[member] = function(params) { var methodargs = args.map(function(argname) { homecoming params[argname]; }); homecoming c[member].apply(c, methodargs); } } homecoming proxy; }; so if have original controller, var c = { sum: function(x, y) { homecoming x + y; }, multiply: function(x, y) { homecoming x * y; } }; calling proxy(c) on homecoming proxy object sum() , multiply() functions. however, because of scope of member variable in proxy() function, phone call lastly referenced fun

laravel 4 - How to handle Twitter authentication? -

laravel 4 - How to handle Twitter authentication? - i'm trying integrate functionality in webapp, user clicks button tweet how awesome webapp is. (i know, know, stupid, hey, boss wants it) i set route below using thujohn's twitter laravel 4 - https://github.com/thujohn/twitter-l4 route::get('/twitter/callback', function() { // should set route on twitter application settings callback // https://apps.twitter.com/app/your-app-id/settings if(session::has('oauth_request_token')) { $request_token = array( 'token' => session::get('oauth_request_token'), 'secret' => session::get('oauth_request_token_secret'), ); twitter::set_new_config($request_token); $oauth_verifier = false; if(input::has('oauth_verifier')) { $oauth_verifier = input::get('oauth_verifier'); } // getaccesstoken() reset token $

java - Find index of first element of last group regex? -

java - Find index of first element of last group regex? - i have next problem: have collection of strings kinda this: "01100110011" "11100110010" "10001110000" could there written regex finds index of first 1 in lastly grouping of ones? using hashmaps , lots of calculations related lastindexof indexof etc. @ point it's starting ridiculous. it quite simple, compile next regex , search first match matcher.find() : ".*(?<!1)(1)" you can index calling .start(1) on matcher object. the regex finds lastly 1 , not preceded 1 (?<!1) , finds first 1 in lastly grouping of consecutive 1's. sample code: int startingindexoflastgroup(string str) { pattern p = pattern.compile(".*(?<!1)(1)"); matcher m = p.matcher(str); if (m.find()) { homecoming m.start(1); } // homecoming -1 string without 1 homecoming -1; } the regex above simple, not nice, since backtr

How can I use Swift REPL with iOS SDK -

How can I use Swift REPL with iOS SDK - can run swift repl ios sdk? i want import , utilize uikit in repl, no success. $ xcrun --sdk iphonesimulator8.1 --show-sdk-path /applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator8.1.sdk $ xcrun --sdk iphonesimulator8.1 swift welcome swift! type :help assistance. 1> import uikit /var/folders/kb/xgglxb597sv6h8b744d5vft00000gn/t/lldb/92014/repl1.swift:2:8: error: no such module 'uikit' import uikit ^ $ swift -sdk `xcrun --sdk iphonesimulator8.1 --show-sdk-path` welcome swift! type :help assistance. 1> import uikit /var/folders/kb/xgglxb597sv6h8b744d5vft00000gn/t/lldb/91881/repl1.swift:2:8: error: no such module 'uikit' import uikit ^ 1> import cocoa 2> i'm using xcode version 6.1 (6a1052d) the swift repl not back upwards ios device or ios simulator. ios swift

oracle - Odbc Connection Error -

oracle - Odbc Connection Error - i using odbc connection 64 bit windows 2012 server oracle database located @ 64 bit windows 2012 server. i getting error: error: library 'odbc' 'dbconnection' not valid physical location. error: sql error return: error: library 'odbc' 'dbconne. error: sql error return: error: library 'odbc' 'dbconne. error: library 'odbc' 'dbconnection' not valid physical location. error: sql error return: error: library 'odbc' 'dbc. error: sql error return: error: library 'odbc' 'dbc. error: library 'odbc' 'dbconnection' not valid physical location. error: sql error return: error: library 'odbc' 'dbc. error: sql error return: error: library 'odbc' 'dbc. error: library 'odbc' 'dbconnection' not valid physical location. error: sql error return: error: library 'odbc' 'dbconne. error: sql error return:

machine learning - Why features extraction? -

machine learning - Why features extraction? - in pattern recognition why of import feature extraction? why have cut down feature space? computational problem or procedure improves generalization ability of classifier? feature extraction not computational complexity. fixed number of training samples, if number of features becomes sufficiently large, performance of classifier can decrease significantly. see curse of dimensionality. as practical case, consider classifier using multivariate normal statistics (mean , covariance). n training samples , k features, covariance matrix become singular n < k . therefore, if number of samples cannot increased, necessary cut down number of features in order utilize classifier. machine-learning feature-extraction

Converting a two-mode edge list to a one-mode edge list in R -

Converting a two-mode edge list to a one-mode edge list in R - i have info set looks this: person team 10 100 11 100 12 100 10 200 11 200 14 200 15 200 i want infer knew 1 another, based on teams on together. in other words, want create info set looks this: person1 person2 count 10 11 2 10 12 1 11 12 1 10 14 1 10 15 1 11 14 1 11 15 1 the resulting info set captures dyadic relationships can inferred based on teams outlined in original info set. "count" variable reflects number of instances dyad on team together. also, doesn't matter id listed person1 versus person2, since relationships undirected. one option: do.call(rbind,tapply(dat$person,dat$team,function(x)t(combn(x,2)))) # [,1] [,2] # [1,] 10 11 # [2,] 10 12 # [3,] 11 12 # [4,] 11 13 # [5,] 11 14 # [6,] 11 15 # [7,] 13 14 # [8,]

sql - How do I change the radius of a circle in PostgreSQL? -

sql - How do I change the radius of a circle in PostgreSQL? - (using postgresql 9.1, without gis stuff installed) assuming i've got box (which should square): > select box '((0, 0), (1,1))' "(1,1),(0,0)" i can circle fits within square: > select circle (box '((0, 0), (1,1))') "<(0.5,0.5),0.707106781186548>" and bit of messing around can bigger circle: > select circle(center(circle(box '((0, 0), (1,1))')), radius(circle(box '((0, 0), (1,1))')) * 2) "<(0.5,0.5),1.4142135623731>" but doing prepared statement means passing square twice: "select circle(center(circle(?)), radius(circle(?)) * 2) which isn't deal breaker, sense there should 'better' way of doing it. is there easier/better way of resizing circle? specifically, want circle center @ center of box, , radius equal half diagonal length of box. (if helps, i'm using "contained in or on&q

java - The blank final field INITIAL may not have been initialized -

java - The blank final field INITIAL may not have been initialized - i'm programming in java. have added comments every method explain they're supposed (according assignment). have added know stub of password.java (which created after researching javadoc provided school). question not several functions, know there mistakes in testword , setword, i'll handle myself. question line: public static final java.lang.string initial; this line provided school, gotta assume correct, cant find documentation anywhere constant field value initial, if provide me info on that amazing (eg. how is handled? store? if anything? type?). im getting error on line in eclipse: the blank final field initial may not have been initialized why error here? in advance comments. fyi code password.java: package ss.week1; public class password extends java.lang.object { // ------------------ instance variables ---------------- /** * standard initial password. */ public static fin

php - Align products in Grid type instead of list? -

php - Align products in Grid type instead of list? - i've issue in displaying products in grid type. instead of grid type, products arranged in left side in top-to-bottom format. i've div called content displays list of products in left side , cart items on right side. code display products: <div id="content"> <h2>spices</h2> <?php $query="select * products"; $result= mysqli_query($db,$query); while($row=mysqli_fetch_array($result)) { $productname=$row['name']; $price=$row['price']; ?> <div class="product1"> <h3><?php echo $productname; ?></h3> <img src="images/bp.png" width="170" height="140"> <p>starting <span> rs. <?php echo $price; ?> </span></p&g

Autohotkey clipboard variable holding values forever? -

Autohotkey clipboard variable holding values forever? - i have below simple code, sends keystrokes text in clipboard 15ms delay in between characters (i utilize traverse huge lists of treeview elements). issue: if have copied 'text1' clipboard, followed 'text2', script outputs 'text1text2' instead of 'text2' alone. if reload script, prints 'text2'. is there error in below code, or bug in implementing %clipboard% in autohotkey 1.1.14.03 ? #v:: texttotype=" " texttotype=%clipboard% loopcount:=strlen(texttotype) ;stringlen, loopcount, texttotype array%loopcount%:=texttotype loop %loopcount% { thechar:=array%a_index% send %thechar% sleep 15 } homecoming update: pointing out smarter ways of doing this, still figure out wrong in above piece of code. update 2: error in understanding of ahk syntax. array%loopcount%:=texttotype assigns whole string value in texttotype (loopcount)th string element of string array named &

c# - That name doesn"t exist in the current context error -

c# - That name doesn"t exist in the current context error - in public static void ammount() error saying: "the name 'mps' not exist in current context" how prepare error? struct mp3players{ private int id; private string make; private string model; private int mbsize; private double price; private int vr; public int id { { homecoming this.id; } set { this.id = value; } } public string create { { homecoming this.make; } set { this.make = value; } } public string model { { homecoming this.model; } set { this.model = value; } } public int mbsize { { homecoming this.mbsize; } set { this.mbsize = value; } } public double cost { { homecoming this.price; } set { this.pr

gruntjs - Grunt bump package.json version -

gruntjs - Grunt bump package.json version - i add together 'release' task: class="lang-js prettyprint-override"> grunt.initconfig({ ... shell: { release: { command: function(version) { homecoming 'git checkout -b release-' + version + ' devel'; } } } ... grunt.loadnpmtasks('grunt-bumpup'); grunt.loadnpmtasks('grunt-shell'); ... grunt.registertask('release', function() { grunt.task.run('bumpup'); var version = grunt.config.get('pkg').version; grunt.task.run('shell:release:' + version); }); but have following: running "release" task running "bumpup" task bumped to: 1.2.5 running "shell:release:1.2.4" (shell) task switched new branch 'release-1.2.4' m gruntfile.js m package.json m src/manifest.json done, without errors. so version bumped up, branch created previous version. i thin

testing - Test lengthy form without re-writing all the fill_ins everytime -

testing - Test lengthy form without re-writing all the fill_ins everytime - i have long form, , 3 of fields, need test whether filled out right or wrong individually, because errors lead different actions. it's tedious , not dry write integration tests this: # test 1 describe "test field3 fails" before fill_in "field1", with: "passing info" fill_in "field2", with: "passing info" fill_in "field3", with: "not passing info" ... end "should lead error specific field3" ... end end # test 2 describe "test field2 fails" before fill_in "field1", with: "passing info" fill_in "field2", with: "not passing info" fill_in "field3", with: "passing info" ... end "should lead error specific field2" ... end end # test 3 describe "test field1 fails" before

ruby on rails - content_tag generating weird html -

ruby on rails - content_tag generating weird html - i have snippet in presenter: html << helpers.content_tag(:li, class: 'dropdown-header') helpers.content_tag('span', "status: #{online_srt}", class: 'glyphicon glyphicon-off') end , generated html this <li class="dropdown-header"> <span class="glyphicon glyphicon-off">::before status: online</span> </li> which makes output pretty weird the 'online' string has lot of spaces after 'status', , makes no sense. think ::before 1 responsible this...what can create output printed without ::before? you have pseudo-element, .glyphicon:before in css files. do utilize twitter bootstrap? suggest way utilize glyph icons. need set text after span tag, like <li class="dropdown-header"> <span class="glyphicon glyphicon-off"></span>status: online </li>

html - Email newsletter first empty table cell height issue in Outlook 2013 -

html - Email newsletter first empty table cell height issue in Outlook 2013 - the first empty table cell in newsletter displayed much bigger in outlook 2013. have: <tr> <td bgcolor="#b0bc12" height="10" style="background-color:#b0bc12; height:10px;"></td> </tr> this works fine on every email client have tested on in outlook 2013, height seems double assigned height. set next code in header not seem have effect: <!--[if gte mso 15]> <style type="text/css" media="all"> body { font-size: 0; line-height: 0; } tr { font-size:1px; mso-line-height-alt:0; mso-margin-top-alt:1px; } </style> <![endif]--> i have similar empty cells farther downwards newsletter working fine. first 1 having issue. outlook 2013 tends render images/spacers @ double height below 19px. adding style <td> , styling font-size , line-height 1px should prepare this