Posts

Showing posts from June, 2010

OpenCL, C++: Unexpected Results of simple sum float vector program -

it simple program read 2 float4 vectors files calculate sum of opposite numbers. result of not expected!! the main file: #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <iostream> #include <iomanip> #include <array> #include <fstream> #include <sstream> #include <string> #include <algorithm> #include <iterator> #ifdef __apple__ #include <opencl/opencl.h> #else #include <cl/cl.h> #include <time.h> #endif const int number_of_points = 16; // number of points in both , b files (number of rows) const int number_of_axis = 4; // number of points axis in both , b files (number of columns) using namespace std; void checkerror(cl_int err, const char *operation) { if (err != cl_success) { fprintf(stderr, "error during operation '%s': %d\n", operation, err); exit(1); } } int main(int argc, char *argv[]) { clock_t tstart = clock();

c# - Can I use the update statement with the select statement together in an SqlDataSource? -

my query looks this: <asp:sqldatasource id="updatefullnamesql" runat="server" connectionstring="<%$ connectionstrings:userqueries %>" providername="<%$ connectionstrings:userqueries.providername %>" updatecommand="update users set firstname = :changefirstname, lastname = :changelastname username = :currentusername"> <updateparameters> <asp:controlparameter controlid="changefirstnamebox" name="changefirstname" propertyname="text" type="empty" /> <asp:controlparameter controlid="changelastnamebox" name="changelastname" propertyname="text" type="empty" /> </updateparameters> <selectparameters> <asp:controlparameter controlid="usernamebox" name="currentusername" propertyname="text" type="empty" />

Calculation of DST in Javascript -

i using below code calculate different countries manually not reflecting dst kindly guide me achive same st gallen time 1 hour back. <span id="clock01"></span> <script type="text/javascript"> function calctime00(city, offset) { settimeout("1"); d5 = new date(); d = new date(); utc = d.gettime() + (d.gettimezoneoffset() * 60000); nd = new date(utc + (3600000*offset));//by smt var area=""+city+"&nbsp&nbsp&nbsp&nbsp&nbsp"+nd.tolocaletimestring().replace(/:\d{2}\s/,' '); $('#clock01').html(area); settimeout(function () { calctime00('','+2');}, 1000); } </script>

episerver - Why is the IContentEvents.LoadedContent event fired multiple times for a page? -

i've added event handler loadedcontent event. i'm bit surprised event seems fire multiple times page during single load. why happen? protected void application_start() { arearegistration.registerallareas(); servicelocator.current.getinstance<icontentevents>().loadedcontent += this.episerverapplication_loadedcontent; } edit i'm using episerver 8. with "a singe load" mean going dope mode edit mode page child has no children. last time counted event fired 17 times page. the loadedcontent event fired every time get/tryget on icontentloader (or icontentrepository) called. happens regardless if data loaded through cache or database. as these apis used many separate code branches, in edit mode, event triggered multiple times have found. should not need worried unless of course doing resource intensive in event handler.

mongodb - Optimizing for random reads -

first of all, using mongodb 3.0 new wiredtiger storage engine. using snappy compression. the use case trying understand , optimize technical point of view following; i have large collection, 500 million documents takes 180 gb including indexes. example document: { _id: 123234, type: "car", color: "blue", description: "bla bla" } queries consist of finding documents specific field value. so; thing.find( { type: "car" } ) in example type field should indexed. far good. access pattern data random. @ given time have no idea range of documents accessed. know queried on indexed fields, returning @ 100000 documents @ time. what means in mind caching in mongodb/wiredtiger pretty useless. thing needs fit in cache indexes. estimation of working set hard if not impossible? what looking tips on kinds of indexes use , how configure mongodb kind of use case. other databases work better? currently find mongodb work quite on lim

Save output in processing every X seconds -

hi i'm using processing , want know if there way can automatically save output every x amount of seconds? any great! you looking saveframe() method. inside draw() method, can save screenshot of visual output. void draw() { // code ... // saves each frame screenshot-000001.png, screenshot-000002.png, etc. saveframe("screenshot-######.png"); } more info: https://processing.org/reference/saveframe_.html and take screenshot every x seconds: int lasttime = 0; void draw(){ // code ... // 1000 in milisecs, that's 1 sec if( millis() - lasttime >= 1000){ saveframe("screenshot-######.png"); lasttime = millis(); } }

FBSDKShareDialog doesn't share Photo without Facebook App installed, IOS -

Image
i using facebook sdk 4.0, https://developers.facebook.com/docs/sharing/ios#share_dialog using fbsdksharedialog share photo.it share photo if user has installed facebook app, fails when user hasn't installed fb app. "if doesn't have facebook app installed automatically falls web-based dialog." idk whats wrong please me in sharing photo using fbsdk 4.0. my code fbsdksharephoto *photo = [[fbsdksharephoto alloc] init]; photo.image = self.capturedimageview.image; photo.usergenerated = yes; fbsdksharephotocontent *content = [[fbsdksharephotocontent alloc] init]; content.photos = @[photo]; [fbsdksharedialog showfromviewcontroller:self withcontent:content delegate:self]; this error report error:"com.facebook.sdk:fbsdkerrorargumentnamekey=sharecontent, com.facebook.sdk:fbsdkerrordevelopermessagekey=feed share dialogs support fbsdksharelinkcontent." fbsdksharedialog supports

bluetooth lowenergy - android BLE,write operation,in the function(Setcharacteristicnotification) -

if carry out write operations,it means send data phone ble. clientconfig.setvalue(bluetoothgattdescriptor.enable_notification_value) can't run,and app stop. when writes,should call setcharacteristicnotification? besides,when write,oncharacteristicwrite staus= 133.i don't understand write good.this code. private final expandablelistview.onchildclicklistener serviceslistclicklistner = new expandablelistview.onchildclicklistener() { @override public boolean onchildclick(expandablelistview parent, view v, int groupposition, int childposition, long id) { if (mgattcharacteristics != null) { final bluetoothgattcharacteristic characteristic = mgattcharacteristics.get(groupposition).get(childposition); final int charaprop = characteristic.getproperties(); if ((charaprop | bluetoothgattcharacteristic.property_read) > 0) {

java - Convert string into keycode in android -

assume, have string s = "hello world" . how can equivalent keycode each character? know way convert using, char pressedkey = (char) event.getunicodechar(); while triggering event. in case dont have keyevent . assume, in case, didn't use androidsdk , tried in java. need find out equivalent value of each character. i have option doing above scenario storing keycode , character values in map compare string reading character. can advise whether option good? if not, can 1 give best suggestion regard scenario? you can use keystroke , have @ example: keystroke kstroke = keystroke.getkeystroke('a'); system.out.println(ks.getkeycode()); also have here: keystroke you can use above example key codes string. let me know if looking for.

Spring MVC: Does this code make child-parent relationship between two context? -

i have learned how configure spring mvc without web.xml , .xml files parent , child context link . saw how programmatically make context hierarchy in the official spring docs follow. applicationcontext parent = new genericxmlapplicationcontext(parentannotationconfig.class); genericapplicationcontext child = new genericapplicationcontext(parent); but post the link don't have similar statements above ones. code make context hierarchy between 2 context or not? the code link submitted uses spring mvc. programmatic method show independant of spring mvc. makes big difference. spring mvc automagically creates parent child relations between root context , dispatcher servlet context(es). wepapp should have : one single root context referenced in servletcontext . supposed used not directly related servlet : model, persistance , filters can exist independantly of servlet one context per dispatcher servlet constructed root context parent. supposed used controllers, vi

ios5 - Testing app on iPad 1 (iOS 5.1.1) using Xcode 6.2 -

Image
when launch app using xcode 6.2 on ipad 1 running ios 5.1.1, following error: i couldn't find documentation on how exclude architecture. ideas? app's deployment target set 5.1.1. the problem in arm64 architecture in valid_archs. removing arm64 valid_archs solves issue. in case had create separate branch testing on ios 5 devices. then try run app. set setting xcode archs = armv7 armv7s valid_archs = armv7 armv7s arm64 in case, binary built armv7 armv7s arm64 architectures. same binary run on archs = armv7 armv7s .

How to get stored variable value from mysql transaction -

i have written transaction mysql innodb engine. has insert in table auto generate key, insert using auto generate key got using last_insert_id() . after second insert have several inserts need foreign key auto generated key last table in have inserted. did made variable , used of them. now, need auto generated key value returned in java program can use it. how do it? transaction large here trying do. start transaction; insert a(value) values(123); insert b(aid,value) values((select last_insert_id()),345); set @key = ( select last_insert_id() ) ; insert c(val,fk) values(1,@key); insert c(val,fk) values(2,@key); insert c(val,fk) values(3,@key); ..... insert c(val,fk) values(10,@key); now need @key variable value returned in program. java program using j connector mysql (if matters). mysql variables session-scoped can following anywhere want long you're using same connection : select @key; for more information, manual friend : https://dev.mysql.com/doc/refman/5.0

javascript - custom tag containing data in option -

i having list of stuff user can select. way it's made, have integer name, price value need add color. it's not unique cannot use id. example : <option name='6' value="30.95">6 orange(30.95$/month)</option> <option name='6' value="33.95">6 green(33.95$/month)</option> <option name='10' value="32.95">10 orange(32.95$/month)</option> <option name='10' value="35.95">10 green(35.95$/month)</option> i need combine 2 non-unique values , them accessible jquery / javascript i not make 2 selects. know it's straightforward easiest solution if stick single 1 give better results. is safe create custom tag "prodcolor" non-reserved nametag or there smarter way achieve this? many once again. you can use html5 data- attributes, invented purpose. more importantly, values of data- attributes can accessed using js. since want include col

How to get a slack user by email using users.info API? -

i'm trying use slack's users.info api retrieve users information, need find users email, there way that? thanks! currently can users users.info id. an alternative solution problem call users.list , filter within client profile.email whichever email you're looking for.

gwt - GWTP Invalid attempt to reveal errorplace, but then works normally -

i have couple of places set up, , work correctly, except delay caused issue. they're using nested presenters. 1 place, appears repeat attempt load causes infinite loop of reveal error / unauthorized place (no idea why, no gatekeeper set), loads page correctly. issue have delay , unnecessary log spam causes - loads page correctly, why can't without going through loop first? have ideas? -- update -- i using gwtp 1.4 gwt 2.7.0, project first created using gwtp 0.6 or maybe earlier. we've updated deprecation etc we've upgraded, know there anachronisms left. tried switching out our clientplacemanager default, bound errorplace , unauthorizedplace our home page, , removed gatekeeper, still tries go error place (overrode revealerrorplace method , noticed it's throwing error valid token had been loaded @ least once session. 1 page in particular, none of presenter lifecycle phases firing, though presenter visible (only breaking in firefox think). don't unde

linux - Why MySQL disable load local infile is not working? -

as part of security hardening, trying disable local_infile , prevent accessing local files of operating system. per documentation can disable either setting variable local-infile=0 in my.cnf or start mysqld service option --local-infile=0 . of option able load local files. i tried first adding in /etc/my.cnf [mysqld] local-infile=0 after confirmed changes got reflected. mysql> show global variables 'local_infile'; +---------------+-------+ | variable_name | value | +---------------+-------+ | local_infile | off | +---------------+-------+ 1 row in set (0.00 sec) then mysql client loaded local file using load_file mysql> select load_file("/etc/passwd"); the above command shows content of /etc/passwd file, though local_infile disabled.can tell going wrong here? i repeated same steps passing mysqld --local-infile=0 no change. have tried starting mysql client --local-infile=0 option no difference. use query in mysql database

responsive design - How to disable devices supported from Android Studio -

how can disable unsupported devices categories? example, want application available phones, don't need take screenshots of tv , tablets , etc. converting comment answer: in application manifest describe capabilities needed application. may use screen characteristics distinguish between tablets, phones, etc. this information used limit devices on application can installed. honored in google play, in development environment, etc. won't have option of installing application on device on not work.

performance - Web Api Owin Hosted - Throughput dropping -

we've copied api have being iis hosted console app (to hosted owin + topshelf service) , have been performance profiling 2 hosting options using jmeter. we throw 18 threads @ apis , differing results iis hosted vs console hosted, follows : response times through iis slower. isn't surprising pipeline in iis more involved. throughput through iis consistent, i.e. don't see significant increases/decreases in throughput (we achieve 5500 requests/responses per min) throughput when hosted in console app starts off high (20,000 per min) degrades approximately 4,500 per min on 10 minute period. we're trying determine cause of throughput drop when hosting console. why start 20,000 requests per min (presumably calculated on initial response times when hasn't run minute) degrade 4,500? other things of note, cpu isn't concern. it's fluctuates start settles below 30% available, , memory average 1.34gb on 4gb ram machine. why might throughput in iis stabl

ios - Adding gesture to UITextView cancels default behavior -

i wanted add single tap gesture uitextview when save dialog opened can cancel tapping uitextview . when cancels normal single tap behavior of textview. when single tap on text without save drawer out nothing. tap trigger callback method correctly cancels default action of uitextview, (to place cursor wherever tapped). // add gesture cancel saving let singlecodetextviewtap = uitapgesturerecognizer(target: self, action: selector("codetextviewtapped")) singlecodetextviewtap.numberoftapsrequired = 1; codetextview.addgesturerecognizer(singlecodetextviewtap) func codetextviewtapped() { if savedrawerout { movefilenamebanneroffscreen() saveastextfield.text = "" } } how can enable default behavior of uitextview while having single tap gesture? edit tried adding cancelstouchesinview = false , not seem work although seem correct answer. code looks this: singlecodetextviewtap = uitapgesturerecognizer(target: self, action: selector("c

visual studio 2012 - TFS Process flow for fixing bug in older version -

scenario: i have bug fix in changeset 100. have 125 changesets. in middle of large changes. have production bug fix. requirement to put current changes on hold pull code changeset 100 (the current production code base) fix bug. recompile. deploy. resume work point 1. , ensure includes bug fix. presumed process flow shelve pending changes server (not locally...just make sure changes safe. source control > specific version , change set 100 fix bug....now i'm not sure of next steps.. check in; unshelve? or check in; latest (which bring me last change set 125) , unshelve? and how fixed bug code merged in?

html - Nav with two dynamic elements + border of first -

Image
i've made image of want archieve. logo resizes on different screen resolutions , actual navigation container long <li>'s . the bottom border needs reach lower left edge of logo. the logo has shadow below, border cant full width. what i've got far nav has border reaches last <li> this quick mockup: http://jsfiddle.net/2x6hddv8/ here's of -- called flight! http://jsfiddle.net/8k45z7nl/ i'd avoid skew maximum browser compatibility.

javascript - ExtJS 5 first steps, cannot see a simple grid with one store -

Image
i'm trying become familiar ext js 5. took sencha generated app start point , modified see grid of 1 line. page blank. can anyone, please, show me doing wrong? not familiar mvvm pattern want learn it. here's set of files: and here js sources. applications.js ext.define('admin.application', { extend: 'ext.app.application', name: 'admin' }); base.js (base class models) ext.define('admin.model.base', { extend: 'ext.data.model', schema: { namespace: 'admin.model' } }); item.js (a simple model) ext.define('admin.model.item', { extend: 'admin.model.base', fields: [ { name: 'id', type: 'int' }, { name: 'title', type: 'string' } ] }); itemlist.js (a store of items want show in grid) ext.define('admin.store.itemlist', { extend: 'ext.data.store', alias: 'store.itemlist', model

excel - Show/hide columns based on input value -

i have 1 input sheet "sheet i", input cell: c3, input value integer, such 1, 2, 3... . output sheets "out 1", "out 2", "out 3", ..."out 10". output sheets contain content a2 g36, while others contain information a2 h36 or t36. ideally, see columns (starting column c) conditionally based on value in $c$3 in sheet i. here logic: if input value = 1, show column a, column b , column c if input value = 2, show column a, column b , column d if input value = 6, show column a, column b , column h ..... right have vba, input value in code set static number. can advise how should change code in order make work? private sub workbook_sheetcalculate(byval sh object) dim sharray dim dim myrange, c range application.screenupdating = false application.enableevents = false sharray = array("out 1", "out 2", "out 3", "out 4", "out 5",.. "out 10") = lbound(sharray) ubound(sharray)

sql - Merge two almost identical UNIONed queries into one -

i have multiple queries nested union alls; of inner queries same. for example select sum(x.amount) amnt, 'txt1' name, x.cfg cfg tbl1 union select -sum(x.amount) amnt, 'txt2' name, x.cfg cfg tbl1 result: amnt|name|cfg ----+----+--- 12 |txt1| z -12 |tst2| z since inner queries not small , go lot of tables i'm trying save processing time , resources combining these 2 inner queries one. take in consideration name (txt1/txt2) on inner query , not in table for particular example, need duplicate results returned, conditional logic. if put conditional logic cte perform cartesian join against main table every row in main table duplicated number of records in join. in case 2. with multiplier (m, name) ( select 1, 'txt1' dual union select -1, 'txt2' dual ) select multiplier.m * sum(t.amount), multiplier.name, t.cfg tbl1 t cross join multiplier

java - Weird behaviour of compareTo(GregorianCalendar c) -

could tell me why fillowing code: int = new gregoriancalendar(2015,3,31,7,45).compareto( new gregoriancalendar(2015,4,1,7,45); system.out.println(a); prints out 0? is there way make work right? ps: need sort strings out date , use comparator: array.sort(new comparator<string>() { @override public int compare(string o1, string o2) { gregoriancalendar cal1 = new gregoriancalendar(integer.parseint(o1.replaceall(p, "$7")), integer.parseint(o1.replaceall(p, "$6")), integer.parseint(o1.replaceall(p, "$5")), integer.parseint(o1.replaceall(p, "$8")), integer.parseint(o1.replaceall(p, "$9"))); gregoriancalendar cal2 = new gregoriancalendar(integer.parseint(o2.replaceall(p, "$7")), integer.parseint(o2.replaceall(p, "$6")), integer.parseint(o2.replaceall(p, "$5")), integer.parseint(o2.replaceall(p, "

how to show 2 decimal places regardless of the number of digits after decimal in swift? -

i writing app in swift , have used below code . output rounded 2 decimal places expected. this working well. if result less 2 decimal places shows 1 digit. basic example have results either whole number or 10 decimal places. want them show .xx 1.2345 => 1.23 1.1 => 1.1 how results display 2 decimal places regardless of number of digits after decimal point ? e.g: 1.1 => 1.10 i have searched extensively answer eludes me. code have tried far : @iboutlet var odds: uitextfield! @iboutlet var oddslabel: uilabel! var enteredodds = nsstring(string: odds.text).doublevalue var numberofplaces = 2.0 var multiplier = pow(10.0, numberofplaces) var enteredoddsrounded = round(enteredodds * multiplier) / multiplier oddslabel.text = "\(enteredoddsrounded)" println("\(enteredoddsrounded)") thanks comments. have amended follows: @iboutlet var odds: uitextfield! @iboutlet var oddslabel: uilabel! var enteredodds = nsstring(string: odds.text).do

C# set pictureboxes to hide using SQL Server database -

sqldatareader reader = null; sqlconnection cn = new sqlconnection(global::vaja15.properties.settings.default.database1connectionstring); cn.open(); sqlcommand sda = new sqlcommand("select * uporabnik attacktype='melee' ", cn); reader = sda.executereader(); reader.read(); cn.close(); my database has column attacktype values melee or ranged. , column picturebox possible values picturebox1, picturebox2.... i didn't saved pictures inside database wrote names on form. i'm trying select attacktype melee , set ranged picturebox1.hide(); can filter these 2 kinds. can sql code?

exchangewebservices - EWS call using Managed API 2.2 never returns -

i'm using ews managed api v2.2 make ews calls. @ 1 of customers, have weird situation service calls, service call, never receives response. we setting explicit timeout, surrounding service calls logging , using ews trace listening. listener show ewsrequest soap message, , that's it. logging shows "before service call" log entry not "after service call" entry. i suspected throttling might behind , have temporarily removed ews throttling limits no effect , in case, expect error response if throttling kicking in. this how service initialised: public exchangewebservice(string username, string password, string emailaddress, string exchangeurl, string exchangeversion) { exchangeversion exversion = (exchangeversion)enum.parse(typeof(exchangeversion), exchangeversion); _exchangeservice = createexchangeservice(username, password, emailaddress, exchangeurl, exversion); _exchangeservice.timeout = 30000; } private static exchanges

How can i get all the list of directories and files in a drive in java. (All files in C:\) -

i writing gui program java fx. user can choose directory in system. unfortunately, directory chooser let user choose drive too. can list out files , folders in directory using file.listfiles(). happens if user choose drive. listfiles() failing there null pointer exception. is there way can list of files , directories in drive in java? //get files user computer public void getfilenames(file folder) { (final file file : folder.listfiles()) { if (file.isdirectory()) { getfilenames(file); } else { if (filenameutils.isextension(file.getname().tolowercase(), videoformatset)) { //don't consider video files less 100 mb final long filesizeinmb = file.length() / 1048576; if (filesizeinmb < 100) { continue; } final string filename = filenameutils.removeextension(file.getname());

ruby on rails - ActiveMerchant Get Braintree ClientToken -

i trying use activemerchant braintree dropin ui , unable find correct methods create client token pass javascript sdk. current setup is: # config/environments/development.rb # activemerchant configuration. activemerchant::billing::base.mode = :test config.gateway = activemerchant::billing::braintreegateway.new( merchant_id: '', public_key: '', private_key: '' ) and have controller needs send client token part of api request: # app/controllers/v1/orders_controller.rb def token @client_token = ...generate client token... respond_with @client_token end i don't know how generate token through activemerchant api. i work @ braintree. if have more questions, suggest email our support team . activemerchant isn't compatible v.zero. use drop-in ui or other v.zero features, you'll need use braintree ruby client library directly. see braintree "getting started" guide instructions.

spring - How to update bidirectional @ManyToOne/@OneToMany relationship via REST from the inverse side -

i have 2 entities in spring data rest app: @entity public class question { ... @onetomany(mappedby = "question") private set<answer> answers = new hashset<>(); ... } @entity public class answer { ... @manytoone question question; ... } and spring data repositories both entities: @repositoryrestresource public interface questionrepository extends pagingandsortingrepository<question, long> { } @repositoryrestresource public interface answerrepository extends pagingandsortingrepository<answer, long> { } suppose have question id 1 , 2 answers ids 1 , 2. able link them this: curl -v -x put -h "content-type: text/uri-list" -d "http://localhost:8080/questions/1" http://localhost:8080/answers/1/question curl -v -x put -h "content-type: text/uri-list" -d "http://localhost:8080/questions/1" http://localhost:8080/answers/2/question but not this: curl -v -x put -

c++ - How does a server obtain the ek and iv arguments from the client, in order to RSA decrypt a message? -

i'm trying use evp utilities in openssl rsa encryption. goal implement seal & open method encrypt using public key , decrypt using private key. assuming ssl handshake successful , client has public key of server, want client seal message before sending it. something this: int crypto::rsaencrypt(const unsigned char *msg, size_t msglen, unsigned char **encmsg, unsigned char **ek, size_t *ekl, unsigned char **iv, size_t *ivl) { ... if(!evp_sealinit(rsaencryptctx, evp_aes_256_cbc(), ek, (int*)ekl, *iv, &remotepubkey, 1)) { return failure; } if(!evp_sealupdate(rsaencryptctx, *encmsg + encmsglen, (int*)&blocklen, (const unsigned char*)msg, (int)msglen)) { return failure; } encmsglen += blocklen; if(!evp_sealfinal(rsaencryptctx, *encmsg + encmsglen, (int*)&blocklen)) { return failure; } ... } if understanding correct, evp_sealinit() generate public key encrypted secret key pointed ek , iv correspondi

ruby on rails - Validations with Active Admin -

i have 2 models, event , image: class event < activerecord::base has_many :images accepts_nested_attributes_for :images validates :date, presence: true validates :location, presence: true validates :name, presence: true end class image < activerecord::base belongs_to :event mount_uploader :file, avataruploader validates :file, presence: true validates :event, presence: true end here migrations: class createevents < activerecord::migration def change create_table :events |t| t.date :date t.string :location t.string :name t.timestamps end end end class createimages < activerecord::migration def change create_table :images |t| t.string :file t.string :caption t.boolean :featured_image t.integer :event_id t.timestamps end end end i using carrierwave upload image. have no problem getting feature work when no validations built in, i'm trying prevent image being uploa

Alternative way to left join in SQL ORACLE DB -

if run query below query: select day.m_cmp_typo m_cmp_typo, day.m_sptcv m_sptcv, day.m_cnt_vs2 m_cnt_vs2, day.m_cnt_org m_cnt_org, day.m_pl_cgr2 m_pl_cgr2, day.m_pl_cgu2 m_pl_cgu2, day.m_pl_csfi2 m_pl_csfi2, day.m_pl_ftfi2 m_pl_ftfi2, day.m_pl_rvr2 m_pl_rvr2, day.m_pl_rvu2 m_pl_rvu2, day.m_trn_fmly m_trn_fmly, day.m_trn_grp m_trn_grp, day.m_trn_type m_trn_type, day.m_cnt_vs2 m_cnt_vs2, day.m_c_cur_pl m_c_cur_pl, day.m_instrlabel m_instrlabel, day.m_nb m_nb, day.m_pl_inscur m_pl_inscur, day.m_tp_cntrplb m_tp_cntrplb, day.m_tp_pfolio m_tp_pfolio, day.m_eco_pl m_eco_pl, day.m_cnt_id m_cnt_id, day.m_eco_pl_usd m_eco_pl_usd, day.m_pos_curr2 m_pos_curr2, day.m_curr2 m_curr2, day.m_tp_qtyeq m_tp_qtyeq, day.m_tp_uqtyeq m_tp_uqtyeq, day.m_tp_lqty32 m_tp_lqty32, day.m_tp_uqty m_tp_uqty, --

android - How to inject different client for retrofit when testing? -

is there way change way inject, dagger, retrofit module different client restadapter on instrumentation tests? @provides @singleton public apiservice getapiservice() { restadapter restadapter = new restadapter.builder() .setendpoint(buildconfig.host) .build(); return restadapter.create(apiservice.class); } but, want set new client when executing instrumentation tests. @provides @singleton public apiservice getapiservice() { restadapter restadapter = new restadapter.builder() .setendpoint(buildconfig.host) .setclient(new mockclient()) .build(); return restadapter.create(apiservice.class); } is there way this? thanks i did in project. can find sample here . app code written in kotlin , uses dagger 2. master branch contains java code , dagger 1 implementation. hope :)

javascript - JS - Color Picker Only first one works -

i using bootstrap colorpicker 2.1 in order display 2 colour pickers in form. works fine using 1 input however, when add second 1 first 1 working. maybe because sharing same class… any idea why happening? <form method="post"> <p><?php _e("box 1: " ); ?> <input class="form-control demo" data-horizontal="true" id="demo_forceformat" placeholder="<?php echo $box1?>" type="text" name="box1" value="<?php echo $box1?>" size="20"> <?php _e(" default: rgba(14,112,209,1)" ); ?></p> <p><?php _e("box 2 " ); ?> <input class="form-control demo" data-horizontal="true" id="demo_forceformat" placeholder="<?php echo $box2?>" type="text" name="box2" value="<?php echo $box2?>" size="20"> <?php _e("

string - How to get a character from an extended ascii number -

the ascii code charts "ü" @ 129 (decimal). when trace("ü".charcodeat(0)) ... answer 252 - wrong. seems string.charcodeat() works 0-127. how convert between char , charcode values ranges 128-255? since there more 1 character set call "extended ascii," there isn't meaning term. ascii used. as you've found, important know character set , encoding using. although libraries flexible in adapting "the platform default," programs aren't written way and, if read or write data across systems, flexibility moot. there no text encoded text. when pass text, have data loss if don't give encoding metadata. actionscript strings sequences of unicode/utf-16 code units. see charcodeat() . unlike character sets, unicode has several encodings; utf-16 being 2 of them. (integers stored big endian or little endian , utf-16 code unit. utf-16 means either utf-16be or utf-16le, depending platform, through use of bom in string, data can s

linux - Whose stack is used when an interrupt handle is running? -

i trying understand steps followed when interrupt taken account processor. reading understanding linux kernel discovered first of processor needs determine vector associated interrupt, somehow address of isr computed. after checking if interrupt issued authorized source, checked if there change of privilege. "checks whether change of privilege level taking place—that is, if cpl different selected segment descriptor’s dpl. if so, control unit must start using stack associated new privilege level" my questions are: if interrupt runs @ expense of same process running when interrupt occurred, why not using process' kernel stack? there different stacks different privilege levels? know there kernel stack per process. if so, why switch of stacks needed?

oracle - What is Java equivalent for .net EnvelopedCms -

i need rewrite .net function below java without using bouncycastle . because has run java stored procedure @ oracle 11g database (it has java 1.5). jars loaded database unpacked , that's why variant bouncycastle fails: jce cannot authenticate provider bc. or if know how load jar (understand whole jar) oracle database jvm. loadjava extracts classes that's why can't work bc. protected byte[] encrypt(ref byte[] content, ref x509certificate2[] recipients) { contentinfo ci = new contentinfo(content); envelopedcms cms = new envelopedcms(ci); cmsrecipientcollection rcps = new cmsrecipientcollection(); foreach (var recipient in recipients) { rcps.add(new cmsrecipient(recipient)); } cms.encrypt(rcps); return cms.encode(); }

ember.js - "undefined is not a function" for CP and didInsertElement -

Image
i'm wrapping js component ember addon, i've done many times before, , yet i'm running problem right @ get-go makes me worry maybe "magic" of ember has shifted slightly? anyway hoping can explain why following: import ember 'ember'; import layout '../templates/components/nav-menu'; export default ember.component.extend({ layout: layout, tagname: 'nav', classnames: ['navmenu','navmenu-default','navmenu-fixed-left'], attributenames: ['role:navigation'], classnamebindings: ['offcanvas'], hideat: null, offcanvas: function() { let hideat = this.get('hideat'); if(!hideat) { return 'offcanvas'; } else { return 'offcanvas-%@'.fmt(hideat); } }.property('hideat'), _initialize: function() { this.$().offcanvas(); }.on('didinsertelement') }); this fails on 2 counts. as-is fails in offcanvas computed property say

html - css menu alignment and word spacing issues -

i have 2 small issues in css unable figure out. first ability extend area of block on drop down fit wording in properly. , secondly sub-menu, sub-menu placement. have fiddle setup here: fiddle the attribute can tell display: inline-block; this first issue: http://screencast.com/t/9gsbhmwe and second issue: http://screencast.com/t/toakie5db could maybe assist if could. missing? thanks in advance. add stylesheet. or you'd better find , edit related properties directly. #nav .main-navigation .sub-menu { background: url(images/background.jpg); } #nav .main-navigation .sub-menu li { display: block; } #nav .main-navigation .sub-menu, #nav .main-navigation .sub-menu li { width: auto; } #nav .main-navigation .sub-menu li { background: none; } to fix 2nd issue, add this. #nav .main-navigation .sub-menu .page_item_has_sub-menu { position: relative; }

ruby on rails - Set content_for for all pages on the site -

i have yield in application.html.erb , <%= yield(:alert_area) %> ... , want set content area every page on site (that uses layout). content cannot hardcoded in view because must display in situations (i.e. " your profile incomplete, click here complete it! ") how can this? can know can try using content_for in applicationcontroller seems breaking mvc pattern putting content in controller. plus, hitting dead end doing way anyway. what proper rails mvc way stick dynamic content on every page of site? as bukk530 suggests, instead of yield / content_for construct use render / partial construct, , in partial have conditional renders when want to. eg. - flash.each |name, message| %div{ class: "flash flash-#{name}" }= message

android - Get facebook fan page images without login -

i have fan page on facebook, , want make app display every image post page. i want make that, , not make user login facebook in order see them. is possible? i've read need access token, https://developers.facebook.com/docs/facebook-login/access-tokens . thanks. to images facebook page using graph api need following steps. authenticate application 'manage_pages' permission. https://developers.facebook.com/docs/facebook-login/permissions/v2.3#reference-manage_pages once user access token application permission make call graph api call /me/accounts , retrieve page access token page. once have page access token can use graph api specific page. the following breakdown of edges can use page access https://developers.facebook.com/docs/graph-api/reference/page in instance want using {page-id}/photos endpoint access token allow retrieve photos page.

java - How to configure proxy server with wildfly-maven-plugin? -

i have configured wildfly 8.2.0 server allow remote deployment maven-wildfly-plugin. have verified works computer not connected through proxy server. however, when using computer trying connect through forward proxy server, get: java.net.connectexception: wflyprt0023: not connect http-remoting://x.x.x.x:9990. connection timed out i have tried through documentation , code, can't find on topic. thank you. you can try configuring proxy jvm-wide using system properties (http.proxyhost , http.proxyport). should configure in 'argline' property in maven plugin configuration.

android - Cannot find my app in the Google Play on the tablet -

Image
i developed , published app. build.gradle has minsdkversion 11 targetsdkversion 22 compilesdkversion 22 and androidmanifest.xml has <supports-screens android:normalscreens="true" android:largescreens="true" android:xlargescreens="true" android:anydensity="true" /> app uses features now, have tablet asus nexus 7 android 5.1. can launch app on when debugging. in developer console says nexus 7 supported. however, cannot find app in google play tablet. it's invisible tablet somehow. most problem following line: <uses-feature android:name="android.hardware.camera" /> the 2012 model has front camera , not rear camera. tells play store camera mandatory app run. won't show on devices front camera. see android camera: require frontal or rear camera by default android:required:"true" . means devices atleast rear camera able see t

c# - Row-like string with even spacing in between values -

i'm trying add multiple lines , different sections listbox, , required use "\t" creating layout. listbox.items.add(emp[index].first + "\t\t" + emp[index].last + "\t\t" + emp[index].number + "\t\t" + emp[index].department + "\t\t" + "annual salary: " + (emp[index].annualsalary).tostring("c") + ", annual bonus: " + (emp[index].annualbonus).tostring("c")); just 1 example line. it comes out looking like: (without dots) mary.......sue................778-435-2321.....accounting.....annual salary: $33,000.00 trevor....joseph...........604-894-2902.....marketing.......annual salary: $52,000.00 steve......collin.............778-234-5432.....finance..........annual salary: $48,500.00 george...........watson..........604-910-2349.....technical.......annual salary: $25,000.00 sally.......henderson.....604-654-2325.....sales..............annual salary: $12,000.00 jenny.....motgomer