Posts

Showing posts from June, 2015

extjs4 - Extjs : Grid column width in percentage -

looks not 1 has run situation. need set widths of columns in grid panel in percentages on size (due resizing) each column has predefined percentage width. not able achieve setting width : 'xy%' on each column. noticed same question being asked in below threads. http://www.sencha.com/forum/showthread.php?138485 http://www.sencha.com/forum/showthread.php?92930 this didnot either : how set width in ext.grid.columnmodel in percentage terms? note : donot want flex columns, want set percentages. extjs gurus please shed light! the other question you've linked relates previous version of ext, not ext 4. flex option you're looking for... you're not limited set integers, , flexed columns width respect ratio between flex value. furthermore, can explicitly convey idea of percentage using fraction of 100. here's example: ext.create('ext.grid.panel', { title: "resize me!", // ratios kept when grid resized. resizable: t...

c++ - Remove old values in list and add new ones -

i'm not sure how explain properly, let me try. have c++ program listening data on can bus (communication bus vehicles). every 1 second, receive new message off bus contains diagnostic information error messages. message not fixed length, message 1 time may contain 5 faults, , next time may contain 3 faults. message comes 2 (or more) different sources, each 1 of them sends every 1 second. in ui, need display list of active faults cycling through them @ rate of 1 per every 5 seconds. here's question. how efficiently keep list updated latest information? adding list no problem, how remove item should no longer in list? in other words, if receive 3 faults in message, means 2 of them not exist anymore. thing can come using timestamps , bunch of loops compare 2 messages , add/remove/update list. there more efficient exists sort of thing? edit: clarify, need remove items list because faults no longer active. if have array follows: // message received: (psudo code...

python scipy sparse matrix SVD with error ARPACK error 3: No shifts could be applied during a cycle of the Implicitly restarted Arnoldi iteration -

i using scipy sparse matrix svd on large data. matix around 200,000*8,000,000 size, 1.19% non-zero entries. machine using has 160g memory suppose memory shouldn't issue. so here code used: from scipy import * scipy.sparse import * import scipy.sparse.linalg slin numpy import * k=1500 coom=coo_matrix((value,(row,col)),shape=(m,n)) coom=coom.astype('float32') u,s,v=slin.svds(coom,k,ncv=8*k) the error message like: traceback (most recent call last): file "sparse_svd.py", line 35, in <module> u,s,v=slin.svds(coom,k,ncv=2*k+1) file "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/eigen/arpack/arpack.py", line 731, in svds eigvals, eigvec = eigensolver(xh_x, k=k, tol=tol**2) file "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/eigen/arpack/arpack.py", line 680, in eigsh params.iterate() file "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/eigen/arpack/arpack.py", line 278, in iterate ...

javascript - jquery form only passing first select box values on submit -

i'm new posting here, have visited several times on years read every ones ideas. my issue have form 2 select boxes, second 1 populated values upon selection in first. second holds url value got upon submit. function works using onchange on submit first of second select list urls work. can swap them first works, others pass primary url followed crosshatch '#'. <script> $(document).ready(function($){ $("#category").change(function() { $('select[name="product"]').removeattr("name").hide(); $("#" + $(this).val()).show().attr("name", "product"); }); /* ' works on $(".product").change(function() { document.location = $(this).val(); }); */ /* passes url on first product option list else passes opening url + #*/ $('#discover').submit(function() { document.location = $(".product").val(); return false; }); }); </script> <div id=...

json - How to make login page in iphone using webservices -

i'm working on app asks user login access of informations. have login.jsp file store on server , usernames , passwords on database. on app have 2 uitextfields 1 username , 1 password. understand can use post method pass on input web server , check whether username , password match load rest of data. having trouble, can me it, how pass on inputs uitextfield web service run login.jsp script? in advance. // jdurlconnection.h typedef void (^successblock)(nsdictionary *dict); typedef void (^errorblock)(nsstring *error); @interface jdurlconnection : nsobject +(void) urlrequestwithurl:(nsstring *)urlstr usingmethod:(nsstring *)verb andparameters:(nsdictionary *) param completionblock:(successblock)completed errorblock:(errorblock)errored; @end // jdurlconnection.m + (void) showmessagestring:(nsstring *)message{ uialertview * alert = [[uialertview alloc]initwithtitle:@"app name!" message:message dele...

html - how to check the div value in javascript -

how set div css styles using javascript? have problem getting value of class name. please if know it. <div class="this_is_i_want_to_set_the_background_color" id="divname"></div> <div class="test" id="divname"></div> var classname = $('.divname').attr('class'); var t = 'divalue'; if(classname == t){ $('.divname').css('background', '#0962ae'); } you may use .hasclass method: $('.divname').each(function() { if ($(this).hasclass('divalue')) { $(this).css('background', '#0962ae'); } }); but there 1 simpler way this: // element class 'divname' has class 'divalue' $('.divname.divalue').css('background', '#0962ae');

android - Why my toast appears so different than others? -

Image
here sample of toast android uses on system (in app) .                                                  now here toast created.                                                          the differences can seen clearly: system toast has lower font size mine in version, padding between container , text more my padding area has different color , there no border in system toast unlike mine the string used information want show. ( w , . has not rendered correct...

linux - trying to install something on an ubuntu ec2 instance -

i running line in ubuntu: sudo apt-get install pptpd and here's output get: reading package lists... done building dependency tree reading state information... done following packages installed: bcrelay following new packages installed: bcrelay pptpd 0 upgraded, 2 newly installed, 0 remove , 0 not upgraded. need 96.2 kb of archives. after operation, 446 kb of additional disk space used. want continue [y/n]? y err http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ natty/main bcrelay amd64 1.3.4-3ubuntu1 403 forbidden err http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ natty/main pptpd amd64 1.3.4-3ubuntu1 403 forbidden failed fetch http://us-west-1.ec2.archive.ubuntu.com/ubuntu/pool/main/p/pptpd/bcrelay_1.3.4-3ubuntu1_amd64.deb 403 forbidden failed fetch http://us-west-1.ec2.archive.ubuntu.com/ubuntu/pool/main/p/pptpd/pptpd_1.3.4-3ubuntu1_amd64.deb 403 forbidden e: unable fetch archives, maybe run apt-get update or try --fix-missing? what doing wrong? known is...

How to export a DWG format file into a SAT file using C# Autocad API's? -

how export dwg format file sat file using c# autocad api's. selection set in selectall mode in sat file. using vs 2010 , autocad 2012. code helpful. out of curiosity, doing sat file? , why http://forums.autodesk.com/t5/autocad-2013-2014-dwg-format/exporting-to-sat-does-not-save-files/td-p/3944406

javascript - Change the color of similar pixels in an image with canvas and js -

i looking algorithm or code find similar pixels (pixels have similar colors) in client side , change color of pixels. searched lot couldn't find formula finding similar pixels. thing want make magic wand tool in photoshop. tool can colorize part of product make custom color. have color restriction in production , can use colors. tried find logic formula like: finding euclidean distance of each pixel in compare neighbors' pixels canvas , java script , compare amount. not working well. weakness every picture has pixels similar colors different color shades. algorithm not smart in finding different color shades. in photoshop can select area same color magic wand tool , expand area similar color shades "similar" option. what have far? helpful if shared relevant code you've written far (i.e. searching through pixels, comparing pixel colors...) if haven't already, may want familiarize floodfill algorithms . basis of traversal algorithm. color compar...

java - Datastructures for storing sorted values -

my data in form of key value.i want sort values.i have stored them in hashmap. map.put(1,.8678) map.put(2,.9578) map.put(6,.0453) i want output: (6,.0453), (1,.8678), (2,.9578) i want sort values, retrive sorted values , keys efficient(with least complexity).what best data structure problem? thanks. the treemap data sorted keys if want sorted values, check might answer question: how sort hashmap in java

c# - Migradoc Add horizontal line -

how can add simple horizontal line in migradoc separate content above line content below line? paragraph 1 paragraph 2 paragraph 3 etc you can add border paragraph or table. with respect sample, add bottom border paragraph 2 or add top border paragraph 3 or add new paragraph between them , set either top or bottom border.

javascript - Single scroll (left and right) website -

i have following code makes website - http://jsfiddle.net/xhgpk/ how able make different colored div sections display inline each other rather jumping , down because of content? -- answer: http://jsfiddle.net/ypeun/ add vertical-align: top; .horizontal class.

actionscript 3 - Remove unvanted clicks in generated sound in AS3 -

i having following problem when generating sound wave in flash. generator part : const sampling_rate:int = 44100; const two_pi:number = 2 * math.pi; const two_pi_over_sr:number = two_pi / sampling_rate; const sample_size:int = 8192 / 4; function generatesine(fq:number):bytearray { var bytes:bytearray = new bytearray(); var sample:number; var amp:number = 1; (var i:int=0; i<sample_size; i++) { sample = amp* math.sin(i * two_pi_over_sr * fq ); bytes.writefloat(sample); } bytes.position = 0; return bytes; } and playback part: function playbacksamplehandler(event:sampledataevent):void { var sample:number; (var i:int = 0; < sample_size && sounddata.bytesavailable; i++) { sample = sounddata.readfloat(); event.data.writefloat(sample); event.data.writefloat(sample); } } function onclickplay(e:mouseevent) { sounddata= new bytearray(); var sound:bytearray= new bytearray(); sound=generatesine(440); sounddata.writebytes(sound,0...

android - Running multiple AsyncTask exits the application without showing any specific error -

i have simple task in application.i trying achieve following in application. 1.capturing image using custom camera class when hardware volume button pressed.and once capturing started, should automatically capture images @ regular interval(lets 2 sec). 2.each images had saved in sd card , mail corresponding mail id in background. in order achieve above created custom camera class , override hardware volume button capture picture.and send mail in background used java mail api. as have send mail @ each 2 sec of interval, wrote mailing , saving sd card code using asynctask . find out here , other posts pool size of asynctask max 128+10=138 total.as sending mail @ 2 sec interval,it exceed max pool size results error. but requirement capture high resolution images @ 2 sec interval , mail corresponding mail id. is possible using asynctask ? or other framework android provides execute long running tasks? below have tried far, hardware volume key override public ...

php - What is the most suitable way to work with databases in Zend Framework? -

i'm developing web application zend framework. in documentation says ... "be aware though table data gateway pattern can become limiting in larger systems." what drawbacks of using table data gateway ? what suitable way handle database zend ? drawbacks of using table data gateway can limit writing complex queries. custom queries such union , sub query , using where clauses such or (b , c) or d best way write complex queries write complex query hand. best way execute them using zend_db_adapter

java - TrueZip on Android, UnsupportedCharsetException: IBM437 -

i'm trying open zip file on android 4.3 emulator using truezip 7.7.3 the line tarchivedetector ad = new tarchivedetector("myext", new zipdriver(iopoollocator.singleton)); throws java.lang.exceptionininitializererror caused java.nio.charset.unsupportedcharsetexception: ibm437 @ java.nio.charset.charset.forname(charset.java:303) @ de.schlichtherle.truezip.fs.archive.zip.zipdriver.<clinit>(zipdriver.java:75) ... 16 more is possible use truezip on android? need because java.util.zipfile on android old , cannot handle more 65536 files in zip archive. truezip on android platform unsupported because platform misses or used miss essential classes, e.g. java.util.serviceloader . regarding missing ibm437 character set: provider bundled truezip, serviceloader class required find , load it. may try use jardriver instead (which uses utf-8 instead of ibm437), i'm afraid run similar issues because truezip depends lot on servic...

.net - WinForms app trying to install Framework, even though it exists -

i have .net winforms app targets framework 4.0. i'm trying install app on pc not have internet access, running it, error below. an error occurred downloading following resource: http://go.microsoft.com/fwlink/?linkid=182805 i have downloaded , installed .net framework 4 client profile (standalone installer) here , app still tries download framework. seems not see 1 installed? (i created setup files vs2012 publish wizard) goto project properties , change framework .net framework 4.0 client profile .net framework 4.0

xml - How to use custom email template while sending mail in magento -

i new using magento, problem have create custom email template different kinds of email formats , these email formats should editable user admin site want send email using these custom email template. so, have created: new module emailtemplate database table name emailtemplate .phtml file in template folder it's working fine, can see template ui running module. want use template while sending email. i tried using <block type> , created observer same it's not working. please suggest me way solve same.

objective c - used memory: c-array vs. NSMutableArray -

i need store 1.000.000 double values in different arrays (during calculation run). far i'm using nsmutablearray looks memory usage huge. 1 idea use c-array in order avoid storage of objects in nsmutablearray . there way estimate memory usage of nsmutablearray vs. , c-array? (i not find information size of nsnumber -object vs. primitive double or float). thanks. it's pretty clear memory consumption of nsarray bigger of raw c array. how big difference be? well, every value in nsarray , every primitive double has wrapped nsnumber @ least 20 b added every value, bit more. one estimate can found here: memory size of classes in objective-c anyway, storing 1 000 000 values in memory bit strange. maybe better store them in file , load them when needed (e.g. using memory mapped file).

php - Restful API for CakePHP 2 -

i creating restful webservice cakephp 2 however, getting 500 internal server error since not able capture post data. rest server below: app::import ( 'vendor', 'exchangefunctions', array ('file'=> 'exchange/exchangefunctions.php')); class exchangecontroller extends appcontroller { public $components = array('requesthandler'); public function index() { $exchange = new exchangefunctions(); $data = $this->request->data('json_decode'); $exchange->username = $_post['username']; $exchange->password = $_post['password']; $emaillist = $exchange->listemails(); $response = new stdclass(); $response->emaillist = $emaillist; foreach($emaillist->messages $listid => $email) { $tempemail = $exchange->getemailcontent( $email->id, $email->changekey, t...

c# - Stop redirect page on back button click -

i'm trying remove history particular site. when i'm logout page , press button, page move in previous page want when user logout , press button on same page login page not go in previous page. i'm trying method session abandon, cache remove problem not solved. can use javascript. protected void btnlogout_click(object sender, eventargs e) { httpcontext.current.cache.remove(""); httpcontext.current.session.clear(); httpcontext.current.session.abandon(); response.redirect("../login.aspx"); } you can try using javascript: <script type="text/javascript"> //logout clears visited pages button function noback() { window.history.forward(); } noback(); window.onload = noback; window.onpageshow = function (evt) { if (evt.persisted) noback(); } window.onunload = function () { void (0); } </script>

css - How to add this code in edit template HTML option of Blogger? -

i'm using dynamic views template provided blogger blog http://www.blogmytrips.com wrote following code creating cool "follow us" option blog. <!doctype html> <html> <head> <style type="text/css"> #hide_show_container { background-color: #606c88; } #hide_show { width:100%; height:15px; font-size:12px;font-family:arial, helvetica, sans-serif; text-decoration:none; display:inline-block;text-shadow: -1px -1px 0 rgba(0,0,0,0.3);font-weight:bold; color: #ffffff; background-color: #606c88; background-image: -webkit-gradient(linear, left top, left bottom, from(#606c88), to(#3f4c6b)); background-image: -webkit-linear-gradient(top, #606c88, #3f4c6b); background-image: -moz-linear-gradient(top, #606c88, #3f4c6b); background-image: -ms-linear-gradient(top, #606c88, #3f4c6b); ba...

java - Custom Error from mysql to jdbc -

i want write stored procedure in mysql validates data before insertion table. use jdbc send custom message "zipcode not valid" java can displayed on screen. such thing possible? at first want underline @duffymo absolutely right . ...but if still want write such procedure snippet might help: delimiter ;; create procedure insert_checked_zip(zipdata int) begin if (zipdata > 0) insert mytable (zipcode) values (zipdata); elseif select 'zip invalid'; end if; end ;; delimiter ; note: checks if passed zip bigger 0 please think of doing these checks on gui level - less expensive , faster (to list 2 advantages).

regex - regular expressions to check length with multiple options -

i need validate date format, can either 11/11/11 or 11/22/2013 , i.e. year block can in yy or yyyy , complete format either mm/dd/yy or mm/dd/yyyy i've code ^(\d{1,2})\/(\d{1,2})\/(\d{4})$ and i've tried ^(\d{1,2})\/(\d{1,2})\/(\d{2}{4})$ // doesn't works, nothing and ^(\d{1,2})\/(\d{1,2})\/(\d{2|4})$ // , returns null every time ps: i'm applying javascript/jquery ^(\d{1,2})\/(\d{1,2})\/(\d{2}|\d{4})$ both \d{2}{4} , \d{2|4} not correct regex expression. have two digits , for digits separately , combine using or : (\d{2}|\d{4})

android - listfragment on click into custom list in another fragment -

when click on listfragment particular data data has shown in custom listview in second fragment.means clicked item has add in second fragment. list view not appearing.. public class myplayerfrag extends fragment { context context; customdetailadapter adapter; listview list; layoutinflater minflater; arraylist<string> title =new arraylist<string>(); arraylist<string> description =new arraylist<string>(); @override public void onattach(activity activity) { // todo auto-generated method stub super.onattach(activity); } public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // todo auto-generated method stub view v = inflater.inflate(r.layout.detail, container,false); list = (listview)v.findviewbyid(r.id.listview); return v; } public void detaildata(context applicati...

java - How do I use special characters in a dot file node_id? -

i looking forward write script automatically take input file , declare nodes , edges, , produce graph can visualized in visualization software. i tried dot language , graphviz. language uses grammar declare nodes of graph this: node1; , node2; , not allow special character except _ . it works in cases when want declare node named java.lang.object shows grammatical error because of presence of . , can't change grammar. can me suggestion other language can take input text file , can draw graph on visualization software. that's quite easy in graphviz, put quotes around node names. or may define first node using simple identifier , label attribute. both techniques demonstrated here: digraph g { "java.lang.object" -> "my.class"; "my.class" -> "special < chars >"; n1 [label="more.strange<node>names"]; "special < chars >" -> n1; }

class - Anonymous modules and classes garbage collection in Ruby -

i'd know why following code apparently doesn't garbage collect anonymous modules supposedly not referenced anywhere anymore (not extended/included, not named, containing array set nil). i'd appreciate if clarify what's going on under hood relatively simple/general programming words. there special ruby way achieve ? can't anonymous modules/classes garbage collected no matter ? or mislead memory stats got ? note : i'm using ruby 1.9.3 ; don't know if ruby 2.x change @ all... note 2 : result same whether or not module defines foo method thanks in advance. puts("initial object space objects : #{objectspace.count_objects}") = 100000 ms = [] i.times ms << module.new def foo() puts('foo method called') end end end puts("#{i} modules created") puts("object space objects : #{objectspace.count_objects}") ms = nil objectspace.garbage_collect puts("#{i} modules garbag...

ruby on rails - Conditional paperclip presence verification -

how can verify paperclip attachment not exist if field exist? tried: validates_attachment :img, presence: false, if: :some_other_field? def some_other_field? some_other_field end similar problem here, solution make comparison in def validate :check_image_with_title def check_image_with_title if !ctitle.blank? , cimage.blank? #if ctitle not empty , cimage empty, add custom error message errors.add :key, "you need image go title" return false else return true end end

c# - There was no channel that could accept the message with action 'http://schemas.xmlsoap.org/ws/2004/09/transfer/Get -

below service code using system; using system.collections.generic; using system.linq; using system.runtime.serialization; using system.servicemodel; using system.servicemodel.web; using system.text; using system.servicemodel.channels; using system.xml; namespace wcfserviceraw { // note: can use "rename" command on "refactor" menu change class name "service1" in code, svc , config file together. public class service1 : iservice1 { public message getdata() { // create body string body = ("<test>data</test>"); // create messatge messageversion ver = operationcontext.current.incomingmessageversion; message msg = message.createmessage(ver, "responsetogetdatarequest", body); //debug.writeline(msg.tostring()); return msg; } } class testdatawriter : bodywriter { string _data; ...

java - NullPointerException in HardwareRenderer -

i wish had more information error don't. have tool called bugsense (now splunk mint ) sends crashes remote server , i'm getting: java.lang.nullpointerexception @ android.view.hardwarerenderer$glrenderer.checkcurrent(hardwarerenderer.java:960) @ android.view.hardwarerenderer$gl20renderer.destroylayers(hardwarerenderer.java:1148) @ android.view.viewrootimpl.destroyhardwareresources(viewrootimpl.java:576) @ android.view.viewrootimpl.performtraversals(viewrootimpl.java:973) @ android.view.viewrootimpl.handlemessage(viewrootimpl.java:2448) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:4482) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:787) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:554) @ dalvik.system.nativestart.main(nativ...

Printing accented characters in Python 2.7 -

i'm new python. i'm trying print accented characters, this: # -*- coding: utf-8 -*- print 'éàÇÃãéèï' but when execute code, get: >> ├®├á├ç├â├ú├®├¿├» i'm using 64-bit windows 7 & python 2.7.5, have code in file.py , execute with python file.py as wooble mentioned, if change print 'éàÇÃãéèï' to print u'éàÇÃãéèï' it should work. here intro unicode in python (both 2.x , 3): the updated guide unicode

MySQL Workbench 6.0.6.11184 too slow -

i'm using latest version of mysql workbench every time try write query application freezes 10 seconds , can continue writing, did not happen version 5. there way speed mysql workbench 6? your problem wait cycles while typing might caused code completion. try switching off in preferences , see if solves problem. also, consider opening bug report ( http://bugs.mysql.com ), can take care of problem.

c++ - Not detecting members in a class -

here exact error given code::blocks d:\cpp\adventuretimetest\main.cpp|12|error: 'class adventure' has no member named 'drawmap' here code:- in main.cpp #include <iostream> #include "adventure.h" using namespace std; int main() { adventure a; a.setmapsize(10); a.drawmap(); return 0; } in adventure.h class adventure { public: adventure(); virtual ~adventure(); int mapsize; void setmapsize(int mapsize); int getmapsize(); void drawmap(); protected: private: }; and, finally, in adventure.cpp #include <iostream> #include "adventure.h" using namespace std; adventure::adventure() { } adventure::~adventure() { } void adventure::setmapsize(int par1) { mapsize = par1; } int adventure::getmapsize() { return mapsize; } void adventure::drawmap() { for(int x = 0; x <= mapsize; x++) { for(int y = 0; y <= mapsize...

Destroy dialog after closing it - jQuery Mobile -

i know if there's way can destroy dialog after closing it. , reason : have dialog dynamic content add text , buttons. when first open dialog, elements styled jquery mobile theme (e.g. buttons), but... when close , reopen second time, dynamic content, elements not styled jqm theme, normal navigator-styled elements. possible explanation : at first, when dialog isn't yet initialized, can insert whatever elements want in it, , in initialization process, jquery mobile stylize elements accordingly. , when close dialog, possible isn't destroyed , when try open it, doesn't initialize elements. how can destroy dialog , remove dom before opening again ? all had trigger create on dialog after editing content, , then open : $('#devicehistorydialog').trigger('create'); $('#linkopenhistorydialog').click();

Remove duplicate based on condition awk/bash -

i remove duplicates dataset has 3 columns a 0 3238 b 0 3367 c 0 3130 d 1 3130 i need remove lines contain duplicate values in third column, preferentially keeping value '1' in second column. know how remove duplicates using awk, can't work out how add in conditional statment. thanks give line try: awk '{if($3 in a)a[$3]=$2==1?$0:a[$3];else a[$3]=$0}end{for(i in a)print a[i]}' file

Differnece Between MYSQL(Binary) and MySql in LAMP/WAMP/MAMP -

what difference between mysql(binary) , mysql in (lamp,mamp, wamp) ? which 1 better use? on criteria should select 1 of them? regardless of operating system. of mysql better use web standalone development. if understand asking, there no appreciable difference between mysql running on windows/linux/mac environments. whichever find easiest. as windows user develop using wampserver on windows pc, gets me apache/mysql , php in 1 easy install package. normal , in many ways preferable use *nix environment implementing live website on.

c# - Bound DataGrid ItemSource retuen null or blank objects -

my datagrid 's itemsource returns empty objects or null. can case ? properties bound. while adding data, shows proper on grid, while retrieving gives null. xml <datagrid autogeneratecolumns="false" grid.row="2" height="208" horizontalalignment="left" margin="20,71,0,0" name="dgvwell" verticalalignment="top" width="528" horizontalscrollbarvisibility="visible" verticalscrollbarvisibility="visible" borderbrush="#ffb7b39d" background="lightyellow" rowbackground="lightgray" alternatingrowbackground="#fffffff5" borderthickness="10" canuserreordercolumns="false" canusersortcolumns="false" fontsize="13" canuseraddrows="false"> <datagrid.columns> <datagridtextcolumn header="layer name" width="80" binding="{binding layername}"/> ...

Use CASE in WHERE clause - Data Parameters Sql Server -

i'm trying verify example, if date null pick date field. below query: select * orderpublish op inner join advertising ad on ad.idorderpublish = op.idorderpublish inner join client cli on cli.idclient = op.idclient left join advertisinginserted aii on ad.idadvertisinginserted = aii.idadvertisinginserted left join typeproduct tp on aii.idtypeproduct = tp.idtypeproduct inner join publication pub on pub.idadvertisinginserted = aii.idadvertisinginserted tp.idtypeproduct in (5,7) , case when pub.dtini null op.dtinc >= isnull('08/18/2013', op.dtinc) else pub.dtini >= isnull('08/18/2013', pub.dtini) end , case pub.dtfinal when null op.dtinc <= isnull('08/23/2013', op.dtinc) else pub.dtfinal <= isnull('08/23/2013', pub.dtfinal) end you can coalesce() in case,...

Disable Nagios recovery notification after WARNING? -

is there way disable recoveries warning states (but keep recovery messages problem states?) we want notified when there problem service , when service recovers. happens each time service enters warning state , recovers recovery notification. thoughts? thanks. notification_options w,u,c

javascript - How to get window handle (int) from chrome extension? -

i got chrome extension , in event of new tab want window handle in windows if current window. on event got tab object , got chrome's internal window id not handle in windows. chrome.tabs.oncreated.addlistener( function (tab) { var intmainwindowhwnd = 0; // how it? not tab.windowid… }); thanks! well, if encounter same problem, solved using npapi plugin in c++ access win32api... in invoke method i've checked method (getprocessid) , got parent process (since addon in different process): ulong_ptr myaddon::getparentprocessid() // napalm @ netcore2k { ulong_ptr pbi[6]; ulong ulsize = 0; long (winapi *ntqueryinformationprocess)(handle processhandle, ulong processinformationclass, pvoid processinformation, ulong processinformationlength, pulong returnlength); *(farproc *)&ntqueryinformationprocess = getprocaddress(loadlibrarya("ntdll.dll"), "ntqueryinformationprocess"); if(ntqueryinformation...

java - Hibernate Criteria select using embedded object (tuple) -

in case have sql query looks like: select * event_instance (object_id, object_type) in (<list of tuples retrieved subquery>); i want map on hibernate entities , have problem query. mapping looks that: @entity @table(name="event_instance") public class auditevent { <other_fields> @column( name = "object_type", nullable = false) private string objecttype; @column( name ="object_id" , nullable = false) private integer objectid; } and second entity: @entity @table(schema = "els" ,name = "acg_objects") public class acgobject implements serializable{ @id @column(name = "acg_id") private string acgid; @id @column(name="object_type") private string objecttype; @id @column(name="object_id") private integer objectid; <other...

paperjs - How can I combine animations in onFrame? -

my goal make wave segments move bottom of screen top, while animating wave. code i'm using make wave comes paperjs.org: http://paperjs.org/tutorials/animation/creating-animations/#animating-path-segments ideally, i'd close path points stay anchored bottom left , right of viewport. can fill wave solid color. simply add points path before , after for-loop generates evenly distributed segments: path.add(new point(0, 1) * view.size); // add 5 segment points path spread out // on width of view: (var = 0; <= amount; i++) { path.add(new point(i / amount, 1) * view.size); } path.add(new point(1, 1) * view.size); this give points anchored bottom of view. account new segments, change loop in onframe function read: for (var = 1; <= amount+1; i++) {

c++ - Best practices for functions with multiple Eigen objects as parameters -

i find design of functions eigen objects parameters cumbersome. while information in eigen documentation helpful, suggests awkward approach template arguments. suppose, want write geometric routine line-plane-intersection. simple , transparent approach be: template<typename _tp> bool planelineintersect(const eigen::matrix<_tp, 3, 1>& planepoint, const eigen::matrix<_tp, 3, 1>& planenormal, const eigen::matrix<_tp, 3, 1>& linepoint, const eigen::matrix<_tp, 3, 1>& linedir, eigen::matrix<_tp, 3, 1>& intersectionpoint) this looks relatively pleasing , looks @ can learn every parameter shall 3d vector of same type. however, directly, not allow eigen expressions of kind (we have call eigen::matrix constructors every expression, use). if expressions used this, need create unnecessary temporaries. the suggested solution is: te...

iphone - Objective-C Class initializing or singleton -

in program should initialize class in several modes without creating new instance. possible? maybe singletons? want have 1 instance , and calling init method more 1 time. tell me if possible?like this: [[myobject sharedobject] initwithmode:mode1]; and later: [[myobject sharedobject] initwithmode:mode2]; a singleton not going here precisely because shared instance. if objecta inits in mode 1, , objectb won't able init in mode 2. if objectb could, changes context in objecta expecting work singleton , lead unexpected behavior. there couple ways manage this, without knowing more of trying accomplish, suggest subclasses of each mode distinct instantiations of classes.

android - Gradle + Robolectric: Where do I put the file org.robolectric.Config.properties? -

i'm trying setup test using robolectric click on menu button in this repository . basic robolectric tests run, i'm not able run project-specific test using resources because says can't find androidmanifest.xml. after running ../gradlew clean check , here's standard output robolectric html file: warning: no manifest file found @ ./androidmanifest.xml.falling android os resources only. remove warning, annotate test class @config(manifest=config.none). i found these instructions indicate should create org.robolectric.config.properties file, i'm not sure put it. i've tried everywhere, pretty much, , despite moving file, path in error message same above (./androidmanifest.xml). makes me think build process has never picked settings in file org.robolectric.config.properties . i tried @config(manifest="") directive gave me cannot find symbol error. if move androidmanifest.xml project directory, error not being able find path ./res/values , ...