Posts

Showing posts from February, 2011

cmd - Compare TXT files and get missing words -

i have 2 txt files, first result of json file , second must contain content of json + content of other txt file. database1.txt word1 word2 word3 word8 database2.txt (from json) word1 word5 word7 word8 database3.txt (database1+database2) word1 word2 word3 word5 word7 word8 here code: @echo off setlocal enabledelayedexpansion if exist "%localappdata%\xxx\xxx\database.json". ( /f "delims=" %%a in ('type "%localappdata%\xxx\xxx\database.json"') %%b in (%%a) ( echo %%b >>json.tmp ) /f "tokens=* skip=1 delims= " %%a in (json.tmp) ( call :sub1 %%a >> json_cl.txt echo.!s! ) set row= /f "delims=" %%j in (json_cl.txt) ( if defined row echo.!row!>>password_jd.txt set row=%%j ) findstr /v /g:"password_list.txt" "password_jd.txt">1.out type password_list.txt 1.out>updated_pw.txt del json_cl.txt del json.tmp del password_jd.txt del 1.out goto :eof :sub1 set s

php - ON DUPLICATE KEY UPDATE keeping some sold values -

ive googled 1½ hour , cant come understanding how this. i want update current row, keep values assigned. have checkbox either gives "1" or "0". if checkbox returns "0" dont want update there's no point updating. dont know how this. if col1 duplicate entry, should update col2,3,4,5 if entry isnt filled "1" or if variable gotten form "0". i lot of if statements id prefer not to. , aware code extremely messy right because im trying find solution. code fixed when result want to. code written in mysql because im more familiar in , ported pdo when done. please dont tell me "dont use mysql" , dont give me answer. gotten enough $insert_movie = "insert filmer (namn, rel_720p, rel_1080p, rel_dvdr, swesub, addate) values ('$namn','$rel_720p','$rel_1080p','$rel_dvdr','$swesub',current_timestamp) on duplicate key update rel_720p = if('$rel_720p' not null, '$rel_72

objective c - iOS face detection CIDetectorAccuracyHigh vs CIDetectorAccuracyLow -

i'm concerned time takes detect faces using cidetector . using cidetector large image such [rep fullscreenimage] cidetectoraccuracyhigh should produce best results , longest execution time. execution time consists of decoding image , running detection on bitmap image. more noticeable on older devices. to save execution time, should use: [rep aspectratiothumbnail] & cidetectoraccuracyhigh [rep fullscreenimage] & cidetectoraccuracylow other ideas?

android - "return of graph.facebook api image as byte[]" VS "Bitmap compressed as byte[]" -

when image graph.facebook api, can easyly converted bitmap structure: bitmap bitmap = bitmapfactory.decodebytearray(src , 0, src .length); but after picture gallery , compress send server db byte[], there problem while decoding same function. bitmap bitmap = getimagefromgallery(); bytebuffer buffer = bytebuffer.allocate(bitmap.getbytecount()); bitmap.copypixelstobuffer(buffer); byte[] result = buffer.array(); and facebook's image sizes more smaller mines, though dimensions same. why happening? how can compress images bitmap byte[] facebook's format?

php - Comparing websockets with long-polling -

i measure , compare server-performance between long-polling , websockets. have built simple php-application ratchet(php websockets) outputs data in console(guide: http://socketo.me/docs/hello-world ). long-polling app php , generating random numbers , logging them in console(this post: how implement basic "long polling"? ). is there way fair comparison between these applications without using database? tool(s) should use measure? thanks. i'd recommand zabbix. it gives alot of information server overload. you can try xdebug.

c++ - Lua C API: Retrieve values from Lua function returning a table in C code -

despite searching hard, couldn't find valid lua c api example calling lua function returning table. i'm new lua , lua c api, don't assume much. can read , have understood principle of loading lua module c , passing values via stack , calling lua code c. did not find example of how handle table return value. what want call lua function sets values in table (strings, ints, ) , want these values in c code called function. so lua function like: function f() t = {} t["foo"] = "hello" t["bar"] = 123 return t end (i hope valid lua code) could please provide example c code of how call , retrieve table contents in c. lua keeps stack separate c stack. when call lua function, returns results value on lua stack. in case of function, returns 1 value, calling function return table t on top of lua stack. you can call function with lua_getglobal(l, "f"); lua_call(l, 0, 1); // no arguments, 1 result use lu

Java syntax error tokens -

package test; public class test { public static void main(string[] args){ system.out.println(" _______________\n"); system.out.println(" .--h--.| |\n"); system.out.println(" _//_|| || Παγωτά |\n"); system.out.println("[ -| |'--;--------------'\n "); system.out.println(" '-()-()----()"()^^^^^^^()"()' "); } } i have have problem at: system.out.println(" '-()-()----()"()^^^^^^^()"()' "); exception: exception in thread "main" java.lang.error: unresolved compilation problems: syntax error on token "" \'-()-()----()"", invalid name syntax error on tokens, delete these tokens @ test.test.main(test.java:11) can me?? how solve prob?? " special in java, because represents start or end of string. if want print need escape \" , use system.out.println("

PHP echo different locations on a page -

i have made form outputs error messages if have not write in right stuff in right places. i got 4 fields. username, last_name, first_name , email. when haven't written in right stuff in right field outputs error here: if($validation->fails()) { //here } else { echo 'everything okay!'; } example: that username taken. the email not valid. all of errors gets output in on place. don't want that. want the errors output under each field not in 1 place. this error groups: echo '<div class="error_message">',($validation->errors()->all('username')), '</div>'; echo '<div class="error_message">',($validation->errors()->all('last_name')), '</div>'; echo '<div class="error_message">',($validation->errors()->all('first_name')), '</div>'; echo '<div class="error_message">'

javascript - CKEditor initial height -

i wanted place ckeditor 4 on div , fill content, dynamically resize editor if window resized. works ok, on instanceready, size of editor default value of 200px, have call custom resize function fit div's size. is there way set size of editor div size, before showing it?. here's code: <!doctype html> <html lang="es"> <head> <script src="../js/jquery-1.11.1.min.js"></script> <script src="../js/ckeditor/ckeditor.js"></script> </head> <style> html, body { height: 100%; margin: 0px; } header { background-color: yellow; height: 50px; } footer { background-color: yellow; height: 50px; } #content { width: 100%; height: 100%; -webkit-box-sizing: border-box; /* safari/chrome, other webkit */ -moz-box-sizing: border-box; /* firefox, other gecko */ box-sizing: border-box; /* o

java - How to use referenced libraries in exported JAR -

i using gradle, , need know how make sure users of java program have gson library installed use. there way so? (i avoid bundling program, if that's has come to, ok). there no standardized way distribute standalone jvm application, dependencies bundled. option gradle use gradle-one-jar plugin, produce single executable jar ( java -jar path/to/the.jar ) containing code , dependencies. option use gradle's built-in distribution plugin , produce zip containing code, dependencies, start scripts *nix , windows, , else want ship along application (e.g documentation).

c - Write to file not visible before close; fflush(stdout) ineffective -

i'm having issues writing file whilst having delay in while loop. here's snippet: void main(int){ file * fp = null; sprintf(filename, "log%i.msg", set_id); fp = fopen(filename, "w+"); fprintf(fp, "file started\n"); while(1){ fprintf(fp, "%i %u %s\n", someint, someunsigned, somestring); fflush(stdout); sleep(5); // commenting out line work } fclose(fp); return 1; } running code gives me output file of 0 bytes nothing in whilst sleep taking effect, although file have expected content when code finishes running. however, when remove sleep(5); line, print correctly. i've searched already, i've found needs flushed, (though apparently incorrectly). doing wrong? you're flushing stdout. need flush file. change fflush(stdout) to fflush(fp) in terms of why sleep() appears impact whether contents visible in file: without present, you're writing file @ higher r

How to specify library dependencies for an IntelliJ IDEA plugin? -

Image
i developing plugin intellij idea. way going creating plugin project in idea, packaging jar appropriate meta-inf/plugin.xml , , installing plugin jar. the problem add dependency on org.scala-lang:scala-library:2.11.0 . have specified library dependency in idea project, information never seems passed along generated jar. how can include information in such way intellij idea recognize it? as far understand, want bundle library (e.g. scala library) plugin. pretty simple. go project settings, select module , go dependencies tab. set scope library want bundle 'compile'. in example 'checker-framework' library. 'groovy-2.3.6' library not bundled due scope set 'provided'. save changes. prepare plugin deployment then got plugin, zipped, ready deployment (uploading repo or installing locally) in root of project. contain lib folder necessary jars.

html - How to set :hover for all elements -

why doesn't work? *:hover {margin-left:50px;} cause when move on element nothing happened. are putting @ end of css file? if not, may getting overwritten. *:hover { margin-left: 50px; } is working me. browser testing on?

sql - Multiple select case in a select query -

i'm beginning in postgres , have issue regarding multiple select case in select query. bd_david=> select * edt_sem; code_module | groupe | week | day | hour | room -------------+----------+------+-----+--------+------- m3106 | infofcas | 1 | 1 | 1 | o104 m3105 | infofcas | 1 | 1 | 5 | o104 m3106 | infofcas | 2 | 1 | 1 | o104 (3 rows) what want create function show rows of week , using function : create or replace function show_edt(in paramsem numeric) returns table(module varchar, groupe varchar, week numeric, day text, hour text, room varchar) $$ begin return query select e.code_module, e.groupe, e.sem, (select case when e.jour = 1 'monday' when e.jour = 2 'tuesday' when e.jour = 3 'wednesday' when e.jour = 4 'thursday' when e.jou

insert data into database using ajax, javascript and php -

the problem is: motive subject name admin , insert database. want give result of query onto same web page without refreshing ajax should do. following code giving wrong o/p. tried many syntaxes still wrong response code. please tell me correct way. my html code is: <form> <input type="text" name="subject" /> <div id="subject"></div> <input type="button" value="submit" onclick="addsubject()" /> <script src="home.js"> </script> </form> my home.js code is: function addsubject() { a=document.getelementsbyname("subject")[0].value; destination="ajaxstoresubject.php?a:"+a+";"; var xhr=new xmlhttprequest(); xhr.open("get",destination,true); xhr.send(); xhr.onreadystatechange=function() { if(xhr.readystate==4 && xhr.status==200) { document.getelementbyid(&q

javascript - Mobile Phone innerWidth,innerHeight vs Resolution -

one of test phones galaxy s3 mini. specs of phone 800x480 resolution. however, when following in html game: window.innerwidth window.innerheight it gives 533 width , 295 height. now i've read window.devicepixelratio, , phone 1.5 how can me make design good? the problem game designed 800x480, , looks stretched because of this. use this, width & height: windowmanager wm = getwindowmanager(); display d = wm.getdefaultdisplay(); d.getwidth() , d.getheight()

c++ - What other values will generate error when given to std::minstd_rand::seed()? -

Image
i'm on vc++11, far values generate errors, not on ideone.com #include "stdafx.h" #include <iostream> #include <random> using namespace std; int _tmain(int argc, _tchar* argv[]) //int main(int argc, char* argv[]) { //print_seq(seeded_rand(0x7fffffff,10)); //cout << print_seq(seeded_rand(0xffffffff,10)); ////print_seq(seeded_rand(0,10)); //cout << print_seq(seeded_rand(-50000,10)); //cout << print_seq(seeded_rand(1,10)); minstd_rand r1; minstd_rand0 r2; r1.seed(0); system("pause"); return 0; } those values generated errors 0xfffffffe 0x7fffffff -2 0 what other values supposed generate abort() call ? visual c++ 11.0.61030.0 update 4 26.5.3.1/5 explicit linear_congruential_engine(result_type s = default_seed); effects: constructs linear_congruential_engine object. if c mod m 0 , s mod m 0, sets engine’s state 1, otherwise sets engine’s state s mod m .

ruby - Changing an array -

i created array way: arr = array.new(4, array.new(4, '*')) when try change 1 element, example first element of first array: arr[0][0] = 3 then every first element changed. print arr [[3, "*", "*", "*"], [3, "*", "*", "*"], [3, "*", "*", "*"], [3, "*", "*", "*"]] can explain why happening? do: arr = array.new(4) { array.new(4, '*') } ruby array in fact set of pointers, points onto other objects n memory. in code pointers point same object created array.new(4, '*') . if, instead of value, pass block, block executed every element of array, each pointer point new object in memory. in fact, code above still have similar issue string '*'. should use same method fix it: arr = array.new(4) { array.new(4) { '*' } }

android - Textview setText from EditText in alert dialog -

what's wrong code? application has been stopped. public void names (view v) { alertdialog.builder alert = new alertdialog.builder(this); layoutinflater inflater = getlayoutinflater(); alert.setview(inflater.inflate(r.layout.dialog_signin, null)); alert.settitle("set players names"); alert.setpositivebutton(r.string.ok, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { textview j=(textview)findviewbyid(r.id.textview2); textview k=(textview)findviewbyid(r.id.textview3); edittext l=(edittext)findviewbyid(r.id.player1); edittext m=(edittext)findviewbyid(r.id.player2); string name1 = l.gettext().tostring(); string name2 = m.gettext().tostring(); j.settext(name1); k.settext(name2); } }); alertdialog dialog = alert.create(); dialog

PHP array to iOS NSArray -

okay, have array in php. 1 want in obj-c $jsonfiltereduniquecolumns. know can convert json , parse obj-c, whenever that, null value. php: //let's create variables $username = $_get['username']; //let's userid $useridquery = sprintf("select id user_info username = '$username';"); $useridresult = mysqli_query($connect, $useridquery); $userid_row = mysqli_fetch_array($useridresult); $id = $userid_row['id']; //let's search tables user's existence $existencetablesquery = sprintf("select distinct table_name information_schema.columns column_name in ('$username') , table_schema='u830212761_users';"); $existencetablesresult = mysqli_query($connect, $existencetablesquery); if ($existencetablesresult === false) { die(mysqli_error($connect)); } $tables = array(); while ($existencetablesrow = mysq

css - font-weight:300 doesn't work in Chrome -

i'm having issue font-weight in chrome. font weights lower default weight of 400 render @ default weight, overriding font-weight:300 css attribute. font weights higher default weight render expected in chrome, , font weights render in firefox. why happening? for example: <div class="light">light</div> with css .light {font-weight:300;} will render if font-weight:400. jsfiddle, compare view in firefox , chrome edit: screenshots of text in both chrome , firefox, running in fedora 20: chrome (incorrect rendering): i.imgur.com/mchhtlf.png firefox (correct rendering): i.imgur.com/tth9rpd.png sorry, can post 2 links maximum, apparently. try changing font family 'open sans light', sans-serif; . had same problem , worked me. worked in provided fiddle.

media player - Standard usb device into a MTP device -

how can convert usb device, used storage, media transfer protocol (mtp) device shows in windows portable media device? sorry not possible. try understand implementation of mtp know why hard. assume usb device referring pendrive/memory card etc. in case of mtp driver used gadget driver. there should mtp server running on usb device reply query sent host pc. if referring usb device mobile in case need change driver part. implement own mtp server. android has implemented mtp can have @ it.

Is there a way in Netbeans to count the number of project files? -

Image
pretty question describes... i trying idea percentage of total project files sub-project modified. counted files edited, there many, many files in total project. is there way count of files included? easy way open netbeans project folder, press ctrl+a , can see selected items information easily.

Keep getting 401'd using WWW::Pusher in Perl -

i'm using www::pusher in perl try send test message keep getting 401 no reason. here's http::request response dumped out. can see it's supposed be, yet still 401'd "invalid signature" when it's not. www::pusher 's source code way , it's correct: my $signature = "post\n".$uri->path."\n".$uri->query; $auth_signature = hmac_sha256_hex($signature, $self->{secret}); $request = http::request->new( 'post', $uri->as_string."&auth_signature=".$auth_signature, ['content-type' => 'application/json'], $payload ); response dump: $var1 = bless( { '_protocol' => 'http/1.1', '_content' => 'invalid signature: should have sent hmacsha256hex("post\\n/apps/77409/channels/eventname/events\\nauth_key=a07f61975e3c3f7903f3&auth_timestamp=1402292321&auth_version=1.0&body_md5=224adf45124f9ba44f83f49cc7964687&am

node.js - How to make API function call inside ng-repeat? -

i have scope function defined in controller calling api fetch data database. using scope function inside ng-repeat. when run application, getting hanged, know little bit dirty checking, not able find how handle such situation. in controler: $scope.gettranslatedtext = function (categoryid, categorydetailid, languageid) { $http.get('api/datacategorydetailtranslations' + '/' + categoryid + '/' + categorydetailid + '/' + languageid). success(function (data) { return data.datacategorydetailtranslations; }); }; inside index.jade li(ng-repeat="property in properties track property.propertyid | orderby : 'region'" ng-init="abc=compute()" menuhover itemscope itemtype="http://schema.org/hotel") a(ng-href='{{property.urlname}}') img.hotelimage(ng-src='http://cdn.objects.florahospitality.com/media/property/thumbnail/{{property.propertythumbnail}}' alt=&q

objective c - == and isEqualsToString giving strange behavior -

this question has answer here: if “a == b” false when comparing 2 nsstring objects 5 answers i have below code nsstring *firstname = @"1.6.1"; nsstring *secondname = @"1.6.1"; if (!(firstname==secondname)) { nslog(@"lock app"); } else { nslog(@"do not lock app"); } if (!([firstname isequaltostring:secondname])) { nslog(@"lock app"); } else { nslog(@"do not lock app"); } output getting do not lock app not lock app however when use actual values firstname & secondname , output lock app not lock app below details of firstname & secondname // coming server firstname = [[nsuserdefaults standarduserdefaults] stringforkey:@"iphoneappversion"]; // coming app version iphone secondname = [self appnameandversionnumberdisplaystring]; - (nsstring *)appnameandversi

javafx - Java FX 8 Tablecell data to Listview selected data -

i have java fx tableview column. column pre-populated values database. when click cell on table listview shown, can update table cell , db selecting values list. before listview shows up, set selected value of list match existing table cell's value following listview.getselectionmodel().select(this.getitem()); when list view opens selected item corresponds cell value of table. i have onchangelistener attached listview's selecteditemproperty. from list view if choose new value, when selection changes db gets updated , table cell gets updated new value. if there problem database update, listview's selected itemproperty still retains newly selected value. i have tried resetting using listview.getselectionmodel().select(this.getitem()); but doesn't reset selecteditemproperty value. hence if click same cell once again, list having selected value highlighted (i.e value not updated due db failure) table cell , selected value in listview dif

join - Mysql query to concat rows -

mysql tables structure is b1 //table 1 aid name 1 aaa 2 bbb 3 ccc 4 ddd b2 //table 2 bid aid 111 1 222 2 333 3 444 3 555 4 i want display data following aid bid name 1 111 aaa 2 222 bbb 3 333,444 ccc 4 555 ddd i tried not getting result expected. how using subquery or joins? thank you. you can use group_concat select b1.aid, group_concat(distinct b2.bid) bids, b1.name b1 left join b2 on b1.aid = b2.aid group b1.aid fiddle demo output | aid | bids | name | |-----|---------|------| | 1 | 111 | aaa | | 2 | 222 | bbb | | 3 | 333,444 | ccc | | 4 | 555 | ddd |

MySQL connection with C# through PHPMyAdmin created database -

we sitting problem regarding mysql database insertion. have installed .net connector , added mysql.data.dll, mysql.web.dll, mysql.entity.dll /bin. displayed in code below, using right namespace. however, when try , insert data through website, nothing gets inserted. details database connection provided webhotel. domain location: http://testing.cce-solutions.dk/testbooking/is/interested/ c# code: protected void button1_click(object sender, eventargs e) { mysql.data.mysqlclient.mysqlconnection connection; string server = "db.cce-solutions.dk"; string database = "web626445"; string uid = "******"; string password = "******"; string connectionstring; connectionstring = "server=" + server + ";" + "database=" + database + ";" + "uid=" + uid + ";" + "password=" + password + ";"; connection = new mysqlconnection(connectionstring);

html - Moulding shapes out of empty tags. Code explanation required -

i have been trying figure out piece of css animation . markup can see <b class = "b switch"> </b> and applied css style is .switch { position: absolute; left: 2px; top: 2px; bottom: 2px; right: 22px; background-color: #fff; border-radius: 36px; z-index: 1; } though css style specifies nothing block display or width or height, empty <b> tag still manages curve round circle fits div. how work ? appreciate if threw light on usage of empty <i> or <b> tags , mould them different shapes . this has nothing tag you're using. if specify position: absolute , width , height of auto (which default), , 4 of top , right , bottom , , left , element stretch fit within bounds.

query optimization - prolog logic gates aggregation recursion optimisation -

i trying implement logic gate type aggregation operation. , having trouble writing implementation perform calculations in reasonable amount of time. think have works logically slow , don't think needs be. think should possible out using many 'findall's or cuts'. i have table of approximately 10,000 columns , 70 rows. rows correspond samples , columns probes. each value in table either 1 or 0 (the state of probe in sample). multiple probes code protein. (many 1 relationship) want aggregate probe columns protein columns logical or operation. in addition proteins part of protein complex or protein set. both protein complexes , protein sets in addition containing proteins may in turn contain protein complexes or protein sets. can kind of recursive relation. want model protein sets or gates , protein complexes , gates. collectively refer proteins, protein_sets , complexes 'entities'. so on want have predicate can ask if protein or entity on or off in samp

node.js - Deploying Ghost - How to define the root path of an application that is managed with NPM forever? -

i installed ghost blog subdomain ( http://blog.example.com ) on ubuntu 14.04 lts behind apache 2.4.7 proxy. ghost located in var/www/html/ghost , can started temporarily sudo npm start , works fine. however, when want permanently deploy ghost using npm forever , installed globally following official ghost guide , following error message: info: forever processing file: index.js error: cannot start forever error: script /home/myuser/index.js not exist. simply copying index.js predefined npm forever root location not solve problem, ghost application not located there. tried sudo node_env=production forever start var/www/html/ghost/index.js without success. i 503 error - service unavailable. how tell npm forever file in var/www/html/ghost/index.js ? it sounds not giving forever correct file. error saying (error: script /home/myuser/index.js not exist.). there no index.js in /home/myuser directory. so, start ghost forever first cd ghost directory: c

sql server 2012 - SSAS Dimension attribute as Calculated Measure -

i having issues trying implement average of dimension attribute. the basic structure is: booking header dimension fact table (multiple rows per booking header entry) on booking header dimension have numerical attribute called booking window, , want able create calculated measure averages value. we using sql server 2012 standard edition. any appreciated. the best approach create measure group dimension table (in bids, go cube designer, tab "cube structure", right-click cube object in measures list, , select "new measure group", select dimension table). bids generate measures, , can remove two: 1 based on numeric attribute (i call "yoursummedattrib" have name refer below), , count measure. aggregate function measure "yoursummedattrib" "sum", leave is. then, create calculated measure divides "yoursummedattrib" count measure, gives average. finally, if have tested everything, make 2 measures "yours

jquery - Split variables in brackets with javascript -

i have tried google not able find answer problem. my javascript/jquery far: $(function() { var facegroup = ['clock-clock.png','clock-clock-2.png','clock-clock-3.png']; var arm1group = ['clock-arm1.png','clock-arm1-2.png','clock-arm1-3.png']; var arm2group = ['clock-arm2.png','clock-arm2-2.png','clock-arm2-3.png']; var arm3group = ['clock-arm3.png','clock-arm3-2.png','clock-arm3-3.png']; var bulletgroup = ['clock-bullet.png','','']; $('button').click(function() { facegroup.split(/*thirst click use clock-clock.png second click use clock-clock-2.png third click etc...*/); //do }); $('.holder').css('backgroundimage','url(' + facegroup + ')'); $('.hours').css('backgroundimage','url(' + arm1group + ')'); $('.minutes').css('bac

javascript - Adding a button element changes the position of the div it is in? -

i have basic layout 6 dynamically sized panels content, arranged in 2 rows , 3 columns. the panels <div> 's , set width of 26% 2% margins, , display:inline-block; . they evenly spaced , correct, add <button> element, box in 1st row, , 2nd column shifts 20 pixels. any ideas? html: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>test client</title> <link rel='stylesheet' type='text/css' href='css/main.css' /> <script src="javascript/main.js"> </script> </head> <body onload="main.onload();"> <div class="panel"> <h3>content</h3> <div class="innercontainer" id=""> </div> </div> <div class="panel"> <h3>content</h3>

java - Error searching *n@domain* in apache solr -

field defination <field name="email" type="text_general" indexed="true" stored="true" /> query email : "*n@domain*" result no data. my question have data indexed in solr matching criteria. not reflecting in query results. there issue query pattern. i'm guessing don't have text *n@domain* in you're field. rather have n@domain somewhere in middle of term (or believe). there few problems run into. assume field uses standardanalyzer . first, no wildcards in phrase queries. field:"query terms" phrase query, meaning match can span multiple (post-analysis) terms. query parser syntax not include support of wildcards in phrase queries. such asterisks in query that, literal asterisks. second, searching email:*n@domain* , better, still no luck. wildcard queries bypass analysis, , chances email analyzed in index. entry like: "test@domain.com", ave 3 terms "t

Need to render HTML file as a book and retain CSS formatting on Android -

i apologize in adavance similiar question exists here: need show html page (with css) book page flipping unfortunately seems poster solved own problem without revealing details of solution. as not have required reputation comment on original post, , lack ability ask poster directly, forced ask community help. i need described in previous post. able display entire html file display book ability swipe page page. the solution know how perform manually splitting file dozens of seperate .html files , switching between them user flips pages. i realize terrible way implement , looking better way. i have been able find solution after research. technique wrap each section in div tags css attribute style="display:none" hide section. inject javascript application change appropriate page style="display:block" display associated section <div id="page1" style="display:none"> text here </div>

Use local copy of python package rather than the one installed in site-packages -

i've installed python based package in site-packages directory. however, i'm trying learn how code works i'd hack bunch putting in lots of print statements can understand code doing. @ end of day want clean installation without hacks in it. of course copy original files else, make hacks, , @ end copy original files over. that's tedious. @ least, i'd install local copy of python package , have python script use copy preferentially (perhaps suitable statements @ top of script). perhaps isn't best way python development/hacking. what's best solution problem? want able hack on package (and use package) without messing clean version. the virtualenv-advice given correct, depending on actual package can go beyond , not mess site-packages inside virtualenv @ all. if package setuptools-based, simple $ python setup.py develop from within working-copy of it's source, won't installed, instead hooked virtualenv pointing working-copy. advant

canvas - Drawing a Region with CSS -fx-shape. How it is possible? -

i'm looking way draw shapes in region (javafx8) i've seen examples set region style this: -fx-shape : "m 3.0313 0 l 0 74 l 7.9688 74 l 4.9375 0 l 3.0313 0 z"; can give explanation of meaning of string? is there way create type of string using visual software? the shape string svg path . note shape string region shape of region, not shape in region. if want create shapes based on paths put in region, use svgpath , not region . you can use svg editor create svg paths. recommending particular svg editors off topic stackoverflow, try google , may find inkscape (and it's option path | object path ).

java - ELKI Maven OPTICS -

i'm trying use elki ( http://elki.dbs.ifi.lmu.de/#gettingelki:downloadandcitationpolicy ) cant find maven dependency. know find it? i want experiments opticsxi implementation i'm finding difficult. please give me advice? links? me started? optics implementation use? i found these links: running optics algorithm on elki how cluster instance weka's dbscan? dont me.. we not provide elki on maven. thus, there no maven dependency . elki changing quickly, , not provide stable api. for example, in next release numbervector<? extends number> simplify numbervector . getting rid of generic nice, break code. , such changes still happen @ every version, why have not released version 1.0 yet. if possible, use command line or minigui. works well . use distribute experiments on cluster of 50 cpu cores. advanced cases (involving nontrivial custom distance functions), have drive elki java. as far know, elki has complete optics implementation . there partial

javascript - Google Analytics Reporting API v3 requires user to be logged in -

i attempting fetch our website's unique user's data google analytics , display data along side other data in custom graph. have set , working long logged google. if not logged in (or user without permissions) hits page fails. goal: want able query analytics api unique users. here's snippet of code failing due error states "login required". gapi.client.analytics.data.ga.get({ 'ids': 'ga:' + profileid, 'dimensions': 'ga:date', 'start-date': '30daysago', 'end-date': 'yesterday', 'metrics': 'ga:sessions', }).execute(function (results, resultsjsonstringified) { // stuff... }); to access google analytics api , of google apis must authenticated. authenticating using oauth2 requested access google analytics data. if else ran script access google analytics data not data site. in instace want show own data recommend using service account . using service acc

java - Workout Gaps between several date entries -

i trying create mechanism requires user enter have been doing last 5 years date range must covered (start date 01/08/2009 - end date 01/08/2014) up ten entries allowed overlapping allowed no gaps not allowed currently order entries start date, verify both ranges covered. gaps between entries compare 2 dates @ time, entry , i+1 , compare start date of later start date earlier start dates end date. find difficult put words think small diagram helps describe problem start x---------------------------------------y b x----------y c x--------y d x-----y e x----------y f x----------y end here option e fail because start date after d's end date, use while loop add day gap everyday start date after end date, trigger validation, though dates have been covered entry a.i using java in text , pseudo code great more logic im lost , if gaps betwee

ruby on rails - How to eagerly load unassociated active model records -

i have 2 models: hurricane , problem , each hurricane has many problem now in database want let users update data each hurricane, have 1 copy of data set admin , each user has access data. when each user wants update data hurricane, create new copy of admin created record , scope each user sees newly created record modified. , each new record stores , 'original_id' attribute stores id of model cloned from. however, each problem model still point original hurricane record (created admin). should mention each problem belongs_to user for given user, when listing problems, i'd eagerly load associated hurricanes, , instead of displaying hurricanes point to, i'd eagerly load ones modified i tried this: in app/models/problem.rb class problem < activerecord::base belongs_to :hurricane belongs_to :user_hurricane, -> (problem) { "original_id = ? , user_id = ?", problem.hurricane_id, problem.user_id }, class_name: 'hurricane' ... t

javascript - jQuery: serializing array returns empty string -

i did not forget add name attributes common problem , yet serialized form returning empty string. doing wrong? html/javascript: <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <script> $( document ).ready( function() { $('#word_form').submit(function(e) { e.preventdefault(); console.log($(this).serialize()); //returns empty string }); }); </script> </head> <body> <div id="wrapper"> <form name="word_form" id="word_form" method="post"> <input type="image" name="thumbsup" id="thumb1" value="1" src="http://upload.wikimedia.org/wikipedia/commons/8/87/symbol_thumbs_up.svg" style="width:50px;height:50px;"> <input type="image" name="thumbsdown" id="thumb2" value="2&q

Eye tracker in oculus -

Image
i'm trying work out how find gaze position of eye viewed through oculus. helpful if me this. image below illustrates setup. black rectangle eye tracker fitted inside oculus, purple line oculus screen , blue line curvature of eye viewed top. @ moment can calculate gaze_angle , viewing_distance through viewpoint application. need in using information find actual x_gaze position marked on picture.

javascript - Avoid looping once click the a tag -

i trying figure out how avoid looping in javascript. have code: $.ajax({ url : '<?php echo base_url()?>project/search_project_structure_stage', type: 'post', data: { project_id: $('#project_id').val() }, success : function(stages) { var stages = $.parsejson(stages); (var = 0; < stages.length; i++) { stageid = stages[i].id; stagename = stages[i].stagename; stageorder = stages[i].ordstage; stagetypecode = stages[i].stagecode; projectid = stages[i].pid var html_stage = "<div class='row col-sm-10'><ol id='"+stageid+"' class='group_stage'>" + "<li style='list-style:none' class='container span1'>" + "<a class='expand_batch'><i class='fa fa-folder'><

java - javafx tableview get selected data from ObservableList -

i working on javafx project , need . while trying selected data table can selected data normal cell can't data observablelist inside tableview. code database: -- phpmyadmin sql dump -- version 4.0.4 -- http://www.phpmyadmin.net -- -- host: localhost -- generation time: jun 10, 2014 @ 06:20 -- server version: 5.1.33-community -- php version: 5.4.12 set sql_mode = "no_auto_value_on_zero"; set time_zone = "+00:00"; /*!40101 set @old_character_set_client=@@character_set_client */; /*!40101 set @old_character_set_results=@@character_set_results */; /*!40101 set @old_collation_connection=@@collation_connection */; /*!40101 set names utf8 */; -- -- database: `test` -- -- -------------------------------------------------------- -- -- table structure table `customer` -- create table if not exists `customer` ( `col0` int(11) not null, `col1` varchar(255) default null, `col2` int(11) default null, primary key (`col0`) ) engine=innodb default charset