Posts

Showing posts from 2010

android - Hide Google Voice recognition -

i'm using google voice recognition , hide popup google , mic being shown.. code: intent intent = new intent( recognizerintent.action_recognize_speech); intent.putextra(recognizerintent.extra_language_model, getresources().getstring(r.string.ttslang)); try { startactivityforresult(intent, result_speech); } catch (activitynotfoundexception a) { toast t = toast.maketext(getapplicationcontext(), getresources().getstring(r.string.notts), toast.length_short); t.show(); } as think saw such apps, think possible.. if is, know how? many thanks! for that, need use speechrecognizer . example can found here . it's quite easy implement: speechrecognizer recognizer = speechrecognizer.createspeechrecognizer(this); recognizer.setrecognitionlistener(new recognitionlistener() { ... }); the listener c

How to install tig docs via Homebrew? -

i installed tig via homebrew , tig works okay, there way cleanly install man pages via brew instead of source (i.e. avoiding make install-doc described @ https://github.com/jonas/tig/blob/master/install.adoc ) "if installed homebrew standard install directories, i.e. relatives /opt/homebrew, there 2 commands register binaries , man files used: /usr/bin/sudo -s echo /opt/homebrew/bin >/etc/paths.d/homebrew echo /opt/homebrew/share/man >/etc/manpaths.d/homebrew exit if using bash or zsh actual shell, have enter 1 simple command take account these 2 environment modifications: . /etc/profile if want learn more how these 2 directories used under macos x, read: man path_helper " - daniel azuelos

c++ - How to properly delete a map of pointers as key? -

i have map of key/value pointers : std::map<a*, b*> mymap; what proper way liberate memory of key only? i thinking doing : for (auto itr = _mymap.begin(); itr != _mymap.end(); itr++) { if (certaincondition == true) { delete itr->first; itr->first = nullptr; } } is correct way of doing it? map keep nullptr key , future iteration include nullptr ? you cannot modify key of container because used define ordering , changing in place invalidate ordering. furthermore, each key needs unique. therefore, need remove item map clean memory. if have key: mymap.erase(key); delete key; if have iterator within map: a* keycopy = itr->first; mymap.erase(itr); delete keycopy; edit per updated question: auto itr = mymap.begin(); while (itr != mymap.end()) { if (certaincondition == true) { a* keycopy = itr->first; itr = mymap.erase(itr); delete keycopy; } else { ++itr;

c# - Delete sqlite database file in .net environment -

i'm doing integration tests of software uses sqlite. the software needs use database file prevent data being lost. after each of tests, want delete database file leave @ beginning. the problem when try delete file throws exception says "system.io.ioexception: process cannot access file '*****' because being used process". before trying delete file, i'm closing , disposing of connection this: if(_connection.state == system.data.connectionstate.open) _connection.close(); _connection.dispose(); to delete file using instruction: file.delete(_databasefilepath); doing wrong?, miss something? in advance.

PHP exact match between input and regex pattern -

i'm trying build check reliably evaluates whether input ($f_username) mac address via regex 'cause there different syntax take. upon finding match. should transferred lowercase without deliminators. the function works fine in matching , transforming input, wrongly match longer input... e.g. 11-22-33-44-55-66-77-88 transferred 11-22-33-44-55-66 , $match set true... this should cause function go "else branch" is not exact match of pattern... contains match... have idea how match ? thanks taking time read , in advance answers :) function username_check($f_username) { global $match; if (preg_match_all("/([0-9a-fa-f]{2})[^0-9a-fa-f]?([0-9a-fa-f]{2})[^0-9a-fa-f]?([0-9a-fa-f]{2})[^0-9a-fa-f]?([0-9a-fa-f]{2})[^0-9a-fa-f]?([0-9a-fa-f]{2})[^0-9a-fa-f]?([0-9a-fa-f]{2})/", $f_username, $output, preg_pattern_order)) { ($i = 1; $i <= 6; $i++) { $new_username .= strtolower($output[$i][0]); } $match = true; $new_username = "'

VBA read Outlook attachment from clipboard -

i'm searching way, using vba, retrieve file path or file data of outlook attachment copied clipboard user. i've implemented (in access) drag/drop option saves entire email (and associated attachments), because of common user workflow need (desire) right-click > copy single attachment has been requested. i've implemented solution thread: vba: read file clipboard , while successful files copied explorer window, not work outlook attachment copied clipboard. i've tested different shell clipboard formats listed here no luck: https://msdn.microsoft.com/en-us/library/windows/desktop/bb776902%28v=vs.85%29.aspx#cfstr_filenamemap any other suggestions/pointers appreciated.

React Native : Is it possible (/how) to pass props to a class of static functions? -

normally when passing props, 1 like: var myclass = require('./myclass.js'); <myclass prop1={prop1} prop2={prop2} /> these available in this.props scope of child component. if have helper class has static functions in it. how pass props class? declaration simply var myhelperclass = require('./myhelperclass.js'); the contents similar to var myhelperclass = react.createclass({ getinitialstate: function(){ return null; }, statics: { functionone: function(string){ var returnobject = {}; // this.props.. return returnobject; }, }, render: function() {} }); for i've created initalise function call in componentdidmount passes of data , function references down helperclass i'm curious. if myhelperclass stores static functions , doesn't render anything, create own store them. here's how package api calls: var api = { getallposts: function(token, daysago) { daysago = daysago || 0;

ruby - How to check if user input is a number -

i'm making small program , want check if user entered integer number, if did program continue if user enters string want program ask user enter integer until it, here's code snippet: print "how old you:" user_age = gets.chomp.to_i if user_age.is_a? string puts "please enter integer number:" user_age = gets.chomp.to_i until user_age.is_a? numeric puts "please enter integer number:" user_age = gets.chomp.to_i break if user_age.is_a? numeric end end i think error to_i after gets.chomps . to_i returns first number(s) @ begining of string or 0, allways number (0 or number). here examples: 2.2.1 :001 > "12".to_i => 12 2.2.1 :002 > "12aaa".to_i => 12 2.2.1 :003 > "aaa12aaa".to_i => 0 2.2.1 :004 > "aaaaaa".to_i => 0 i wrote code, works me: print "how old you:" begin user_

javascript - beforeEach with suite syntax for mocha tests -

i'm coming rspec style before(:each) blocks , working on javascript project uses mocha's suite instead of describe . seems mocha has beforeeach need, doesn't work because we're using suite instead of describe . team doesn't want change syntax. how run code before each test? you should able use setup , teardown , suitesetup , , suiteteardown . reference: https://github.com/mochajs/mocha/issues/310

javascript - How to add a mute button to my app? -

i have few events in app make sounds. for example, background music looped background on click makes sound when 2 rectangles collide makes sound what want have button when clicked toggles between letting sounds play , not letting them play. i don't want have load of if statements on each sound, there way around ? here how im calling sounds @ moment //html <div id='mainright'></div> //js var mainright = $('#mainright'); $(mainright).width(windowdim.width/2).height(windowdim.height); $(mainright).addclass('mainright'); var sounds = { coinhit : new audio('./sound/coincollect.wav'), playerclick : new audio('./sound/playerclick.wav'), gameover : new audio('./sound/gameover.wav'), backgroundmusic : new audio('./sound/backgroundmusic.wav') } sounds.backgroundmusic.addeventlistener('ended', function() { this.currenttime = 0;

android - Camera2 with a SurfaceView -

i'm trying new camera2 working simple surfaceview , i'm having problems live preview. on devices image stretched out of proportions while looking fine on others. i've setup surfaceview programatically adjust fit size of preview stream size. on nexus 5 looks fine 1 samsung devices way off. samsung devices have black border on right part of preview. is not possible work surfaceview or time switch textureview ? yes, possible. note surfaceview , associated surface 2 different things, , each can/must assigned size. the surface actual memory buffer hold output of camera, , setting size dictates size of actual image each frame. each format available camera, there small set of possible (exact) sizes can make buffer. the surfaceview displaying of image when available, , can size in layout. stretch underlying associated image data fit whatever layout size is, note display size different data's size- android resize image data display automatically. causi

c# - DataGridViewCell Change Error Icon -

i using .net 4.0 , i'm looking way change error image in cell when error text set word "linked". want original error image display if other error text. i've tried setting image when set text unable so. this have far: protected override void oncellpainting(datagridviewcellpaintingeventargs e) { if (e.errortext == "linked") { //image } else { base.oncellpainting(e); } } p.s. i've never used overrides before i'm aware i'm doing maybe wrong. reading you can try following code change error icon of datagridviewtextboxcell ... class datagridviewcell: datagridviewtextboxcell { protected override void painterroricon(graphics graphics, rectangle clipbounds, rectangle cellvaluebounds, string errortext) { if(errortext == "linked") { graphics.drawicon(systemicons.error, new rectangle(cellvaluebounds.width - 10, 0, 10, 10));

unix - Renumber everything that is in a specific column -

1) how renumber second column numbered 33 through 64 instead of 1 through 32? 2) how renumber 5th column add +5 every number shown? i.e. first 21 rows have 6 in fifth column. next 10 rows have 7 in fifth column. atom 1 n phe 1 -475.892 131.360 18.903 1.00 0.00 prt atom 2 ht1 phe 1 -474.916 131.490 19.239 1.00 0.00 prt atom 3 ht2 phe 1 -476.183 130.447 19.307 1.00 0.00 prt atom 4 ht3 phe 1 -475.832 131.151 17.886 1.00 0.00 prt atom 5 ca phe 1 -476.789 132.490 19.345 1.00 0.00 prt atom 6 ha phe 1 -476.569 132.728 20.375 1.00 0.00 prt atom 7 cb phe 1 -478.274 131.952 19.117 1.00 0.00 prt atom 8 hb1 phe 1 -478.456 131.739 18.042 1.00 0.00 prt atom 9 hb2 phe 1 -478.286 131.075 19.799 1.00 0.00 prt atom 10 cg phe 1 -479.371 132.856 19.681 1.00 0.00 prt atom 1

c# - asp:DataGrid visibility with async? -

.net 4.5.2, iis 8.5 on windows 8.1 x64. have single asp.net web site @ /localhost/. i've got real async-puzzle here i've been wrestling 2 days now. i'm reworking long-running reports async, can demonstrate problem simple code. i have asp:datagrid on page i've set visible="false". should visible if populated. problem is, if code populates async don't see grid! here's markup: <body> <form runat="server"> <asp:datagrid id="grid" visible="false" runat="server"></asp:datagrid> </form> </body> in code-behind, code works: void page_load() { grid.datasource = new dictionary<string, string>() { { "col1", "value1" } }; grid.databind(); grid.visible = true; } now if make 2 changes: add async="true" @page directive replace page_load this void page_load() { this.registerasynctask(new

javascript - Getting php results to show after AJAX call without page reload -

i have 3 sections on page. pending, accepted, , denied users. output of data through php while loop. next pending users section, each user in section have 2 buttons (accept , deny). when either of buttons pressed run ajax call php file updates users status either accepted or denied (whichever pressed). the issue having without letting page refresh user's data not moved updated status section(everything updates correctly on db side). however, if move out return false; code page refreshes, $('#success').html('user status changed!'); $('#success').delay(5000).fadeout(400); goes away right when page refreshes, instantly. i need way page not refresh, user's data moved appropriate section, success message still appears. $(document).ready(function () { $('.approve').click(function () { $.ajax({ url: 'userrequest_approve.php', type: 'post', data: { id: $(this).val(), //i

java - Maven: class not found compiling osgi bundle -

i have 3 osgi projects: projecta (has dependency projectb <scope>provided</scope> ) has class code ... classb b=new classb(); projectb (has dependency projectc <scope>provided</scope> ) has following class: public class classb extends abstractclassc{ ... } projectc has following class: public abstract class abstractclassc{ } projectb , projectc export necessary packages. in order: i compile projectc - ok. i compile projectb - ok. i compile projecta - throws abstractclassc not found. when add in projecta dependency projectc compiles without problem. why happen? understand projecta must compiled 1 dependency projectb. wrong? i've checked several times abstractclassc not used in projecta , not imported. first of all, can't make instance of classb unless know abstractclassc , code won't compile without reference. the main problem you're having, though, <scope>provided</scope> not transitive :

sql - Hibernate : insert="false" update="false" column used in hibernate generated select query -

i have table called loadout , doesn't have column called productname. hibernate xml has because need fetch table display purposes. the loadout.hbm.xml has property called productname, insert="false" , update="false". when session.merge() being called, hibernate calls select query , during query following error issued. hibernate: select loadout0_.id id225_0_, loadout0_.name name225_0_, loadout0_.product_id product3_225_0_, loadout0_.location_id location4_225_0_, loadout0_.loadout_loading_time_id loadout5_225_0_, loadout0_.time_slots time6_225_0_, loadout0_.product_name product7_225_0_ ethanol.loadout loadout0_ loadout0_.id=? 2015-07-14 19:28:31,410 warn [org.hibernate.util.jdbcexceptionreporter] >sql error: 904, sqlstate: 42000 2015-07-14 19:28:31,410 error [org.hibernate.util.jdbcexceptionreporter] ora-00904: "loadou

carousel - How to make product image slideshows in Shopify? -

i'm working on shopify website, , need create couple of image slideshows (for mobile layout only): (1) 1 product collection (2) 1 thumbnails of product on product page itself anybody have idea how accomplish either? thanks. you're going need @ image loop: https://docs.shopify.com/themes/liquid-documentation/objects/image nb - images assigned product variants, you'd like: {% image in product.images %} <img src="{{ image.src | img_url: 'compact' }}" alt="{{ image.alt | escape }}"> {% endfor %} then you'd need make sure js / jquery pugin wraps around html. collection images - you'd same, output images in collection. {% product in collection.products %} <img src="{{ product.featured_image.src | img_url: 'large' }}" alt="{{ product.featured_image.alt | escape }}"> {% endfor %} for cool you're going need javascript. liquid of renders html - yo

php - Most efficient way of accessing a private variable of another class? -

there many methods around allow access private variables of class, efficient way? for example: i have class details in: class something{ private $details = ['password' => 'stackoverflow',]; } in class need access them, example (although wouldn't work since variable isn't in scope class): class accesssomething{ public function getsomething(){ print($something->details['password']); } } would function enough within class "something" used access class?: public function getsomething($x, $y){ print $this->$x['$y']; } you should using proper getters/setters in classes allow access otherwise restricted data. for example a class class aclass { private $member_1; private $member_2; /** * @return mixed */ public function getmember1() { return $this->member_1; } /** * @param mixed $member_1 */ public function setmember1( $member_1

android - Why text is not formatted with Html.fromHTML? -

Image
i'm trying display html code in text view. want display this: i'm using page generate code: http://tohtml.com/java/ html: <pre style='color:#000000;background:#ffffff;'><span style='color:#7f0055; font-weight:bold; '>public</span> <span style='color:#7f0055; font-weight:bold; '>class</span> mainactivity <span style='color:#7f0055; font-weight:bold; '>extends</span> activity { <span style='color:#3f7f59; '>// called when activity created</span> @override <span style='color:#7f0055; font-weight:bold; '>protected</span> <span style='color:#7f0055; font-weight:bold; '>void</span> oncreate(bundle savedinstancestate) { <span style='color:#7f0055; font-weight:bold; '>super</span>.oncreate(savedinstancestate); setcontentview(r.layout.main); } } </pre> i'm tried this:

java - Find the hierarchy -

let's consider class in java class entity { integer id; integer parentid; public integer getid() { return id; } public void setid(integer id) { this.id = id; } public integer getparentid() { return parentid; } public void setparentid(integer parentid) { this.parentid = parentid; } } } consider parentid foreign key(relates id object). now created 6 objects , put values. entity e1 = new entity(); e1.setid(400); entity e2 = new entity(); e2.setid(300); e2.setparentid(400); entity e3 = new entity(); e3.setid(200); e3.setparentid(300); entity e4 = new entity(); e4.setid(100); e4.setparentid(200); entity e5 = new entity(); e5.setid(50); e5.setparentid(100); entity e6 = new entity(); e6.setparentid(50); now want obtain hierarchy of objects. means if give id, should complete parent hierarchy , child hierarchy. for eg: if give 100 id(entity: e4), should parent hi

mysql - it is possible to prevent insert/updates in sql relating to 2 different columns in a table? -

im trying figure out method sql-side (mysql) prevent inserting or updating data depending on columns. depending on data in 1 column, other 1 isnt allowed have same , via versa. example: ╔═══════════╦═══════════╦════════════════════════════╗ ║ col1 ║ col2 ║ ok? ║ ╠═══════════╬═══════════╬════════════════════════════╣ ║ 168068786 ║ ║ ok ║ ║ ║ 636435623 ║ ok ║ ║ 536733246 ║ 356367235 ║ ok ║ ║ 526372123 ║ 526372123 ║ isnt ok (same values) ║ ╚═══════════╩═══════════╩════════════════════════════╝ is possible via constraints? or other method? dont quite how achieve if indeed possible via constraints. appreciated this can achieved trigger-functions called before doing insert/update. check documentation details

sql - Does select top 10 * from tablename give same result every time? -

i want know select top 10 * tablename give same result every time? thanks in advance no. result set unordered unless specify order by clause. then, order by needs stable, meaning keys have no ties (you accomplish putting primary key last keys ordering). there several reason why results might differ. obviously, underlying data might change, guessing not gist of question. the primary reason on multi-threaded machine, different threads reading data. thread returns data indeterminate, don't know first ten rows (without order by ). sql not guarantee tables read in order processing queries. however, in practice, think sql server read pages in order.

swift - Bundle Identifier: setup for new project with IOS App+Framework+Today Extension -

i'm in process of starting develop ios/swift app framework share common logic today widget , have questions bundle identifier: if choose org.whateveriwant.testbundleid app, should whateveriwant.org exist or unique identifier? if later add cocoa touch custom framework project, asks me product name (testbundleidframework) , appends default product name org.whateveriwant without testbundleid . instead, if add target today extension appends product name (testbundleidextension) org.whateveriwant.testbundleid . given fact 3 parts (app, today extension , framework) part of same app i'll upload store, way of using bundleids correct? should framework under org.whateveriwant.testbundleid , such org.whateveriwant.testbundleid.testbundleidframework today extension? is extremely important chose right bundle id @ beginning of project (consider still have no developer account, i'll pay see i'm able build app i'd to) or can changed without hassle later on? an brief o

java - BeanProperties.list().observe() does not propagate ListChangeEvent -

i have data class contains observable list of items: public class data { private final iobservablelist items = writablelist.withelementtype(item.class); public iobservablelist getitems() { return items; } } when bind directly items fine: data.addlistchangelistener(mylistener); //ok but when bind items via beanproperties.list() listchangeevent not propagated beanproperties.list(data.class, "items", item.class). observe(data).addlistchangelistener(mylistener); //not working my goal automatically add rows (and remove from) tree. realm realm = swtobservables.getrealm(composite.getdisplay()); ilistproperty listproperty = beanproperties.list(data.class, "items", item.class); iobservablefactory observablefactory = listproperty.listfactory(realm); observablelisttreecontentprovider contentprovider = new observablelisttreecontentprovider(observablefactory, null); treeviewer.setcontentprovider(contentprovider); it s

nested - Rails 4 has_many through - Cannot modify association -

Image
i have dayitem model has 1 schoolprogram has many seminars. class dayitem < activerecord::base has_one :school_program, dependent: :destroy has_many :seminars, through: :school_program accepts_nested_attributes_for :school_program accepts_nested_attributes_for :seminars, reject_if: :all_blank end class schoolprogram < activerecord::base belongs_to :day_item has_many :seminars, dependent: :destroy accepts_nested_attributes_for :seminars, allow_destroy: true, reject_if: :all_blank end class seminar < activerecord::base belongs_to :school_program end i using cocoon gem dynamic nested forms follows. _form.html.haml: = simple_form_for [@day, @day_item] |f| = f.input :start_time = f.simple_fields_for :school_program |form| = form.input :school = form.simple_fields_for :seminars |seminar| = render 'seminar_fields', :f => seminar, :parent => form .links = link_to_add_association 'add seminar', form, :sem

osx - wav to mp3 encoding using ShineMP3Encoder is really slow on MAC desktop -

i'm using shinemp3encoder http://github.com/kikko/shine-mp3-encoder-on-as3-alchemy convert recorded wav file mp3 using flash as3. performance fast on windows os (any browser) bad (almost 10 times slower) on mac os (any browser). e.g. 5 second recording takes 2 mins encoded mp3 on mac while takes 3 secs on windows machine. i thought doing wrong noticed same problem demo @ http://code.google.com/p/flash-kikko/ has faced similar problem? there alternate mp3 encoders work on mac desktop?

angularjs - access the $routeparam and $stateParam objects with the dot -

i taking me debuge thing can't seem figure out.i think missing basic here. here problem consol.log($stateparams) returns params out in console energychain: "6"energyid: "1"facilityid: "1"resourceid: "1" when running specific params consol.log($stateparams.energychain) returns undfined 6 for link http://localhost:3238/#/resource/1/6/1/1 here either controller excuted 2 times 1 time undefined value 1 time 6 value true or statesparam returning old value variable here code var myapp = angular.module('myapp', ['nggrid', "nganimate", "ngaria", 'ngmaterial', "ui.router"]); myapp.config(function ($stateprovider, $urlrouterprovider) { // unmatched url, send /route1 $urlrouterprovider.otherwise("/") $stateprovider .state('firststate', {

machine learning - Weka - How to use classifier in Java -

i have created model in weka explorer, , saved .model file first, load saved model java code classifier cls = null; try { cls = (classifier) weka.core.serializationhelper.read("model.model"); } catch (exception e1) { e1.printstacktrace(); } then, read instance want classify, .arff file bufferedreader reader = new bufferedreader(new filereader(file)); arffreader arff = new arffreader(reader); instances data = arff.getdata(); the file, contains 1 instance. value of class attribute '?'. code below, try make classification of instance. data.setclassindex(data.numattributes()-1); try { double value=cls.classifyinstance(data.firstinstance()); string prediction=data.classattribute().value((int)value); system.out.println("the predicted value of instance "+ integer.tostring(s1)+ ":

html - CSS title code animation -

info : css code showing name small line below , 1 hover on it, line starts completing full rectangle. when hover out, transitions being line below name. the issue having that, when try changing size of text (in rectangle), have ton of issues such as: - rectangle needs adjusting new text height , width - rectangle needs re-centring (for reason not stay centred) - when text name: e.g. john smith, when size big, bottom of john, start touching top of smith question : how can make code bit better, such when change size of text, fits automatically without ton of re-adjustments? html code <header id="header"> <div class="svg-wrapper"> <svg class="svg-name" xmlns="http://www.w3.org/2000/svg"> <rect class="shape" /> <div class="text">john smith</div> </svg> </div> </header> css code header { heigh

html - How to set parameter and its value to HREF dynamic using javascript -

i have link following <a id="dynamiclink" href="http://www.w3schools.com?username=test">visit w3schools</a> i change value of username test test1 . how using javascript? could me on this? i suggest using library work uri s. provide consistency. here example using uri.js : // our <a> element var l = document.getelementbyid('dynamiclink'); // use uri.js work uri // http://medialize.github.io/uri.js/ var uri = uri(l.href); // query string object var qs = uri.query(true); // change our value qs.username = 'test1' // update uri object uri.query(qs); // set our new href on <a> element l.href = uri; <script src="https://cdnjs.cloudflare.com/ajax/libs/uri.js/1.15.2/uri.min.js"></script> <a id="dynamiclink" href="http://www.w3schools.com?username=test&someotherkey=val">visit w3schools</a>

c# - Uploading file to Web API timeouts on the server -

i've been having problem day, , i'm pretty lost why happens. i'm posting file (a .xls file) client side in react js component in response click on button this: upload: function (e) { e.preventdefault(); var model = this.state.model; var xlsfile = this.refs.xlsfile.getdomnode(); var file = xlsfile.files[0]; var fd = new formdata(); fd.append('file', file); var request = { groupid: this.state.vknumber, payload: fd }; model.importrequest = request; model.setimportprocessing(); multiorderactions.updateusers(request); this.setstate(model.tostate()); } the request appears in chrome (post-request): accept: / accept-encoding:gzip, deflate accept-language:en-us,en;q=0.8,da;q=0.6 connection:keep-alive content-length:3799243 content-type:multipart/form-data; boundary=----webkitformboundarybvyydsxrza1yruw4 and payload of request: ------webkitformboundarybvyydsxrza1yruw4 content-disposition: form-d

hadoop - Mapreduce job is not running -

after installing , configuring hadoop 2.7.1 in pseudo-distributed mode running, can see in the ~$ jps 4825 jps 4345 namenode 4788 jobhistoryserver 4496 resourcemanager than ran mapreduce example hadoop jar /usr/local/hadoop-2.7.1/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.1.jar pi 2 10 and execution frezees (?) number of maps = 2 samples per map = 10 15/07/14 08:40:09 warn util.nativecodeloader: unable load native-hadoop library platform... using builtin-java classes applicable wrote input map #0 wrote input map #1 starting job 15/07/14 08:40:13 info client.rmproxy: connecting resourcemanager @ master/10.0.0.4:8032 15/07/14 08:40:15 info input.fileinputformat: total input paths process : 2 15/07/14 08:40:15 info mapreduce.jobsubmitter: number of splits:2 15/07/14 08:40:16 info mapreduce.jobsubmitter: submitting tokens job: job_1436860512406_0002 15/07/14 08:40:17 info impl.yarnclientimpl: submitted application application_1436860512406_0002 15

ios localization issue for library -

i trying develop custom control , plan publish using github drag&drop installation. support localized strings created mycontrol.bundle directory en.lproj , de.lproj folders inside. each folder contains mycontrol.strings language specific content. in code defined macro this: #define mylocalizedstring(key) \ nslocalizedstringfromtableinbundle(key, @"mycontrol", [nsbundle bundlewithpath:[[[nsbundle mainbundle] resourcepath] stringbyappendingpathcomponent:@"mycontrol.bundle"]], nil) i use mylocalizedstring(@"whatever_title"); in xcode edited schemes "application language" german , "application region" germany. when run in simulator works charm , displays german user interface. when run on device, set german language , german region, shows me english user interface. the following code nsstring *language1 = [[[nsbundle mainbundle] preferredlocalizations] firstobject]; nsstring *language2 = [[[nsbundle mainbundle] p

java - Hibernate: Saving null entity in many-to-one relationship -

there similar question , case bit different cascading defined. on trying save task non-empty siteentity - works fine. however, when try save 1 null siteentity there null parameter exception (unsuprisingly) - , using dummy siteentity ends in creating new row in sites table... this relevant piece of code (irrelevant data omitted): @javax.persistence.table(name = "tasks") @entity public class task { @id @generatedvalue @column(name = "id", unique = true, nullable = false) private int id; @manytoone(cascade = cascadetype.all, fetch=fetchtype.eager) @joincolumn(name="siteid", nullable = true) @notfound(action = notfoundaction.ignore) @foreignkey(name = "id") private siteentity site; } @javax.persistence.table(name = "sites") @entity public class siteentity { @id @column(name = "id") @generatedvalue(strategy=generationtype.auto) private int id; } question is, ba

php - How to redirect to another folder in htdocs? -

can me on how redirect user folder in htdocs. current page @ : http://maps/index.php my goal everytime user access site automatically redirected to: http://dev_maps/index.php both maps , dev_maps folders under htdocs of xampp. thanks. you must place <?php header('location: http://dev_maps/index.php'); ?> before opening tag. easiest way.

c++ - Passing template arguments as target type -

in shortened example (not real world code), i'm attempting call callback int & , however, when going via callmethod method, template parameter interpreted int , meaning can't convert target parameter type. is possible? know can cast parameter correct type when calling callmethod , i'd solution implicit if possible. #include <functional> #include <iostream> using namespace std; void callback(int &value) { value = 42; } template <typename method, typename ...params> void callmethod(method method, params ...params) { method(std::forward<params>(params)...); } int main() { int value = 0; callmethod(&callback, value); cout << "value: " << value << endl; return 0; } you aren't correctly forwarding arguments. in order make use of perfect-forwarding std::forward should operate on forwarding references, when have rvalue reference in deduced context. callmethod funct

css - Strange blue colour on Popup JQuery mobile -

Image
i facing strange issue jquery mobile pop up, when appending popup body strange blue colour appearing on pop up. can me on this? css can avoid issue? this issue on android 4.2 or below devices

java - click on Button based on Text contain in multiple Rows -

i need perform following scenario: there form data entered in multiple rows , every record has own button , need click on specific record based on email address. html source: <div id="daily-sales-graph"> <table class="graph" align="center"> <tbody> <tr> <th style="width: 25px;"></th> <th style="width: 170px;"> <h2 align="center" style="white-space: nowrap">&nbsp;order number</h2> </th> <th style="width: 60px;"> <h2 align="center">&nbsp;amount</h2> </th> <th style="width: 100px;"> <h2 align="center" style="white-space: nowrap">&nbsp;order date</h2> </th> <th> <h2 align="center" style="white-space: nowrap&

excel vba - SQL - Get the most recent data -

hi guys hope can me! i have done piece of code here: " select distinct left(ut.text,27) " & _ " [mydatabase].[dbo].[table1] ut, dbo.table2 u " & _ " ut.table1 in (select unitid dbo.table2 serialno '" & cstr(right(sheet1.cells(i, 3), 8)) & "' ) " & _ " , ut.text 'epp:%' " & _ " , u.table2 = ut.table1 " & _ " order 1 " it works perfectly! does? have sheet this: order pid serial 3033421 6625mc3209 13-49026969 3033421 6625mc3209 13-49027001 it gets information on third column , uses search , paste data database fourth column. my problem is: query pastes first information gets , need last information (or more precise latest information added). illustrate: order pid serial epp 3033421 6625mc3209 13-49026969 123456789 2015-01-25 3033421 6625mc3209 13-49026969 987654321 2015-03-25 my query pasting data dates 2015-01-25 ,

oracle11g - How to encode japanese character in oracle Sql developer? -

i'm using oracle sql developer. version (1.5.5). tried store japanese character in database. running script success. couldn't see japanese character in sqlresult.and set in environment variable nls_lang english_france.ja16sjis. , encoding shift_jis. how solve?

PHP how to check there are more than 2 running same chars in a string -

checking if string has more running 1 occurrence of same character. iiiiiiii or ssssss . maybe use preg_match pattern should be? try regex: $str = 'hello'; print preg_match('/([\w])\1{1,}/', $str); /*return true */

mysql - Creating an object with multipple associations on ruby on rails -

i'm beginner @ ruby on rails , i'm trying create "order" table 2 foreign ids, "user_id" , "room_id". far i'm able fill in 1 foreign id @ 1 time. here codes models. class user < activerecord::base has_many: orders, dependent: :destroy end class room < activerecord::base has_many: orders, dependent: :destroy end class order < activerecord::base belongs_to :user belongs_to :room validates :user_id, presence: true #validates :room_id, presence: true validates :meal, presence: true end here relevant codes users controllers class userscontroller < applicationcontroller def current_user channel_id = session[:channel_id] @current_user ||= user.find_by(id: channel_id) end end here relevant codes rooms controllers class roomscontroller < applicationcontroller def current_room room_id = session[:room_id] @current_room ||= room.find_by(id: channel_id)

java - Why this piece of code isn't compilable -

here small piece of code , don't understand why javac can't compile it. miss? there errors? public class helloworld<t> { private static enum type { } private t value; private list<type> types = new arraylist<>(); public t getvalue() { return value; } public list<type> gettypes() { return types; } public static void main( string[] args ) { ( type type : new helloworld().gettypes() ) { // error: type mismatch: cannot convert element type object helloworld.type } } } why gettypes() returning object (raw) list when should type list? link online compiler this looks compiler limitation me. gettypes returns list<type> , using raw helloworld type should make no difference. that said, either of these 2 solutions overcome error : create parameterized type of helloworld instead of raw type : for (type type : new helloworld<integer>().gettypes() ) { // type do, chose

Node Webkit: Using Fullscreen API while beeing in kiosk mode -

my node webkit app starts in "kiosk" mode. want able open app element (eg video) in fullscreen mode using: element.webkitrequestfullscreen(); it doesn't seem work cause "kiosk" mode seems fullscreen mode. any ideas? you need make kiosk : true in package.json file { "name": "app", "window": { "kiosk" : true } }

vba - I run log but log is clean -

i run command in cmd: cscript d:\new.vbs > output.log but when open log clean: microsoft (r) windows script host version 5.8 copyright (c) microsoft corporation. i need simple log system vbs backup. source code of new.vbs (from internet): ' backup folder using 7-zip ' written steve allison 2014 - steve@allison.im dim fso, rs, shell ' file system object set fso = createobject("scripting.filesystemobject") ' recordset set rs = createobject("ador.recordset") ' shell set shell = createobject("wscript.shell") const advarchar = 200 const addate = 7 srcfolder="c:\customer" dstfolder="s:\backup" backupname="backup" zipexe="c:\program files\7-zip\7z.exe" ' number of files keep inum = 5 ' date in correct order. why vbscript suck hard @ date formatting? function getdatestring() d = zeropad(day(now()), 2) m = zeropad(month(now()), 2) y = year(now()) getdate

xcode6 - Can't we use Instruments with a real-device attached, instead of using iOS simulator ?? -

am using xcode6.4 , , trying out instruments (time profiler) first time... the instrument working fine if choose simulator , somethig wierd happenning when connect real-device(iosv8.3)...(i.e)the application hangs. my question is there way use instruments real device connected ?? pls share if u came across same probs , found solution ... thanks in advance.. yes can. here apple documentation talks bit . note paragraph: in order use instruments profile ios device, device must provisioned development before data can collected it. see provisioning ios device development.

angularjs - Set today's date as default date when page load in jQuery UI datepicker -

i trying display today's date default value in text box. have tried below code. not working start date : <input tgdatepicker ng-model="searchmodel.starttime" id ="starttime" /> end date : <input tgdatepicker ng-model="searchmodel.endtime" id ="endtime" /> $("#starttime").datepicker({ dateformat: "mm-dd-yy" }).datepicker("setdate", new date()); you can set default date using : defaultdate: new date(1985, 00, 01) $("#starttime").datepicker({ dateformat: "mm-dd-yy", defaultdate: new date(2015, 07, 01) })

Questions about Data Binding in Android Studio -

i heard of data binding today. since wanted have try of , know it, created test project. data binding is support repository available on api 7+. databinder , capable of saying goodbye findviewbyid (which complained lot developers) when binding application logics , layouts. here information project: android studio: current version: android studio 1.3 build number: ai-141.2071668 android sdk tools: 24.3.3 android platform version: mnc revision 2 project build.gradle : buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0-beta4' classpath 'com.android.databinding:databinder:1.0-rc0' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { jcenter() } } module build.gradle : apply plugin: 'com.android.application' apply plugin: 'com.android.

excel - VBA For loop not printing value to cell -

option explicit public sub autoserial() dim long dim b long dim c long dim d long dim e long = selection.row b = selection.rows.count + selection.row - 1 c = selection.column d = 1 e = e = b cells(e, c).value = d d = d + 1 next e end sub this code manual ranking function. when run code, serial numbers should appear on first column of selection. nothing gets printed on column. also, no error shows up. selection a1 d5 please try this, tidied , removed not required variables should print serial numbers in first column of selection option explicit public sub autoserial() dim irowstart long dim irowend long dim icol long, irow long dim iincrement long irowkstart = selection.row irowend = selection.rows.count + selection.row - 1 icol = selection.column iincrement = 1 irow =irowstart irowend cells(irow, icol).value = iincrement iincrement = iincrement + 1 next irow end sub