Posts

Showing posts from January, 2012

ruby - Am I doing it wrong or is it a bug in net/http? -

i'm using ruby net::http under nginx/phusion passenger server, attempting post json string server. appears post, when sending 'application/json', prematurely closes session server. i.e.: on server side: 127.0.0.1 - - [03/sep/2013 07:47:14] "post /path/to/submit " 200 45 0.0013 pid=12893 thr=47197563169088 file=ext/nginx/helperagent.cpp:933 time=2013-09-03 07:47:14.830 ]: uncaught exception in passengerserver client thread: exception: cannot read response backend process: connection reset peer (104) backtrace: in 'void client::forwardresponse(passenger::sessionptr&, passenger::filedescriptor&, const passenger::analyticslogptr&)' (helperagent.cpp:698) in 'void client::handlerequest(passenger::filedescriptor&)' (helperagent.cpp:859) in 'void client::threadmain()' (helperagent.cpp:952) a client side debug session is: opening connection hostname.com... opened <- "post /path/to/submit http/1.1\r\ncontent-typ

mysqli - PHP - is it recommended to use mysqli_data_seek within a loop -

when looping through mysqli query usual way be: $res = $db->query($sql); while($rs = $res->fetch_assoc()) { echo $rs['field']; } i found out use mysqli_data_seek setting internal result pointer, change loop following: $res = $db->query($sql); $records = $res->num_rows; ($i = 0; $i <= $records-1; $i++) { mysqli_data_seek($res,$i); // set result pointer $rs = mysqli_fetch_assoc($res); echo $rs['field']; } i benchmarked both ways , couldn't see difference wondering - there drawbacks using second method? thanks php - recommended use mysqli_data_seek within loop of course not. are there drawbacks using second method? sure. takes as twice more code first one.

listview - jquery plugin to toggle list view and column view for bootstrap -

i'm trying put script toggle grid , list group views. want keep code light possible utilizing bootstrap classes. i'll add additional classes col-lg-* etc... , work on cookie script now, i'm trying wrap classes using wrapall, wrap nwrapper . first time click grid view button, works fine , everytime after list view i'm stuck trying fix grid view after second click. perhaps set of eyes can me see doing wrong. here demo of i'm working on: toggle list grid view . this script far: $(document).ready(function() { $('#grid').click(function() { $('#products').fadeout(300, function() { $(this).addclass('row-group').fadein(300); $(this).removeclass('list-group').fadein(300); $('#grid').addclass('disabled'); $('#list').removeclass('disabled'); $('.item').removeclass('list-group-item row'); $('.item').wrap( '<div class=&quo

css - Border inside an image with margin -

Image
this question has answer here: inner border on images css? 5 answers how can achieve effect css: do need smaller div margin , border or somehow possible using box-shadow you need single element :before or :after the demo : http://jsfiddle.net/6a95a/1/ the markup: <figure></figure> the style figure{ width:200px; height: 180px; position:relative; background-image:url(http://24.media.tumblr.com/tumblr_m2scelxyga1qbmtexo1_500.jpg); background-size:cover; background-position:50%; } figure:before{ content:''; position: absolute; left: 2%; top: 2%; width: 95%; height: 95%; border: 1px solid white; }

python - Organizing pyramid / paster config files in a modular way -

i have pyramid application using paster ini file, hosted via uwsgi. want host different instances (i.e. development, staging, production), ideally without having touch config file @ all. different instances need different settings. approach like: [app:base] sqlalchemy.url = some/connection/string/%(instance)s [app:development] instance = development [app:production] instance = production that not work, because instance not yet defined, when sqlalchemy.url defined. tried inject instance somehow outside, without success. i'm not able access environment variables. tried pass values via uwsgi_param nginx, not work. how organize paster ini files in modular way, not have duplicate settings? you can use "config:" url include settings file. in "shared.ini" [app:myapp] use = egg:myapp in "development.ini" [app:main] use = config:shared.ini#myapp = 2 in "production.ini" [app:main] use = config:shared.ini#myapp = 3

angularjs - ng-repeat not working, am I missing something? -

i've set : $scope.privates = [ {value:'private'}, {value:'public'} ]; and in view : %h2 etablissement %div{"data-ng-repeat" => "private in privates"} %input{"data-ng-model" => "filterprivacy[private.value]",:type => "checkbox"} {{private.value}} and renders : <h2>etablissement</h2> <div data-ng-repeat-start='private in privates'> <input data-ng-model='filterprivacy[private.value]' type='checkbox'> </div> the {{private.value}} isn't showing anywhere , should have 2 inputs cause i've got 2 values. missing ? cordially, rob p.s : when test {{privates}} renders me <div ng-repeat='private in privates'> [{"value":"private"},{"value":"public"}] </div> there issue in rendered code, should use data-ng-repeat

Difference between CLASS and By processing in SAS STAT Procs? -

i wondering if there major difference between using class or statements in sas stat procs. take proc means example. suppose have 2 group/categorical variables, x1 , x2. want compute summary statistics variable (x3) each level combination of x1 , x2. example, using class x1 x2 gives me summary stats x3 @ x2=1 @ x1=1 , summary stats x3 @ x2=2 @ x1=1, , on. below example output. x1=1 x2=1 x3 mean std x2=2 x3 mean std x1=2 x2=1 x3 mean std ... if use by x1 x2 get x1=1 x2=1 x3 mean std (new page) x1=1 x2=2 x3 mean std (new page) .... if use class x1 , by x2 get x1=1 x2=1 x3 mean std x2=2 x3 mean std x1=2 x2=1 x3 mean std x2=2 x3 mean std ...... this sample data x1 x2 x3 1 1 3 1 1 4 1 2 6 1 2 2 2 1 5 2 1 1 2 2 2 2 2 6 3 1 10 3 1 2 3 2 1 3 2 8 the best can tell, there no difference in output, except manner in displayed. example may simplistic show differences. beyond bob noted (the sorting requirement), important, there differ

asp.net - How to achieve URL rewrite in mvc3? -

Image
my directory structure in mvc3 below. i installed url-rewriting 2.0. have added url rewriting. web.config <?xml version="1.0" encoding="utf-8"?> <!-- more information on how configure asp.net application, please visit http://go.microsoft.com/fwlink/?linkid=152368 --> <configuration> <configsections> <sectiongroup name="elmah"> <section name="security" requirepermission="false" type="elmah.securitysectionhandler, elmah" /> <section name="errorlog" requirepermission="false" type="elmah.errorlogsectionhandler, elmah" /> <section name="errormail" requirepermission="false" type="elmah.errormailsectionhandler, elmah" /> <section name="errorfilter" requirepermission="false" type="elmah.errorfiltersectionhandler, elmah" /> </sectiongroup&g

subsonic - mysql too many connections - too many sleeping threads? -

i getting error mysql database error connecting: timeout expired. timeout period elapsed prior obtaining connection pool. may have occurred because pooled connections in use , max pool size reached. i have website , console application talking database dont have 100 concurrent connections! did showprocesslist query , found 10 connections command of sleep , time of 16000 seconds. there wasn't 100 connections. i using subsonic data provider talk database , believe closes database connections , doesnt leave them hanging isn't culprit. i restarted mysql server , console application talks database , seems working ok naturally can't have either console/website application crashing this. looking @ error log error seems coming please advice on can find out going on , how can fix it edit: have looked more , appears subsonic/mysql issue. have tried recommended fix in link below closing connection in block nothing closes connection... dim sp storedprocedure = s

c# - add a Number to an array of strings -

i made object player(int number, string name, string guild, int hp, int mana) , csv file i'm reading list of players. public static list<player> getplayerfromcsv(string file) { list<player> result = new list<player>(); using (streamreader sr = new streamreader(file)) { string line = sr.readline(); if (line != null) line = sr.readline(); while (line != null) { player pl = addplayer(line); if (pl != null) result.add(pl); line = sr.readline(); } } return result; } private static player addplayer(string line) { line = line.trimend(new char[] { ';' }); string[] parts = line.split(new char[] { ';' }); if (parts.length != 5) return null; player pl = new player(parts[0], parts[1], parts[2], parts[3], parts[4]); return pl; } public override string tostring() { return number + " - " + name;

php - Symfony2 - register vendor as service -

i want register vendor library service, doctrine, can access via $container->get('doctrine') . want register way vendors, example phpexcel ( $container->get('phpexcel') ). see services.yml file liuggio/excelbundle parameters: xls.phpexcel.class: phpexcel services: xls.phpexcel: class: %xls.phpexcel.class% and $container->get('xls.phpexcel');

c++ - Why my token-pasting usage doesn't work? -

i made declaration below. #define func_dec(f) inline void f##(){} class myclass { public: func_dec(a); func_dec(b); }; after preprocessing, expected class looked like: class myclass { public: inline void a(){}; inline void b(){}; }; while actually, got compiling errors #20 identifier "a" undefined #20 identifier "b" undefined warnings description resource path location type #891-d omission of explicit type nonstandard ("int" assumed) can tell me what's wrong declaration? thank much. in case, don't need use ## operator. #define func_dec(f) inline void f(){} is fine. it concatenation operator, useful kind of case: #define func_dec(f) inline void funcdec##f(){} // ^^^^^^^^^^ who expanded as: inline void funcdeca(){} // func_dec(a) just say: code works fine on visual studio.

javascript - jquery Looping (.each) -

i have object looks following: node{ name: "root", level: 0, children: array[14], parent: null, id: 0 } and inside node.children ... node.children[ { name: "child1", level: 1, children: array[1], parent: root, id: 1 }, { name: "child2", level: 1, children: array[1], parent: root, id: 2 }, { name: "child3", level: 1, children: array[2], parent: root, id: 3 }, ] and inside node.children[1].children ... node.children[1].children[ { name: "child1-1", level: 2, children: array[0], parent: child1, id: 4 } ] what need loop through node object , try , match every " id " value given. example... $.each(node, function(i, nodes){ $.each(nodes, function (i2, nodes2){ if (nodes2.id == 5){ //do } }) })

sql - Creating Dynamic Column Names from Dynamic Row Number -

about me not sql dba programmer. pretending one. so, when comes designing complex queries beginner/middle of road depending on is. so far have come example show do. tried researching , have gotten far. what want rownumber dynamic based off 2 factors recid, groupeddataid. without getting whicked doing. hoping simple example illustrate enough. factors number of roles unknown. recid can have multiple groupeddataids. groupeddataids can have 1 record. output desired pcrid,groupeddataid, answertext, question 1 1 driver, driver role1 1 2 driver, driver role2 1 33 driver, driver role3 2 48 driver, driver role1 2 55 driver, driver role2 3 32 driver, driver role1 3 33 driver, driver role2 4 109 driver, driver role1 example created create table #example ( recid int, groupeddataid int, question varchar(50), answertext varchar(100) ) insert #example (recid, groupeddataid, question, answertext) select 1, 1, 'role', 'driver,

c# - XNA: My richtextbox is invisible when fullscreen is toggled -

i have added richtextbox in xna invisible when fullscreen toggled this code: richtextbox richtextbox1 = new richtextbox(); public engine() { graphics = new graphicsdevicemanager(this); content.rootdirectory = "content"; this.ismousevisible = false; graphics.preferredbackbufferwidth = 1280; graphics.preferredbackbufferheight = 720; graphics.isfullscreen = true; } protected override void initialize() { richtextbox1.location = new system.drawing.point(100, 100); richtextbox1.name = "richtextbox1"; richtextbox1.size = new system.drawing.size(100, 100); richtextbox1.tabindex = 0; richtextbox1.text = ""; control.fromhandle(window.handle).controls.add(richtextbox1); } the code above working fine if graphics.isfullscren set false when set direct x run full screen, form no longer visible. when form not visible, controls no

c# - Dynamic EF Where Clause raising ArgumentNullException -

i'm trying code method that, in it's class given values of of attributes, returns filtered dbset. code, far, is: public ienumerable<pesquisa> pesquisas { { prometheusdbcontext db = new prometheusdbcontext(); var temp = db.pesquisas; if ((this.filtro.nome != null) && (this.filtro.nome.trim() != "")) { temp = (temp.where(p => sqlfunctions.patindex(this.filtro.nome, p.nome) > 0) dbset<pesquisa>); } if ((this.filtro.codtipopesquisa != null) && (this.filtro.codtipopesquisa.trim() != "")) { temp = (temp.where(p => p.codtipopesquisa == this.filtro.codtipopesquisa.trim()) dbset<pesquisa>); } if ((this.filtro.idstatuspesquisa != null) && (this.filtro.idstatuspesquisa > 0)) { temp = (temp.where(p => p.idstatuspesquisa == this

xml - XSLT bug in Firefox? -

so have xml document describes table this <section columns="1" id="2" name="datatable"> <datatable name="testdatatable"> <displayoptions column="1" /> <tableoptions appendable="true" /> <header name="tableheader"> <label iscurrency="false">unit</label> <label iscurrency="false">type</label> <label iscurrency="false">min</label> <label iscurrency="false">max</label> .... more label header </header> <row> <label>a unit</label> <datafield id="312" name="unit1" controltype="text"> <fieldoptions visibility="true" iscurrency="false"/> </datafield> .... more dat

Jquery / Javascript execute, but do nothing -

i'm executing javascript/jquery, doesn't nothing. this code: function ocultagrid(idpanel) { var idpnl = '#' + idpanel $(idpnl).toggle(); alert("batman"); } the alert runs okay, toggle not. here call js: panel panelgrid = new panel(); panelgrid.id = "panel_grid" + i; linkbutton lkbtn = new linkbutton(); lkbtn.id = "link_button" + i; lkbtn.text = "+"; lkbtn.attributes["onclick"] = "javascript:return ocultagrid('" + panelgrid.id + "'), false"; ps.: jquery version 1.7.2 any idea, why it's not working? thanks in advance.

sql - Show job, total number of employees under each job from emp table -

i want output like: ---------- job count ename ---------- salesman 4 name1 name2 name3 name4 clerk 4 name1 name2 name3 name4 manager 3 name1 name2 name3 analyst 2 name1 name2 president 1 name .......and on. it shoud not repeat job title , count each name in job. have got answer repetition. sql fiddle oracle 11g r2 schema setup : create table employee ("job" varchar2(9), "ename" varchar2(5)) ; insert employee ("job", "ename") values ('salesman', 'name1') employee ("job", "ename") values ('salesman', 'nam

Running a batch file from another batch file from shared location -

i have batch file has series of commands (abc.bat). need copy file c:\abc\xyz folder , after copying need run abc.bat file shared location. the copy command same if typing directly command prompt: copy abc.bat c:\abc\xyz be sure include path original file location if isn't in same location current batch file running from. to run batch file batch file, use call keyword. call c:\abc\xyz\abc.bat

alignment - Jasper Reports - align dynamic text fields and their labels horizontally -

Image
i'm using jasper report 5.2, ireport 5.2 , exporting report in rtf , pdf formats. in report want add few text fields along (static text)labels aligned horizontally name: $f{name} age: $f{age} date of birth: $f{dateofbirth} but i'm unable align them. tried position type: float (for static text , fields) stretch type: no stretch (for static text , fields) stretch overflow: true (for dynamic text fields) the image shows , want. moreover, text field's content dynamic i.e. content size vary. i've read many forums not find solution, please suggest. thanks it can done of container - frame element. you should put frame position type float , put them both statictext (label) , textfield . for textfield i've set position type float stretch overlfow true . the sample the jrxml file: <?xml version="1.0" encoding="utf-8"?> <jasperreport xmlns="http://jasperreports.source

cpython - Python: where is the method listdir because there is no "def listdir()" in module os.py? -

python: wonder method listdir because not in module os.py. in module there no method: def listdir () the listdir method implemented in c module, , imported dynamically depending on operating system environment. can see imports near top of os.py , in blocks : if 'posix' in _names: name = 'posix' linesep = '\n' posix import * then file posixmodule.c in python source has posix implementation of listdir : https://github.com/python-git/python/blob/master/modules/posixmodule.c#l2068 (and likewise other oses).

password protection - Programmatically unprotect MS Excel VBA project in Windows 8 -

i'm having trouble unprotecting workbook's vba project via code. sendkeys method used work pretty well, in windows 8 64-bit doesn't work anymore. reason? know different method environment? i had same issue module password. , know sounds little twisted way work out how unprotect module locally store copy of module unprotected, use code remove exiting module , export in unprotected version, make changes required using vba vise verse again. utilizing export , import function on module. you'll need store protected , unprotected versions locally in separate folders. hope helps!

java - SVNKit to find diff between two files stored at separate locations with separate revision numbers -

i writing java program using svnkit api, , need use correct class or call in api allow me find diff between files stored in separate locations. 1st file: https://abc.edc.xyz.corp/svn/di-edc/tags/ab-cde-fgh-axsym-1.0.0/src/site/apt/releasenotes.apt 2nd file: https://abc.edc.xyz.corp/svn/di-edc/tags/ab-cde-fgh-axsym-1.1.0/src/site/apt/releasenotes.apt i have used listed api calls generate diff output, unsuccessful far. defaultsvndiffgenerator diffgenerator = new defaultsvndiffgenerator(); diffgenerator.displayfilediff("", file1, file2, "10983", "8971", "text", "text/plain", output); diffclient.dodiff(svnurl1, svnrevision.create(10868), svnurl2, svnrevision.create(8971), svndepth.immediates, false, system.out); can provide guidance on correct way this? your code looks correct. prefer using new api: final svnoperationfactory svnoperationfactory = new svnoperationfactory(); try { final by

Why is the ROWID column that comes with every fusion table hidden? -

i have been adding id column fusion tables, appears not needed because every fusion table automatically comes rowid column auto populates. why column hidden , how change displayed? it makes no sense me hidden default. this not possible fusion tables ui, there's feature request can add star to: https://code.google.com/p/fusion-tables/issues/detail?id=859

How to enclose a text in box in itextpdf (while generating pdfs) -

i have display normal text , next following text should inclosed in box. how can in itextpdf. there easy way. example name: name in above name should inclosed in box. if "box" mean colored background, can use setbackground() method: chunk chunk = new chunk("my name"); chunk.setbackground(basecolor.red); you can add 4 parameters extend rectangle left, bottom, right , top api documentation indicates. if "box" mean rectangle (without background color), can use generic tag event . movieyears example shows how add film strip or ellipse chunks. result shown here . years put in small box looks pellicule. imdb links put in blue ellipse.

javascript - Why same width Select and Input tag in Safari is outrageously different while rendering -

i have code setting width of <input> , <select> dynamically same (width-wise). know there ~5px width discrepancy between 2 if set width of <input> 100px set <select> width 105px; , seems work fine everywhere (chrome tends off pixel, fine me.) find out 100px width not equal 105px width in safari. in fact outrageously off. can see on following link: http://jsfiddle.net/jh8qc/5/ check on chrome/firefox , on safari see difference. then thought using css fix using -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; to maintain consistency. works not if set width dynamically seen here. http://jsfiddle.net/jh8qc/6/ any idea? you can width of tag running width() function that: var foo = $("#example").width(); you can width of inputs , selects , then, if desired value 200 (for example), can run this: $("#example").width(200);

asp.net - databind in gridview from dropdownlists -

i have 2 dropdownlists on webform. dlname , dlstage. have gridview needs based on values selected these 2 drop downs. currently, not filtering gridview , using following code: private void binddata() { string query = "select [annotationnumber],[annotationby],[annotationtype],[businessunit] unit,[errortype],[actualagencyerror],annotationcomments,[sgkcomments],[actualagencyerror],cust,name,annotationdate vw_gridviewsource "; sqlcommand cmd = new sqlcommand(query); gvsummary.datasource = getdata(cmd); gvsummary.databind(); } what have gridview check drop downs , bind data based on values in drop down lists. at end of select statement 2 values name , annotationdate variables need matched. included them in query because trying use datakey bind data failed. i pretty new can use possible. try this: // both drop down lists need selected value or don't query , bind if(!string.isnullorempty(dlname.selectedvalue

java - Using JTA does not roll back data in datastore in Jackrabbit -

when exception thrown data added datastore not rolled back. correct behaviour since uses filesystem? or should roll data in datastore. using spring 3.2. have deployed jackrabbit jboss 7.1.1. using jtatransactionmanager since using database. edit: after reading jta , spring added line spring config file. seems registers necessary things. in "test" have set store file in jackrabbit, throw runtimeexception (and after persisted database since exception aborts it never run far, normal case). happens inside 1 method in service layer annotated @transactional . after exception thrown still see file in datastore, tried empty datastore , expect file gone after exception thrown, still there. correct? meta data (which don't know stored) rolled back? <tx:jta-transaction-manager/> when files added datastore binaries stored in datastore early, after setting binary property node (even if node not saved, , change still in called "transient space"). mea

boost::spirit::lex, how does one generate a end of file token? -

the question rather simple, i've written lexer, using boost::spirit, can't seem find way, generate eof token. - how 1 go doing this? what eof token? historically, platforms have associated special 'eof' (ascii 26, e.g.) characters text files . use of 0x15 newline character , such uses largely defunct. end of file better defined absense of further input, in other words: stream state, not character. the token iterators spirit lex signal 'eof' returning end iterator. both tokenizer api ( lex::tokenize(...) ) spirit qi understand behaviour (by exiting tokenizing loop (lex) and/or making qi::eoi parser succeed match ). e.g. if need assert parsing reached end of input, you'd say myrule = subrule1 >> subrule2 > qi::eoi; or if want assert presence of (say, closing ; ) unless @ end of input: myrule = subrule1 >> subrule2 >> (qi::eoi | ';'); did miss question isn't addressed this?

c - Must the main() executable program be compiled and linked with gcov options to use gcov on shared library -

is there way gcov provide coverage analysis of shared library without building main() program uses shared library? i have external users of shared library have own executable programs use library , need test code coverage programs not have access source code. surely else has encountered problem gcov. the main() , shared library written in c. main() program have source code able use gcov fine execution trace of calls placed shared library. i have not seen examples gcov used without compiling , linking main() program. never less asking question hope else has found work around solution. a similar question has been posted on gcc-help. warren ferguson

php - Redirecting specific (but a lot of) URLs to include specific text -

the problem: first of site using wordpress. using facebook sharer on lots of links include # or fragment identifier in url. problem facebook sharer doesn't allow , stops link. for example if link is: example.com/europe/#comment-123 the facebook sharer change to: example.com/europe i have been able change facebook sharer url display following: example.com/europe/123 achieved using code within "[url]=" part of facebook sharer code: <?php echo esc_url ( get_permalink()); ?><?php comment_id(); ?> one way have tried solve problem trying echo "#comment-" using code: <?php echo esc_url ( get_permalink()); ?><?php echo "#comment-" ?><?php comment_id(); ?> but once again facebook sharer stops displaying. desired solutions: 1) if knows code allow facebook sharer hyperlink fragment identifier 2) read elsewhere possible solution redirect. if can facebook sharer display url of example.com/europe/123 , can red

Cannot assign new value to array element - javascript -

i relatively new programming , new javascript/html/css (read on few tutorials) , having weird problem first script. (trying make sudoku solver) array puzzle contains: "3.542.81.4879.15.6.29.5637485.793.416132.8957.74.6528.2413.9.655.867.192.965124.8 " puzzle[0] = 3 puzzle[ 1 ] = . , on. puzzle represents unsolved sudoku puzzle digits 1-9 rep solved cells , . unsolved cells. below code 1 of functions , there 4 alert messages in it. problem lies near message 4 puzzle[c+(9*r)] = nums[0]; shows puzzle[c+9*r] still contains . , not value of num[0] (in first case 6). declared outside of functions: var puzzle = new array(); var options = new array(); var nums = new array(); var r = 0; var c = 0; var num=0; function checknumber works fine * message 1: "puz conatians ." message 2: "nums length 1" message 3: "nums[0] 6" message 4: = "puzzle ." should "puzzle 6" any appreciated! please let me know if need furth

swing - JTable doesn't show all over in JFrame in java -

i have jtable add jpanel . add jpanel jframe called frame. frame show table when maximize window jpanel still remains small size. want show jpanel on frame when maximize frame. here code: import java.awt.borderlayout; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.resultsetmetadata; import java.sql.statement; import java.util.vector; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jscrollpane; import javax.swing.jtable; @suppresswarnings("serial") public class testclass extends jpanel { public testclass() { vector columnnames = new vector(); vector data = new vector(); int columns =3; // column names columnnames.addelement("id"); columnnames.addelement("name"); columnnames.addelement("age"); // row data vector row = new vector(columns);

c++ - Visual Studio 2012 app could not load file or assembly -

the infamous not load file or assembly "filename.dll" or 1 of dependencies. i error when client tries run mixed c/c++/c# app developed in vs2012. used process monitor see modules not being loaded , got weird results. on developer computer, vs2012 installed, runs fine. client computer not have visual studio installed, have .net 4.0 , redistributable update. for reason when program run on client computer, handful of c:\windows\microsoft.net\assembly\gac_msil\system(*.ini) files queried. since these files not exist, confident issue. now, why when ran on developer computer these files not queried, when ran on client computer these files become necessary? you can use fusion utility(assembly binding log viewer) determing problem run command prompt admin, fuslogvw.exe tool determine referenced assemblies calls in program , including broken references. helped me lot while trying resolve unmapped ioc registries. you can learn more here http://msdn.microsoft.com/

unity3d - Include custom Activity inside of Unity Android Plugin (Without overriding UnityPlayerActivity)? -

i trying write android plugin unity3d interface google play in app billing. aware there existing plugins out there this, wish on own. it appears need catch android's activity::onactivityresult handle successful purchase through gplay iab sdk. issue java class not contain activity because want run in background behind actual unity application. this code gplay iab sdk initiates purchase flow. if pass "unityplayer.currentactivity" activity, google play pops up, , can purchase product. however, not receive successful message oniabpurchasefinishedlistener. if purchases unsuccessful (ie: own product) receive callback there. public void launchpurchaseflow(activity act, string sku, string itemtype, int requestcode, oniabpurchasefinishedlistener listener, string extradata) ... ... act.startintentsenderforresult(pendingintent.getintentsender(), requestcode, new intent(),

Python - how to fix the unhashable type: 'dict' and format requires a mapping for operator tripple quotes -

how arr , myname formatted? arr = { 'pincode':'pincode', 'username':'username', 'password':'password', 'action':'action', 'forward':'forward' } myname="myname" print """my pincode is: %(pincode)s , name is: %s !""" % {arr, myname} print """my pincode is: %(pincode)s , name is: %s !""" % (arr, myname) expecting output: my pincode is: pincode , name is: myname ! getting: typeerror: format requires mapping typeerror: unhashable type: 'dict' typeerror: not enough arguments format string this works: arr = { 'pincode':'pincode', 'username':'username', 'password':'password', 'action':'action', 'forward':'forward' } myname="myname" print """my pincode is: %s , name is: %s !""" % (arr['pin

gruntjs - AngularJS + Grunt + Karma + E2E -

i tried run e2e tests grunt karma, no success. i've many solutions, no 1 worked! my karma-e2e.conf.js: module.exports = function(config) { config.set({ // base path, used resolve files , exclude basepath: '../', // frameworks use frameworks: ['ng-scenario'], // list of files / patterns load in browser files: [ 'test/e2e/**/*.js', 'test/e2e/*.js' ], // list of files exclude exclude: [ ], // test results reporter use // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' reporters: ['progress'], // web server port port: 9877, // enable / disable colors in output (reporters , logs) colors: true, // level of logging // possible values: config.log_disable || config.log_error || config.log_warn || config.log_info || config.log_debug loglevel: config.log_info, //

mysql - Collecting multiple columns of aggregate data with a join -

i'm trying figure out if query i'd @ doable or feasible in sql or if need collect raw data , process in application. my schema looks this: applications ================ id int application_steps ================= id int application_id int step_id int activated_at date completed_at date steps ===== id int step_type_id int ideally, data in application_steps : | id | application_id | step_id | activated_at | completed_at | | 1 | 1 | 1 | 2013-01-01 | 2013-01-02 | | 2 | 1 | 2 | 2013-01-02 | 2013-01-02 | | 3 | 1 | 3 | 2013-01-02 | 2013-01-10 | | 4 | 1 | 4 | 2013-01-10 | 2013-01-11 | | 5 | 2 | 1 | 2013-02-02 | 2013-02-02 | | 6 | 2 | 2 | 2013-02-02 | 2013-02-07 | | 7 | 2 | 4 | 2013-02-09 | 2013-02-11 | i want result: | application_id | step_1_days | step_2_days | step_3_days | step_4_days | | 1

java - How many times 'X' sequence repeat on ArrayList -

supposing have following sequence in arraylist<integer> 1 2 3 4 1 2 3 4 5 6 i need know how many times sequence (1,2,3,4) appears on list. for example, answer 2! i need 2 solutions, one, numbers need in following sequence (1,2,3,4) , without following sequence (4,1,2,3) i'm using java, in advance. what tried: check sequence, , if it's true: anotherlist.add(integer.valueof(1)); anotherlist.add(integer.valueof(2)); anotherlist.add(integer.valueof(3)); anotherlist.add(integer.valueof(4)); if(thelist.containsall(anotherlist)) thelist.removeall(anotherlist); but when it, removes 1s, 2s, 3s , 4s in list. on presumption can't overlap counts (so 1,1,1,1 in list (1,1,1) sequence gives 1). in algorithm can code (i won't give psuedocode until see solid progress on problem): use loop, see if current number in list matches first number in sequence. if doesn't match, move next number in lis

php - Async ajax calls messes up image source -

i'm using d3.js in conjunction facebook php sdk display visitors friends. each friend displayed in small div name , profile picture. my problem facebook api doesn't return direct link profile picture. instead, have use url https://graph.facebook.com/userid/picture?redirect=false , , url picture returned in json. other friend data fetched , stored in javascript array. now, set ajax call deal this, doesn't work because of asynchronous nature. once picture urls fetched, dom loaded , images <img src="undefined"> . from main.js function ajax(path) { $.ajax({ type: "get", url: "ajax.php", data: {'path': path}, success: function(data) { return data; //returned data correct } }) } // d3 code profile.append("img") .attr("src", function(d) { return ajax(d.id); }) //this "undefined" .attr("class", "thumb"); from ajax.php $path = file_get_co

Raspberry Pi Pianobar PulseAudio -

i have been trying pianobar working on raspberry pi. built version 2013.05.19-dev github , works when have /etc/libao.conf default_driver=alsa . problem gives horrible quality audio. followed instructions installing pulseaudio , mpd on dbader's blog . when set default_driver=pulse , pianobar tells me /!\ cannot open audio device . have been looking solution tips or great!

ruby - Automate testing of process flows in Rails -

i building educational service, , rather process heavy application. have lot of user actions triggering various actions, present, future. for example, when student completes lesson day, following should happen: updating progress count user-module record checking if has completed particular module , progressing him next 1 (which in turn triggers more actions) triggering current emails other users triggering future emails himself (ongoing lesson plans) creating range of other objects (grading todos teachers) any other special case events all these triggers built observers of various objects, , execution delayed using sidekiq. what killing me testing, , paranoia might breaking whenever push something. in past, lot of assertion , validations checks, , sufficient. project, think not enough, given elevated complexity. as such, implement testing framework, after reading through various options (rspec, cucumber), not clear should investing effort into, given rather specif