Posts

Showing posts from February, 2013

html - Changing a DIV class style in JavaScript -

this question has answer here: javascript getelementsbyclassname() returns none? 3 answers how apply style class in javascript? 2 answers i can change style of div id... document.getelementbyid('test').style.display = "none"; why can't same thing class? document.getelementsbyclassname('egg').style.display = "none"; how change style of class? thanks document.getelementsbyclassname returns list of elements class specified. can set display none of first element: document.getelementsbyclassname('egg')[0].style.display = "none"; or loop through list , set each desired effect: var eggs = document.getelementsbyclassname('egg'); for(var = 0; < eggs.length; i++) { eggs[i].style.display=...

java - Can't insert into Sql Server using Spring Framework SimpleJdbcInsert -

i'm trying insert row in sql server 2008 using jdbc spring framework: here code: bdclass bdclass= new bdclass(bdclass.bdconfig.connectionstring_myhome); person personanueva = new person(); personanueva.setidperson(5); personanueva.setusuario("javauser"); personanueva.setclave("javapassword"); personanueva.setnombre("javanombreusuario"); personanueva.setactivo("s"); personanueva.addperson(bdclass); //person class public void addperson(bdclass bdclass) { map<string, object> parameters = new hashmap<string, object>(); parameters.put(constantes.idperson, this.getidperson()); parameters.put(constantes.usuario,this.getusuario()); parameters.put(constantes.clave,this.getclave()); parameters.put(constantes.nombre,this.getnombre()); parameters.put(constantes.activo, this.getactivo()); bdclass.insert(parameters,constantes.table_name); } //bdclass insert in step enabling identity insert pub...

objective c - How to solve this error 'BIO_new' is deprecated in cocoa? -

i new macintosh development. have nsdata+connection.m file. file have more deprecated function bio_new , bio_write , bio_get_mem_data etc. functions encounter deprecated errors. - (nsstring *)base64encoding { bio * mem = bio_new(bio_s_mem()); bio * b64 = bio_new(bio_f_base64()); bio_set_flags(b64, bio_flags_base64_no_nl); mem = bio_push(b64, mem); bio_write(mem, [self bytes], [self length]); bio_flush(mem); char * base64pointer; long base64length = bio_get_mem_data(mem, &base64pointer); nsstring * base64string = [nsstring stringwithcstring:base64pointer length:base64length]; bio_free_all(mem); return base64string; } please me. what apple has deprecated using their openssl headers , their openssl dynamic library. reason openssl's interface changes in incompatible ways across minor revisions, it's hard keep date bugfixes , security updates without breaking clien...

java - Opencl with jocl: same computation rules for cpu and gpu -

i'm using jocl apply trigonometric functions on elements of float-array. while doing same code on both cpu , gpu @ same time, results vary minorly on 0.000x digits , rarely. must origineated differecies cores of cpu/gpu. 1 using little different algorithm(maybe i'm mistaken). question: how can tell opencl/jocl use same rounding/ieee-rules calculate trigonometric/exponential functions? edit: system.out.println() 's rounding incident when written on console? problem emerges especialy when applied sin() or cos() 80000 times of feedback. thanks. host: fx8150 devices: fx8150 + hd7870(will used on 2x xeons , 1 firegl 4800 later)

access xampp/htdocs directory from remote computer -

i have installed xampp server in computer a. want access xampp server other computer b.i typed ip address of computer ,where xampp server installed , in browser of computer b. landed **http://xx.xx.xx.xx/xampp** page. want access htdocs directory not able access it.i used path. http://xx.xx.xx.xx/htdocs and http://xx.xx.xx.xx/xampp/htdocs i getting error object not found somebody please explain doing wrong? first of have see permitions of xampp (they blocked default , can see @ php.ini if recall well) , firewall of computer b. after that, should see port of xampp in computer b , should see localhost of computer. if doing in differents places, should see if operator allow see ip remotely. in countries blocked too.

angularjs - Modify scope variables outside the controller -

is possible modify $scope variables on button click if button outside controller area? for example: <input type="button> <div ng-controller="meetingsctrl"> using classes or ids find elements not how things typically done in angular. a controller typically defined on top-level element of each view. if button belongs view managed meetingsctrl , should inside div . however, maybe button part of view, in case need 2 views interact each other. done via services, each controller injecting same service. or use events.

c++ - Will std::cout affect timers? -

i have graphics program, , want measure time function calls take. since not sure how std::cout works under hood, wanted ask if calls in between timer calls affect performance. know it's slow in naturally not put in functions i'm measuring, buffered/asynchronous effect linger after call returns in way? looking (pseudocode): timer->start(); runsomefunction(); timer->stop(); std::cout << timer << std::endl; // affect next timer event? timer->start(); runanotherfunction(); timer->stop(); std::cout << timer << std::endl; // etc in short, no. longer answer: however, depend, cout going to, , system running on. typically, internals of cout use sort of "write file" system call, file "standard out" filehandle - may sort of display device, window or file if output redirected. may of course lead sort of interrupt or process elsewhere running (e.g. "cmd.exe" in windows or "xterm" or similar in...

qt - Error: Cannot assign QObject* to QQuickItem* -

i error when try show either dialog or popup in tab. don't understand why. in other apps i've made, works, cannot see difference between them. what doing wrong? i made example code has exact same issue: import qtquick 2.0 import ubuntu.components 0.1 import ubuntu.components.listitems 0.1 listitem import ubuntu.components.popups 0.1 mainview { // objectname functional testing purposes (autopilot-qt5) objectname: "mainview" // note! applicationname needs match .desktop filename applicationname: "testar" /* property enables application change orientation when device rotated. default false. */ automaticorientation: true width: units.gu(50) height: units.gu(75) tabs { id: tabs // first tab begins here tab { objectname: "tab1" title: i18n.tr("hello..") // tab content begins here page: page { column { width: parent.width listitem.standa...

how to run java project using batch file -

i have written java project contains 1 class. i want run on pc's using batch file. please advise me how this. class contains parameters running. i organize them in such way: scanner in = new scanner(system.in); system.out.println("enter value1: "); value1 = double.parsedouble(in.nextline()); path java c:\program files\java\jdk1.7.0_09\bin project in eclipse workspace. i need add want see in cmd output "enter value1: " , have possibility set value during execution. you need write batch file mentioned here: "%java_home%\bin\java" -cp "path of class files" nameofyourclass

ios - Drawing a polygon with one color for stroke, and a different one for fill? -

Image
i'm having trouble drawing lines stroked color , filling insides (they make polygon) one. uicolor *housebordercolor = [uicolor colorwithred:(170/255.0) green:(138/255.0) blue:(99/255.0) alpha:1]; cgcontextsetstrokecolorwithcolor(context, housebordercolor.cgcolor); cgcontextsetlinewidth(context, 3); // draw polygon cgcontextmovetopoint(context, 20, viewheight-19.5); cgcontextaddlinetopoint(context, 200, viewheight-19.5); // base cgcontextaddlinetopoint(context, 300, viewheight-119.5); // right border cgcontextaddlinetopoint(context, 120, viewheight-119.5); cgcontextaddlinetopoint(context, 20, viewheight-19.5); // fill cgcontextsetrgbfillcolor(context, (248/255.0), (222/255.0), (173/255.0), 1); //cgcontextfillpath(context); // stroke cgcontextstrokepath(context); with cgcontextstrokepath commented out, result: but if uncomment cgcontextstrokepath , fill out polygon, color overflows strokes: how achieve result (without having redo whole drawing procedure twice): ...

localization - Visual Studio InstallShield Project building error about localized resources -

i created installshield setup project in visual studio 2012. in application files section of project assistan , added "primary output" , "localized resources" files using add project outputs button after completed other sections. when trying build setup project, i'm getting error below. could not resolve visual studio .net project output '{projectname}.localized resources' component {projectname}.localized_resources i have 3 different projects in solution , have got error 2 projects. if there no localized resource in project, installshield gives error. to avoid error ( maybe complete resources localization when project completed need setup now ) and complete setup project building, @ least 1 resource file must localized in project .

ruby on rails - What's the best way to store images for a carousel? -

i'm using ruby on rails. i'll have 2 carousels on landing page, , want know best way store , display these images: option one put images in assets/images , show them in carousel. if way, can loop through images in folder or i'll have specify each 1 of files? option two create model image column , loop through images have specific attribute? other three something else thanks! i'd recommend not place them directly in assets/images directory because add application-specific images app @ point won't want in carousel. folder app/assets/images/carousel , example, allows more determine images belong in carousel. in controller, add following: @images = dir.glob("app/assets/images/carousel/*.{gif,jpg,png}") then, in view, add following (assuming erb) <% @images.each |image| %> <%= image_tag "carousel/#{image.split('/').last}" %> <% end %>

apache - Can I write an HTML response from an .htaccess file -

apologies if stupid question, can control html response .htaccess file (apache)? in other words (psuedo code) write <!doctype html><html>...[etc] the reason ask because "take down" sites in 1 "hit", without replacing files or having other kind of holding page. i found answer myself, worked needed: errordocument 503 "<!doctype html><html><head><title>this website undergoing maintenance</title></head><body style='font-family: sans-serif'><h1>this website undergoing maintenance</h1></body></html>" rewriteengine on rewriterule .* - [r=503,l] hope helps somebody

jquery - How to properly utilize .scrollTop() -

could please let me know why not working? $(window).scroll(function(){ if($(window).scrolltop() > 100){ alert("scroll in y > 100px!"); } }); i have tried quite few variations of code, none seem work. can line 1 run alert function on own seems crash browser. page linked jquery-1.9.1 , above code on external .js file , referenced. relatively new jquery sorry if question elementary. thank in advance!

c++ - Sort by lexicographical_compare() function -

is there way sort string using lexicographical_compare() function in c++? i can stl sort, question lexicographical_compare() function. you don't need std::lexicographical_compare sort string. need std::sort algorithm: #include <iostream> #include <string> #include <algorithm> int main() { std::string s("qwertyuioplkjhgfdsazxcvbnm"); std::cout << s << "\n"; std::sort(s.begin(), s.end()); std::cout << s << "\n"; } the same applies sorting collection of strings: #include <iostream> #include <string> #include <vector> #include <algorithm> int main() { std::vector<std::string> v{"apple" , "apple" ,"apple" , "apple"}; (const auto& s : v) std::cout << s << " "; std::cout << "\n"; std::sort(v.begin(), v.end()); (const auto& s : v) std::cout << s ...

mod rewrite - Apache URL Rewriting - change globally the root of a site -

i'd internally redirect url coming root , subdirectories of site specific subdirectory (and subdirectories) of root, i.e. http://example.net/index.html --> /prod/index.html http://example.net/image/im01.jpg --> /prod/image/im01.jpg .... my provider gives me access .htaccess, not global server configuration files. i tried following rule: rewriterule ^(.*) /prod/$1 [l] but doesn't work because of internal redirect , recursive match of rule. you need condition avoid infinite loop. add rewritecond before rule: rewritecond %{request_uri} !^/prod/ some helpful links apache url rewriting: url rewriting beginners apache rewrite guide rewriterule tester

jquery - hasClass if statement for navigation -

first post here bear me! i using jquery ui tabs plugin create gallery , want have little arrow slide left , right show user gallery being shown: the code i'm using this: <script> if ($('#wedding-btn').hasclass('ui-state-active')) { $('.nav-selector').css('left', '5px'); } else if ($('#portrait-btn').hasclass('ui-state-active')) { $('.nav-selector').css('left', '125px'); } else if ($('#landscape-btn').hasclass('ui-state-active')) { $('.nav-selector').css('left', '255px'); } else if ($('#blackandwhite-btn').hasclass('ui-state-active')) { $('.nav-selector').css('left', '410px'); } </script> here link show i'm talking about: http://www.maxhenchman.co.uk/oh/latest2/ i've looked @ other articles on here , code above seems should work...but i'm pretty new jquery i'm wrong...

CSS: aligning overlays -

i'm trying create responsive design logo, using 2 strings, both transparent. strings in different sizes, second on top of first. i've got want ( try html below) right hand edge of 2 strings align - div extends width of browser , overlap changes width of display. because want give browser choices on how it's rendered rather not use measurements in pixels. if @ relevant - plan add additional elements either side of div. <!doctype html> <html> <head> <style> .outertext { position: relative; font-family: arial,sans-serif; font-weight: 900; font-size: 800%; text-align:center; letter-spacing: -0.1em; color: red; opacity: 0.2; top: 0; left: 0; } .innertext { position: absolute; font-family: arial,sans-serif; font-weight: 900; font-size: 600%; text-align:right; letter-spacing: -0.1em; float: right; color: blue; opacity: 0.2; z-index: 1; right: 0; bottom: 0; }...

reporting services - Report rsExecutionNotFound when exporting to other formats -

i using crm 4.0 ssrs. can display reports take long time. when report displays can export excel, xml or file type within in 10 minutes. after 10 minutes, cannot export reports excel or other formats. report message : the report execution ifjzab55k5icxl4510oyfsmt has expired or cannot found. (rsexecutionnotfound) report server log text: error: throwing microsoft.reportingservices.diagnostics.utilities.reportserverstorageexception: , error occurred within report server database. may due connection failure, timeout or low disk condition within database.; session!reportserver_0-10!17c8!05/09/2013-16:03:14:: e error: error in getting session data: expired session: qkmiqv455sdu5wyc2sa23az1 session!reportserver_0-10!17c8!05/09/2013-16:03:14:: info: loadsnapshot: item session: qkmiqv455sdu5wyc2sa23az1, reportpath: , username: vrvending\crm.service not found in database library!reportserver_0-10!17c8!05/09/2013-16:03:14:: e error: throwing microsoft.reportingservices.d...

jQuery email validation issue -

i found jquery email validation works fine on own. have added other functions validate checkboxes , empty fields. full code here: http://jsfiddle.net/vuags/4/ function validateemail(email) { var emailreg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if( !emailreg.test( email ) ) { add_color(email, 'orange'); return false; } else { add_color(email, white); return true; } } the form still return not valid though email valid. i made changes on fiddle, , works....you can refine code ;) html: <input class="email_val" type="email" id="emailin" value=""/> js: function validate_form(){ $('form input:not(.checkbox_wrapper input, .email_val), textarea').each(function(){ if ($(this).val() == '') { add_color($(this), red); } else { add_color($(this), white); ...

php - contact form is blank; contact form reply goes to wrong address -

am trying make captcha-free, spam blocking contact form. user's point of view, appears working since thank-you page appears after send button clicked. problem #1 : email arrives blank, containing none of content of message sent. found post here sounds similar, suggestion offered didn't apply: contact form problem - receive messages, no contents (blank page) . problem #2 : reply message shows in same inbox instead of being sent form user's address--which when testing, own. the html: <form method="post" action="submit.php"> <p>name:<br> <input type="text" name="name" id="name" /></p> <p>phone:<br> <input type="text" name="phone" id="phone" /></p> <p>email:<br> <input type="text" name="email" id="email" /></p> <p class="antispam">leave empty:<br /...

php - PHPUnit Mock Database Connection Class -

i'm adding unit tests legacy codes in mvc framework. have model class called dbconnection initiate database connection, looks this: class dbconnection function __construct() { mysql_connect(hardcoded) } } every methods needs database access call dbconnection, this: function insertuser() { $db = new dbconnection(); $sql = "select ..... .... } if want have option of either connect different testing database or using xml file mock database, how should without refactor code?

javascript - jQuery/Foundation: Uncaught TypeError: Object #<Object> has no method 'hover' -

the following code (foundation 4, jquery) <script> $(document).ready(function(){ $("#important img").hover(function() { alert(""); }); }); </script> </body> gives following error: uncaught typeerror: object # has no method 'hover' usually error caused missing $ not in case? edit: here's how foundation 4 html looks @ end of body: <script> document.write('<script src=' + ('__proto__' in {} ? 'js/vendor/zepto' : 'js/vendor/jquery') + '.js><\/script>') </script> <script src="js/foundation.min.js"></script> <script src="js/foundation/foundation.js"></script> <script src="js/foundation/foundation.alerts.js"></script> <script src="js/foundation/foundation.clearing.js"></script> <script src="js/foundation/foundation.cookie.js"></script> ...

python - How to resize only image width using scrapy? -

using scrapy can resize image , keep aspect ratio. http://doc.scrapy.org/en/latest/topics/images.html#std:setting-images_thumbs images_thumbs = { 'small': (50, 50), 'big': (270, 270), } what want re sizing image width , keeping image height is. know how ? note: i'm using scrapy upload images amazon s3, don't have option of resizing them locally. you create own images pipeline . in item_completed method, can open downloaded images , resize them using pil . scrapy uses pil imaging pipelines. here tentative example. (i don't use scrapy.) from scrapy.contrib.pipeline.images import imagespipeline scrapy.exceptions import dropitem scrapy.http import request pil import image class myimagespipeline(imagespipeline): def get_media_requests(self, item, info): image_url in item['image_urls']: yield request(image_url) def item_completed(self, results, item, info): result, image_info in resul...

database - symfony2 doctrine.dbal.connection_factory with ssl? -

i connect remote database within symfony2 app code $connectionfactory = $this->container->get('doctrine.dbal.connection_factory'); $conn = $connectionfactory->createconnection(array( 'driver' => 'pdo_mysql', 'user' => 'mattias', 'password' => 'fdfsdf', 'host' => 'fs1.rrtgy.se', 'dbname' => 'csmedia', )); return $conn; is there parameter can set using ssl? the equivalent of this: $link = mysql_connect("192.112.7.18","test","testpass",false,mysql_client_ssl) you try add createconnection array 'driveroptions' $conn = $connectionfactory->createconnection(array( 'driver' => 'pdo_mysql', 'user' => 'mattias', 'password' => 'fdfsdf', 'host' => 'fs1.rrtgy.se', ...

angularjs - Separate models from controllers -

i have - function detailctrl($scope) { $scope.persons = [{ id: 1, name: "mark" }]; } i'd keep models separate controller, - //models var person = { id: '', name: '' }; function detailctrl($scope) { person = db.getperson(); $scope.person = person; } is practice in angularjs? come asp.net mvc background. yes, best practice have models elsewhere, , have scopes reference models: listen 2 minutes of misko "best practices" video. services place store models. brandon has answer related this: https://stackoverflow.com/a/14667066/215945

python - In Django, how does one filter a QuerySet with dynamic field lookups? -

given class: from django.db import models class person(models.model): name = models.charfield(max_length=20) is possible, , if how, have queryset filters based on dynamic arguments? example: # instead of: person.objects.filter(name__startswith='b') # ... and: person.objects.filter(name__endswith='b') # ... there way, given: filter_by = '{0}__{1}'.format('name', 'startswith') filter_value = 'b' # ... can run equivalent of this? person.objects.filter(filter_by=filter_value) # ... throw exception, since `filter_by` not # attribute of `person`. help appreciated & thank in advance. python's argument expansion may used solve problem: kwargs = { '{0}__{1}'.format('name', 'startswith'): 'a', '{0}__{1}'.format('name', 'endswith'): 'z' } person.objects.filter(**kwargs) this common , useful python idiom.

swing - at java.awt.AWTEventMulticaster.mouseExited(Unknown Source) occur after using the GUI for several times -

good morning, i'm implementing gui game , when play game sometime endless number of exception game freezes, on problem or how fix appreciated here code: public class boardframe extends jframe implements mouselistener { private void boardwithoutcheckers() { for(int i=0; i<8; i++) { for(int j=0; j< 8; j++) { if(((i + j) % 2) == 0){ boardframe[i][j] = new lightgraybutton(); } else { boardframe[i][j] = new darkgraybutton(); } boardframe[i][j].addmouselistener(this); this.getcontentpane().add(boardframe[i][j]); } } this.setvisible(true); } @override public void mouseclicked(mouseevent e) { count++; if(count == 1){ (int = 0; < 8; i++) { (int j = 0; j < 8; j++) { if(e.getsource().equals(boardframe[i][j])){ ...

excel - XLS - Conditional Formatting - Java POI Example -

:) after research found solution problem, not yet satisfied i use conditional formatting show line yellow color if column b , c same line not have same value. marco on vba i'm not using me undrstund = 3 fin step 1 range("c" & i).select selection.formatconditions.delete selection.formatconditions.add type:=xlcellvalue, operator:=xlnotequal, _ formula1:="=b" & selection.formatconditions(1).interior.colorindex = 6 this methode java .it fileinputstream file = new fileinputstream(new file("d://deq//"+selectitem.getrefdeq()+"//comparatif.xls")); hssfworkbook workbook1 = new hssfworkbook(file); hssfsheet sheet1 = workbook1.getsheet("page1"); hssfsheetconditionalformatting cf =sheet1.getsheetconditionalformatting(); hssfconditionalformattingrule cfrole=cf.createconditionalformattingrule(org.apache.poi.hssf.record.cfrulerecord...

How to get a file name currently being read into SAS? -

%sysget(sas_execfilename) , %sysget(sas_execfilepath) sas program submitted data file itself? use infile statement in data step , filename= , others characteristics written sas log, how print file name being read title ?

javascript - Calculating Subtotals for Category Sections Using Class Names -

i'm working on project based on excel spreadsheet, need calculate budgets, etc. there various categories in table, , need calculate subtotal of each category. here's screenshot make more clear: http://i.imgur.com/loylbw7.png my problem is, i'm not sure how calculate subtoal each category. right now, have $('.subcat100 .budget').each(function(). class "subcat100" attached tr , changes each category section (subcat100, subcat200, subcat300, etc.). numerical value based off sub category number stored in database. how pull of these classes , iterate through them? jquery: $(document).ready(function() { $('input[name="txtquantity[]"],input[name="txtunitcost[]"]').change(function(e) { var budget = 0; var $row = $(this).parent().parent(); var quanity = $row.find('input[name="txtquantity[]"]').val(); var unitcost = $row.find('input[name="txt...

html - Adjusting and image Size to fit a div (bootstrap) -

i'm trying image fit within specific size div. unfortunately, image isn't conforming , instead proportionally shrinking size isn't big enough. i'm not sure best way go getting image fit inside is. if isn't enough code, i'd happy supply more, , i'm open fixing other errors overlooking. here html <div class="span3 top1"> <div class="row"> <div class="span3 food1"> <img src="images/food1.jpg" alt=""> </div> </div> <div class="row"> <div class="span3 name1"> heres name </div> </div> <div class="row"> <div class="span3 description1"> heres describe , "read more" </div> </div> </d...

c# - Sql Injection parameterised query -

i need achieve function below public partydetails getallpartydetails(string name) { try { string query = "select * [party details] name=@name "; pd = new partydetails(); com = new sqlcecommand(query, con); com.parameters.addwithvalue("@name", name); con.open(); sdr = com.executereader(); while (sdr.read()) { pd.name = sdr.getstring(0); } con.close(); return pd; } catch (exception e) { con.close(); throw e; } } but function not efficient me because don't need write different function code because of change in query. now need public partydetails getallpartydetails(string query) { try { pd = new partydetails(); com = new sqlcecommand(query, con); con.op...

Can we use PHP iF Statements in <<<EOD syntax code -

i using <<<eod output data. question how use php if condition inside <<<eod syntax? can use this <<<eod <h3>caption</h3> if(isset($variablename)) { echo "...some text"; } else { echo "...some text"; } eod; no, because inside <<< block (known "heredoc") string. if write code in question, you'll writing string containing php code, isn't want (i hope). do logic outside of heredoc, , use plain variables inside it: if(isset($variablename)) { $outputvar = "...some text"; } else { $outputvar = "...some text"; } print <<<eod <h3>caption</h3> {$outputvar} eod;

java - Convert audio stereo to audio byte -

i've trying audio processing, i'm stuck stereo mono conversion. looked in internet regarding stereo mono conversion. as far know, can take left channel, right channel, sum them , divide 2. when dump result wav file again, got lot of foreground noise. know noise can caused when processing data, there overflow in byte variable. this class retrieving byte[] data chunks mp3 file: public class inputsounddecoder { private int buffer_size = 128000; private string _inputfilename; private file _soundfile; private audioinputstream _audioinputstream; private audioformat _audioinputformat; private audioformat _decodedformat; private audioinputstream _audioinputdecodedstream; public inputsounddecoder(string filename) throws unsuportedsamplerateexception{ this._inputfilename = filename; this._soundfile = new file(this._inputfilename); try{ this._audioinputstream = audiosystem.getaudioinputstream(this._soundfile); } catch (exception e){ e.print...

ruby on rails - ghostscript pdf to thumbnail -

i searched didn't got solution want create thumbnail pdf using ghostscript of pixels 185x185. tried using options- gs -q -sdevice=png16m -dnopause -dbatch -r35x36 -dpdffitpage=true -ddevicewidth=185 -ddeviceheight=185 -soutputfile= output.%d.png input.pdf i have reffered question on stackover flow thumbnail generation ghostscript rotates device size definition landscape pdf pages but image not being created of size want. how this.?? in advance add -dfixedmedia prevent pdf file changing media size. believe can omit -r well, since resolution doesn't make sense when specify media size in pixels.

jquery - Bug in html5 video when overflow is hidden? -

i have div scrollsdown when called anchor tag , covers 50% of div underneath (using higher z-index). when div loads via ajax call, there video oversized (min-width: 150%, height: auto). the overflow setting ajax div scrolls down set :hidden, html5 video playing, subsequently takes portion of entire window should hidden. video hidden should , viewable area visible. driving me crazy mouse hit area video isn't showing up, still registering within video's zone (er, hidden visible area). currently i'm beating forcing underlying div have higher z-index div scrollsdown, doesn't seem should have if overflow of div video :hidden. if interested, please let me know if showing code necessary. not posting might grasp of css, html5 video , :overflow value. this happening in broswers being tested: system osx (latest update, macbook pro retina) chrome, safari, firefox, ie3(kidding).

c# - Running a Console from an Azure Worker Role - Do not have permissions -

hello trying run console app worker role (as per user demand) console fails execute completely. i doing : process proc = new process(); proc.startinfo.filename = "zprocessing"; proc.startinfo.arguments = "argument" //example proc.startinfo.useshellexecute = false; proc.startinfo.username = "man1"; string pass = "lolol213"; securestring str = new securestring(); char[] charray = pass.tochararray(); foreach (char c in charray) { str.appendchar(c); } proc.startinfo.redirectstandardoutput = true; proc.startinfo.redirectstandarderror = true; proc.startinfo.createnowindow = false; proc.start(); proc.waitforexit(); i have tried startinfo.useshellexecute = true proc.startinfo.verb = ...

php - Why are empty arrays being hidden when outputting them as XML? -

i'm trying have php convert nested arrays xml document. i've been unable troubleshoot why arrays no children being hidden xml output entirely; want them show having no children in xml too. here's relevant code snippet: private function response_xml_encode($node, $data) { if ($node == null) return false; if (!is_array($data)) return false; foreach ($data $key => $value) { if (is_array($value) && !$this->response_xml_encode_assocarray($value)) { foreach ($value $val) $node->addchild($key, htmlentities($val)); } else if (is_array($value)) { $this->response_xml_encode($node->addchild($key), $value); } else if (!$this->response_xml_encode_validkey($key)) { $subnode = $node->addchild($node->getname(), htmlentities($value)); $subnode->addattribute('keyinvalid', 'true'); $subnode->addattribute('key', htmlentities($key)); } else ...

playframework - Setting Netty configuration in the play framework? -

i'm attempting enable tcp nodelay in play server , way i've found through netty. netty has socketchannelconfig allows enable tcp no delay, can't figure out how access said configuration play. looking @ sources (play.core.server.nettyserver) not can set through play. the sources of class: https://github.com/playframework/play20/blob/master/framework/src/play/src/main/scala/play/core/server/nettyserver.scala

Trigger a view before plugins are processed in Django-cms -

i have views.py in django-cms application. there way trigger method in views.py , add stuff context before plugins processed? i hook page(s) in question django-cms app hook. cause django-cms retrieve content page, hand on processing of request view before page rendered. see http://docs.django-cms.org/en/2.4.0/extending_cms/app_integration.html#app-hooks more information. this way can add many values context need before plugins render, assuming you're using custom plugin , you're overriding render() method.

c++ - Interface for returning a bunch of values -

i have function takes number , returns many things (say, ints). what's cleanest interface? thoughts: return vector<int> . vector copied several times, inefficient. return vector<int>* . getter has allocate vector itself, elements. there usual problems of has free vector, fact can't allocate once , use same storage many different calls getter, etc. why stl algorithms typically avoid allocating memory, instead wanting passed in. return unique_ptr<vector<int>> . it's clear deletes it, still have other problems. take vector<int> reference parameter. getter can push_back() , caller can decide whether reserve() space. however, should getter if passed-in vector non-empty? append? overwrite clearing first? assert it's empty? nice if signature of function allowed single interpretation. pass begin , end iterator. need return number of items written (which might smaller desired), , caller needs careful not access items n...

regex - Javascript regular expression - match */ -

i trying write tool whereby enter incorrectly formatted css 1 text area, hit submit , runs few regular expressions , feeds minified , "maxified" css in 2 other textareas. first removes white space (that is, unless within line - white space @ end of line , tabs within line removed). proceeds fall on over next line - reg = new regexp("\*\/", "\g"); . error uncaught syntaxerror: invalid regular expression: /*//: nothing repeat . can't figure out why is. have idea how resolve this? in advance. if want */ use reg = /\*\//g; , if want /* use reg = /\/\*/g; .

How to play DVD (.vob files) in windows media player (wmp.dll) in VB6 -

i try play dvd file format (*.vob) in vb6 code not work! wmp1.url="d:\my dvd1\video_ts\vts_01_1.vob" or wmp1.url="dvd://d:\my dvd1\video_ts\vts_01_1.vob" please me ... this syntax below 'works' me, when try it, choppy video. still looking solve problem. but try: wmp.url = "wmpdvd://d" if dvd drive d: full protocol documented here http://msdn.microsoft.com/en-us/library/windows/desktop/dd564696(v=vs.85).aspx

sql - Sharing row in a union - group by? -

i have query this: select * ( select id, sum( orderlinetotal ) orderline1, null orderline 2 orders orders.date < @today group id union select id, null orderline1, sum(orderlinetotal2) orderline 2 orders orders.date = @today group id ) o group o.id, o.orderline1, o.orderline2 i'm getting result this: id orderline1 orderline2 ----------------------------------------- 1 105.00 null 1 null 204.00 2 49.30 null 2 null 94.24 is there way modify query return this? id orderline1 orderline2 ----------------------------------------- 1 105.00 204.00 2 49.30 94.24 you want 1 query , conditional aggregation: select id, sum(case when orders.date < @today orderlinetotal end) orderline1, sum(case when orders.date = @today orderlinetotal...

c# - Using Guids as Identifies in resources -

is possible use guids identifier in resource files? in program user able chose between possible types when creates item. item chosen saved via guid. but hyphens in guids seem problem resource files. there better solution use replace in order remove every hyphen guid before looking typename in current language? how turning guids strings? you can use guid.tostring("n") produce string guid without hyphens. you may have put non-digit @ start - if do, it's easiest string.format(): string guidstr = string.format("x{0:n}", guid.newguid()); // prefix "x"

javascript - How to apply this method to all future matching elements as well? -

the following javascript/jquery snippet applies css matchicng elements in dom. $('.centeredbyjquery').each(function(){ $(this).css({'margin-left': -parseint($(this).css('width'))/2, 'left':'50%', 'margin-top': -parseint($(this).css('height'))/2, 'top':'50%'}); }) how apply method future matching elements ? you can't.. way using interval: setinterval(function(){ $('.centeredbyjquery').each(function(){ $(this).css({'margin-left': -parseint($(this).css('width'))/2, 'left':'50%', 'margin-top': -parseint($(this).css('height'))/2, 'top':'50%'}); }) },1000); but terrible idea.. if know when new element inserted, can call function center element.

dependencies - how to resolve maven cyclic dependency -

how can resolve maven cyclic dependency. suppose parent project , b , c child projects. if b dependent on c , c dependent on b, there way resolve cyclic dependency other having different project. thanks in advance, have searched in forums, not exact solution. please let me know if there possibility. maven not allow cyclic dependencies between projects, because otherwise not clear project build first. need rid of cycle. 1 solution 1 mentioned, create project. 1 move classes b c or vice versa when helps. or correct merge project b , c 1 project if there no need have 2 of them. but without knowing , analyzing why projects depend on each other it's kinda difficult suggest best solution. so suggest can use tools jdepend or intelij analyse tool find problematic classes , based on them find better design software. most of time, create interface module , and implementation module, gets rid of cycles.

mongodb - mongoexport aggregate export to a csv file -

i want save result aggregation csv file. using mongo cmd line tool can results want: db.compras.aggregate({ $group : { _id : "$data.proponente", total : { $sum : "$price" } }} how translate mongoexport command saves results csv? you can't run aggregate() queries through mongoexport . mongoexport tool intended more basic data export query filter rather full aggregation , data processing. write short script using favourite language driver mongodb, though.

ruby on rails - check_box always submitting as 0 -

the data goes database, it's submitting :location 0. how avoid this? want :location submit checked value. also, easier use simple_form instead of doing this? here's partial: <%= form_for(@offering) |f| %> <%= render 'common/form_errors', object: @offering %> <%= f.label :description, "description:" %> <%= f.text_field :description %> <%= f.label :location, "where?" %> <%= check_box("offering", :location, {}, "alphabet city") %>alphabet city <%= check_box("offering", :location, {}, "battery park") %>battery park <%= check_box("offering", :location, {}, "chelsea") %>chelsea <%= check_box("offering", :location, {}, "chinatown") %>chinatown <%= f.submit "post offering" %> <% end %> here's html produces: <form accept-charset="utf-8" ...