Posts

Showing posts from April, 2015

c# - Binding Data To WebBrowser -

c# - Binding Data To WebBrowser - i'm binding info list view, , need display html string in web browser. how this? list: <listbox margin="0,0,-12,0" itemssource="{binding}" name="postslist"> <listbox.itemtemplate> <datatemplate> <stackpanel margin="0,0,0,17" width="432"> <textblock text="{binding path=name}" textwrapping="nowrap" style="{staticresource phonetextsubtlestyle}"/> <textblock text="{binding path=content}" textwrapping="wrap" margin="12,-6,12,0" style="{staticresource phonetextnormalstyle}"/> <phone:webbrowser source="{binding path=webcontent}" margin="12,-6,12,0" /> </stackpanel> </datatemplate> </listbox.itemtemplate> </listbox> tia, ng93 c# windows-phon...

SVN : How to fix a commit erroneously made to the trunk instead of to a branch? -

SVN : How to fix a commit erroneously made to the trunk instead of to a branch? - i created maintenance/bug-fix branch in our svn repository, in order create stable releases while introduce new features on trunk. branch called "4.2.x" now, 1 developper of team didn't switch working re-create 4.2.x branch , commited changes trunk. these changes should in 4.2.x branch along other bug fixes , little changes, shipped client in next 4.2 release. these changes comprised in bunch of consecutive revisions, 500 510, , latest commits made trunk. what best , cleanest way bring these changes 4.2.x branch, , out of trunk, in way won't cause problems later when want merge 4.2.x branch trunk ? merge revisions 500 510 trunk branch, , commit branch. since these bug fixes, should done in trunk, leave trunk is. if want remove them trunk, undo these changes. to avoid merging changes branch trunk, merge commit branch trunk alternative "record only". ...

Spring 3.1 ConversionServiceFactoryBean breaks tilesViewResolver -

Spring 3.1 ConversionServiceFactoryBean breaks tilesViewResolver - i have little spring (3.1.0.release) application, working fine, until decided need have converter converting stuff strings other types. my application context file includes file, mvc-config.xml: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"> <mvc:annotation-driven /> <mvc:view-controller path="/" view-name="index"/> <mvc:resourc...

ios - Tapping UIButton that's a subview of UIView -

ios - Tapping UIButton that's a subview of UIView - i'm having problem capturing taps on uibutton that's subview of uiview . here's how code setup: // in myclass.m @interface myclass () @property (nonatomic, retain) uibutton *mybutton; @end @implementation myclass @synthesize mybutton; - (void) buttontapped:(id) sender { nslog(@"button tapped!"); } - (id) initwithframe:(cgrect)frame { if (!(self = [super initwithframe:cgrectzero])) homecoming nil; mybutton = [uibutton buttonwithtype:uibuttontyperoundedrect]; [mybutton setimage:[uiimage imagenamed:@"image.png"] forstate:uicontrolstatenormal]; [mybutton addtarget:self action:@selector(buttontapped:) forcontrolevents:uicontroleventtouchupinside]; mybutton.exclusivetouch = yes; mybutton.frame = cgrectmake(100, 100, 100, 100); [self addsubview:mybutton]; homecoming self; } - (void) dea...

Run Jenkins jobs on Linux under a User -

Run Jenkins jobs on Linux under a User - i have jenkins installed in linux , want run build(s) under user. not simple user, 1 belongs list of user access linux machine , belongs grouping has privileges modify/create files under folder. i have read somewhere can set variable $jenkins_user not know , how. give thanks time p.s. did research questions posted similar not same one please if not clear read this: jenkins execute build using user called jenkins, want able utilize different user (pre-existing). have @ started-by environment variable plugin. https://wiki.jenkins-ci.org/display/jenkins/started-by+environment+variable+plugin edit: if asking how set jenkins run under different user in linux depends on how installed it. never set jenkins on linus yet (but can utilize google). have @ https://wiki.jenkins-ci.org/display/jenkins/installing+jenkins different setup options. had @ installing jenkins unix daemon , @ step 7 need setup configuration file. alter...

c# - The remote server returned an error: (500) Internal Server Error -

c# - The remote server returned an error: (500) Internal Server Error - i trying phone call webservice. getting 500 internal error. webservice running .i uses next code i getting error @ point: webresponse response = request.getresponse(); code: string requestxml = @"c\request.xml"; xmldocument xmldoc = new xmldocument(); xmldoc.load(requestxml); stringwriter sw = new stringwriter(); xmltextwriter tx = new xmltextwriter(sw); xmldoc.writeto(tx); byte[] bytes = encoding.utf8.getbytes(sw.tostring()); webrequest request = webrequest.create("http://localhost:3993/test.asmx"); request.method = "post"; byte[] bytearray = encoding.utf8.getbytes(sw.tostring()); request.contenttype = "application/xml"; request.contentlength = bytearray.length; stream datastream = request.getrequeststream(); datastream.write(bytearray, 0, bytearray.length); datastream.close(); ...

ruby on rails 3.1 - How to resolve the cache_clases = true/false conflict using Spork, RSpec & Cucumber? -

ruby on rails 3.1 - How to resolve the cache_clases = true/false conflict using Spork, RSpec & Cucumber? - i had problems ages in rspec models not beingness reloaded between spork runs. i fixed changing next line in config/environments/test.rb : config.cache_classes = true became config.cache_classes = false however... while solved issues rspec, cucumber requires cache_classes set true. https://rspec.lighthouseapp.com/projects/16211/tickets/165 is there canonical solution works both rspec , cucumber , reloads rspec models successfully? footnote * other changes implemented create rspec reload models included adding next lines spec_helper.rb : activesupport::dependencies.clear factorygirl.reload none of these lines solved problem without setting cache_classes=true line. i had problem, , me due rails' threadsafe mode. ensuring config.threadsafe! not called in test environment fixed me. because threadsafe mode prevents code reloading on e...

How to show a splash screen for 3 seconds on Android? -

How to show a splash screen for 3 seconds on Android? - i splash image begin , remain 3 seconds, , disappear , go on or replaced rest of layout in main.xml. this code: main.java public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); setcontentview(r.layout.main); imageview splash = (imageview) this.findviewbyid(r.id.splash); main.xml <?xml version="1.0" encoding="utf-8"?> <!-- margin=0px, padding=20px --> <!--textview padding=10dp, textsize=16sp--> <!--px=pixel, dp=density indepen sp=scale indepen fontsize preference --> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <imageview android:id="@+id/splash" android:layout_width="fill_parent" android:layout_...

asp.net : How to embed a server.exe? -

asp.net : How to embed a server.exe? - i haven't set web site/app yet, please excuse ignorance. eloquera looks great object database, embedded (in-process) mode not meant used web app. have hence somehow run server exe on server utilize it. when utilize server on comp first needs allowed through firewall, 1 expect. i wondering if somehow run server.exe in same process web app , still have tcp/ip server accepting multiple connections. or perhaps there normal ways of dealing situation on typical "retail" web hosts? in short: believe trying embedd tcp "server.exe" asp.net web application seems usual thing in situation dedicated server, or, more realistically in case, vps (i did learning!).this pushes costs , hassle. no shared hosting can see offers eloquera db. so, seems alternative low-end vps. it's disappointing can't utilize embedded (desktop mode) eloquera in asp.net web app, understand nature of web apps. asp.net ...

android - black screen appears when come back from an external application -

android - black screen appears when come back from an external application - i have application open external application read pdf files. here code open external app. if(file!=null){ packagemanager packagemanager = getpackagemanager(); intent testintent = new intent(intent.action_view); testintent.settype("application/pdf"); list list = packagemanager.queryintentactivities(testintent, packagemanager.match_default_only); if (list.size() > 0 && file.isfile()) { intent intent = new intent(); intent.setaction(intent.action_view); uri uri = uri.fromfile(file); intent.setdataandtype(uri, "application/pdf"); startactivity(intent); }else{ toast.maketext(this, "problem loading file", toast.length_long).show(); } } the problem when come pdf application (adobe...

javascript - jQuery multiple file upload throwing error onload -

javascript - jQuery multiple file upload throwing error onload - i trying utilize jquery plugin ( http://www.fyneworks.com/jquery/multiple-file-upload/#tab-examples ) , reason when seek set events on "function expected". can help me? everything works fine, except trying bind events. $(document).ready(function () { $('#<%=flimage.clientid%>')[0].multifile(function () { onfileremove: function (element, value, master_element) { alert('heyoooo'); } }); }); it looks need supply 'onfileremove' function object parameter: $('#<%=flimage.clientid%>')[0].multifile({ onfileremove: function (element, value, master_element) { alert('heyoooo'); } }); this allows supply multiple functions parameters , function parameters optional. javascript jquery asp.net jquery-plugins

Rails check a form is edited and let user confirm page redirection or close -

Rails check a form is edited and let user confirm page redirection or close - form posting mutual operation on web site, , improve user experience, need prevent user mistaken close window or click wrong link, page :) so there standard way or gem in rails? var edited = false; $('#formid :input').change(function() { if(!edited) { edited = true; } }); window.onbeforeunload = preventuser(); function preventuser() { if(edited) { alert("are sure?"); } } ruby-on-rails

Sorting: Sort array based on multiple conditions in Ruby -

Sorting: Sort array based on multiple conditions in Ruby - i have mulitdimensional array so: [ [name, age, date, gender] [name, age, date, gender] [..] ] i'm wondering best way sort array based on multiple conditions...for instance, how sort based on age first name? i messing around sort method so: array.sort { |a,b| [ a[1], a[0] ] <=> [ b[1], b[0] ] } besides don't understand syntax, i'm not getting results expect. should using sort method? should individually comparing results mapping array? you should always utilize sort_by keyed sort. not much more readable, much more efficient. in addition, prefer utilize destructuring bind, again, readability: ary.sort_by {|name, age| [age, name] } ruby arrays sorting

Change in APC for Magento stops SimplePie from working -

Change in APC for Magento stops SimplePie from working - we have been using simplepie on our magento install pull our blog posts our home page without issue several months now. due other issues magento, had our web host turn off opcode in apc. 1 time did that, next hourly update of simplepie stopped loading of home page , returns next error in apache: [wed jan 18 09:59:57 2012] [error] php fatal error: class 'zend_log' not found in {server root}/lib/simplepie/simplepie.inc on line 738 i @ bit of loss on happening , prepare it. simplepie delivered banner/widget if set on different category page same results. (page stops @ simplepie command) hoping simple alter forcing old chached rss remain , can not modified not sure. any help appreciated! code simplepie unaltered , version 1.2.1. have page /app/design/frontend/default/default/template/page/html/blog.phtml has next code. <div class="col-narrow right sidebar-blog"> <h2>our gardening bl...

c - calculating double integrals in R quickly -

c - calculating double integrals in R quickly - i'm looking solution double integral faster integrate(function(y) { sapply(y, function(y) { integrate(function(x) myfun(x,y), llim, ulim)$value }) }, llim, ulim) with eg myfun <- function(x,y) cos(x+y) llim <- -0.5 ulim <- 0.5 i found old paper referred fortran programme called quad2d , couldn't find else help pages matlab rest. i'm looking c or fortran library can double integrals quick (i.e. without sapply loop), , can called r. ideas much appreciated, long they're gpl compatible. if solution involves calling other functions libraries shipped r, i'd love hear them well. the cubature bundle 2d (and n-d) integration using adaptive algorithm. should outperform simpler approaches integrands. c r fortran integral

Write a Unicode scribal character in an HTML page (with Junicode)? -

Write a Unicode scribal character in an HTML page (with Junicode)? - this simple question, 1 lot of googling has not found reply to! i display unicode character latin extended-d set on web page (pdf description of extended-d), using junicode, supports extended-d. the code display "a760 latin capital letter vy". this page in full: <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>font experiments</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> </head> <body id="home"> &#8166; &#a760; </body></html> and stylesheet looks like: @font-face { font-family: 'junicode'; src: url('../fonts/junicode-regular-webfont.eot'); src: url('../fonts/junicode-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../...

mysql - ComboBox Selected Item or ComboBox text Which you prefer to get the Combo Box Value in WinForm C#? -

mysql - ComboBox Selected Item or ComboBox text Which you prefer to get the Combo Box Value in WinForm C#? - when saw combo box propriety selected item , text returns same value in winforms. so difference in between,.. utilize combobox.selecteditem ? , utilize combobox.text? combobox.text string, combobox.selecteditem object mysql winforms

Date() function in javascript giving NAN-NAN-NAN in firefox and chrome while working fine with IE -

Date() function in javascript giving NAN-NAN-NAN in firefox and chrome while working fine with IE - i calculating on date part through java script , giving nan-nan-nan in firefox , chrome while working fine in ie . code below using. var datedisp = $("#txtdateinputbox_startdate").val(); datedisp = datedisp.split("/"); var month = datedisp[0]; var year = datedisp[2]; var dtepart = eval(datedisp[1]); var moddate = dtepart + setid - 1; var finaldate = month + '-' + moddate + '-' + year; var disp_fdate = new date(finaldate); //alert(finaldate); var disp_date = disp_fdate.getdate(); //var disp_date = disp_fdate.getutcfulldate(); var disp_month = disp_fdate.getmonth() + 1; var disp_year = disp_fdate.getyear(); var uidate = eval(disp_month) + '-' +eval( disp_date) + '-' + eval(disp_year); and uidate using in div creation. please help in advance this? var date, i, string; function date_to_string( date ) { homecomin...

java - How do I replace a certain class when running some JUnit tests? -

java - How do I replace a certain class when running some JUnit tests? - i'm using java 6 junit 4.8.1 (and maven 3.0.3). junit tests, want replace class of tests dependent on (qualified com.myco.clearing.product.server.cache) own version of class (which has same public method signatures). elegant way this? note of junit tests don't invoke com.myco.clearing.product.server.cache.cache class directly, rather phone call classes rely on class. in these indirect cases, want version of class used. thanks help along these lines, - dave it hard exactly here, in general: use ioc techniques - contructor, setter injection. use mocking framework mock objects, recommend mockito. so, example, if have class uses com.myco.clearing.product.server.cache.cache let's phone call foo . , utilize this: class foo { private cache _cache = new cache( ... ); } if possible, alter this: class foo { private cache _cache; public foo( cache cache ) { ...

css - Logo Moves All Over The Place When Resize Windows -

css - Logo Moves All Over The Place When Resize Windows - okay have problem website working on.. infact have problem alot , never asked help, think it's time now. here css: header { background: #eeeeee; height: 50px; } .logo { background: url(logo.png); width: 200px; height: 40px; margin: 0 280px; } when resize window logo in header go in right when window resized. have tried position absolute, relative etc same thing. ideas please guys? here html: <header> <div class="logo"></div> </header> here links pictures representing problem: this working alligned: and this starts go on place: any ideas? please set width on header element. it's defaulting width: auto; spanning 100% of browser window. thus, when re-size window's width, header element re-sized moving contents. update 1 you're using margin position logo 280px left side of browser window, when res...

android - creating app looking like ICS "Phone" app -

android - creating app looking like ICS "Phone" app - i pretty new @ android java development create apps after series of tutorial sense more confident. have ideas app in layout phone app in android 4.0.3. allow me explain : app would.consist in 3 or 4 tabs user switch between on other swiping finger left or right. top of layout display title of each tab , underline in bluish name current tab (same phone app does). have hints or places find sample code ? or code of androidphone app ? thank much help. david http://www.pushing-pixels.org/2011/08/11/android-tips-and-tricks-swipey-tabs.html http://blog.stylingandroid.com/archives/537 is refering ? android

xml - redirect 301 - page for page (apache) html to htm and non www -

xml - redirect 301 - page for page (apache) html to htm and non www - the server apache, not know means. needs/notes: redirect visits www.oldsite.com , oldsite.com www.newsite.com old site uses .html extension , new site uses .htm about half file names in new site match of old site need specify redirect each page. here sample code: options +followsymlinks rewriteengine on rewriterule (.*) http://www.newsite.com/$1 [r=301,l] redirect 301 /index.html http://www.newsite.com/index.htm redirect 301 /pagetwo.html http://www.newsite.com/pagetwo.htm redirect 301 /pagethree.html http://www.newsite.com/thishasanewname.htm currently work home page when types www thats it. can help telling me how accomplish goals in one: to summarize need redirect traffic old site new site html file names not match, have started using .htm extension old site uses .html , need visits both www. , non www version of old site redirect www version of new site. please help me out - i'm not ...

c# - Generic Type Exceptions -

c# - Generic Type Exceptions - recently came across problem of creating exception given message within generic method. instance, next code works expected: public static void throw<t>() t : exception, new() { throw new t(); } ... public static void main() { throw<argumentoutofrangeexception>(); // throws desired exception generic message. } however, able write public static void throw<t>(string message) t : exception, new() { t newexception = new t(); newexception.message = message; // not allowed. 'message' read-only. throw newexception; } ... public static void main() { throw<argumentoutofrangeexception>("you must specify non-negative integer."); // throws desired exception. } is there way of achieving without utilize of reflection either alter value of message property or dinamically activate instance of type desired parameters? you can utilize activator.createinstance(typeof(t), ...

api - linux tcpdump ---how to find number of hits -

api - linux tcpdump ---how to find number of hits - how can check number of api hits per day linux. scenario : need nail client's api fetch data. api nail using cron job , through linux wget command. client complaining receives huge number of hits ip. so, how can find number of times api hit/day linux command. please help. urgent!! if sure, wget client's api invoked cron job, can @ crontab next command: crontab -l in cases have phone call crontab root rights see scheme wide crontab. this: # m h dom mon dow command 10 1 * * 1 /usr/bin/wget http://example.com/api this means, wget scheduled request illustration api every mon @ 01:10am. can interpret output of crontab this: * * * * * command executed - - - - - | | | | | | | | | +----- day of week (0 - 7) | | | +------- month (1 - 12) | | +--------- day (1 - 31) | +----------- hr (0 - 23) +...

Keep x number of files and delete all others - Powershell -

Keep x number of files and delete all others - Powershell - i trying write script through set of folders , maintain lastly 10 files. files in each folder created daily, weekly or monthly. need script maintain 10 recent copies regardless of creation date or modified date. using post created script below works doesnt maintain 10 copies keeps file isn't older 10 days. $ftppath = "c:\reports" get-childitem $ftppath -recurse *_report_*.zip -force|where {$_.lastwritetime -lt (get-date).adddays(-10)} |remove-item -force any thought on how can tweak work? if utilize script below works if dont set -recurse. if utilize -recurse switch error have listed below script. # keeps latest 10 files directory based on creation time #declaration variables $path = "c:\reports" # illustration $path= c:\log\*.tmp $total= (ls $path).count - 10 # alter number 5 whatever number of objects want maintain # script ls $path |sort-object...

php throw exception is caught,but the error message still appear -

php throw exception is caught,but the error message still appear - i utilize code of php manual create exception test,but weird message. here code: function inverse($x) { if (!$x) { throw new exception('division zero.'); } else homecoming 1/$x; } seek { echo inverse(5) . "\n"; echo inverse(0) . "\n"; } grab (exception $e) { echo 'caught exception: ', $e->getmessage(), "\n"; } // go on execution echo 'hello world'; and here output: 0.2 ( ! ) exception: partition zero. in /var/www/ooplearing/slash.php on line 10call stack#timememoryfunctionlocation10.0002330188{main}( )../slash.php:020.0002330232inverse( $x = 0 )../slash.php:17dump $_server$_server['http_host'] =string 'localhost' (length=9)$_server['server_name'] =string 'localhost' (length=9)dump $_getvariables in local scope (#2)$x =int 0 caught exception: partition zero.hello world ...

How do I delete the first 3 characters in mysql? -

How do I delete the first 3 characters in mysql? - how might tell mysql to.. delete first 3 characters mytable.title first 3 characters numbers 01-10 followed space? example.. delete record in 'title' column looks this: 01 california 09 texas 10 idaho leave records lone don't start number , space (such these): california texas idaho i have several one thousand records want remove these preceding numbers from. thoughts? update my_table set title=substring(title, 4) title regexp '^[0-9][0-9] '; mysql

php - $_POST not finding a "name" value -

php - $_POST not finding a "name" value - i trying submit form, should send forth name, know i'm messing silly , can't see (3 hours of sleep lastly night + new coding project @ work != smart idea) here's form on 1 page: <form action="add.php" method="post"> <button type="submit" name="exportcult">export all</button> </form> and here's code on other page, meant process post: if (!isset($_post["name"]) || $_post["name"] == '') { header('location: '.$criteria."?error=data"); die(); } i getting error message sends back, know isn't registering name - why be? i think you're confused how form info gets submitted. "name" attribute, not key value found in post data. need specify name element, key value nowadays in post data. have specified name="exportcult" in post data, variable @ $_post[...

ckeditor plugin for custom links / tags -

ckeditor plugin for custom links / tags - i'm using ckeditor 3.6 , find myself in need of writing simple plugin. need button works much format buttons (bold, italic, etc.) except turn this: selectedword not into, say, <b>selectedword</b> but into: <a href="http://www.mywiki.tld/wiki/selectedword">selectedword</a> i've tried looking various plugins come ckeditor, quite frankly, more confusing helpful. i've read tutorials, know basics of writing plugin, eludes me functionality itself. you going have hack ckeditor code base, allow me tell hacking around ckeditor not difficult. also, there versions of older fckeditor floating around. compare 2 , see 1 easier hack mod. have had utilize older version creating pinholes against coldfusion utilize file upload segment of tool. , in case function against domain cookies, because of security issues regular cookies. fckeditor , ckeditor has never been clear install me b...

c# - Returning in a base class's method returns in child class call? -

c# - Returning in a base class's method returns in child class call? - i'm creating c# framework in (nearly) of classes based off of single, abstract base of operations class. base of operations class contains privately-set properties, 1 of beingness boolean garbage. in xna's draw loop, don't want kid classes execute code in respective draw() methods if base of operations class's garbage property set true. tried doing next implementation: abstract base of operations class: class="lang-cs prettyprint-override"> public virtual void draw(gametime gametime, spritebatch spritebatch) { if (garbage) return; } inherited class: class="lang-cs prettyprint-override"> public void draw(gametime gametime, spritebatch spritebatch, color overlaycolor, float scale) { base.draw(gametime, spritebatch); //other code here... } because base of operations class's draw method beingness called before actual code ...

openssl decryption passphrase issue in perl -

openssl decryption passphrase issue in perl - i having difficulty analyzing how parameters beingness treated when passed in scheme phone call in perl. when next code runs . . . . $password = ‘t5!redrkbyg@bjd!’; system("pv myfile.aes | openssl enc -d -pass pass:$password -rc4 | md5sum > decrypted.md5"); the code results in different hash values on different systems. on original system, crashed, similar code ran , file encrypted , decrypted successfully. when executing code on machine, code runs clear text invalid. think problem special characters in password. can prepare problem going forwards but, need know got passed in pass parameter decrypt info old system. thinking has how shell interpreting password. help appreciated. thanks. mark, response. the code running in ubuntu 11.10 , bash shell. i have tried decrypt interactively , typed in password when prompted exclamation marks should passed in seek escaping exclamation marks in ...

c# - LINQ - ToString("N2") fails without exception? -

c# - LINQ - ToString("N2") fails without exception? - the linq query below works fine without .tostring("n2") part. works fine using .tostring() . when adding ("n2") instead of () returns nil without raising exceptions. why? workaround question: when printing fundfee numbers without formatting printed 9.00000000e-3. happens in linq queries, currentculture en-us . way alter non e-notation? 1 workaround utilize .tostring().substring(0,4) work since numbers between 0 , 1. any other improvement ideas welcome too:) list<fundstairitem> listfunds = (from fundinfoisin in amdw.fundsinfos.where(f => f.type == 1) fundinfoname in amdw.fundsinfos.where(f =>f.type == 2) fundfee in amdw.fundfees securities in amdw.securities securities.isin == fundinfoisin.valu...

php - Magento grid column position -

php - Magento grid column position - i'm editing order grid adding custom columns this $this->addcolumn('pagamenti', array( 'header' => 'paymentsource', 'width'=>'50px', 'align' =>'left', 'type' => 'text', 'renderer' => 'blablabla_adminhtml_block_sales_order_renderer_lol' )); but every column positioned on far right of table, no matter phone call addcolumns. is there way forcefulness position? thanks you can utilize addcolumnafter function. $this->addcolumnafter('pagamenti', array( 'header' => 'paymentsource', 'width'=>'50px', 'align' =>'left', 'type' => 'text', 'renderer' => 'blablabla_adminhtml_block_sales_order_renderer_lol' ), 'id_of_column_to_be_after'); php magento

objective c - NSRegularExpression doesn't match -

objective c - NSRegularExpression doesn't match - i'm making regular look next line: table 'joella viii' 6-max seat #4 button so far, i've got this: self.tabledetailsregex = [nsregularexpression regularexpressionwithpattern:@"table '[a-za-z0-9 ]*' [0-9]+-max seat #[0-9]+ button" options:nsregularexpressionallowcommentsandwhitespace error:nil]; if([self.tabledetailsregex numberofmatchesinstring:line options:nsmatchingreportcompletion range:nsmakerange(0, line.length)] == 1) { nslog(@"%@", line); } so, regular look is: table '[a-za-z0-9 ]*' [0-9]+-max seat #[0-9]+ button and i'm sure selected line comes @ point, because i'm printing lines bit farther in code... your problem in options using. nsregularexpression class reference, nsregularexpressionallowcommentsandwhitespace means whitespace , after # in regular look ignored. alternative enabled, regular look acts this: table'...

c# - Can I use a generic method as a sort of template pattern? -

c# - Can I use a generic method as a sort of template pattern? - hi i'm not sure generic method right way solve problem. need parse xml file , read items it. items can things orderlines, notes, attachments. basic steps these items same. how can create 1 method creates list of these items , phone call specific method read item? public override ilist<t> getitems<t>(xpathnavigator currentorder) t : isortablebylinenumber, new () { var itemlist = new list<t>(); var itemxmlnodes = currentorder.select(orderxpath); if (itemxmlnodes == null) throw new exception(""); var linenumber = 1; foreach (xpathnavigator itemxmlnode in itemxmlnodes) { var item = new t(); item = readitem(itemxmlnode, linenumber++, item); itemlist.add(item); logger.debug(string.format("added item {0}", item)); } homecoming itemlist; } i...

html5 - Finding the size of an HTML 5 web sql database size after creation -

html5 - Finding the size of an HTML 5 web sql database size after creation - i'm using html 5 web sql database in safari. i'm setting database size 5 mb. after creating database size increased, can't find out new size of database. can find size of database after creation? the database stored on client in different places: windows: /users/{user}/appdata/apple computer/safari/databases safari: ~/library/safari/databases there master database file in folder points database in relevant subfolder. can see size of database in explorer/finder. find, however, size of database dependent on platform (and database size varies between safari , chrome). html5 web-sql

java - Why can I only upload one file using Play and uploadify? -

java - Why can I only upload one file using Play and uploadify? - i wrote simple play-uploadify demo. i want upload button automatically upload image each time pressed. for reason, first time button pressed, upload. after button has been pressed once, farther presses not cause unless "cancel" previous uploads. (i don't understand meaning of canceling upload auto mode. perhaps problem downloads never "complete" in sense?) here action method: public static void upload(file file, long userid){ system.out.println("uploaded file name " + file.getname() + " user " + userid); } and phone call uploadify: $(function() { $("#uploader").uploadify({ uploader : '/public/libraries/uploadify/uploadify.swf', script : '/application/upload', cancelimg : '/public/libraries/uploadify/cancel.png', folder : '/uploads', fileext ...

.htaccess - can htaccess prevent a file type being written to a directory? -

.htaccess - can htaccess prevent a file type being written to a directory? - is possible htaccess allow files uploaded directory? i have found several posts discussing how htaccess allow images out, disable php, output scripts in plain text form... cannot find if or not possible htaccess prevent files of type entering directory in first place.. could perchance help me out on query? no, not possible. apache web server, can not command gets written php or other script directory. you need manage in script utilize upload files. .htaccess file-type

php - YII on different domain -

php - YII on different domain - i have 2 part of application. first manager panel , pointed http://mysite.com/. other personal product page , pointed own domein http://product_domain.com/ . these parts have 2 different router maps mutual models, components , widgets. list of product domain have saved in database. what best way separate parts? p.s. maybe should have 2 different application or config? what utilize combination of "prerouter" , modile. yii supports way of "onbeginrequest" => array('class', 'function') in config. in function can observe user came , create needed changes. illustration activate specific module (if functionality grouped in one), or set different defaultcontroller. perhaps want load custom theme? you can in there before done. php dns yii routes

iphone - Up to date instructions on how to install XMPPFramework manually? -

iphone - Up to date instructions on how to install XMPPFramework manually? - i'm having tough time getting xmppframework work. i've followed every direction written on net, , xcode not finding of xmppframework classes. expected specifier-qualifier-list before 'xmppstream' xmpp.h: no such file or directory xmpproster.h: no such file or directory i have xmppframework copied project's root directory. why can't these files seen? there need under header search paths or library search paths? i've set entries $(inherited) , $(srcroot) , xcode 4.2 auto-fills in project's root directory , still doesn't find files. i'm quite sure i'm not 1 having issue, , showstopper. ideas? at xmppframework github wiki 1 there step step instruction helps setting xmppframework project. in fact error have mentioned close indicated instructions. "however, upon importing xmppframework class, such calling '#import xmpp.h' ...

Android: Eclipse autocomplete does not work in xml files -

Android: Eclipse autocomplete does not work in xml files - i seeing unusual problem eclipse ide android development. autocompletion not work when nail ctrl + space in main.xml file layouts. in bottom left, message saying illustration "linearlayout not found". i have right namespace specified in file. it work though other xml files, such strings.xml find strange. this annoyance i'd see options available view or layout. anyone got ideas on how resolve this? check file beingness opened in android xml layout editor (not "plain" xml editor). right-click file, take open with, , select android layout editor. android eclipse

Photoshop Photo filter math -

Photoshop Photo filter math - photoshop has nice feature called photofilter (adjustments > photo filter). i've tried understand math behind no luck. it's not standard blending , not multiplication. applying specific filter white image i've found has non-linear behavior different each channel. 1 has suggestions ideas how mimic color photo filters? thanks here few javascript libraries filter effects: loupe.js grayscaler alphajpeg math photoshop

android - How to set the language of the Google Map? -

android - How to set the language of the Google Map? - i need google map in chinese.how set language? i developing app .i need show map on android mobile. <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&language=your-language"> </script> android google-maps

android - How to know which package is launching? -

android - How to know which package is launching? - i have downloaded 'application protection' application market. allows me protect open application password. i.e. have protected 'connectionlost' application application protection. now when open 'connectionlost' app. found below log in logcat. line 1-starting: intent { act=android.intent.action.main cat=[android.intent.category.launcher] flg=0x10200000 cmp=com.android.connectionlost/.connectionlost } pid 5746 line 2-starting: intent { flg=0x10000000 cmp=com.ruimaninfo.approtect/.ui.screenlocker } pid 5494 it means first application launch , after 'applicaton protection' launch it's own activity. so question is how 'application protection(downlaode market)' know bundle launched? , programmer how can know same thing? thank you. you can find out bundle launching activity manager activitymanager = (activitymanager) getsystemservice(activity.activity_service); str...

How to deal with comma in quote for csv file in Java? -

How to deal with comma in quote for csv file in Java? - i using opencsv read csv file. fields separated comma. in 1 field, if contains quote, comma within quote not delimiter. example, "hello, world". the current opencsv cannot deal that. how address problem? update i found not problem of comma (so far). problem row is: ...,"a children""s heart\",... . seems remove quote, read field becomes a children"s heart",...... , ...... represent next data. it seems not problem of opencsv, mess of input data. you can write custom code search through csv file , replace comma's within quotes &comma; or special character can identify later , place comma. java csv quotes comma opencsv

Sometimes GTK modal dialogs are not modal --- bug or feature? -

Sometimes GTK modal dialogs are not modal --- bug or feature? - when create custom dialog in gtk (both, gtk2 or gtk3) , set modal, input other windows of application ignored. works always, fails under conditions. when add together scrolledwindow containing treeview dialog, still works supposed. but if fill treeview entries until scrolledwindow starts display scroll bars --- modality lost , can click on other windows! here basic illustration able set up. it's written in vala, you'll idea: class mydialog: gtk.dialog { public mydialog() { this.modal = true; var info = new gtk.liststore(1, typeof(string)); // increment number -- dialog not modal anymore! (int i=0; i<2; ++i) { gtk.treeiter current; data.append(out current); data.set(current, 0, "lorem ipsum"); } var render = new gtk.cellrenderertext(); var column = new gtk.treeviewcolumn(); ...

java - how to use hibernate @EmbeddedId when i try to create insert query -

java - how to use hibernate @EmbeddedId when i try to create insert query - i using hibernate , have created entities on java side using hibernates. 1 of db table has multiple columns primary key , hibernate used @embeddedid deal that. my problem when create insert query error: "null id generated for:class com.iu.eblood.model.eventtypeofevent" to set id,i need create objejt embeddedid , when create , set id, problem appeared: "the target name "eventid" specified more 1 time assignment in same sql statement" i guess,the reson error both eventtypeofevent object , eventtypeofeventpk object(class created hibernate embeddedid) show same attribute. here class: @entity public class eventtypeofevent implements serializable { private static final long serialversionuid = 1l; private eventtypeofeventpk id; private timestamp createddate; private timestamp deleteddate; private string isactive; private event event; priva...

How to update table rows with javascript in rails partial -

How to update table rows with javascript in rails partial - i have table: <table class="articles"> <%= render :partial => 'articles/article' , :collection => @articles %> </table> and next partial: <tr> <td> <div id="vote_form"> <% form_tag url_for(article_votes_path(article)), :remote => true %> <%= image_submit_tag("vote-arrow-up.png", :alt => "vote-up", :id => "voteup_button") %> <% end %> </div> <div id="vote_score"> <% form_tag url_for(article_votes_path(article)), :remote => true %> <%= image_submit_tag("vote-arrow-down.png", :alt => "vote-down", :id => "votedown_button") %> <% end %> </div> <div id="vote_score"> votes: <%= article.votes.count %> </...

backbone.js - Using Handlebars with Backbone -

backbone.js - Using Handlebars with Backbone - i learning backbone/handlebars/require. have looked on online , on - there tutorials or websites can direct me provide helpful info using using handlebars instead of underscore? using handlebars.js instead of underscore templating pretty straightforward. check out example: http://backbonetutorials.com/what-is-a-view/ (scroll "loading template" section) searchview = backbone.view.extend({ initialize: function(){ this.render(); }, render: function(){ // compile template using underscore var template = _.template( $("#search_template").html(), {} ); // load compiled html backbone "el" this.el.html( template ); } }); basically, convention in backbone build html in render function. utilize of templating engine left (which backbone). you'd alter to... searchview = backbone.view.extend({ initialize: function(){ this.rend...

php - CakePHP model assosciation: View product image -

php - CakePHP model assosciation: View product image - i have products model, , each product has several images. product - hasmany - image . now when browse product able see images has not able view images when list products in index. how should first image product display in index? the way can manage deal utilize image model within products controller guess not best option. edit: of stuff after baked. default hasmany display when listing products? model: class product extends appmodel { var $hasmany = array( 'image' => array( 'classname' => 'image', 'foreignkey' => 'parent_id', 'dependent'=> false ), ); } when have used bake script, index action have line in it: $this->product->recursive = 0; this disable relations you've set. comment/remove line , should able display image (it should under $this->data['product']['image']). ...

ajax - How to add Access-Control-Allow-Origin in VLC HTTP-interface? -

ajax - How to add Access-Control-Allow-Origin in VLC HTTP-interface? - i working on new centralized interface vlc media players around house. have made website (or in progress of)... so anyways, can add together links the different functions in vlc http interface, , works , page xml data. if instead create same request using ajax, access-control-allow-origin error. so how add together http headers access-controlallow-origin? have seen how add together apache , aspx add together simple html file vlc interface is. so input in matter nice :) ajax vlc

C++: Diamond concerns -

C++: Diamond concerns - simple question: hierarchy cause dp? //abstract base of operations class class { //implement pure virtual methods default definition. //pure virtual methods still declared pure virtual. }; //abstract derived class class b : public { //define pure virtual methods default definition. //pure virtual methods still declared pure virtual. }; //abstract base of operations class class c { //define pure virtual methods default definition. //pure virtual methods still declared pure virtual. }; //concrete class class d : public b, public c { //implement methods d, b, , c }; no. draw picture; bases unique: a | v b c \ / v d the "diamond problem" pertains ambiguous base of operations classes due multiple repeated bases, e.g. if d derive both a -> b , a -> c : class="lang-none prettyprint-override"> no-diamond-problematic: virtually-inherited diamond: ...

actionscript 3 - Change cursor on datagrid row -

actionscript 3 - Change cursor on datagrid row - i'm working on flex project, , have datagrid i'd cursor alter when hovering on row containing data. i have double click enable on datagrid , i'd indicate utilize can click row hovering over. this i've tried seems utilize hand cursor on datagrid self , not row data. <mx:datagrid x="9" y="47" width="330" height="244" usehandcursor="true" buttonmode="true" mousechildren="true" horizontalscrollpolicy="{scrollpolicy.auto}" stylename="resultgrid" dataprovider="{aclatest}" doubleclickenabled="true" itemdoubleclick="doubleclickoverview()" id="overviewlatest_dg"> <mx:columns> <mx:datagridcolumn headertext="tag" id="overviewlatest_dg_animal_ptag" visible="true" datafield="animal_ptag" width="11...

tdd - rails, how to stub :user_id in session with mocha? -

tdd - rails, how to stub :user_id in session with mocha? - how stub :user_id in session using mocha framework spec test ? i tried following: session.stubs(:user_id).returns(1) session.stub!(:user_id).and_return(1) session.expects(:[]).with(has_entries('user_id' => 1)) but got nil session[:user_id] in above tries! all examples shows how stub object, session hash array, how stub or mock key :user_id, or :page_id .. etc in session ?? i think may have new session instance on every request, have stub every single one. ?> session.class => actioncontroller::session::abstractstore::sessionhash so have stub is actioncontroller::session::abstractstore::sessionhash.any_instance.stubs(:user_id).returns(1) ruby-on-rails-3.1 tdd rspec-rails mocha

javascript - -moz-calc crossbrowser (pollyfills? hooks?) -

javascript - -moz-calc crossbrowser (pollyfills? hooks?) - i'm working on project in i'm using less, css3 , other "fancy" technologies. have piece of code calculate height me: height: -moz-calc(100% - 40px); i utilize -moz-calc in couple other places calculate stuff. problem create working crossbrowser (o, safari, chrome, ie8+). it's kinda tricky when seek via js (jquery), cases tricky unfortunately. i'm looking kind of bullet proof solution automatic updates, css' calc().. ideas? webkit landed prefixed calc() support. -webkit-calc() works in chrome dev build , should included in next release of chrome , safari. javascript jquery css css3

php - Programming Languages for Forums -

php - Programming Languages for Forums - disclaimer: i'm novice web developer. i'm pretty html, decent css, alright javascript, , that's web programming know, capable , willing learn. i'm wanting create forum on website have next features: searchable user login/signup scheme using openid expandable site navigation menu on every page dependent upon topics available in forums. content same on page1.html, page2.html, , on. content perchance need alter @ every load of page. each page has it's own url seo purposes. i do not want utilize online service makes forums , not want code examples. my issue: want recommendations on web programming languages i'm wanting. ones have in mind: php python django note: have code site navigation menu worked out. dynamic loading/changing concern. thank help. also: have own domain supported hosting through godaddy. , have unlimited sqlite databases (1gb each, think), if matters. actually can impleme...

Difference between several "import" eclipse code template -

Difference between several "import" eclipse code template - in eclipse 3.7 i've seen java code templates several variations of ${import} command: ${:import} ${imp:import} ${x:import} what's difference between them? in above illustration have created 3 variables: "" (ie blank) "imp" "x" you can utilize these names refer variables later on within template. seems largely useless in case of import statements. to thought of how might used usefully take @ arraymerge, template shipped eclipse, , see result variabe beingness used in few places. i suggest taking @ templates ship eclipse , first-class useful eclipse java code templates question larn bit more. note: within template variables must have unique names, if took illustration above , added ${:importstatic} you error, have used "" (blank) variable name. eclipse templates import

oracle10g - SQLPlus 's weird reaction during DML statements execution -

oracle10g - SQLPlus 's weird reaction during DML statements execution - today executing dml statements sql file in sqlplus, oracle 10.2, found weird question "enter value hamburger:". see attached and ending of question "enter value xxx" kept alter intervals. mean after few seconds found statement "enter value mcdonald".... i want know normal sqlplus ???? i have tried execute dml statement giving location of sql file in sqlplus. sql>@/tmp/mydir/dmls.sql; an exemplary statement sql file insert myschema.mytable (id,dix_dir_id,dix_agl,dix_xml_inline) values (23202,1100080319000620471,'directory','<values> <dir_class_title>person</dir_class_title> </values> '); you have ampersand in statement. when sql*plus encounters ampersand, tries replace defined to. if undefined, prompts value: this statment without ampersand: sql> select 'foo' dual; 'fo --- foo now, stat...

php - Trouble with URL rewriting in .htaccess -

php - Trouble with URL rewriting in .htaccess - my .htaccess file looks this: rewriteengine on rewriterule ^articles/(\d+)*$ ./articles.php?id=$1 so, if url foo.com/articles/123 requested, command transferred articles.php?id=123 . however, if requested url is: foo.com/articles/123/ or foo.com/articles/123/whatever i "404 not found" response. i phone call articles.php?id=123 in these cases. so, if url starts foo.com/articles/[digits]... no matter other characters follow digits, execute articles.php?id=[digits] . (the rest of url discarded.) how have alter regular look in order accomplish this? just don't end: rewriterule ^articles/(\d+) ./articles.php?id=$1 php url mod-rewrite

symfony2 - Twig Assetic Stylesheets Among Several Templates -

symfony2 - Twig Assetic Stylesheets Among Several Templates - i'm trying add together stylesheets array twig templates extend through sec , 3rd levels aggregated styles carry through. this topic related combining assetic resources across inherited templates from config.yml, made global array mystyles can add together list of necessary styles "bubble up" through rendering process. twig: debug: %kernel.debug% strict_variables: %kernel.debug% globals: mystyles: [] the first template called action communicatorbundle/resources/views/admin/workspace.html.twig , i've set specific style page called admin.workspace.css . {% extends "djcommunicatorbundle::base.html.twig" %} {% set mystyles = ["@djcommunicatorbundle/resources/public/css/admin.workspace.css"]|merge(mystyles) %} it extends communicatorbundle/resources/views/base.html.twig has it's own requirement data-table.css . {% extends "djsharedbundle:...

android - not found activity to handle broadcast intent -

android - not found activity to handle broadcast intent - this code isn't work. happen? public class main extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); registerreceiver(br, new intentfilter("a.b.c.d")); intent = new intent("a.b.c.d"); startactivity(it); } broadcastreceiver br = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { toast.maketext(context, "test", toast.length_short); } }; } error: 01-22 10:55:21.812: error/androidruntime(10405): java.lang.runtimeexception: unable start activity componentinfo{sample.intent.broadcast/sample.intent.broadcast.main}: android.content.activitynotfoundexception: no activity found handle intent { act=a.b.c.d } if trying test re...

getPreviewFormat and setPreviewFormat on Android api level 7 -

getPreviewFormat and setPreviewFormat on Android api level 7 - the methods of camera.parameters setpreviewformat() , getpreviewformat() take , homecoming int respectively. int should correspond 1 of specified imageformat class, class introduced api level 8, while 2 methods above there since api level 1. how know image format (rgb888? yuv? other?) of photographic camera preview when using api level 7? here existing imageformats on android: http://developer.android.com/reference/android/graphics/imageformat.html but said, class available since api level 8.... parametres within of photographic camera class before api 7. android-camera android

mysql - Filter on the Many side of a One-To-Many Relationship -

mysql - Filter on the Many side of a One-To-Many Relationship - i've got 2 tables: jobs , job_industries (joined on jobs.id=job_industries.job_id ). i'd find every job jobs.title '%finance%' , without job_industries.industry=1 . however, when running query below, i'm getting list of every job matches title criteria , has @ to the lowest degree 1 industry alternative isn't 1 . select jobs.id, title, industry `job_industries` left bring together jobs on jobs.id=`job_industries`.job_id is_live=1 , jobs.`is_closed`=0 , 1 in (select industry job_industries job_id in ) e.g. if job has 2 job_industry relations ( industry=1 , industry=2 ), job match query. i'd prefer find jobs don't. select j.id, j.title, ji.industry jobs j inner bring together job_industries ji on j.id = ji.job_id , ji.industry <> 1 j.title '%finance%' , j.is_live = 1 , j.is_closed = 0 ,...

How can I import a javascript library in CoffeeScript? -

How can I import a javascript library in CoffeeScript? - when loading page include javascript library used create graphs google api. handling coffeescript in front end end. according tutorial initiating library like: data = new google.visualization.datatable(); . when parsing produced js code coffeescript jshint getting error google not defined. how can show parser library loaded , object exists? data = new google.visualization.datatable(); problem: 'google' not defined. i have tried phone call window object data = new window.google.visualization.datatable(); and stopped complaining. javascript coffeescript jshint

github - What is the best way to synch an outdated git directory to a remote? -

github - What is the best way to synch an outdated git directory to a remote? - i maintain vim configuration files on github maintain them synched across multiple machines. 1 time in while utilize machine haven't used in while , vim files way out of synch. if simply git pull from remote directory becomes messy since old files (or renamed files) not nowadays anymore in official remote remain put. typically delete , git clone scratch. is best approach? ideally have command git xxx which delete/replace making perfect replica of remote git fetch origin git reset --hard origin/master where origin remote, , master remote branch want local working re-create in sync with. note these commands replace local files (including changes) remote state. means there no merge conflicts. mimics delete-and-reclone workflow. git github

DataGridView bound (through DataSource) to a List does not show anything -

DataGridView bound (through DataSource) to a List does not show anything - i'm windows forms, datagridview , datasource property. want set datasource property of datagridview instance of list. not bindingsource, or bindinglist. list. if this, nil shows in datagridview. changing list bindinglist makes thing work, still want utilize list (for reasons). has succesfully done simple thing? thank you. list datagridview datasource

android - Orientation change messes with hardware acceleration settings -

android - Orientation change messes with hardware acceleration settings - i'm developing app sdk 11 (honeycomb). in app create utilize of hardware acceleration (at application level) create animations smoother , without it, unacceptably sluggish. since client wants have them, have find solution turning acceleration off. the problem have activity contains few webview elements. 3, exact - 1 shown , 2 others used preloading pages, invisible (i mean positioned off screen, still "visible"). utilize translation animation "switch" between them. hardware acceleration on, render web pages incorrectly - big, flickering black boxes on page. of course of study unacceptable, bypassed problem turning hardware acceleration off webviews: webview.setlayertype(view.layer_type_software, null); i've tried set in xml file ( android:layertype="software" ), worked same way (as should be). anyway, both methods work pretty - animations , webviews smooth...

arrays - Java Monopoly-ish Game -

arrays - Java Monopoly-ish Game - i'm working on monopoly based game properties, money, cards, etc. ran problem when working on chance card aspect of game... i have array of strings things, ex,"tax refund; collect $25" or "you lose money due stocks; -$100". each card different, not of them deal money. question: how can store these cards each hold string description action involved. example, card1 has string , int value (-25), on other hand card, card2 has string, int value(+10) , property. sorry if question vague don't know how else describe it. just clarify: a card contain description , money value. while card might contain description, money value , move spaces. thanks gave out awesome ideas quickly! if range of actions limited (say, 2 or 3 actions involving money, move squares, etc) might utilize next class: class card { // practice not create next fields // public , utilize getters/setters instead i've made them ...