Posts

Showing posts from February, 2011

java - Elastic search sort field containing special characters numbers and alpahbets -

i created case insensitive analyzer put /dhruv3 { "settings": { "index": { "analysis": { "analyzer": { "analyzer_keyword": { "tokenizer": "keyword", "filter": [ "lowercase", "asciifolding" ] } } } } }, "mappings": { "test": { "properties": { "about": { "type": "string", "analyzer": "analyzer_keyword" }, "firsname": { "type": "string" } } } } } and used in mapping. field supposed contain aplha numerc , special characters.then inserted values about field as 1234, `pal, pal, ~pal . besides searching need result sorted. searching working when try sort them as get dhruv/test/_search { "sort...

oracle - Sql query OR function to reverse the Arabic strings -

i need sql query reverse arabic string. ex: string 1: abc def (assume abc def arabic string ) out put should cba fed. string 2: abcdef (assume abcdef arabic string ) out put should fedcba. thanks rajeev naik this 3 step process split string rows using space separator reverse each string join strings together sql fiddle demo with spacesplit ( select t.id, trim(regexp_substr(t.text, '[^ ]+', 1, lines.column_value)) text, lines.column_value seq t, table (cast (multiset (select level dual connect level <= regexp_count(t.text, ' ')+1 ) sys.odcinumberlist ) ) lines order id, lines.column_value ), reversestring ( select id, reverse(text) text, seq spacesplit ) select id, listagg(text, ' ') within group (order seq) text reversestring group id ; output | id | text | |----|----------| | 1 | cba fed | | 2 | fedcba | | 3 | ba dc fe |

serialization - Using Kryo to Serialize Classes with Non Serializable Attributes -

i using kryo serializer serializing java object my java object this class { private class b; private class c; private class d; int x ; int y; } b, c , d third party libraries , not serializable . cant edit code . i using kryo serialize a = new (); //populate properties of kryo kryo = new kryo(); output output = new output(new fileoutputstream("file.bin")); kryo.writeclassandobject(output, ); output.close(); and deserialize input = new com.esotericsoftware.kryo.io.input(new fileinputstream("file.bin")); inputqueuemanagerimpl inputqueue = (a) kryo.readclassandobject(input);//, a.class); input.close(); while executing , concurrentmodificationexception @ apache.application.main(application.java:43) caused by: com.esotericsoftware.kryo.kryoexception: java.util.concurrentmodificationexception serialization trace: classes (sun.misc.launcher$appclassloader) contextclassloader (java...

excel - Create new worksheet based on cell but ignore empty cell -

i create new worksheet in workbook; name based on information in c column (starting @ c4) of "summary" worksheet. have following vba far when gets blank cell stops. need ignore blank cells , continue. help? sub createsheetsfromalisttest() dim mycell range, myrange range set myrange = sheets("summary").range("c4") set myrange = range(myrange, myrange.end(xldown)) each mycell in myrange sheets.add after:=sheets(sheets.count) 'creates new workbook sheets(sheets.count).name = mycell.value 'renames new workbook next mycell end sub replace set myrange = sheets("summary").range("c4") set myrange = range(myrange, myrange.end(xldown)) each mycell in myrange sheets.add after:=sheets(sheets.count) 'creates new workbook sheets(sheets.count).name = mycell.value 'renames new workbook next mycell by set myrange=range(sheets("summary").[c4],sheets("summary").cells(rows.count,"c...

mysql - Ordering questions by most recently answered and filtering those unanswered by a particular user -

i'm having trouble writing active record query returns results want. have following setup: abridged user model: class user < activerecord::base has_many :answers end abridged answer model: class answer < activerecord::base belongs_to :question belongs_to :user end abridged question model: class question < activerecord::base has_many :answers def self.unanswered_by(user) where( 'id not in (select question_id answers user_id = ?)', user.id ) end def self.recently_answered includes(:answers).order('answers.updated_at desc') end end i'm trying activerecord::relation orders questions have been answered , filters result contains questions current_user has yet answer. ideally, i'd write question.recently_answered.unanswered_by current_user but doesn't appear work , i'm struggling understand why limited understanding of sql. this result when run in rails console: me = user.fi...

c# - Releasing a unplugged virtual Serial Port -

i got little problem usb barcode scanner. using scanner "serialport" class: this._barcodescanner = new serialport(comport, 9600, parity.none, 8, stopbits.one) { handshake = handshake.none, readtimeout = 500, writetimeout = 500 }; this._barcodescanner.open(); this._barcodescanner.datareceived += barcodescannercallback; if unplug usb device while it´s opened via "serialport" class, can´t close software , virtual port stays open eternity or till reboot whole computer. so question is, there way close virtual port after unplugged device via c# code? greetings [edit #1] alrighty, more code: this way checking every 10 seconds if device plugged in: private bool checkusbdeviceavailability() { managementobjectsearcher searcher = new managementobjectsearcher("root\\wmi", "select * msserial_portname portname = '" + this.portname + "'"); if (searcher.get().count ...

c# - How To Fix Icon For InstallShield -

i used able create setup project in visual studio, microsoft has "improved" , i'm wasting hours trying simple project else in company. need upgrade version of .net or wouldn't use setup. after going through pain of downloading "improved" installshield , going through pain of watching video , setting parameters tried build setup project , says icon isn't valid. "screw icon. let me deploy project." actual error message "cannot extract icon index 0 file ..." doesn't matter me if uses standard icon or no icon, want user able test project. so, easiest way setup project in hands of user? i solved problem adding new icon project , re-compiling. can right-clicking on project , selecting add -> new item -> icon file. assign icon file under project -> properties menu item.

sql - Is it possible to update a Sybase datetime column that defaults to current time? -

a sybase table column called "update_time" datetime type , defaults current time whenever row updated. however, want update "update_time" of row time in past, keeps putting current time. possible make kind of change? the query i'm using try update: update table set update_time = '09-21-2015 12:00:00.000 pm' id=1; after run this, update_time row goes current time when run query, not actual time in query.

How to get test-instances from HP ALM using REST API using Java? -

i've connected hp alm, not know how test-instance data. url looks like: https://hpalm.hostname.ca/qcbin/rest/domains/domain_name/projects/project_name/test-instances is there way append query url , test-instances under project? thanks use 'http' instead of 'https' http://hpalm.hostname.ca/qcbin/rest/domains/ {domain_name}/projects/{project_name}/test-instances

C++ , using strptime and strftime to convert date formats including invalid dates -

am using strptime , strftime convert date 1 format in c++, works fine valid input dates in case of invalid dates can't work. using mktime 'fixes' or changes dates if there invalid day, automatially changes month well. want convert input date 1 format like if 12/22/99 , want convert mm/dd/yy dd-mm-yyyy , shall convert 22-12-1999 . if there invalid date, shall emit 00 , keep other things in required format, 12/45/01 (in mm/dd/yy) shall convert 00-12-2001 (in dd/mm/yyyy format since day can't 45), problem strptime, mktime, changes value since tm timestruct works way, there possibility that? a simple use case can be convert mm/dd/yy dd-mm-yyyy 03/33/99 -> 00-03-1999 i tried best strptime changes corresponding month in case of wrong input day. tried putting 00 in case of wrong date, strptime handles 00 differently too, each format, can't work. stuck now. //////////////////////////////////////////// // wants programming question...

swift2 - Access denied - Search API from AngelList -

when i'm calling "search api" angellist ( https://angel.co/api/spec/search ) following url: https://api.angel.co/1/search?query=barack&type=locations&callback=?access_token=707cfhgbdae43060876388ac584bf4cf4fdb the result gives me error: {"error":"access_denied","error_description":"you must pass in access token when making request."} i'm not sure why happening because when i'm calling other apis same access_token, these run successfully. how can solve situation? i think have typo in url. need & character access_token parameter. , can remove callback parameter @ point can retrieve data response message. your url should this: https://api.angel.co/1/search?query=barack&type=locationtag&access_token=707cfhgbdae43060876388ac584bf4cf4fdb . it solved problem @ least :).

html - how to change search button text color? -

i made simple error of changing #000 tags #fff tags when wasn't working originally, changing them #fff works want, minues hovering chose #deb900 for! question answered! original question below , can see simple error made: i'm trying change color of text in search bar i'm creating website. want change color of text white, , have change golden yellow color when hover on button. i've tried placing color tag in multiple places within css code file, nothing working. i've used chrome's "inspect element" tool make sure nothing overiding code. !important option doesn't seem work either :(. i guess should mention website made in wordpress. i've been checking, nothing in bootstrap css code or default css file messing part of code. i've tried check every source possible before posting. here have: #tsheader { background-color: transparent; } #tsnewsearch { float: right; height: 30px; } .tstextinput { margin: 0 auto; ...

bash - Apple script parameter with space in path -

i unable following - there space in $my_path osascript -e "tell application \"terminal\" script \"cd $my_path\"" can done. know in normal sh script need " $(pwd)" don't know how this, when passing apple script? this quite tricky, because have 2 levels of quoting/parsing deal with: have path string shell (your script) applescript intact, applescript shell (the argument cd ). wrap in multiple layers of quotes , let each translation unwrap 1 layer, gets messy (especially since shell , applescript have different quoting rules). but there couple of tricks can use: path applescript, pass argument script instead of part of script (see this previous answer "osascript using bash variable space" ), use applescript quoted form of prep use cd : osascript \ -e "on run(argv)" \ -e "set my_path item 1 of argv" \ -e "tell application \"terminal\" script \"cd \" & qu...

python - Remove square brackets from list -

i have list: list1 = [['123'], ['456'], ['789']] i want convert list string , later store column in database in form: 123 / 456 / 789 i tried doing this: s2 = ", ".join(repr(e) e in list1) print(s2) but i'm getting: ['123'], ['456'], ['789'] any ideas on should next desired output? you close, want flatten list of lists first, convert string. this: " / ".join([item sublist in list1 item in sublist])

python - Django internationalization / translation not working for dynamically generated urls -

i've run issue dual language site can't find answer in other questions. so, have wired form , display system relies heavily on verbose names given each model. verbose name translated, idea work base. so, example, have model in products/models.py: from django.utils.translation import ugettext_lazy _ class producttype(models.model): description = models.charfield(max_length=250) ... class meta: verbose_name = _('Ürün tipi') verbose_name_plural = _('Ürün tipleri') from there, create class-based forms , views. then, create urls importing views , looping through them in urls.py (i focus on 1 url example): from django.conf.urls import patterns, url .views import editing_views editing_patterns = [] view in editing_views: list_view = view['list'] slug = slugify(list_view.model._meta.verbose_name) editing_patterns.append( url(_(r'{0}/list/$').format(slug), list_view.as_view(), name='{0}-...

angularjs - Angular: further dynamic filtering issue -

i'm trying these dynamic filters working , there think. looks model isn't being passed watch function. would've expected work first set of filters @ least doesn't. what i'm trying achieve when user selects option select list , sets value in input box data filtered. user can optionally add set of filters clicking "add fields" button. if there user completes second set of filters data filtered further. this i've got far. if there's 1 filter showing shouldn't work? this code creates user defined filters. <div data-ng-repeat="filter in filters"> <select ng-model="filter.id"> <option value="age">age</option> <option value="customerid">customerid</option> <option value="productid">productid</option> <option value="name">name</option> </select> <input type="text" ng-model=...

swift2 - Swift/Sprite-kit Adding a static hud that is always at the top and bottom, with the moveable game in the middle? -

i have been playing around trying learn spritekit in xcode7. far have level larger screen, hero can move around , camera follows hero moves off the viewable screen area. next i'm trying create hud @ top , bottom of screen. bottom 1 joystick/buttons live. i tried this: let hud = skspritenode(color: skcolor.blackcolor(), size: cgsizemake(self.size.width, self.size.height * 0.05)) hud.anchorpoint = cgpointmake(0, 0) hud.position = cgpointmake(0, (self.view?.bounds.height)! - hud.size.height) self.addchild(hud) but puts black view @ top of level , can see if walk hero there. means if move bottom, hero walks joystick , buttons off screen. can please provide direction on how can add huds sprite-kit @ top , bottom of viewable area, while still allowing hero move around level? swift 3: this should move hud (suppose sknode ) origin anchorpoint (0.5,0.5) of camera cgpoint.zero visible: override func didsimulatephysics() { hud.position = cgpoint(x:-self.fra...

C# Inheritance of same class twice -

let's i've such code public class holded { protected internal int holdedid = 0; } public class inventory : holded { public inventory() { } public void changeholdedid() { this.holdedid = 100; } } public class equipment : holded { public equipment() { } public void writeholdedid() { console.writeline("holded id is: {0}!", this.holdedid); } } public class cargo : holded { public cargo() { } } if i'd call changeholdedid , writeholdedid, console still output string "holded id is: 0!". want achieve have same base class (holded) in both of classes. if i'd change holdedid inventory, equipment's writeholdedid function output "holded id is: 100!". , regards! @edit: more detailed: have game. each person character, owns equipment, inventory , cargo class. each class contains 20 slots "items". thing is, if try move item, ex. inventory, equipment, , there's such inde...

ubuntu 14.04 - Vagrant up fails with loading plugin -

the zulip setup requires having vagrant setup. https://github.com/zulip/zulip fails in ubuntu 14.04 $vagrant plugin install vagrant-lxc installing 'vagrant-lxc' plugin. can take few minutes... installed plugin 'vagrant-lxc (1.2.1)'! $vagrant failed load "vagrant-lxc" plugin. view logs more details. bringing machine 'default' 'virtualbox' provider... there errors in configuration of machine. please fix following errors , try again: vm: * box 'ubuntu/trusty64' not found. any ideas might going wrong? the problem not seem come plugin box instead. can download box using vagrant box add ubuntu/trusty64 https://atlas.hashicorp.com/ubuntu/boxes/trusty64 once box installed, should able run vagrant up also why need vagrant-lxc plugin if you're running on normal ubuntu box, did mean use box ?

ios - When adding more items to top of scrollview shift existing items down -

i'm trying add item top of scrollview while shifting down existing items. dont want remove existing views , re-add them. this how i'm building scrollview: for var index=0; index < data.users.count; index++ { if data.users[index] as! string != "" { let myimageview:uiimageview = uiimageview() myimageview.image = myimage myimageview.contentmode = uiviewcontentmode.scaleaspectfit myimageview.frame.size.width = imagewidth myimageview.frame.size.height = imageheight myimageview.frame.origin.x = 0 myimageview.frame.origin.y = myvariables.yposition self.myscrollview.addsubview(myimageview) myvariables.yposition += imageheight + spacer myvariables.scrollviewcontentsize+=imageheight + spacer self.mychatscrollview.contentsize = cgsize(width: imagewidth, height: myvariables.scrollviewcontentsize) }} is there way can shift exisitng items down on scrollview when adding new item top? // on button click, want shift ...

django - List per Date python -

i creating list page , have concept. data list = [ {'exec_date': datetime.date(2015, 9, 30), 'name': 'aaa', 'status': 'pe'}, {'exec_date': datetime.date(2015, 10, 29), 'name': 'bbb', 'status': 'dn'}, {'exec_date': datetime.date(2015, 9, 30), 'name': 'ccc', 'status': 'pe'}, {'exec_date': datetime.date(2015, 9, 30), 'name': 'ddd', 'status': 'dn'}, {'exec_date': datetime.date(2015, 9, 7), 'name': 'eee', 'status': 'dn'}, {'exec_date': datetime.date(2015, 9, 30), 'name': 'fff', 'status': 'ny'}] and display output this 2015-9-7 1. eee, dn 2015-9-30 1. aaa, pe 2. ccc, pe 3. ddd, dn 4. fff, ny 2015-10-29 1. bbb, dn i thinking loop display dates once , not repeat it. @gocht result. have...

Android get Exif information issue -

in order exif information of image,i wrote codes below: exifinterface exif = new exifinterface(path); string aaa= (exif.getattribute(exifinterface.tag_datetime)); i add read,write permission in androidmanifest.xml <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.read_external_storage" /> now problem specific folder, such /storage/emultaed/0/pictures,/storage/emultaed/0/download, return values of exif.getattribute(...) null. i wondering if there 3rd party lib can solve issue? help. some pictures work fine - problem data, not code. suspect devices/applications encode exif data in non-standard way exifinterface cannot parse. can use exiftool dump exif, , modify , standardise it

ios - How to connect external camera to iPhone and take/download photos? -

i want connect external camera iphone (the camera built iphone inadequate needs) , write iphone app allows me send signal external camera when desire take picture , download taken photo onto iphone can send wirelessly server somewhere else. i have lot of experience web programming , js, have no experience iphone apps, , i'm not sure if want possible. ideally, if away coding in js , using cordova (or similar) make app can run on idevice or android device, great. however, assuming that not possible, focus on app idevices @ first. looked around web resources on subject, couldn't find anything. i have 2 questions: is want possible? if so, can using web technologies , cordova and/or chrome app convert can used on smart device? if not, books/resources learning how on iphone? even though i've never coded iphone app before, i'm more happy try learn, need books/resources explain basics of how create "hello, world!" iphone app point can things listed ab...

How to check and set if current time is out of specific range [Javascript/jQuery] -

i submit forms time time must in specific range time. if out of specific range time, generated in new time in specific range time. my specific range time 08:30-17:30 on weekday. if current time not on weekday, sets day monday @ 08:30. ex. if current time saturday 12:00 ,sets monday 08:30 if current time less 08:30, sets time 08:30 on day. ex. if current time tuesday 01:00 ,sets tuesday 08:30 if current time more 17:30, sets time 08:30 on tomorrow. ex. if current time tuesday 20:00 ,sets wednesday 08:30 if current time on friday , time more 17:30, sets time 08:30 on monday. ex. if current time friday 20:00 ,sets monday 08:30 could please help? thank you. function createddatefunction() { var days = ['sun','mon','tue','wed','thur','fri','sat']; var = new date(); var day = days[now.getday()] var date = now.getdate(); var month = now.getmonth()+1; var year = now.getfullyear(); ...

Is it possible to compile a simple Java code in Android Studio? -

this question has answer here: can android studio used run standard java projects? 11 answers i have android studio, not eclipse. do have install eclipse in order test simple java code? or possible using android studio? what difference between both? the cool thing android studio delegates build process gradle. , gradle, building plain java application matter of adding necessary plugin build.gradle file. apply plugin: 'application' mainclassname = "com.your.package.mainclassname" and don't need go through new project wizard. make project directory, create build.gradle file in script above. put java source code in 'src/main/java'. in android studio click 'import project (eclipse, gradle, etc.)', open project directory , select build.gradle file. choose ok configure gradle wrapper. when import finished press run ...

c++ - vector function "push_back" keeps rewriting the value to the same slot in memory -

the push_back method of std::vector isn't putting second console input in v[1] slot, keeps overwriting in v[0] i tried search other answers code , answer complicated me follow, im trying keep simple (but tried using pointers, got bunch of errors) my method: vector<string> createtable(std::vector<std::string> v, std::string insertedstr) { std::vector<std::string> vcreate; vcreate.push_back(insertedstr + " "); return vcreate; } main: int main() { int option; std::string insertedstr; std::vector<std::string> v; cin >> insertedstr; v = createtable(v, insertedstr); (int = 0; <=v.size(); i++) { cout << v[i] << endl; } cin >> insertedstr; v = createtable(v, insertedstr); (int = 0; <...

How to read just lists in a text file in Python? -

i need read text file this bruce chung bruce@outlook.com 8893243 costarricense divisa del informe colones ['nokia', 5277100.0, 'china'] ['samsung', 10554200.0, 'turkey'] ['apple', 52771000.0, 'argentina'] but need read lists inside file , assign them new variable. i've used this data =[ast.literal_eval(x) x in open("test.txt")] registros = data and worked before until added information of user below. is there way read lists in text? you can use str.startswith() check if string starts '[' , , use ast.literal_eval() if true. example - with open("test.txt") f: registros = [ast.literal_eval(x) x in f if x.startswith('[')] demo - >>> s = """bruce ... chung ... bruce@outlook.com ... 8893243 ... costarricense ... divisa del informe colones ... ['nokia', 5277100.0, 'china'] ... ['samsung', 10554200.0, 'turkey'] ......

playframework 2.4 - I cannot use ebean in play framework -

i'm using play 2.4. got compilation error: package "com.avaje.ebean" not exist. need help, appreciate! play's ebean external project. need add dependency in project/plugins.sbt file: addsbtplugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0") in build.sbt file, enable plugin: lazy val myproject = (project in file(".")).enableplugins(playjava, playebean) all information , more available in 2.4 migration guide .

android - stub_image showing on universal image loader in recyclerview -

i have implement universal image loader showing images in recyclerview. showing stub_image. code contain 1 fragment , adapter, working before added universal-image-loader. here code: fragment.class public class fourthfragment extends fragment { private displayimageoptions options; imageloader imageloader; recyclerview rv; recyclerview.layoutmanager mlayoutmanager; recyclerview.adapter madapter; string[] str = {"one","two","three","four"}; int[] img = {r.mipmap.rio_one,r.mipmap.rio_two,r.mipmap.rio_three,r.mipmap.rio_four}; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view v = inflater.inflate(r.layout.view_pager_fourth_fragment, container, false); try { rv = (recyclerview) v.findviewbyid(r.id.recycler_view); rv.sethasfixedsize(true); mlayoutmanager = new linearlayoutmanager(getcontext...

javascript - Angular ng-bind-html issue with emoji plugin? -

i using angular emoji plugin requires ng-bind-html . using emoji plugin creating messages, don't want html code such <h2>hello</h2> can compiled ng-bind-html mandatory use emoji plugin. suggestions/ways can around posts include emojis not html code gets compiled? thanks angular.module("app", ["dbaq.emoji","ngsanitize"]).controller("appctrl", function ($scope) { $scope.message = "animals: :dog: :cat: :snake: people: :smile: :confused: :angry: places: :house: :school: :hotel: :poop:"; }); <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="emoji.min.css"> <script src="angular.min.js"></script> <script src="emoji.min.js"></script> </head> <body ng-app="app" ng-controller="appctrl"> <div ng-bind-html=...

fadein - JQuery text fade in fade out -

i replace word "." "first" after 1 sec, replace word "first" "second" after 1 sec, replace word "second" "first" after 1 sec, replace word "first" "second" after 1 sec, replace word "second" "first" repeatedly continue cycle however code not work expected. - instead appends word previous word. could please suggest how approach problem? thank you. http://codepen.io/anon/pen/oywpqq <h2 class="quotes"><span class="typebg"><span class="type">.</span></span> <span class="details"><a href="#"><span class="detailstext">.</span></a></span> <span class="cta"><a href="#"><span class="ctatext">.</span></a></span></h2> .quotes {height:45px !important;margin-top:-17.5px;margin-bo...

logging - Oracle MAF : Log file for Android Emulator -

Image
i'm using oracle maf mobile app development. , know that, log file generate device file path when deployed android device. i'm getting log in device. but when deploy oracle maf android emulator find application log. i'm having default logger file ( dalvik logger mechanism ), attached below reference. logging.properties # default loggers use consolehandler .handlers=java.util.logging.consolehandler # default loggers use simpleformatter .formatter=java.util.logging.simpleformatter # default consolehandler logging level severe oracle.adfmf.util.logging.consolehandler.level=severe oracle.adfmf.util.logging.consolehandler.formatter=oracle.adfmf.util.logging.patternformatter oracle.adfmf.util.logging.patternformatter.pattern=[%level% - %logger% - %class% - %method%] %message% #configure framework logger use adfmf consolehandler oracle.adfmf.framework.useparenthandlers=false oracle.adfmf.framework.handlers=oracle.adfmf.util.logging.consolehandler oracle.adfmf.framewo...

How to maintain session in Jmeter for testing web application? -

how maintain session in jmeter each user should login, search tickets , logout ? , process kept going until loop completes users. trying test our web application multiple users. each jmeter thread (representing virtual user) executes samplers upside down if have 3 samplers login, search , logout each thread execute them in order. keep in mind that: you need provide different credentials each thread impersonate different users. common way of parametrization using csv data set config it's better add http cookie manager represent browser cookies. it may required perform correlation: in majority of cases application expects dynamic parameters need extracted previous page response , added next request. if fail may not logged in. commonly used test element correlation regular expression extractor depending on nature of response may worth using css/jquery extractor , xpath extractor or json path extractor

jdbc - Getting Read time out when connecting to hive/spark sql through squirrel sql -

i'm trying use squirrel sql connect spark-sql thriftserver using jdbc. smaller resultset i'm getting response. queries running more 30s, squirrel throws below exception: error: org.apache.thrift.transport.ttransportexception: java.net.sockettimeoutexception: read timed out sqlstate: 08s01 errorcode: 0 but when check spark job page on port 4040 shows query execution successful. when run same query thru beeline i'm able see results. looks there client side timeout squirrel sql. kindly let me know how increase timeout parameter.

python - ndarray concatenate error -

i wish concatenate following arrays: a=np.array([[1,2],[1],[2,3,4]]) b=np.array([[20,2]]) np.concatenate((a,b),axis=0) but following error: valueerror traceback (most recent call last) <ipython-input-40-42253341965b> in <module>() ----> 1 np.concatenate((a,b),axis=0) valueerror: input arrays must have same number of dimensions i expecting answer [[1,2],[1],[2,3,4],[20,2]] . if b=np.array([20,2]) instead concatenation works fine except answer: [[1,2],[1],[2,3,4],20,2] check dtype, ndim , shape of a : you'll find numpy.object , 1 , (3,) , respectively. because array a contains lists of different lengths, each list treated object, , a 1 dimensional array of objects. don't know aiming for, if want a have ndim of 2, you'll need make sure lists have same length. of course, b has ndim of 2, since contains 1 (nested) lists, result in regular n-dimensional array. the error message obvious: you'r...

ember.js - How to use a form component to submit to an external URL? -

i have form-tag component. needs submit outside url. i'm trying (pseudo code): {{#form-tag action="https://foo.com/submit.aspx"}} {{input type="hidden" value=hiddenvalue}} {{/form}} when form submits, need end @ https://foo.com/submit.aspx i'm tempted use <form> element instead. wondering if there way using form component. you can use following code component (taking advantage of attributebindings , tagname ): import ember 'ember'; export default ember.component.extend({ tagname: 'form', attributebindings: ['action', 'method'] }); and can use: {{#form-component action="https://foo.com/submit.aspx" method='post'}} {{input type="hidden" value=hiddenvalue}} <button type="submit">submit</button> {{/form-component}} working demo. full code behind demo.

ruby - How to check whether a File exists -

this question has answer here: how check if directory/file/symlink exists 1 command in ruby 2 answers i have array of strings , want select these strings paths files: my path "~/dlds/some_file.ics" ~/dlds symlink ~/archive/downloads on system. file has following permissions: -rw-r--r-- my code (i tried several variants): argv.select |string| file.file? string # returns false pathname.new(string).file? # returns false pathname.new(string).expand_path.file? # returns false end i don't know else try. i'm running ruby 2.2.0 or 2.2.2. file.exist? file.expand_path "~/dlds/some_file.ics"

http - How is it possible that Google and Youtube, outlook.com and msn.com use same account? -

how browsers share credentials belonging 1 domain other? asked in question, if log 1 service, i'm automatically logged other service? authentication scheme , how credentials shared? the answer use oauth or it. can read @ https://en.wikipedia.org/wiki/oauth or google oauth. 1 site receives username , password. others granted permissions site.

list - Send some pdf files as email attachments stored in a db in c# -

Image
i need send pdf files email attachments stored in database. i need convert comma separated string list<string> , have tried c# code: if (reader.hasrows) { while (reader.read()) { recoveryatt = reader["att"].tostring(); string commaseplist; string[] itemlist = { recoveryatt.tostring() }; commaseplist = string.join("; ", itemlist); response.write(commaseplist.tostring()); } } but in output have: d:\inetpub\wwwroot\app\public\015.pdfd:\inetpub\wwwroot\app\public\016.pdfd:\inetpub\wwwroot\app\public\017.pdfd:\inetpub\wwwroot\app\public\018.pdfd:\inetpub\wwwroot\app\public\019.pdf and in email attachment first pdf file... this doesn't work cause returns string[] without separator. please help. i think trick string[] itemlist = regex.split(recoveryatt, @"(?=d:)").where(x => !string.isnullorempty(...

nexus - Packages not found from Nuget command line -

i trying list package using below command getting no package found output, though have packages in nexus repository. nuget list "path of repo" please advise. running scheduled task "rebuild nuget feed" against repository path solved issue.

spring - ImportBeanDefinitionRegistrar vs BeanDefinitionRegistryPostPro -

my use case deals creating beans dynamically. find 2 options register bean definitions: importbeandefinitionregistrar , beandefinitionregistrypostprocessor i wanted understand difference between two. thanks, prateek the beandefinitionregistrat must used @import annotation @configuration @import(myimportbeandefinitionregistrar.class) public class mainconfiguration { } while beandefinitionregistrypostprocessor should used that @bean public static mybeandefinitionregistrypostprocessor mybeandefinitionregistrypostprocessor() { return new mybeandefinitionregistrypostprocessor(); } however on spring 3.2.16 both fails modify own bean definitions created @bean, seemed called early.

javascript - How to individually increase or decrease a value using jquery -

i looking increase or decrease each products clicking + or - button individually, issues when click + button.. products value increased instead of one, same when click - button. kindly me out how this jquery $(document).ready( function(){ $(".quantity-adder .add-action").click( function(){ if( $(this).hasclass('add-up') ) { $("[name=quantity]",'.quantity-adder').val( parseint($("[name=quantity]",'.quantity-adder').val()) + 1 ); }else { if( parseint($("[name=quantity]",'.quantity-adder').val()) > 1 ) { $("input",'.quantity-adder').val( parseint($("[name=quantity]",'.quantity-adder').val()) - 1 ); } } } ); }); html <div class="product-extra"> <p>product 1</p> <div class="quantity-adder pull-left"> ...

xml - Understand Configuration Pre-processor in the CruiseControl.net -

after reading document configuration pre-processor . i got basic knowledge it. , make summary here, hope review it. , correct me if there wrong. all available pre-processors defined in ccnetconfigbuilder.xsd . in xsd . has define , scope 2 pre-processors . (did missed ?) from ccnet.xsd . can see ccnetconfigbuilder.xsd imported , element cruisecontrol root element of configuration. below. didn't know why directive import doesn't need attribute schemalocation specify location of imported xsd file. <xs:import namespace="urn:ccnet.config.builder" /> <xs:element name="cruisecontrol"> all child elements of cruisecontrol choice not sequence. below: <xs:choice minoccurs="0" maxoccurs="unbounded"> and define , scope can occur under cruisecontrol without specified order other elements. can't occur under element project . right? i saw document of configuration_preprocessor mention others elements...

python - selenium webdriver url navigation (on microsoft edge with window10) , hang after 28/29th url -

i have been doing url navigation ( list of url in file ) using selenium webdriver microsoft edge browser on window 10 machine. have written automation script in python. code snippet : driver = webdriver.edge() driver.set_page_load_timeout(60) url in list_of_url: #100 url print "navigating url :",url driver.get(url) so after navigating 28th url, script got hanged on 29th url on "driver.get(url)" line ,and never return. have tried different list of urls, behavior same, got hanged on 29th url. pls issue. you missing edge browser standalone server. download webdriver microsoft edge , , place in same directory scripts stored. try code snippet below, working fine me - import os selenium import webdriver # create new edge session dir = os.path.dirname(__file__) edge_path = dir + "\microsoftwebdriver.exe" driver = webdriver.edge(edge_path) driver.implicitly_wait(10) # driver.maximize_window() driver.get("https://www.freelancer.in/...

ember.js - ember-simple-auth: Persisting session in localstorage using custom authenticator -

setup: ember : 2.0.2 ember data : 2.0.1 jquery : 1.11.3 ember simple auth : 1.0.0 (jjabrams branch) ember cli : 1.13.8 i'm using pretender mock server. usecase: using custom authenticator interface server. have 2 routes: login, protected (and default index,application) when login right credentials, authenticate method of authenticator gets called , logs response object passed resolve(). observations: after logging in , being directed protected page, refreshing protected route (which has authenticatedroutemixin ) leads login page. localstorage has no values bound after successful login. before login: ember_simple_auth:session -> {"authenticated":{}} restore() method of authenticator never called. going route protected route after auth , coming goest login page again. //authenticators/custom.js import ember 'ember'; import base 'ember-simple-auth/authenticators/base'; expo...

sql - How to use table as variable in stored procedure -

there query keep using on , over: select column_name, count(column_name) table_name group column_name order count(column_name) desc i use check different values there in column , how occur. because use query , it's repeating same 4 times: column_name, like: why not make stored procedure: create procedure countcv @table_name varchar(50),@column_name varchar(50) begin select @column_name,count(@column_name) @table_name group @column_name order count(@column_name) end here stuck, can not manage variable tablename: must declare table variable "@table_name" there no way directly. need use dynamicsql approach. assuming pass correct table , column names. below 1 should work. create procedure countcv @table_name varchar(50),@column_name varchar(50) begin declare @sql nvarchar(max) set @sql = 'select '+@column_name+',count('+@column_name+') '+@table_name+' group '+@column_name+' ...

kubernetes - Does the Google Container Engine support DNS based service discovery? -

from kubernetes docs see there dns based service discovery mechanism. google container engine support this. if so, what's format of dns name discover service running inside container engine. couldn't find relevant information in container engine docs. the dns name services follow: {service-name}.{namespace}.svc.cluster.local . assuming configured kubectl work cluster should able service , namespace details following steps below. get namespace $ kubectl namespaces name labels status default <none> active kube-system <none> active you should ignore kube-system entry, because cluster itself. other entries namespaces . default there 1 namespace called default . get services $ kubectl services name labels selector ip(s) port(s) broker-partition0 name=broker-partition0,type=broker name=broker-part...