Posts

Showing posts from September, 2013

html - Unwanted space around custom fonts -

Image
i'm trying use custom font website of @font-face kit. theres unwanted space inside tag. i've used h1 tag. changing tag doesn't help. take @ picture. in chrome , others, theres lot of space on top. in ie space below. solution this? code - @font-face { font-family: 'kozukalight'; src:url('fonts/kozgopr6nlight.eot'); src:url('fonts/kozgopr6nlight.eot?#iefix') format('embedded-opentype'), url('fonts/kozgopr6nlight.woff') format('woff'), url('fonts/kozgopr6nlight.ttf') format('truetype'), url('fonts/kozgopr6nlight.svg#kozukalight') format('svg'); font-weight:normal; font-style:normal; } h1 { font: 60px 'kozukalight', helvetica, arial, sans-serif; text-shadow: 0 1px rgba(255,255,255,0.5); color: #383838; } <body> <h1>news , events</h1> </body> this got nothing custom font. <h1> has default margin have rid of it: h1

Cocos2d Game Crashes -

Image
i used cocos2d 2.1 beta. when run keep idle few minutes game crashes in same place every time. please see attach image. how can solve crash. nothing in game..simple background few menu buttons. this happens in simulator only, every time. run on device..

.cmd file get relative path when running file on a server -

i have cmd file contains following command: start h:\applications\mystoreapp\application.exe the file location in h drive (this mapped shared drive) in folder mystoreapp. want make cmd resolve it's location relatively this: start .\application.exe i'm getting error since cannot resolve on remote host. is there anyway solve without having enter specific location of file including mapped network drive? %~dp0 path actual script directory ( %0 script itself). considering h:\applications\mystore\app\launcher.cmd @echo "%~dp0application.exe" "h:\applications\mystoreapp\application.exe" or, heavy use : @set $root=%~dp0 @rem remove last backslash @set $root=%$root:~0,-1% @start "app" "%$root%\app.exe" /config "%$root%\app.ini" /log "%$root%\app.log" quotes required in case of spaces in folder name. for more information parameter extensions, see ss64.com .

e-mail address not shown in proper format like myname@mycompany.com -- PHP -

i trying code php script, wherin trying send mail specified email address collect post variables java. @ first able send mails on email used warning like: message may not have been sent by: xxx@gmail.com learn more report phishing. came know need have email associated domain name, after getting 1 mails not sent warning, email address sending neither displayed , mydomainname@rsb29.rhostbh.com. how can fix this? below php script: $email = $_post["email"]; $pass = "0"; $pass = mysql_query("select password `seller` email = '$email'"); $myrow = mysql_fetch_array($pass); if ($pass){ $to = $email; $subject = "no reply, carlist password request"; $message = "hello! \n in response request password. \n\n\re-mail id: ".$email."\n\rpassword: " .$myrow[password] . "\n\n\n\r if you've received mail in error, it's user entered email

noclassdeffounderror - Android JExcel API NoClassDefFound error -

i using jexcel in android project, when ever try , run line of code: workbooksettings wbsettings = new workbooksettings(); it crashes , error ' noclassdeffound: jxl.workbooksettings', i understand error means confuses me jxl.jar added 'libs' folder, referenced libraries , i've added projects build path, have attached source .jar , checked class in .jar manually i'm @ bit of loose end here?

sql - Query to arrange rows horizontally -

Image
i have 2 tables need join , produce third table columns arranged horizontally. tables follows: i need output 2 table1 , table2 . i did research , found need use pivot . wrote query also. query select * ( select convert(char(4), table_2.date, 100) + convert(char(4), table_2.date, 120) registrationdate, table_1.pdesc productdescription table_2 left outer join table_1 on table_1.pid = table_2.pid ) tablet pivot (count(productdescription) registrationdate in ([jan 2009],[feb 2009],[mar 2009],[apr 2009],[may 2009],[jun 2009])) pvt but query not working! have attached sql script create tables. i have uploaded script here . the problem attempting both count , display productdescription . if want display productdescription there few different ways can this. instead of applying count productdescription , can count pid column: select * ( select convert(char(4), t2.date, 100) + convert(char(4), t2.date, 120) registrationdate, t1.produc

localization - TYPO3, select from localized table -

i created localized table. when adding translations go table new uid. have checked other localized extension, seems right. example: localized entries in table gives not translations entries in table new uid tysk (uid 1, danish , default language) -- german (uid 7, english translation of "tysk") -- deutch (uid 13, german translation of "tysk") now have concern: when tre persons denmark, england , germany sign in german, sign uid 1, uid 7 , uid 13... prefer if signed default language. else difficult generate list of users signed language if each language exist own uid each translation. what have missed? som exec_select_localized function? you 100% correct every translation new record (= new uid) in same table. have done right. for frontend can use $globals['tsfe']->sys_page->getrecordoverlay('tx_mytable', array('uid' => 1)); original record (with result of record in exec_selectquery()), or in typo3 back

linux - usb_modeswitch is hangs on manual switch -

i have 3.2.27 linux kernel busybox . using raspberry pi . when pluging huawei e303c dmesg showing [ 4.569781] usb 1-1.2: new high-speed usb device number 5 using dwc_otg [ 4.681078] usb 1-1.2: new usb device found, idvendor=12d1, idproduct=14fe [ 4.690885] usb 1-1.2: new usb device strings: mfr=2, product=1, serialnumber=0 [ 4.701143] usb 1-1.2: product: huawei mobile [ 4.708326] usb 1-1.2: manufacturer: huawei [ 4.718185] scsi0 : usb-storage 1-1.2:1.0 [ 4.726518] scsi1 : usb-storage 1-1.2:1.1 [ 5.720951] scsi 0:0:0:0: cd-rom huawei mass storage 2.31 pq: 0 ansi: 2 [ 5.738561] scsi 1:0:0:0: direct-access huawei sd storage 2.31 pq: 0 ansi: 2 [ 5.755514] sd 1:0:0:0: [sda] attached scsi removable disk the option kernel module running usb-storage module not running. when enter usb_modeswitch -v 0x12d1 -p 0x14fe -h it's hangs looking default devices ... found default devices (1) accessing device 002 on bus 002 ... usin

Trouble with figure output in matlab -

i try figure large data file (about 400 mb) using matlab 2010b on windows 7 x64 ultimate. here code function psi12 op = load ('20_01_w=0-021_op_ksi1.txt'); z=op; tt=length(z); x=linspace(0,20,41); t=linspace(0,0.01*tt,tt); contourf(x,t,z) xlabel('x','fontsize',24) ylabel('t','fontsize',24) title(['v = 0.1, \omega = 0.021'],'fontsize',20) but after launch code first obtain figure white background. , after long waiting (about 3-4 hours) have desired contour plot. further editing of figure practically impossible, because long response commands in figure menu observed. it's interesting larger data files (about 900 mb or 1 gb) contour plot faster (within 10-15 minutes) , can edit figure without problems response figure menu. do know solution of problem? beside dan suggested, thing should load data directly z: z = load ('20_01_w=0-021_op_ksi1.txt');

javascript - How to call a method of view from controller in ExtJs -

i have method in view of application, wrote method there, method working fine need call method controller here code... listeners:{ itemmousedown : function(obj) { alert(obj.storeitem.data['name']+ ' &' + obj.storeitem.data['data']); } }//this method in view & itemmouseup: function(item) { }// controller section, have call method please ..

javascript - Jquery Tooltip .position on form items not working -

my tooltips dont seem working correctly, have made small fiddle , tried out other options cant seem work, form has around 50 form fields have added 4 onto fiddle. i tooltips align right of form field , not mess when re entering form field. http://jsfiddle.net/h2fws/ please out if know how :) here code: jquery(document).ready(function(){ jquery(".information").hide(); jquery("#info_starttip").show(); jquery(".textbox").focus(function(){ jquery(".information").hide(); var getid = this.id; jquery("#info_"+getid).position({ of: this, my: "right top", at: "right top", collision: "fit" }).show(); }); }); try this: http://jsfiddle.net/h2fws/3/ jquery(".information").hide(); var getid = this.id; jquery("#info_" + getid).show().position({

shuffle two arrays in same order in javascript -

i have 2 arrays var skladby=["skladba00", "skladba01", "skladba02", "skladba03"]; var zoznam=["text00", "text01", "text02", "text03"]; i randomize/shuffle 2 arrays in same order items in arrays on [0] position must stay on positions. i.e. var skladby=["skladba00", "skladba02", "skladba03", "skladba01"]; var zoznam=["text00", "text02", "text03", "text01"]; thx answers. to change arrays in place, shuffled order first , add new arrangements end of existing arrays. then splice out index 1 new arrangement begins (the original length). the elements @ index 0 not affected. var skladby= ["skladba00", "skladba01", "skladba02", "skladba03"]; var zoznam= ["text00", "text01", "text02", "text03"]; var i=0, len= skladby.length, ne

playframework - Play cannot resolve org.alfresco:alfresco-web-service-client dependency -

i new play framework , have application need access alfresco. build.scala file object applicationbuild extends build { val appname = "librarian" val appversion = "1.0-snapshot" val appdependencies = seq( javacore, javajdbc, javaebean, "org.alfresco" % "alfresco-web-service-client" % "4.2.c" ) val main = play.project(appname, appversion, appdependencies).settings( lessentrypoints <<= basedirectory(_ / "app" / "assets" / "stylesheets" ** "main.less"), resolvers += "alfresco repository" @ "http://maven.alfresco.com/nexus/content/groups/public" ) } when run play compile not resolve alfresco dependency , gives following error. [info] loading project definition d:\projects\play\librarian\project [info] set current project librarian (in build file:/d:/projects/play/librarian/) [info] updating {file:/d:/projects/pla

ruby on rails - How do I search for a word in a string which is in an array with different combinations? -

i have an array like: ["rob meyer", "michelle preston"] i want search occurrence of rob or rob, or meyer or meyer , on, "word" in array, no characters words , not case sensitive. so how do that? include? looks exact match. looking more flexible here. is looking for? query = 'rob' ["rob meyer", "michelle preston"].any?{|e| e =~ /\b#{query}\b/i}

database - HDF vs NoSQL solutions -

hi in scientific data stored in hdf5 format , wondering if there nosql solution reach same performance in read/write hdf5 . the data of example use tree architecture ( /root /root/key /root/key/data_key ) possible find open source nosql solution use double key querying (oracle nosql offer possibility primary , minor key )? if have idea or opinions subject in general not hesitate share them ! thank . performance comparison depend on access pattern. difficult provide numbers general case. if have graph structure , want query try use graph database (i.e. neo4j ). (how deep hierarchy/tree structure?) you can think splitting data raw part , meta-information part. meta-information part can stored in nosql/rdbs database , raw data in hdf5 files.

javascript - Fastest method for testing a fixed phone number pattern -

so, challenge trying detect if string matches fixed phone number pattern, simple string pattern. the pattern is: ddd-ddd-dddd where "d "represents decimal digit , minus symbol represents itself, "-" the patterns used testing are, can increased if felt there not enough patterns debunk incorrect format. "012-345-6789" "0124-345-6789" "012-3456-6789" "012-345-67890" "01a-345-6789" "012-34b-6789" "012-345-678c" "012" the goal , answer seek, find method executes fastest return boolean true means pattern , false means pattern bad. here current solution function matchespattern(pattern) { if (pattern.length !== 12) { return false; } var = 0, code; while (i < 12) { code = pattern.charcodeat(i); if (i > 8 || % 4 !== 3) { if (code < 48 || code > 57) { return false; }

vb.net - Call to LotusSession.GetDatabase works in VB but not in C# -

i have old vb code send mails using lotus notes works, have re-written c#, behaves differently: vb: notessession = createobject("notes.notessession") notesdb = notessession.getdatabase("", "") c#: _notessession = new notessession(); _notessession.initialize(passwordstring); _notesdatabase = _notessession.getdatabase( "", ""); first of in c# need initialize notessession password, , secondly not accept empty string parameters @ runtime. exception thrown: "a database name must provided". in both vb , c# refer same com : lotus domino objects i need able call getdatabase without specifying server , database file. thanks in advance. solution (thanks guys): dynamic _notessession = activator.createinstance(type.gettypefromprogid("notes.notessession")); _notesdatabase = _notessession.getdatabase("", ""); this way have no intellisense properties , meth

javascript - Dynamicaly add images in DIV one by one -

in have 9 images , want write jquery code add first 3 , last 3 images selected image .suppose user clicks on 4 add 1,2,3 1 class , 5,6,7, class how this.i tried following add prev. t.prevall().addclass('t1'); t.nextall().addclass('t2'); thanks , regards, you can use :lt selector: t.nextall(':lt(3)').addclass('t2'); t.prevall(':lt(3)').addclass('t1'); http://jsfiddle.net/lvm3t/ update according comment: if want select 2 first elements, can use slice method: $('#container img').slice(0, 2);

objective c - Resize on rotation -

i trying put uiscroll view on page fills page minus 10px margin around edge. have done. however, want uiscrollview resize device rotated, keeping 10px margin. code far is: // screen dimensions, considering status bar scrollwidth = self.getscreensize.width // evaluates 1004 in landscape & 748 in portrait scrollheight = self.getscreensize.height // evaluates 728 in landscape & 984 in portrait scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(10,10,scrollwidth,scrollheight)]; [scrollview setautoresizingmask:uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight]; ... other stuff load scrollview content ... [self.view addsubview:scrollview]; when launch app, scrollview wider page, irrespective of orientation launch in. removing [scrollview setautoresizingmask..... line makes scrollview fit perfectly, doesn't react device rotation. what doing wrong? use shouldautorotatetointerfaceorientation detect when screen going rotate, , change

ruby - How do I add a cumulative sum to an array for only one value? -

i have array of arrays x , y values: [[some_date1, 1], [some_date2, 3], [some_date3, 5], [some_date4, 7]] the result should sum y values (1, 3, 5, 7) result this: [[some_date1, 1], [some_date2, 4], [some_date3, 9], [some_date4, 16]] how possible in ruby? yes, possible in ruby. can use [map][1] , this: sum = 0 array.map {|x,y| [x, (sum+=y)]} this how works. given input: array = ["one", 1], ["two", 2] it iterate through each of elements in array e.g.) first element ["one", 1] . it take element (which array itself) , assign variable x first element in array e.g.) "one" , y second e.g.) 1 . finally, return array result this: => ["one", 1], ["two", 3]

mysql - How to change all table prefix in a single query -

i pretty amateur in mysql..can please tell me how can change table prefixes of whole database in single query... can manually, quite time consuming change tables prefixes. please me out. isc_administrator_log cus_administrator_log means isc_ cus_ i found these 2 solutions not understand either of them. select group_concat('rename table `', table_schema, '`.`', table_name, '` `', table_schema, '`.`prefix_', table_name, '`;' separator ' ') `tables` `table_schema` = "test"; and select concat('rename table ', group_concat('`', table_schema, '`.`', table_name, '` `', table_schema, '`.`prefix_', table_name, '`')) q `information_schema`.`tables` table_schema='test'; you can dynamic sql query mysql 5.0.13 delimiter // create procedure dynamic(in tbl char(64), in col char(64)) begin set @s = concat('select 'rename table ',

java - Styling a JavaFX 2 button using FXML only - How to add an image to a button? -

Image
i want change styling of button, of threads here , articles on internet show how using java code, don't see real solution, there way example set button text , image inside using fxml (no css) ? solution using fxml as tarrsalah points out, css recommended way of doing this, though can in fxml if prefer: <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.control.*?> <?import javafx.scene.image.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.paint.*?> <?import javafx.scene.text.*?> <anchorpane id="anchorpane" maxheight="-infinity" maxwidth="-infinity" minheight="-infinity" minwidth="-infinity" prefheight="400.0" prefwidth="600.0" xmlns:fx="http://javafx.com/fxml"> <children> <button layoutx="104.0" layouty="81.0" mnemonicparsing="false" text="love&#10;potion&qu

zend framework - Magento create nested categories programmatically and recursivelly -

is there way create nested categories using string like: category 1/category 2/category 3/category 4/ a such of method me create them in easy way. i have base method: public function createcategories($categories, $parentid=2){ $arrcategories = explode("/", $categories); foreach($arrcategories $category){ $category = new mage_catalog_model_category(); $category->setname($category); $category->setisactive(1); $category->setdisplaymode('products'); $category->setisanchor(0); $parentcategory = mage::getmodel('catalog/category')->load($parentid); $category->setpath($parentcategory->getpath()); $category->save(); } } but how create recursively function? i have grouped them in array: array(2) { [1] => array(3) { [0] => string(9) "ping pong" [1] => string(19) "accessori ping pong" [2] => s

fonts - How do I get my text to be both bold and italic in iText? -

i trying make text both bold , italic @ same time paragraph in pdf document using itext. i can use either of these bold , italic respectively, not both simultaneously: font font = new font(font.fontfamily.times_roman, 10, font.fontstyle.bold.ordinal()); font font = new font(font.fontfamily.times_roman, 10, font.fontstyle.italic.ordinal()); how can use both? try font font = new font(font.fontfamily.times_roman, 10, font.bolditalic);

excel - PivotTable FormatConditions ScopeType is causing 1004 -

this question exact duplicate of: conditional formatting pivottable report 1 answer a 1004 error occurs @ end of sub, when trying set scopetype. want formatcondition apply active rows in current column, thought it. sub createpivot() ' define rngtarget , rngsource range type variables dim rngtarget range dim rngsource range dim intlastcol integer dim intcntrcol integer dim ws1, ws2 worksheet dim pt pivottable dim cf formatcondition set ws1 = thisworkbook.sheets("sheet1") set ws2 = thisworkbook.sheets("sheet2") ws2.cells.clear ' rngtarget pivottable created (ie: sheet2, cell b3) set rngtarget = ws2.range("b3") 'set rngtarget = thisworkbook.worksheets("sheet2").range("b3") ' rng

forms - Ho to merge Six datatable into one and show date in datagridview without database -

i have 6 datatable myclass1 mc = new myclass1(); datatable dt = mc.getnumber(list); datatable dt1=mc.getpnr(list); datatable dt2 = mc.getdetail(list1); datatable dt3 = mc.getdetail1(list1); datatable dt4 = mc.getdetail2(list1); datatable dt5 = mc.getdetail3(list1); mc object of class used call function class on click event of button now want when click on button data in datatable 1 datatable , bind datatable datagridview when click on button can view details in datagridview comes function created in class. i use merge didn't work search lot on google didn't want came here hope clear.

c++ - NAT-Traversal implementation for P2P connection -

Image
i need implement simple p2p application behind nats. should send data on reliable , secure connection (encrypted data on tcp). theoretical background know there several nat-traversal techniques (for example session traversal utilities nat) described in several rfcs (5389, 5769, , 5780). though in practice can't find needed tools/libraries implement such system (preferably in c++ programming language). found googling around blindly: ice , turn , libnice , libjingle , stuntman below image describes should like. have vps valid ip address, pc behind nat , sensor behind nat. have private ips. want sensor connect server, find monitor , send connection request it. after connection establishment, relay server should not used direct traffic of data. want sensor , monitor use path communicate: sensor <--> ap0 <--> r3 <--> {the internet} <--> r2 <--> monitor currently data transmitted through vps: sensor <--> ap0 <--> r3 <--> {the

newbie Django form not valid -

i have form.py : class specform(modelform): = doctors_list.objects.values_list('specialty', flat=true) specialty = forms.modelchoicefield(queryset=a) class meta: model = doctors_list and views.py : from django.shortcuts import render_to_response testapp.forms import specform def specform (request): if request.method == 'post': form = specform(request.post) if form.is_valid(): form.save() else: form = specform() return render_to_response('hello.html', {'form':form}) when run folowing error: specform() takes 1 argument (0 given) , suposse it's because considers form not valid, why? how fix it? my models.py: class doctors_list(models.model): name = models.charfield(max_length=30) specialty = models.charfield(max_length=15) hp_id = models.manytomanyfield(health_plan) location = models.charfield(max_length=15) def __unicode__(self): return se

c# - Is there a publicly accessible event to mark a ModalDialog close? -

i made custom ribbon in sitecore. 2 buttons in fire off command activate xaml application using sheerresponse.showmodaldialog . these applications effect state of database being read component on ribbon. i either need able fire custom event or function xaml application make other ribbon component, or need able make component on ribbon aware needs re-render when modaldialog s close. don't see obvious events this, , i've gone far can when looking through raw code dotpeek , haven't seen looks promising. apparently, answer there whole time , had missed it. sheerresponse has 5 parameter version of showmodaldialog accepts boolean final parameter. means can couple clientpage.start : context.clientpage.start(this, "run", kv); } private void run(clientpipelineargs args) { var id = args.parameters["id"]; if(!args.ispostback) { string controlurl = string.format("{0}&id={1}", uiutil.geturi("control:al

java - JFrame Not Disposing -

i attempting dispose jframe on button click. however, when click button executes except jframe doesn't close! why this? problem jframe opening directly after it? public static void login() { jframe loginframe = new jframe(); jpanel loginpanel = new jpanel(); jbutton loginbutton = new jbutton("login"); jlabel usernametext = new jlabel("username:"); jlabel passwordtext = new jlabel("password:"); final jtextfield usernamefield = new jtextfield(15); final jtextfield passwordfield = new jtextfield(15); status.setforeground(color.red); new loginbackground(); loginpanel.add(usernametext); loginpanel.add(usernamefield); loginpanel.add(passwordtext); loginpanel.add(passwordfield); loginpanel.add(loginbutton, borderlayout.center); loginpanel.add(status); loginframe.add(loginpanel); loginpanel.add(loginbackgroundlabel); loginframe.add(loginpanel); loginframe.repaint(); lo

c# - Hashing and GetString/GetBytes issue -

i have below code hash/store/retrieve data passwords first unit test , fails. i beleive encoding causing problem because when getbytes called returns byte[38] , byte[36] when should 20 think. i have convert string i'm storing in database. any ideas? thanks [fact] public void encryptdecryptpasswordshouldmatch() { string password = "password"; string passwordkey = string.empty; string passwordsalt = string.empty; helpers.createpasswordhash(password, out passwordsalt, out passwordkey); assert.true(helpers.passwordsmatch(passwordsalt, passwordkey, password)); } public static bool passwordsmatch(string passwordsalt, string passwordkey, string password) { byte[] salt = encoding.utf8.getbytes(passwordsalt); byte[] key = encoding.utf8.getbytes(passwordkey); using (var derivebytes = new rfc2898derivebytes(password, salt)) { byte[] newkey = derivebytes.getbytes(20); // derive 20-byte key if (!newkey.sequenceeq

How to traverse git repository at the lower level (than git log) -

wanted know how go through list of commits (or single branch) in git. how git log (pointers part of codes cool too, don't know start)? can on raw filesystem somehow? reasoning is: need write tool in other language doesn't need call system command. update: i've read git internals: git objects (and following chapters), understand there packfiles. main problem have understand what's going on when run: git rev-list --all . or - single branch - same command without --all flag. git figures out head, pulls it's object store, checks parents' shas, pulls object store , one? or there other, faster method? not sure if have come across this: libgit2 : https://github.com/libgit2/libgit2 libgit2 portable, pure c implementation of git core methods provided re-entrant linkable library solid api, allowing write native speed custom git applications in language bindings. its open source, browsing through code, should give valuable inputs.. e.g: c

html - d3 Adding cells to an existing table -

i'm having problems getting work. have existing html table , use d3 append data table. here's html table: <table> <thead> <tr id="table_header"> <th>header 1</th> <th>header 2</th> <th>header 3</th> <th>header 4</th> <th>header 5</th> <th>header 6</th> </tr> </thead> <tbody id="data_table"> </tbody> </table> for want append additional headers use d3 <script> d3.json("data.php", function(monthly_growth) { d3.select("#table_header").selectall("th").data(monthly_growth).enter().append("th").text(function(d) {return d.month;}); }); </script> i hope isn't hard understand without having actual data available. data set has values every month next several years. want create new header ea

c++ - Custom comparator (ordering) as a (multi)map ordering parameter? -

my question in many ways similar one: pass custom comparator through function , tried solution proposed there, , not work. in nutshell, have method keeps several sorted structures , performs several comparisons, on elements of type int , all using same ordering . ordering determined when method called . the intended call like: myfunction(std::greater<int>()); first, tried declaring function as: void myfunction(binary_operator<int, int, bool> order); but, per this explanation , binary_function not suited act base class in function calls. finally, i tried suggestion this answer (and many other sites), suggested using templates . but, still can not code compile. the minimal non-working example: template <typename comparator> void myfunction(comparator order){ if (order(1,2)){ // stuff // compiles ok } std::vector <int> vectosort; // ... initialize std::sort(vectosort.begin(), vectosort.end(), order); // works // compi

WPF prevent dynamic grid contents from stretching beyond parent size -

have usercontrol must never exceed 700px in width. have set it's maxwidths 700px. inside grid - 3 columns. first , second column have labels, third column input fields. label contents dynamic based on language. what trying let input fields in column 2 wide possible once labels in column 0 , 1 contents dynamically when control loaded. i've set: 1) minimum width on column 2 make sure input fields don't hidden if labels in column 0 , 1 wide. 2) set column 2 width="*" let input fields use width available when labels set. 3) columns 0 , 1 width="auto" let them grow needed accommodate labels. now have problem - if either column 0 or 1 gets text long, entire gird starts expanding beyond maximum size of it's container, , third column gets cut off. there way stop that, without setting maxwidth on columns 0 , 1? no, not really. if don't want labels cut off , don't want grid expand passed parent, 2 options set max width on c

cordova - Sencha Touch 2.2: list items render on top of each other in android phonegap app -

Image
i'm experiencing weird issue on every third launch or of sencha touch 2.2 android phonegap app list items render on top of each other. drag list bit sorts out. tried bunch of things: changing configs on list, removing custom css, adding scroll function scrolls down , again after list has finished rendering, no avail. any ideas? update: better description of setup. the list inside of navigationview which, in turn, inside slidenavigationview (github.com/wnielson/sencha-slidenavigation). the store set on initialization of list view. list definition (a little bit simplified): ext.define('labblistan.view.lablist', { extend: 'ext.dataview.list', xtype: 'lablist', requires: [ 'labblistan.controller.searchcontroller', 'ext.util.delayedtask', 'ext.plugin.pullrefresh', 'ext.segmentedbutton'], id: 'lablist', config: { grouped: true, infinite: true, usesimpleitems: true, variableh

c# - How do I tell RhinoMocks to return the same object passed as parameter -

i'm using rhinomock unit testing , want know how set particular method returns same object received parameter. this interface want mock: public interface iitemrepository { item craete(item item); } i want set rhinomocks in such way every time create method called, mocked stub return same object passed parameter. this test initialization method: [testinitialize] public void crateservicewithmockrepository() { var stubrepository = mockrepository.generatestub<iitemrepository>(); // ... how set-up stubrepository described above ... // create target service unit test this.targetservice = new servicexyz(stubrepository); } you can use do , pass delegate execute when method called: stubrepository.stub(r => r.create(null)).ignorearguments() .do(new func<item, item>(item => item));

c++ - QT - QGraphicsScene doesn't show properly (z-buffer?) -

this simple code generating chessboard. first added rects acting place figure. next, qpixmap, containing png of figure displayed over. don't see figures, because under rects. if put comment lines adding rect (scene->addrect...) looks fine. why? painting in order in wich items should displayed. for (int column = 0; column < 8; column++) { if ((row + column) % 2) { scene->addrect(row * 50, column * 50, 50, 50, greypen, greybrush); } else { scene->addrect(row * 50, column * 50, 50, 50, whitepen, whitebrush); } int figure = chessboard->getfigureonpos(row, column); if (figure == dama::chessboard::dama_black) { qgraphicsitem * item = scene->addpixmap(dama_black); item->setpos(column * 50, row * 50); } else if (figure == dama::chessboard::dama_white) { qgraphicsitem * item = scen

java - why getting wrong answer when using Collections.binarySearch() -

public class binarysearchcollections { public static void search(list<string> list) { list.clear(); list.add("b"); list.add("a"); list.add("c"); system.out.println(collections.binarysearch(list, "b")); system.out.println(list); } public static void main(string[] args) { list<string> lis = new arraylist<string>(); binarysearchcollections bs = new binarysearchcollections(); bs.search(lis); } } here getting ans -3 (as telling me @ location going added) have b in list. your original list isn't sorted, binary search going give nonsense answer. imagine steps takes: "is b > a? yes, higher." "is b > c? no, can't go lower, insert @ index 2 (aka return -3.)" if want binary search work, give list on can take meaningful steps, , give correct answer.

java - Error using JMS Transaction - javax.jms.IllegalStateException: The session is closed -

i using jms polling poll jms queue every 5 minutes using below code. in below code, have set polling frequency 1 minute testing. polling working fine throwing below exception in logs. not able figure out why doing this. tried play around changing settings not figure out. please me resolving issue. <jms:connector name="jmsconnector" jndiinitialfactory="${jndi.initialfactoryclass}" connectionfactoryjndiname="${jndi.connectionfactoryname}" jndiproviderurl="${jms.brokerurl}" username="${jms.username}" password="${jms.password}" persistentdelivery="true" maxredelivery="2" numberofconcurrenttransactedreceivers="5" disabletemporaryreplytodestinations="true" specification="1.1" /> <service-overrides transactedmessagereceiver="com.mulesoft.mule.transport.jms.transactedpollingjmsmessagereceiver"/> <jms:inbound-endpoint queue="${jms

upload video to youtube from android using google-api-java-client 1.14.1 or ytd-android-0.2 -

further earlier question not answered using youtube data in android project my goal upload youtube video, , after url, search key developer. i spent 3 days , not found yet aworking code android. i try code appears superior : how upload video youtube in android? that link file https://code.google.com/p/ytd-android/downloads/list but recive toast write : "request made myytddomain failed. please make sure have correct domain" i chack cuple time, myytddomain right... and in locate error 05-02 20:01:37.889: e/adreno200-es20(128): <qgl2drvapi_gluseprogram:1318>: **** 293: gluseprogram(6) 05-02 20:01:38.279: e/androidruntime(6775): fatal exception: main 05-02 20:01:38.279: e/androidruntime(6775): java.lang.runtimeexception: unable start activity componentinfo{android/android.accounts.grantcredentialspermissionactivity}: java.lang.nullpointerexception 05-02 20:01:38.279: e/androidruntime(6775): @ android.app.activitythread.performlaunchactivity(

TYPO3: Howto share session / cookies between domains (one for each language )? -

i wonder if there's way tell typo3 share sessions / cookies between different domains? we wrote extbase extension on multi language / multi domain site. store search words search form in user session. if user switches page language, should same results before - without need re-fill search form. one way tell browser store several cookies @ same time - 1 each domain/language. how can achieved typo3 / extbase? by default, there no way set cookies different domain - not or without typo3. security measure implemented in every browser (or want me set / read cookies yourbank.com when visit web site? ;-)) you have create helper script you. 1 way be: example.com loaded this page includes iframe php script (or typo3 site, e.g. eid) on example.org parameter storing being session id the script loaded example.org reads parameter , sets cookie session id (or whatever parameter want transfer). afterwards cookie available when browsing example.org i have never tried thi

php - Grabbing information from multiple tables -

Image
currently able pull recipe name recipe table want able grab ingredients required ingredients table. know it's joins i'm new joins. this ingredients table this recipeingredients table, has 2 primary keys able assign multiple ingredients 1 recipe this recipe table this search script <?php $query = $_get['query']; // gets value sent on search form $min_length = 3; if(strlen($query) >= $min_length){ $query = htmlspecialchars($query); $query = mysql_real_escape_string($query); // makes sure nobody uses sql injection $raw_results = mysql_query("select * recipes (`recipename` '%".$query."%') or (`ingredients` '%".$query."%')") or die(mysql_error()); if(mysql_num_rows($raw_results) > 0){ // if 1 or more rows returned following while($results = mysql_fetch_array($raw_results)){ // $results = mysql_fetch_arr

image - Geoserver SLD styling issue with external graphics and attribute rules -

i creating sld geoserver wms layer. sld validates without error icons not show in map. using attribute based rules compare strings have correct image show correct feature. here code , help! <?xml version="1.0" encoding="iso-8859-1"?> <styledlayerdescriptor version="1.0.0" xsi:schemalocation="http://www.opengis.net/sld styledlayerdescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <namedlayer> <name>upper shore image points</name> <userstyle> <title>vendor points</title> <featuretypestyle> <rule> <name>famers market</name> <title>all farmers markets</title> <ogc:filter> <ogc:propertyislike wildcard="*" singlechar="." escape=&q

Collect exception reports in Java application -

i'm maintaining desktop java application has small medium user base. pretty useless mails saying "something went wrong" , i'm left digging through source code, unable reproduce problem. now i'm wondering if there library allow me collect exceptions when happen, present small dialog users , if/when agree, post stack trace webserver. i'm looking similar application crash report android (acra) , desktop java applications. if using slf4j , logback, can configure appender send detailed error reports ctrlflow automated error reporting server (which offers filtering , aggregation of incoming reports + dashboards + email digest). blog post has information on how configure logback accordingly. if want present user confirmation dialog first, may have extend existing appender, though – unless “desktop java application” “eclipse rich client platform applications.” in case work has been done you. see webinar more information.