Posts

Showing posts from July, 2015

Croping out points from an array list in Java -

crop: has parameters 2 points in cloud. 1 of these 2 points bottom corner, , other diagonally across top corner of rectangle. crop remove points outside rectangle cloud crop image. crop method must deal 2 input points on horizontal or vertical line segment, in case points not on line segment removed, , must deal 2 equal points p1 , p2, in case points p1 removed cloud. for example, if 2 input points (0.0,0,0) , (1.0,1.0), points outside square delimited (0.0,0.0), (0.0,1.0), (1.0,1.0), , (0.0,1.0) removed, if 2 input points (0.0,0,0) , (0.0,1.0), points outside line segment delimited (0.0,0.0), , (0.0,1.0) removed. i'm having hard time approaching logically. if me out thankful. public void crop(point p1, point p2) { point left = points.get(0); point right = points.get(1); point top = points.get(2); point bottom = points.get(3); // point []rectangle2d = {p1,p2}; rectangle2d rect = new rectangle2d.double(p1.getx(), p1.gety(), p2.getx(), p2

Best approach to add a case in a column for nhibernate -

what best way add query projection in nhibernate? case when account.firstname = '' , account.lastname = '' email.emailaddress else account.firstname + ' ' + account.lastname end should this: var accounts = session.queryover<account>() .select(projections.conditional(restrictions.and( restrictions.eq("firstname", ""), restrictions.eq("lastname", "")), projections.concat(p.lastname, ", ", p.firstname), projections.property(t => t.emailaddress))) .list();

CSS Background Images To Repeat on x left and x Right with out overlapping -

ok trying set background image set like <---repeating image on left --- center image --- repeating image on right ---> the image on left not same image on thie right. i have tried using this body{ background: url(../img/background-01.png) center top no-repeat, url(../img/background-02.png) right 0 repeat-x, url(../img/background-03.png) left 0 repeat-x; background-color:#232323; } but background-02.png overlapping background-03.png resulting in background-02.png repeating on both left right side of page when meant repeating on right. here screen shot of design might give beter idear of trying make white boxes parts of background layer cropt out in there own image use on website [img] http://s7.postimg.org/iy0tm6k2j/screen_shot_2014_06_27_at_5_16_13_pm.png[/img] any apreeseated fix this. ok worked out used '#container{ position:relative; width:1000px; margin: 0 auto; left: 0; right: 0; border:thin solid #000; z-index:4; } #bgcon

excel - Using application.ontime for a time tomorrow -

i have written timer in vba in excel using application.ontime makes sound , gives message box when end time reached. this works fine when time later in same day, when goes next day timer ends right away, time has passed today. eg if time 7:00 pm , want timer go off @ 6:00 tomorrow, timer goes off because 6:00 has passed today. is there way of incorporating date application.ontime call? better off using other function? thanks caroline you can use: application.ontime date + 1 + timeserial(6,0,0), "macro_name" as long don't close excel before 6am tomorrow. ;)

python - I don't understand the k-means scipy algorithm -

i'm trying use scipy kmeans algorithm. so have simple example: from numpy import array scipy.cluster.vq import vq, kmeans, whiten features = array([[3,4],[3,5],[4,2],[4,2]]) book = array((features[0],features[2])) final = kmeans(features,book) and result is final (array([[3, 4], [4, 2]]), 0.25) what don't understand is, me centroids coordinate should barycentre of points belongings cluster, in exemple [3,9/2] , [4,2] can explain me result scipy algorithm giving? it looks preserving data type giving (int). try: features = array([[3., 4.], [3., 5.], [4., 2.], [4., 2.]])

ruby - How do I download a pdf document from html in rails for a custom path? -

i trying figure out how download pdf document standard html template. using wicked pdf gem generate pdf. i followed instructions in bundle install , set config according https://github.com/mileszs/wicked_pdf following this, trying make work custom route. keeps rendering html instead of delivering pdf specified in form what doing wrong? there better way route pdf download? config/routes.rb match "/profile" => "vacancies#profile", via: :get view <%= form_for(@vacancy, :url => profile_path, :html => {:method => :get, :format => 'pdf'}) |f| %> <%= submit_tag "export profile"%> <%end%> vacancies_controller def profile respond_to |format| format.html{ render :layout => false } format.pdf render :pdf => "temp" render :layout => false end end end i wrote second action following research, download link(in view) works de

hadoop - hdfs group permission doesn't work -

i'm using hadoop 2.2.0 , found hdfs group permission configs don't work linux filesystem $hadoop fs -ls /user drwxrwx--- - data data 0 2014-06-27 11:18 /user/data $whoami raw $groups raw data this directory belongs user data , group data . when user raw , member of group data , tries list directory /user/data on hdfs following exception raised: ls: permission denied: user=langxian.chen, access=read_execute, inode="/user/data":data:data:drwxrwx--- any idea why?

xpath to get immediate following element -

i'm writing xpath in "title" element want following "abbrev" within same parent(feature). i'm using xpath 1.0 <root> <feature> <title>burst cycle length</title> <titlealts class="- topic/titlealts "> <navtitle>burst cycle length</navtitle> </titlealts> <abbrv>bcl</abbrv> <featbody/> </feature> <feature> <title>burst parameter</title> <titlealts class="- topic/titlealts "> <navtitle>burst cycle length</navtitle> </titlealts> <abbrv>bcp</abbrv> <featbody/> </feature> </root> if want nodes: /root/feature/title/following-sibling::abbrv or, if want specific one: /root/feature/title[.='burst cycle length']/following-sibling::abbrv this has same output preceding: /root/feature[1]/title/following-sibling::abbrv

postgresql - Find Last 5 columns of a table -

is there way find values of last 5 columns of table? suppose if have table of 20 columns, want select values last 5 columns. any appreciated. in advance. don't. it's stupid. there shouldn't be order columns - should have names. it's convenience when testing or sitting @ db console select * gives them all. there very few cases select * makes sense in live system. can't think of want whatever columns happen "last" on table. if committed doing you'll have query information-schema or system catalogues . list of columns on particular table , build sql query them. however, if aren't in control of table it's meaningless task since won't know information means. if in control of table know column-names there , that's better way it.

android - How to use higher sdk if needed else use lower -

i'm developing android sms app. using 2.2 api , needs stay way. with new kitkat framework send/receive sms messages got problem know if use kitkat sms or lower api sms framework want able use lower sdk time except times when device kitkat , use kitkat api instead. i saw solution use android.os package check kind of os u got if write in class kitkat sms functions , wouldn't make app 4.4 api? thanks headds up while creating project should target lowest api level possible. because if not using kitkat features should not target kitkat. because people using gingerbread (2.3–2.3.7), honeycomb (3.0–3.2.6), ice cream sandwich (4.0–4.0.4), jelly bean (4.1–4.3.1) not able application though runs fine on devices.

ibm mq - Whats default protocol used by ibm mq broker for JMS interface -

we using ibm mq mom java based jms application. need know underlying communication protocol used ibm mq. specifically, if need communicate using mqtt protocol ibm mq, need use mq telemetry product ? the mq jms client use proprietary protocol communicate queue manager rather mqtt protocol. proprietary protocol not published externally mqtt protocol is. if need use mqtt protocol need use mqtt client.

awk - Save lines to separate files -

i have file --> http://wklej.org/id/1403118/ creating separate files awk '/o[0-9]{5}/{print > $0}' file in each file want put model , subsequent lines. an example of first 2 files file name --> o00001(odjazdxyz) o00001(odjazdxyz) g91 g28 y0 z0 g90 m99 file name --> o00001(049-479514) o00001(049-479514) / m97 p1 (fr25) m97 p2 (fr8) m30 n1 t2 g43 h02 g54 m06 g00 x1. y-12.5 z1. m08 s890 m03 g01 x-58. f250. y12.5 x1. g00 y-12.5 z0 g01 x-58. y12.5 x2. m09 g00 y170. z300. n1 m99 n2 t8 g43 h08 g54 m06 (fr8) g00 x0 y57. z2. m08 s2785 m03 g01 z-4. f250. m09 g00 z2. y380. n2 m99 this should work. awk '/o[0-9]/{out=$0} out{print > out}' file

JMS serialization exception php -

i have following classes /** * @discriminator(field = "type", map = { * "b":"b", "c":"c", * }) */ abstract class {} class b extends { ... } class c extends { /** * @var * @serializer\type("a") */ $a } now when serialize object of class c : the discriminator field name "type" base-class "a" not found in input data. any idea doing wrong here? using jms serializer. edit i getting exception when try deserialize serialized object. an abstract class can't initialized , therefor not deserialized. if need class a, should change normal class , not beeing abstract. i had similar problem year ago, solution: jms serializer deserialize abstract parent class

c# - Uppercase problems -

how can output when i'm using replace , toupper in visual studio c# firstname here's code: private void button1_click(object sender, eventargs e) { string input; input = combobox1.text; input = input.replace("_", ""); label1.text = input.first().tostring().toupper() + string.join("", input.skip(1)); } the output this: firstname if input "first_name" works: var text = "first_name"; text = string.join("", text .split('_') .where(x => !string.isnullorempty(x)) .select(x => new string( x .take(1) .select(c => char.toupperinvariant(c)) .concat(x.skip(1)) .toarray())));

javascript - Setting $watch to scope variables causes watch code to execute immediately, how to avoid? -

i have angularjs code this: // procedure called on page load... rectlayout(svg, scope.xdim, scope.ydim, scope.numorder); // watch changes of relevant variables: if of basic variables changed, redraw whole thing. scope.$watch(['xdim', 'dimy', 'numorder'], function () { rectlayout(svg, scope.xdim, scope.ydim, scope.numorder); }, true); this code causes rectlayout called twice in row. need $watch working later, during initialization of page want first call happen. how can achieve that? you want following: scope.$watch(['xdim','dimy', 'numorder'], function(newval, oldval) { if (newval !== oldval) { rectlayout(svg, newval.xdim, newval.ydim, newval.numorder); } }); i'm not sure, way, newval hash , not array. should double check that, in case, that's general pattern.

android - ListView Not Updating After Filtering, when the backspace key is entered -

here code, used custom adapter, , applied filter method, listview not update when backspace key entered, on when 1 switches item activity. please me.. , how display no result filtered list.. public class itemlistadapter extends arrayadapter<itemvo> { private arraylist<itemvo> itemlist; private arraylist<itemvo> fiems; private static final int long_delay = 3500; // 3.5 seconds private static final int short_delay = 2000; // 2 seconds private context context; private filter filter; public itemlistadapter(context context, int textviewresourceid,arraylist<itemvo> statelist) { super(context, textviewresourceid, statelist); this.context = context; this.itemlist = new arraylist<itemvo>(); this.itemlist.addall(statelist); this.fiems=new arraylist<itemvo>(); this.fiems.addall(statelist); } private class viewholder { textview code; checkbox na

symfony - Where to write server-specific parameters? -

for custom bundles of application, need define parameters (mainly folder/file path). of them different depending on if i'm on local test server or remote prod server , common both. how should manage these parameters? i had idea create such kind of file: myfirstbundle/resources/config/parameters_local.yml myfirstbundle/resources/config/parameters_distant.yml mysecondbundle/resources/config/parameters_local.yml mysecondbundle/resources/config/parameters_distant.yml and import them respectively in app/config/parameters_local.yml: imports: - { resource: @myfirstbundle/resources/config/parameters_local.yml } - { resource: @mysecondbundle/resources/config/parameters_local.yml } and app/config/parameters_distant.yml: imports: - { resource: @myfirstbundle/resources/config/parameters_distant.yml } - { resource: @mysecondbundle/resources/config/parameters_distant.yml } but bit heavy, when have 1 or 2 parameters in bundle or when have parameters common

sql - procedure to take information from one table and write to another table -

ive got question stumped on. reads follows: write import stored procedure take information table (source) , write table (target). im guessing following: create procedure add_data(@name, @surname) begin select name, surname cardholder insert new_table values (name, surname) is logic correct or missing it? you there. since directly copying 1 table another, can use insert ... select ... idiom, so: create procedure add_data @name varchar(100) @surname varchar(100) begin insert new_table(name,surname) select name, surname cardholder end note 2 changes made: how declare parameters sp the values clause should consist of actual values being inserted. since inserting data retrieved table rather fixed values, use select query instead.

javascript - Is there a compatible solution for all browsers to monitor the select dropdown open/release event -

i need capture dropdown open/release events something. release can done through selecting option item, pressing esc, , clicking other place or clicking on select again. and can't use lib , rely on pure javascript. far, have compatible solution there minor/random issues not overcome. example: <select opened='false' onmousedown="mousedownhandler(event, this), return true" onkeyup="keyuphandler(event), return true"> <option> op1 </option> <option> op2 </option> <option> op3 </option> </select> javascript: var expectmouseup = false; var objselect = null; onmousedownhandler = function(event, select) { if(select.getattribute('opened') = 'false') { expectmouseup = true; select.setattribute('opened', true); objselect = select; document.body.addeventlistener('mouseup', mouseuphandler); } } mouseuphandler = function(

ruby on rails - Open Tok plugin conflicts with firefox -

i'm using opentok plugin making video sessions in ror app. unfortunately not working in firefox-firefox browser. if peers using firefox, not working. i'm new this. problem? make sure firefox version date , users have latest version of firefox. webrtc not supported in older firefox versions. once have latest firefox version, test code group video chat in multiple tabs/browsers/computer (you can sessionid/token credentials dashboard account page): ... <body> <script src='//static.opentok.com/webrtc/v2.2/js/opentok.min.js'></script> <script> var apikey = "your key"; var sessionid = "your session id"; var token = "your token"; var session = ot.initsession(apikey, sessionid); session.connect( token, function(err){ if(!err){ session.publish(); } }); session.on("streamcreated", function(event){ session.subscribe( event.stream ); }); </script&g

check android developer tools version command line -

i'm trying retrieve adt version generate system reports, not know how , did not find after time googling... how can check version of android developer tools installed on system using command line? thanks! various parts of tools save revision number in files for example cat /android/sdk/platform-tools/source.properties | grep pkg.revision cat /android/sdk/tools/source.properties | grep pkg.revision the build tools placed in versioned directories, can find them via ls /android/sdk/build-tools/

Python Image Processing: Measuring Layer Widths from Electron Micrograph -

Image
i have image electron micrograph depicting dense , rare layers in biological system, shown below. the layers in question in middle of image, starting near label "re" , tapering left. to: 1) count total number of dark/dense , light/rare layers 2) measure width of each layer, given black scale bar in bottom right 1 micron long i've been trying in python. if crop image beforehand contain parts of few layers, such 3 dark , 3 light layers shown here: i able count number of layers using code: import numpy np import matplotlib.pyplot plt scipy import ndimage pil import image tap = image.open("vdtap.png").convert('l') tap_a = np.array(tap) tap_g = ndimage.gaussian_filter(tap_a, 1) tap_norm = (tap_g - tap_g.min())/(float(tap_g.max()) - tap_g.min()) tap_norm[tap_norm < 0.5] = 0 tap_norm[tap_norm >= 0.5] = 1 result = 255 - (tap_norm * 255).astype(np.uint8) tap_labeled, count = ndimage.label(result) plt.imshow(tap_labeled) plt.show()

jquery - two close buttons on one popup in codedrop window effect plugin -

i using http://tympanus.net/development/modalwindoweffects/ plugin in website. want use 2 close buttons on 1 popup 1 working, not both. how can make both close buttons work. add class="md-close" span <span id="cda-remove" class="md-close"></span>

Excel runs very slow (with VBA) -

i have userform several drop-down lists, populated via vba macro. happens right @ beginning, on opening workbook. once load done, workbook becomes slow. scrolling 1 cell causes noticeable lag, despite not having running macro. on opening workbook, load() function called preps userform. the userform has ~25 dropdown lists, populated separate sheet ("menu") stores values each of these dropdowns in separate column. "menu" sheet filled via load() function calls 1 of 2 menuquery() routines. one of these pick distinct values columns in dbf file, other lists down options based on list in question. snippets load() subroutine : sub load() application.screenupdating = true dim mysht, datasht worksheet set mysht = sheets("dashboard") set datasht = sheets("menu") mysht.visible = xlsheetvisible mysht.activate datasht.visible = xlsheetvisible datasht.activate activesheet.range("a1:iv2000").select selection.clearcontents r

android - How do I get the wearable preview? -

how can preview implementing new apis wearables? android studio 0.6.1 not offer update 0.8. find new android studio? in order use these new apis need use new play service library find it? at first need android studio beta 0.8 here . when done go android sdk manager , install required sdks: update android sdk tools , platform-tools versions 23 , 20 respectively. click tools > manage add-on sites > user defined sites. click new, enter https://dl-ssl.google.com/android/repository/addon-play-services-5.xml text field, , click ok. click close. should see new emulator images support preview release of google play services , google play services client libraries need start developing. while sdk manager installing stuff need work go on prepare device: for getting lastest play services library need join comunity . can download google play services 5.0 preview , android wear companion needed connect real wearable via bluetooth or emulator. next step install

Php code in html not working as expected -

i want use code results database , show in html not happening. getting weird results , not able fix it. it display } ? > on webpage @ end wonder why.and cannot results database displayed either. database proper believe error in html , php code(php variables in html tags). <?php while($row = mysqli_fetch_array($result)) { $price = ($row['isbn']%1000); echo $price; <li> <div class="book-display-bg"> <div class="book-display-placeholder"> <div class="book-display-container"> <div class="book-display-centered"> <a href='product/taqatu-niran-min-yaumiyat-al-intifada-as-suriya-9789953892368-(105523).html' > <img src=''$row['image_url_m']'' style='border: 0;' alt=''$row['book_title']''/> <

ruby on rails - Capybara issues with request specs for post request url -

i writing request spec capybara , having trouble hit post url, here code context 'discounts in api', js: true let(:user) { fabricate(:user, activated: true) } let(:api_token) { user.api_token } let(:discount) { fabricate(:discount_coupon, code: 'test_dc', global: true) } 'should able add discount coupon' visit api_url_for("/v1/discount_coupons/#{discount.id}/add", api_token) save_screenshot("tmp/capybara/screenshot-#{time::now.strftime('%y%m%d%h%m%s%n')}.png") save_and_open_page expect(response).to have_text('true') end end but fails post request, there way hit post url capybara ? form data need api_token. , " api_url_for " helper go @ http://api.mydomain:3000

Android - Can't make the textview below the framelayout -

i have textview , framelayout inside linearlayout. can't make textview below framelayout, keeps staying @ top. this code : <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="bottom" android:text="textview" /> <framelayout android:layout_width="match_parent" android:layout_height="match_parent" > <framelayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <imagebutton android:id="@+id/btngototop" android:layout_width="wrap_content"

vpn - Why do we need to add internal ip addres for VpnService in Android -

i googled of time , not able convincing reasons. i got few links not useful doube: vpnservice capture packets. android firewall vpnservice. in places obsesrve (examples in google) using internal ip address in case of "addaddress()" in vpnservice.builder. why need add internal ip address instead of actual ip address device assigned to? please guide me answer :). after big study got know that, ip address vpn server assign user on connecting server. in examples on google, hardcoding ip addresses out comment/explanation has baffled me. anyway ip address assigned vpn server internal(aka private) ip addresses.

h.264 - Gstreamer + h264 stream from c920 + v4l2loopback not working -

i've been month working in project cubieboard2 , webcam logitech c920, after lot of search , trial error decided use gstreamer + v4l2loopback sending hardware encoded h264 stream provides c920 vlc , add textoverlay program. the problem came when tried use gstreamer v4l2loopback. if use raw stream logitech works fine: gst-launch-1.0 -v v4l2src ! "video/x-raw,format=yuy2,width=640,height=480,framerate=30/1" ! queue ! v4l2sink device=/dev/video1 sync=0 also it's fine gst-launch-1.0 -v -e uvch264src device=/dev/video0 name=src auto-start=true src.vfsrc ! queue ! video/x-raw,format=\(string\)yuy2,width=320,height=240,framerate=10/1 ! v4l2sink device=/dev/video1 sync=0 but when use h264 stream: gst-launch-1.0 -v -e uvch264src device=/dev/video0 name=src auto-start=true src.vidsrc ! queue ! video/x-h264,width=1920,height=1080,framerate=30/1 ! v4l2sink device=/dev/video1 sync=0 it doesn't work, outputing "streaming task paused, reason not-linke

asp.net - EmberJS RESTAdapter with extra parameters -

i have emberjs application uses asp .net restfull web api fetch data server. use ember restadapter connect web api, , works great these scenarios: get products //findall products/{id} //find post products //createrecord put products/{id} //updaterecord delete products/{id} //deleterecord but if encounter scenario: get products?categoryid=1 how can call method via ember , process result? my asp.net rest api controller public class productscontroller : apicontroller { private iordercapturerepository _ordercapture; public productscontroller() { _ordercapture = new ordercapturerepository(); } public ihttpactionresult get() { try { var result = wrapper.wraptoember(_ordercapture.getproducts()); return ok(result); } catch (exception e) { return internalservererror(e);

vb.net - Make VB code that replaces LINQ expressions -

i found code on answered question c# - how xml deserialize object itself? code , want use in application target .net 2.0 compact framework, cant use linq expressions. there can tell me how can convert "normal vb" code? original code from user wheelibin. i went approach: public class serialisableclass public sub savetoxml(byval outputfilename string) dim xmls = new system.xml.serialization.xmlserializer(me.gettype) using sw = new io.streamwriter(outputfilename) xmls.serialize(sw, me) end using end sub private tempstate object = me public sub readfromxml(byval inputfilename string) dim xmls = new system.xml.serialization.xmlserializer(me.gettype) using sr new io.streamreader(inputfilename) tempstate = xmls.deserialize(sr) end using each pi in tempstate.gettype.getproperties() dim name = pi.name ' part cant figure out (how without linq)

html - How to make Bootstrap Panel body with fixed height -

i using bootstrap's panel display text , image, text grows, body of panel increases. want know how create body fixed height, e.g. 10 rows or @ 10 rows. here code: <div class="span4"> <div class="panel panel-primary"> <div class="panel-heading">jhdsahfjhdfhs</div> <div class="panel-body">fdoinfds sdofjohisdfj</div> </div> </div> you can use max-height in inline style attribute, below: <div class="panel panel-primary"> <div class="panel-heading">jhdsahfjhdfhs</div> <div class="panel-body" style="max-height: 10;">fdoinfds sdofjohisdfj</div> </div> to use scrolling content overflows given max-height , can alternatively try following: <div class="panel panel-primary"> <div class="panel-heading">jhdsahfjhdfhs</div> <div class="panel-body

SQL server 2008 .Date foramat -

i have data values in dd-mmm-yyyy format, e.g. 18-jun-2014 . have written query fetch records logged on particular day. in date format available in database table stores above date in yyyy-mm-dd hh:mm . want form query on below scenario. if give date alone query need check given date dd-mm-yyyy 00:00 dd-mm-yyyy 23:59 . example from 18-jun-2014 00:00 18-jun-2014 23:59

javascript - html get div tag in many levels -

i got class required on div tag , , want remove change function of text field , can't div level, please me reach this.parent.parent.closest('div') <div class='required'> <div> <div> <input type='text' value='123' onchange(removerequired(this, this.parent.parent.closest('div')))/> </div> </div> </div> <script type='text/javascript'> function removerequired(elm1, elm2){ if ($(elm1).val()) { $(elm2).removeclass('required'); } } </script> it seems want add/remove required class based on whether input empty or not. $('.required').on('change', 'input', function(event) { // add or remove required class $(event.delegatetarget) .toggleclass('required', this.value.length === 0); }); it work following html: <div class='required'>

actionscript 3 - Define rectangle how to -

Image
i 'm trying develop game.in project have movieclip character game.i have 5 buttons(left right down , stop) user can move.the game android.in library have square dimnesions 50 x 50.i have filled stage copies of square different instances character can move on them.the point of game user moves character , hittestobject() function removes square walking on.i used timer if 5 seconds on , player hasn't completed rectangle of missing squares squares appear again.but if makes rectangle(lets makes removing 8 squares) squares inside rectangle must dissapear also.i need find way see when player completes rectangle.i think aproach want draft , there better one. thanks in advance! i think may haven't explained problem well..sorry mistake!everytime character touches on square disapears.if in 5 seconds character hasn't completed "rectangle" of missing squares appear again.when rectangle mean rectangle of squares.for example if 4 squares missing(not in row) rectangle

xpages - Domino OSGI Update Site Creation -

Image
this continuation of question asked few days ago regarding designer connection domino osgi dev , testing. in eclipse, have "debugging plug-in" installed (as mentioned stwissel), , fairy configured properly. in second attempt, tried export plug-in in update site. 1. import plug-in feature 2. import feature update site 3. build update site i first tried install using widgets in notes sidebar. did not thing run so, went designer , installed there directly, nothing. current stand i built update site , deployed using nsf update site widget. use openntf domino api, extlibs -- comfortable , it. i can verify feature available in application management window of designer. 3 expect see libraries in xsp.properties page generation tab, not. questions 1. missing something? 2. must add sort of class/code/flag in order choose library/plug-in in designer? 3. how can best verify plug in , not feature installed? if xsplibrary not 'global' 1 wo

Windows Embedded does not honor ShutdownBlockReasonCreate -

Image
the following program works on windows 7 not on windows 7 embedded standard service pack 1. not prevent shutdown (e.g. shutdown /r /t 0) happening. this similar question 1 linked duplicate. question has accepted answer of "it not work". provide sourcecode working solution in windows 7 needs adjustment windows embedded. any ides how working on embedded? or @ least hint windows docu points difference out? #include <windows.h> #include <stdio.h> const char g_szclassname[] = "mywindowclass"; // step 6: window procedure lresult callback wndproc(hwnd hwnd, uint msg, wparam wparam, lparam lparam) { switch(msg) { case wm_queryendsession: outputdebugstr("got wm_queryendsession message\n"); char buf[1024]; sprintf(buf, "callback %d %d\n", wparam, lparam); outputdebugstr(buf); return false; // false should prevent reboot break; case wm_endsess

node.js - Mongo values not updating -

i'm trying increment value of object in mongoose , seems not want go past 2?? there i'm missing? i'm new mongo campsite.findone({slug : req.body.campsite.slug }, function(err, site){ if(!site.tracking){ console.log("no previous tracking @ all"); site.tracking = {}; } if(site.tracking[req.body.tracking_type] == undefined){ console.log("no previous tracking of type"); site.tracking[req.body.tracking_type] = 1; }else{ console.log("well count then!"); site.tracking[req.body.tracking_type] += + 1; } site.save(function (err, fluffy) { console.log(err); }); res.send(200); }); it wont save updated result? schema below var campsitesschema = new schema({ name: string, address_line_1: string, address_line_2: string, county: string, postcode: string, loc: array, website: string, email: string, telephone_1: string, te

javascript - Deleting cookies function is not working -

i want delete cookies, code works upto , set cookies,,, deleting of cookie not working please suggest me answer code <body> <select id="themeselect" onchange="savetheme(this.value);"> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> <option value="4">four</option> <option value="5">five</option> </select> <button type="button" onclick="showcookie();">getcookie</button> <button type="button" onclick="deletecookie(name);">deletecookies</button> <script> var saveclass = null; function savetheme(cookievalue) { var sel = document.getelementbyid('themeselect'); saveclass = saveclass ? saveclass : document.body.classn

eclipse - Android application: "The Application has stopped unexpectedly" - using setText() method -

this question has answer here: nullpointerexception accessing views in oncreate() 11 answers i have problem android application. if use settext() method textview have problem like: application has stopped unexpectedly. please try again. code of application: public class tc1 extends actionbaractivity { private textview textview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_tc1); if (savedinstancestate == null) { getsupportfragmentmanager().begintransaction() .add(r.id.container, new placeholderfragment()).commit(); } textview = (textview)findviewbyid(r.id.textview); textview.settext("hi"); // wrong line } ... } xml fragment: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"

Range projection: equivalent of LINQ select in D? -

is there linq select in d? i want remove container elements contained in member of objects in given array. thought nice if do: mycontainer.remove( myarray.select!( => a.member ) ) ; it called map : import std.algorithm; mycontainer.remove(myarray.map!(a => a.member));

jquery - input textbox validations based on unicode -

i have applied validations on input textbox using keycode. how can using unicode. in code shown below, have restricted special characters in textbox seen using keycode want restrict using unicode. $('.alphaonly').keydown(function (e) { var pressedkey = e.keycode; if ($(this).getcursorposition() == 1 || $(this).getcursorposition() == 0) { if (pressedkey == 32) { e.preventdefault(); } } if (!((pressedkey == 8) || (pressedkey == 9) || (pressedkey == 32) || (pressedkey == 46) || (pressedkey >= 35 && pressedkey <= 40) || (pressedkey == 17) || (pressedkey == 18) || (pressedkey == 19) || (pressedkey >= 65 && pressedkey <= 90))) { e.preventdefault(); } }); use e.charcode (which supposedly obsoleted e.char ) reference: https://developer.mozilla.org/en-us/docs/web/events/keydown

java - Why does this array give me trouble? -

this question has answer here: scope of local variable in enhanced for-loop 5 answers if write this: int array[] = {2, 2, 4, 6, 8, 5}; (int : array) { } ..it's ok, if write this: int array[] = {2, 2, 4, 6, 8, 5}; int = 0; (i : array) { } it gives me issues. teacher says wants initialize @ top, how doesn't put int inside of for ... is there other ways write it? the syntax you're using special case of loop, called "for-in" loop. teacher wants more traditional c style loop this: for (int = 0; < array.length; i++) { // need array[i] access elements here } the difference for-in loop doesn't use counter (loop induction variable), uses uninitialised value i , binds name each element of array iterate.

xpath - How to fill timepicker field with capybara -

i new capybara , have problems text field, capybara can not find field. i need create automatic tests , 1 of them has fill in fields changes time(id , name changes, this: id="patterndailystart_146d7547140" , number different). html part looks this: <div class="timepicker"> <input value="" id="patterndailystart_146d7547140" name="patterndailystart_146d7547140" class="timepicker-input patterndailystart hasdatepicker" type="text"> <img class="ui-datepicker-trigger" src="/mpromoter/assets/4716a6a0a357181/app/components/timefield/clock.png" alt="..." title="..."> </div> this time picking field. , problem capybara can not find field.. try find filling. when try find xpath, found, when want fill in time($starttime=17:00) says element not found or not exist. these xpaths f

python - dmb.error when looking up data, I need some pointers -

i have dbm file leads error when try access value directly: >>> import dbm >>> db = dbm.open('scrapers','c') >>> key1 = db.keys()[0] >>> db[key1] traceback (most recent call last): file "<stdin>", line 1, in <module> dbm.error >>> db.get(key1) '(dp1\ns\'username\'\np2\nnss\'password\'...etc... it happens file, contains pickled classes of scrapers various websites. i can't provide actual db data because contains login data. question is: possible explanations problem? should start looking debug this? if need other info (except data itself) please let me know. turns out there's detail dbm isn't explained in python dbm docs: the sum of sizes of key/content pair must not exceed internal block size (normally between 512 , 4096 bytes). i'm using gdbm now, , works fine.

django - How to retrieve the Email from Twitter and Google -

i using django-allauth these settings: socialaccount_providers = { 'google': { 'scope': ['https://www.googleapis.com/auth/userinfo.profile'], 'auth_params': {'access_type': 'online'} }, 'facebook': { 'scope': ['email', 'publish_stream'], 'auth_params': {'auth_type': 'reauthenticate'}, 'method': 'oauth2', 'locale_func': lambda request: 'pt_br', 'verified_email': false } } account_email_verification = 'none' then when made login through twitter or google email not filled in user. when use providers github or facebook users have proper email. in advance o/ you cannot. twitter not provide users' email addresses. source - https://dev.twitter.com/discussions/5232