Posts

Showing posts from March, 2013

android - Jmeter performance testing on mobile devices -

i have done configuration in jmeter , android device. configuration , have refereed below link:- http://community.blazemeter.com/knowledgebase/articles/186249-load-test-mobile-apps-easily . issues is, while performing steps on native application (on android phone) not able capture 'https' traffic in jmeter. installed jmeter certificate on android phone. please me resolved above problem. note: able capture http request through jmeter. it "referred" link not attentively. states: note android supports http proxy. if application uses https connection, may use additional application performs https proxing. for instance looks proxydroid application does support http / https / socks4 / socks5 proxy

algorithm - Prime factors using recursion in Java -

i'm having trouble recursion in java. have following method , should transform recursion without loop. public static list<integer> primesloop(int n) { list<integer> factors = new arraylist<integer>(); int f = 2; while (f <= n) if (n % f == 0) { factors.add(f); n /= f; } else f++; return factors; } the recursive method should start same form: public static list<integer> primesrec(int n); and should define methods transformation result example: primesrec(900) -> prime factors of 900 : [2, 2, 3, 3, 5, 5] you can add f argument overloading, , adding private method take it, , invoked "main" public method. in private method, have 3 cases: stop clause: n==1: create new empty list n%f == 0: recurse n'=n/f, f'=f, , add f list. n%f != 0: recurse n'=n, f'=f+1, don't add list. code: public static list<integer> primesrecursive...

java - Dom parser is not working- output shown is all null -

i want parse xml file called "weather.xml" shown below: <?xml version ="1.0" encoding="utf-8" ?> <weather> <forecast_information> <city data="pittsford, ny" /> <postal_code data="14534" /> <forecast_date data="2015-03-12" /> <unit_system data="us" /> <condition data = "mostly cloudy" /> <temp_f data ="42" /> <wind_condition data="wind: nw @ 7 mph" /> <day_of_week data="sat" /> <low data="32"/> <high data = "45...

What's the better solution for this javascript code not using reverse method -

i'm trying code works not success , need find out mistake make works. don't want use reverse method better , fast solution find other way, it's challenge me. instructions how solve problem? input welcomed. thanks <body> <form id="form_id"> <input type="text" id="your_input" /> </form> <script> ispalindrome = function() { var len = this.length-1; (var = 0; <= len; i++) { if (this.charat(i) !== this.charat(len-i)) { return false; } } else if (i === (len-i)) { return true; } return true; } document.getelementbyid("form_id").onsubmit = function() { ispalindrome(document.getelementbyid('your_input').value); return false; } ...

android - How to prevent View above the keyboard (adjustResize)? -

Image
my layout has following structure: in manifest have attribute defines behavior of keyboard display after user clicked on edittext, contained in scrollview: android:windowsoftinputmode="adjustresize" here btnapply markup: <linearlayout android:id="@+id/btnapply" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentleft="false" android:layout_alignparentstart="true" android:background="#00bbe3" android:orientation="vertical" android:layout_alignparenttop="false"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="15dip" android:text="continue" android:textcolo...

asp.net mvc - T4MVC - Folder under views in areas, can't create view property in Controller Views -

Image
i have mvc project has t4mvc , i'm using areas, under views in areas, i'm using folder organize views feature. because of t4mvc can't identify views specific controller. how solve this? here's screenshot.

seo - How to evidence a particular page on Google SERP? -

Image
i noticed results of searching on google not single url single url two-column list of call 'important links' of website. for example: if open google , search "amazon.it", without double quote, got this: as can see, links evidenced directly on serp ("ebook kindle", example). i know can produce sitemap.xml google bot pleasure, but, question is: how can evidence particular link of website presented in way in google's serp? . as far know, there no special syntax in sitemap protocol 'force' or 'suggest' search engines. future readers: this link sitemap protocol . these called sitelinks , unrelated sitemaps. google shows them when: it understands structure of website (typically via structures in urls). it trusts website's content (no spam). the content/link relevant , useful corresponding user query. some implementing breadcrumbs helps google find sitelinks candidates, has never been confirmed , may false. ...

ios - xcodebuild equivalent of Xcode's "Product > Build For > Testing" -

i'm trying write script submits ios apps appthwack (a 'real device' ui testing service). guidance use xcode gui , build app using build > testing option in xcode product menu. works, haven't been able translate xcodebuild equivalent. more generally, how determine arguments xcode passing xcodebuild (assuming uses tool). this possible of xcode 8 (in beta @ time of writing). use build-for-testing . example: xcodebuild -workspace <workspace> -scheme <scheme> -destination 'generic/platform=ios' build-for-testing to switch beta version of xcodebuild, use xcode-select : sudo xcode-select -switch /applications/xcode-beta.app/contents/developer

javascript - I need an array of selected checkboxes -

javascript code: var simvalue = $('input[name="simnamecbx"]:checked').each(function() { var sim_name=this.value.split(" ")[0]; console.log("simname:",sim_name); var sim_list = [{ simulation_name : sim_name, }]; console.log(sim_list); }); i need array of selected checkboxes in sim_list.. array of values replaced same index ie array[1].. need values 1,2,3,4 in 'var simvalue' your not pushing data array instead re initiating array try var sim_list=[]; var simvalue = $('input[name="simnamecbx"]:checked').each(function() { var sim_name=this.value.split(" ")[0]; console.log("simname:",sim_name); sim_list.push({ simulation_name : sim_name, }); }); console.log(sim_list);

batch file for compressing folder in same directory -

i want zip folder using batch file. here's code zip.bat: cscript zip.vbs e:\app e:\app.zip zip.vbs has following code: set objargs = wscript.arguments inputfolder = objargs(0) zipfile = objargs(1) 'create empty zip file. createobject("scripting.filesystemobject").createtextfile(zipfile, true).write "pk" & chr(5) & chr(6) & string(18, vbnullchar) set objshell = createobject("shell.application") set source = objshell.namespace(inputfolder).items objshell.namespace(zipfile).copyhere(source) 'required! wscript.sleep 2000000 this code ziiping folder dont want mention drive name. want in drive if keep bat file n app folder after running bat file should zip folder. there code this??? you'll need add filesystemobject , use getabsolutepathname function - shell.application namespaces not accept relative paths. though using sleep bad idea - either make script slow or will interrupt zipping.the better idea...

c# - Can I create a mutual login system for multiple windows store apps? -

i have multiple windows store apps of company , of them have signing in option. trying create mutual login system of apps. in simple words, if user log 1 app automatically signed in other apps. i using sqlite locally maintain user's session data. so, tried access 1 app sqlite file other app giving static path installed location. won't open sqlite file. can put sqlite file in folder other apps can access too? there common folder/storage space in windows store app other apps able access sqlite file? any appreciated, in advance! although doesn't right now, windows 10 have solution apps same publisher sharing data. can use applicationdata.getpublishercachefolder(foldername) access 1 or more folders share amongst apps.

algorithm - Trying to create an algo that creates a spanning tree with least number of edges removed from a unweighed graph -

i trying create algo spanning tree root node such that, spanning tree have least number of edges removed original graph g. thanks in advance for connected graph, spanning tree contains n-1 edges n number of nodes in graph. have remove remaining edges. (if have understood question correctly) even disconnected graphs, number of edges in spanning tree defined number of components , number of nodes in each component.

java - Execution of ant file within exec task -

i want run ant i.e. build.xml file in parallel execution along ongoing execution of task. using exec task achieve this. i.e. using ant run build.xml file within exec task facing following error: error: exec doesn't support nested "ant" element. my excerpt of code is: <if> <istrue value="${parallel.exec}" /> <then> <!-- parallel execution of task --> <mkdir dir="${buildroot.dir}/product/${build-log.dir}" /> <exec dir="../../apollo" executable="/bin/sh" spawn="true"> <ant antfile="${buildroot.dir}/product/abs-build.xml" /> </exec> </then> we'll, <exec> doesn't support arbitrary tasks nested elements, manual page lists. in order run ant you'd use like <exec dir="../../apollo" executable="/bin/sh" spawn="true"> <arg value=...

ruby on rails - Tagging like github or gitlab -

i want introduce github tagging in app, repo has predefined tags/labels , tags can used on issues/prs. project can have_many issues . tags related both repos , issues, in issues has_many tags , repos has_many tags . can't seem figure out how implement it. using acts-as-taggable-on . so, initialize tag_list of repo when first created with: repo.tag_list = 'bug, feature, improvement, inspiration, discussion, help' i allowing user add tags @ same time issue created (ie on new form of issues). how validate in issue model tags being added in tag_list of repo on issue being created?

MYSQL Sorting by alternative sets of results by a column -

suppose have result set column_id: 1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4 i have tried usual "order asc" , returned me: 1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4 but required result set is: 1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4 also used "group by" function, since used aggregation functions returns me 1st set of results: 1,2,3,4 please me solving this. you can use user defined variables desired result set select column_id ( select column_id, @r:= case when @g = column_id @r + 1 else 1 end seq, @g:= column_id table1 cross join (select @g:= null,@r:=0) t order column_id ) t1 order seq,column_id

ios - connecting Central to peipheral for change the colour of lights or on/off light -

i want use ble device ios has on/off lights & coloured lights. connecting bluetooth using core bluetooth framework. now want on/off or change colour of lights. how central app peripheral bluetooth device, methods required function ? 1) scan nil service id (if using in background need service id) 2) scan [self.centralmanager scanforperipheralswithservices:nil options:nil]; 3) devices in delegate method - (void) centralmanager:(cbcentralmanager *)central diddiscoverperipheral:(cbperipheral *)peripheral advertisementdata:(nsdictionary *)advertisementdata rssi:(nsnumber *)rssi { // check advertisementdata service uuid [self.centralmanager connectperipheral:peripheral options:nil]; } 4) on successful connection - (void) centralmanager:(cbcentralmanager *)central didconnectperipheral:(cbperipheral *)peripheral { [peripheral discoverservice...

javascript - How do I send texbox and attachement to webmethod using jquery ajax call? -

i trying send textbox , input file data webmethod. have been googling quite sometime still not sure how can achieve this: jquery/ajax call: var datatosend = new formdata(); datatosend.append('file', document.getelementbyid("myfile").value); datatosend.append('text', document.getelementbyid("biddername").value); $.ajax({ type: "post", url: "suppliermaster.aspx/registersupplier", data: datatosend, processdata: false, contenttype: false, datatype: false, async: true, success: function (data, status) { console.log("callwm"); alert(data.d); }, failure: function (data) { alert(data.d); }, error: function (data) { alert(data...

jquery - Bootstrap 3 Dropdown - SlideToggle Effect on Dropdown Menu Open and Close -

how can apply slidetoggle effect dropdown menu bootstrap? if click on dropdown should slidedown, , clicking outside should slideup... fiddle html <div class="btn-group" role="group" aria-label="..."> <div class="btn-group" role="group"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">dropdown <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="#">dropdown link</a></li> <li><a href="#">dropdown link</a></li> </ul> </div> </div> add jquery demo $('#ddl').click(function(e){ e.stoppropagation(); if ( $( "ul" ).is( ":hidden" ) ) { $( "...

templates - How to add custom text elements in Limesurvey? -

by default, limesurvey provides follow text elements surveys - survey title, description, welcome message, end message etc, can use in template tags {surveyname} , {surveydescription} , {welcome} etc. is possible add own custom field, can use in template? need way because need have text translatable, , present on every page. you can not add custom replacement actual version of limesurvey. , limesurvey version seems outdated. ls include jquery it's easy move element form place elsewhere. quick exemple : <p>here description</p> <div style='display:none'> <label for='languagechanger' id='labellang'>here te new label language</label> </div> <script> $(function() { $("#labellang").insertafter("#languagechanger") }); </script> php solution, hacking limesurvey code @ https://github.com/limesurvey/limesurvey/blob/master/application/helpers/replacements_helper.php#l814

Passing file content from Extjs to php -

i looking way pass content extjs php processing it's not working. i've tried far: ext.onready(function(){ ext.create('ext.form.panel', { title: 'upload pdf file', width: 400, bodypadding: 10, frame: true, renderto: 'uploadform2', items: [ { xtype: 'filefield', name: 'file', fieldlabel: 'pdf file', labelwidth: 50, msgtarget: 'side', allowblank: false, anchor: '100%', buttontext: 'select file...', id: 'file' }, { xtype: 'button', text: 'upload', handler: function(){ var file = ext.getcmp('fi...

css shapes - CSS: Talk Bubble -

this question has answer here: speech bubble arrow 2 answers i have jfiddle right now. code found online implementing talk bubble https://jsfiddle.net/3l5abt5t/ however, when run code, triangle part seems green. want transparent , have green outline. sorry, new css. might simple fix. appreciated! thank you! does have code? .triangle-border.left:before { top: 10px; bottom: auto; left: -30px; border-width: 15px 30px 15px 0; border-color: transparent #5a8f00; } .triangle-border { border: 5px solid #5a8f00; border-radius: 10px; padding: 20px; position: relative; width: 200px; margin: 0 auto; } .triangle-border:before, .triangle-border:after { content: ''; position: absolute; top: 50%; left: -40px; border: 20px solid transparent; border-right: 20px solid #5a8f00; -webki...

php - print value of a variable that is composed for a string into a For Loop -

in loop, i'm trying take value of variable, save code want use loop print concatenating part of variable number genereted loop. try. <?php $x0 = 0; $x1 = 1; $x2 = 2; $x3 = 3; ($i=0; $i < 5; $i++) { echo '$x'.$i; } ?> the result i'm geting $x0$x1$x2$x3$x4 i want end this: 0123 its supposed be: for ($i=0; $i < 5; $i++) { echo ${"x$i"}; } sidenote: you'll have define $x4 or terminate < 4 won't undefined index.

dsl - Scala: store call-by-name variable as class field -

in progress in scala learning try implement simple dsl callbacks object button {...} // apply class button(val name: string) { private val: => unit; // doesn't work def click(f: => unit) = { _click_cb = f } def onclick() = this._click_cb() } button("click me!") click {println("clicked!")} i create new object, pass callback store. demo framework fires onclick method, should call stored one it works () => unit dsl looks ugly: button("click me!") click (() => println("clicked!")) sure, onclick abstract , implement anonymous class later new button("click me!") {def onclick = println("clicked!")} but want play dsl , such the questions are: how store f in _click_cb ? how provide initial "empty" function _click_cb ? and maybe there's more scala-way achieve this? (without anonymous classes) an uglier version show lazy val can hold ...

cygwin - PETSC Build Error : C compiler does not work -

i trying install petsc on cygwin terminal invoking following command.. ./configure --with-cc='win32fe cl' --with-fc='win32fe ifort' --with-cxx='win32fe cl' --download-fblaslapack and /configure --with-cc=cl --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich it shoots me below error: c compiler provided -with-cc=win32fe cl not work c compiler provided -with-cc=cl not work i'm new unix platform please me on this. try : ./configure --with-cc="win32fe\ cl" --with-fc="win32fe\ ifort" --with-cxx="win32fe\ cl" --download-fblaslapack note backslashes added before whitespaces escape them.

Excel searchable data validation dropdown lists -

Image
there 2 ways make drop down list in excel: data validation list combobox form control now in project have data validation dropdown lists wich can long , want add search functionality it. i've find solutions combobox control, not applicable excel document, because theese dropdown lists should repeated in each row: is there possible solution add search functionality datavalidation dropdown list?

PostgreSQL - No relations found. -

i’m totally new developer world, apologize if i’m not make question clearly, please don’t hesitate point out if did wrong. thanks. i faced problem on setting postgresql db, no relations found when type command timlin=# \d . i did try below solution fix didn’t work. postgresql database owner can't access database - "no relations found." below situation timlin=# \dn+ list of schemas name | owner | access privileges | description --------+--------+-------------------+———————————— public | timlin | timlin=uc/timlin +| standard public schema | | =uc/timlin | (1 row) timlin=# \l list of databases name | owner | encoding | collate | ctype | access privileges ---------------------+--------+----------+-------------+-------------+-------------------- postgres | timlin | utf8 | en_us.utf-8 | en_us.utf-8 | psqlapp ...

ios8.1 - Error for request to endpoint 'me/feed': An open FBSession must be specified for calls to this endpoint -

i know question posted many times didn't suggestion can solve problem. wasted 2 days on problem till didn't solutions. please give valuable guidance. i want post status on facebook. if ([posttype isequal:@"article"]) { [dict setobject:posttitle forkey:@"message"]; params = [nsmutabledictionary dictionarywithobjectsandkeys: posttitle, @"message", nil]; if (fbsession.activesession.isopen) { // yes, open, lets make request user details can user name. if ([[[fbsession activesession] permissions]indexofobject:@"publish_actions"] == nsnotfound) { [[fbsession activesession] requestnewpublishpermissions:[nsarray arraywithobjects: @"publish_actions",nil] defaultaudience:fbsessiondefaultaudiencefriends completionhandler:^(fbsession *session,nserror *error){ ...

android - Gradle system error "java.net.BindException: Address already in use" after first build -

this typical scenario of "one day woke , realised things used work stopped working unknown reason." i have jenkins job run gradle command. now, after successful build, following throw exceptions below. to honour jvm settings build new jvm forked. please consider using daemon: http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html. failure: build failed exception. * went wrong: unable start daemon process. problem might caused incorrect configuration of daemon. example, unrecognized jvm option used. please refer user guide chapter on daemon @ http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html please read following process output find out more: ----------------------- 03:38:49.137 [main] debug o.g.l.daemon.bootstrap.daemonmain - assuming daemon started following jvm opts: [-xx:maxpermsize=512m, -xx:+heapdumponoutofmemoryerror, -xmx2048m, -dfile.encoding=utf-8, -duser.country=us, -duser.language=en, -duser.variant] 03:38:49.501 [main] debug o.g.l.daemon.serve...

php - Laravel 5 error Call to undefined method Illuminate\Database\Query\Builder::Test -

i following error while trying retrieve array list use load view create select list. error: call undefined method illuminate\database\query\builder::albums in our controller using following: $albums = \auth::user()->albums->lists('name', 'id'); and in model albums.php using: <?php namespace app\models; use illuminate\database\eloquent\model; /** * app\models\albums * */ class albums extends model { protected $table = 'albums'; } in in our main file: public function albums() { return $this->hasmany('app\models\albums', 'name', 'id'); } the problem \auth::user() object not have albums function the albums() function must created in user model class

c# - execute a javascript function and button click event on enter keypress at the same time in asp.net -

this code <asp:button id="btncompute" runat="server" onclick="btncompute_click" text="" onkeypress="return tabe(this,event)"/> when enter key press javascript function execute, want execute button click event on server side when user press enter key. how this? if want execute btncompute_click() function, add onkeypress attribute , separate commands semicolon. onkeypress="btncompute_click(); return tabe(this,event)"

c++ - Region detection opencv -

Image
i have probleme detecte principale region of trafic sign probleme how extract interior region in project have i wan change black circle white color , other black color tryed function doesn't work mat mainwindow::region (mat img ){bool chacolbn=false;mat res ;img.copyto(res); for(int =0; i< img.rows; i++) { for(int j=0; j < img.cols; j++) { if (img.at<uchar>(i,j) !=255&&img.at<uchar>(i,j+1) == 255) { chacolbn= true; } if (img.at<uchar>(i,j) ==255&&img.at<uchar>(i,j+1) !=255) { chacolbn= false; } if (chacolbn= true) { if(img.at<uchar>(i,j) ==255) { img.at<uchar>(i,j) =0; } else { img.at<uchar>(i,j) =255; } } } } return img;}

How do I use Amazon Machine Learning with multi-value data -

amazon machine learning works csv files of data. doesn't appear have ability work relational data represent one-to-many relationships. how should transform relational dataset can used machine learning? would best denormalize dataset or thinking wrong way? your best bet denormalize dataset, each input observation has attributes (columns) needed make prediction. if can provide few example data rows, using made-up data values, i'd happy more.

Storing and Accessing a Range of Numbers / Dates in MySQL -

i need store range of numeric or datetime values in mysql, preferably in single column. unfortunately, there no real array or set data-types in mysql, likewise seems there no range data-type, i'm bit @ impasse here, hoping come smart. common use cases range e.g. storing start , end times of event, or minimum , maximum prices of given product. in case, need store year(s) book written. in cases, there ambiguity , year have on record may e.g. 810-820. of course 1 way go have separate year_min , year_max columns, , have identical data stored in both columns in case there no variance. yet fraction of entries have need have such range stored, , i'd love query simple between 750 , 850 example -- , avoid both having where hit on 2 columns, redundant duplication of data in 98% of cases. what's recommended approach? best practice tips? know how tune decent two-column queries. i'm hoping there's way go this... (and no, i'm not switch postgresql just have b...

php - Dealing with POST variables and adding them -

i cannot deal problem php-fusion addon. succesfully created post form, when try call post variables, not echo, not mentioning adding variables , putting them database. when - works. know it's not safe , beautiful, i'm still learning. there code: $id_ucznia = $_get["id"]; $result2 = dbquery( "select id,imiona,nazwiska,dom,punkty ".db_zapisy." (funkcja = 'student') , (id = '".$id_ucznia."')" ); if (dbrows($result2)) { while ($data2 = dbarray($result2)) { echo '<form method="post" action=""> <input type="hidden" name="uczen_id" value="'.$id_ucznia.'"> <table border="0" align="center"> <tr><td align="right">imiona ucznia: </td> <td align="left"><input type="te...

java - Is Expectations redundant if I have Verifications in my test? -

i'm confused purpose of , difference between expectations , verifications. e.g. @tested fooserviceimpl fooservice; @injectable foodao foodao; @test public void callsfoodaodelete() throws exception { new expectations() {{ foodao.delete(withequal(1l)); times = 1; }}; fooservice.delete(1l); new verifications() {{ long id; foodao.delete(id = withcapture()); times = 1; assert.assertequals(1l, id); }}; } first of all, please let me know if test poorly written/thought out. second, question: expectations section seems redundant me, , can't come example wouldn't be. the purpose of expectations allow test record expected results mocked methods and/or constructors, needed code under test. the purpose of verifications allow test verify expected invocations mocked methods and/or constructors, made code under test. so, normally, test wouldn't both record and verify same expectation (where "expecta...

performance - Possible to free Context from Singleton in Android to prevent memory leak -

i'm maintaining legacy project can't refactoring due limitations. found possible memory leak in below scenario. pass fragment singleton class foo.getinstance().setbar(fragment); assuming static instance lives longer need it, approach null in ondestroy() method in fragment. @override public void ondestroy(){ foo.getinstance().setbar(null);//to prevent memory leak super.ondestroy(); } i'm new memory leak area, correct me if there wrong :) use weakreference in singleton

cordova - Onsen UI Navigator from Jquery -

i had navigator interacts pages. trying use jquery instead onf angular. googling had found solution modify selected page html code: ons.ready (function (){ $(document).on('ons-navigator:postpush', 'ons-navigator', function(event) { //do }); }); how set specific html page(because code above page navigator changes to). thank in advance check postpush event in onsen ui docs: http://onsen.io/reference/ons-navigator.html#event-postpush there useful parameters can use such event.enterpage , event.leavepage . also, can current page mynav.getcurrentpage() and entire page stack mynave.getpages() . more info in previous link. hope helps! edit: looks original event wrapped in object. ons.ready (function (){ $(document).on('ons-navigator:postpush', 'ons-navigator', function(event) { event = event.originalevent; // console.log('from',event.leavepage.name, 'to', event.enterpage.name)...

Python error: keyword can't be an expression. print value -

i making game has fake loading screen in beginning. trying make gradual elipsys adds period every second until there 3 periods. code put in: def intro2(): print('loading capsulecorp computer'=end) time.sleep(1) print ('.'=end) time.sleep(1) print ('.') time.sleep(3) print ('welcome capsulecorp main computer.') time.sleep(1) print ('due new security issues, have added new security system.') print ('if employee, teach these maditoraly.') time.sleep(1) print ('we wipe mind ex-enployee') then, after running, error: keyword can't expression and highlights this: print**(**'loading capsulecorp computer'=end) this fix it: print('loading capsulecorp computer=', end) based on additional comment below, may looking this: print('loading capsulecorp computer', end='')

hadoop - how to make a sqoop job iterative by catching the tables from the sqlserver? -

hi have multiple tables in sql server. can use select statement list tables , make sqoop job iterative catching tables. , create hive schema. have tried using sqoop import-all-tables didn't worked. can please provide me documentation go through. thank you. i don't think so. there way of using sqoop direct command. try following, below. may you: sqoop import-all-tables --connect jdbc:mysql://localhost/databasename --username $user_name$ --password $password$ --exclude-tables table1, table2 -m 1

logstash output to elasticsearch with document_id; what to do when I don't have a document_id? -

i have logstash input use document_id remove duplicates. however, input doesn't have document_id . following plumbs actual document_id through, if doesn't exist, gets accepted literally %{document_id} , means documents seen duplicate of each other. here's output block looks like: output { elasticsearch_http { host => "127.0.0.1" document_id => "%{document_id}" } } i thought might able use conditional in output. fails, , error given below code. output { elasticsearch_http { host => "127.0.0.1" if document_id { document_id => "%{document_id}" } } } error: expected 1 of #, => @ line 101, column 8 (byte 3103) after output { elasticsearch_http { host => "127.0.0.1" if i tried few "if" statements , fail, why assume problem having conditional of sort in block. here ...

elasticsearch - Is it possible to query Elastic Search with a feature vector? -

i'd store n-dimensional feature vector, e.g. <1.00, 0.34, 0.22, ..., 0> , each document, , provide feature vector query, results sorted in order of cosine similarity. possible elastic search? i don't have answer particular elastic search because i've never used (i use lucene on elastic search built). however, i'm trying give generic answer question. there 2 standard ways obtain nearest vectors given query vector, described follows. k-d tree the first approach store vectors in memory of data structure supports nearest neighbour queries, e.g. k-d trees . k-d tree generalization of binary search tree in sense every level of binary search tree partitions 1 of k dimensions 2 parts. if have enough space load points in memory, possible apply nearest neighbour search algorithm on k-d trees obtain list of retrieved vectors sorted cosine similarity values. obvious disadvantage of method not scale huge sets of points, encountered in information retrieval....

javascript - Problems with cross-language HMAC / SHA256 / Base64 -

i'm using node.js script create signature azure documentdb - simplified version (result @ bottom):- var crypto = require("crypto"); var masterkey = "abcde" var key = new buffer(masterkey, "base64"); var signature = crypto.createhmac("sha256", key).update("fghij").digest("base64"); console.log("\n\n"+signature) // rnkid54/1h1h9p3nwpera0mow2l0c0hujgtty2gpbdo= this works, , need to. i'm trying same thing in swift commoncrypto let keystring = "abcde" let body = "fghij" let utf8data = keystring.datausingencoding(nsutf8stringencoding) let key = utf8data!.base64encodeddatawithoptions(nsdatabase64encodingoptions(rawvalue: 0)) let str = body.cstringusingencoding(nsutf8stringencoding) let strlen = body.lengthofbytesusingencoding(nsutf8stringencoding) let digestlen = int(cc_sha256_digest_length) let result = unsafemutablepointer<cunsignedchar>.alloc(digestlen) cchmac(cchmacalgor...

MySQL: Export table containing columns of type BLOB using the function LOAD_FILE -

how (or tool) can export data table blob type fields so, there sql script insert table (id, image) values (1, load_file('dir/image_1')) insert table (id, image) values (2, load_file('dir/image_2')) insert table (id, image) values (3, load_file('dir/image_3')) ... instead of insert table (id, image) values (1, '0x89504e470d0a1a....') insert table (id, image) values (2, '0xffd8ffe000104a....') insert table (id, image) values (3, '0xffdd0a1004e470....') ... and set of files (dir/image_1, dir/image_2,...) received each blob in output.

android - Color Image in the Google Tango Leibniz API -

i trying capture image data in onframeavailable method google tango. using leibniz release. in header file said buffer contains hal_pixel_format_yv12 pixel data. in release notes buffer contains yuv420sp. in documentation said pixels rgba8888 format (). little confused , additionally. don't image data lot of magenta , green. right trying convert yuv rgb similar this one . guess there wrong stride, too. here eís code of onframeavailable method: int size = (int)(buffer->width * buffer->height); (int = 0; < buffer->height; ++i) { (int j = 0; j < buffer->width; ++j) { float y = buffer->data[i * buffer->stride + j]; float v = buffer->data[(i / 2) * (buffer->stride / 2) + (j / 2) + size]; float u = buffer->data[(i / 2) * (buffer->stride / 2) + (j / 2) + size + (size / 4)]; const float umax = 0.436f; const float vmax = 0.615f; y = y / 255.0f; u = (u / 255....

c# - Trying to Search by id then display data in gridview but getting syntax error -

could please explain why getting error? aware code has no security not public access. please explain going wrong? want search id display data in gridview. have linked gridview data. exception details: system.data.sqlclient.sqlexception: incorrect syntax near 'equipmentregister''. line: 53 highlighted in source error source error: line 51: sqldataadapter da = new sqldataadapter(querystring, con); line 52: dataset ds = new dataset(); line 53: da.fill(ds); line 54: gvregister.datasource = ds; line 55: gvregister.databind(); here apsx file: private void rep_bind() { string theconnectstring = system.configuration.configurationmanager.connectionstrings["equipregisterconnectionstring"].connectionstring; sqlconnection con = new sqlconnection(theconnectstring); string querystring = ("select * equipmentregister engineerref '" + txtengref.text + "%...

Need Mobile Device to Open Desktop Version of Site -

there's review site out there when open site in desktop version, can leave reviews particular company when visit mobile version of site, there option read reviews not leave review. i'd send user link (reviewourcompany.com) , when visit link smartphone, opens desktop version them leave review. is possible? if site using url determine version display, send "desktop" version. if, more likely, querying information provided user's browser determine version display, out of luck.

c++ - Fullscreen in VS 2010 using WinBGIm library -

i using borland c++ 3.1 (mostly graphics purposes), , open program in fullscreen mode using alt + enter combination. but lately, had switch visual studio 2010, , continue work graphics installed winbgim library. so, after initiating graphics mode window alt + enter combo isn't working. anyone else encountered problem? find kinda hard work small objects in 640x480 window.

google search appliance - GSA return symbol ? for double quote -

i getting gsa search result xml , parse xml show result along other contents. i have noticed double quote(") or special character returned question mark (?). tested using postman on chrome , xml looks correct. using resttemplate fetch result. code snippets looks follows string gsasearchurl = " http://xxx.yyy.com/search?client=maintenance_frontend&filter=0&getfields= *&q=frequent&site=default_collection&start=0&num=10&sort=date:d:l:d1"; httpheaders headers = new httpheaders(); mediatype mediatype = new mediatype("application", "xml", charset.forname("utf-8")); headers.setcontenttype(mediatype); //search(gsasearchurl); resttemplate.getmessageconverters().add(0, new stringhttpmessageconverter(charset.forname("utf-8"))); responseentity<gsp> response = resttemplate.exchange(gsasearchurl, httpmethod.get, new httpentity<string>(headers), gsp...

Perl - Changing Excel Worksheet name -

in perl script writing, trying find way open existing excel spreadsheet, change name of first worksheet, , save it. seem simple task haven't found simple way it. spreadsheet::writeexcel can change worksheet name, seems can't read in existing excel file. another constraint perl module use shouldn't need installation. can work around if there's no option, make things more complicated. edit: using activeperl 5.18, modules included in ideal. the way of doing while preserving else in excel file use win32::ole . that requires having excel installed on computer on program run, and, of course, works on windows. if can't that, have read excel file, , write out contents file, changing name of worksheet in process. depending on have in source excel file, can rather involved rather fast. see " how can merge 2 excel (xls) files in perl or batch? " , " in perl, how can copy subset of columns xlsx work sheet another? "

How to read first and last 64kb of a video file in Delphi? -

i want use subtitle api. requires md5 hash of first , last 64kb of video file. know how md5 part want know how achieve 128kb of data. here solution problem in java unable implement in delphi. how read first , last 64kb of video file in java? my delphi code far: function tsubdbapi.gethashfromfile(const afilename: string): string; var md5: tidhashmessagedigest5; filestream: tfilestream; buffer: tbytearray; begin md5 := tidhashmessagedigest5.create; filestream := tfilestream.create(afilename, fmopenread, fmsharedenywrite); try if filestream.size > 0 begin filestream.read(buffer, 1024 * 64); filestream.seek(64, sofromend); filestream.read(buffer, 1024 * 64); result := md5.hashstreamashex(filestream); end; md5.free; filestream.free; end; end; i not getting accurate md5 hash stated official api. api url here . using delphi xe8. the hash function used api described as: our hash composed taking first , last ...

java - Why is there a transformation of hashcode to get the hash and is it a good idea for all keys? -

this question has answer here: understanding strange java hash function 6 answers i see implementation of hashmap applies kind of transformation hashcode actual hash. 1 please me understand how transformation works and additionally if make difference if object store integer? as taken javadoc of method hash(object) in openjdk java 8 hashmap implementation (assuming jvm concerned about): /** * computes key.hashcode() , spreads (xors) higher bits of hash * lower. because table uses power-of-two masking, sets of * hashes vary in bits above current mask * collide. (among known examples sets of float keys * holding consecutive whole numbers in small tables.) * apply transform spreads impact of higher bits * downward. there tradeoff between speed, utility, , * quality of bit-spreading. because many common sets of hashes * reasonably distributed (...

f# - FunScript querySelector null result -

i want use document.queryselector method html node. in js can receive null result. in f# result type element , it's neither nullable nor optional , it's not clear how check null . how can handle situation when queryselector doesn't match dom node? yes, it's true f# code assumes element not nullable. can trick compiler think otherwise in several ways. easiest 1 box value this: let el = globals.document.queryselector(".myclass") if (box el) = null dosomething() else dosomethingelse()` box ignored when generating js code, there's no performance penalty in doing this.

c - Incrementing pointer to static allocated array -

by how pointer incremented in these situations , why? void f(int a[]) { a++; printf("%d", *a); } void g(int a[][m]) { a++; printf("%d", *a[0]); } lets in main have static allocated array n elements , static allocated matrix ( 2d array ) n rows , m columns , i'm calling functions f , g ( i couldn't write in code because unable post question lot of code , no text ). in both cases pointers incremented once.:) a++; their values changed sizeof of types of objects point to. value of first pointer changed sizeof( int ) , value of second pointer changed sizeof( int[m] ) take account parameter int a[][m] adjusted int ( *a )[m] thus within functions both pointers point second elements of arrays. two-dimensional array element one-dimensional array. , statement printf("%d", *a[0]); will output first element (integer) of second "row" of two-dimensional array.

git - How to determine closest divergent branch-point -

not sure how word question. imagine it's been asked on so pointer existing post great. complexity: linear in number of commits, not number of named refs. ideally concise sequence of git commands instead of manual loops. let's have following commit graph: a b | / | /-- c |/ a & b named refs start with. less abstract concepts, origin/master & b name of branch conceptually based on a. finding commits made b diverge trivial & natively supported via ... notation. i'm, however, looking find if there's named ref c happens on path a...b . should not find c in either of graphs below assuming d named ref & c not. a b d | / / | /-- c |/ b | / | /-- c |/ \ d | / | / ---- edit: in example assuming both c & d named refs, expect find d: a b | /-- d | /-- c |/ | | in other words, commit closest b head of branch. in example, d & b different refs same commit, should not find d & instead find c: a b,...