Posts

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.