Posts

Showing posts from April, 2015

symfony - Image management for styles in Symfony2 -

ok time make webpage pretty when try include images in twig templates images not show. my images stored in route 'mybundle/resources/public/images' and im trying use them in twig templates <img src="{{ asset('bundles/predit/images/goddie.png') }}"> or in <style> { background-image:url('gradient.png'); background-repeat:repeat-x; background-attachment: fixed; } any idea? i'm kinda new in web styling , i'm using symfony framework php app/console assets:install web after path files in web folder , set in asset. should "bundles/yourbundlename/images/goddie.png"

html - border between search text and search button in a search box -

Image
demo html <div class="search"> <input type="text" value="search..." /> <input type="image" value="q" /> </div> css .search{ width: 400px; background-color: gray; border-radius: 12px; padding: 20px; } .search input:first-child{ width: 300px; } .search input:nth-child(2){ width: 50px; height: 20px; overflow: hidden; background-color: #fff; float: right; text-align: center; } .search:after{ content: " "; border-right: 4px solid red; margin-left: 20px; } i couldn't insert :after elements in input tag because won't work doesn't have closing tag. managed in main div .search . border showing want this actually, can desired result css. give :after absolute position , negative margin-top equal padding of parent. give height of parent : .search:after{ content: " "; border-right: 4px solid...

ruby on rails - Print out different messages dependent on gender of patient -

i want print out diffrent messages whichever gender patient has. defined text variable: p10 = "bitte kodierung überprüfen: kode gilt überwiegend nur für #{@gender} patienten." and code wrote this: if patient.geschlecht == '2' && code.geschlecht == 'm' && code.geschlecht_fehler == 'm' @gender = 'männliche' @arr << p10 end if patient.geschlecht == '1' && code.geschlecht == 'w' && code.geschlecht_fehler == 'k' @gender = 'weibliche' @arr << p10 end but somehow wont work, in view error: undefined local variable or method `gender' #<diagnosecontroller:0x50197e0> so did wrong? or how print out different messages? update_ _ __ _ __ _ __ _ __ _ __ _ __ _ _ update _ __ _ __ _ __ _ __ _ __ _ __ now have no error, somehow @gender gets not insertet in p10 string! whats wrong? the problem have defined p10 first @ time @gender ...

java - Tomcat ClientAbortException Listener? -

our tomcat 6 server reporting quite few clientabortexception errors, believe down user navigating away page before loaded. getting no buffer space available (maximum connections reached? errors. is there way of creating clientabortexception listener terminate abandoned connection clean or unused http threads , delete byte data used incomplete downloaded images. this project inherited , i've noticed when running locally if start visualjvm , view monitor , open website locally see abandoned connection clean thread created , number of http threads created. if open website on same local web server can see yet again abandoned connection clean thread created , set of http threads created. if navigate through pages, don't see other connections created, because project using database pooling if close browser threads still running, not being freed up. needless say, server has been running number of days or under load aforementioned errors generated. any appreciated :-) ...

php - Form field length validation in phpmailer -

i want validate form fields minimum , maximum length. i'm validating if if they're empty or if email address invalid. want add additional length requirements each field (min. length , max. length). best practice this? excerpt process.php file: require_once('includes/phpmailer-config.php'); require_once('includes/phpmailer/class.phpmailer.php'); // other stuff here // validate each form field if (empty($name)) { $errors['name'] = mia_name; // error message missing name } if (empty($email)) { $errors['email'] = mia_addr; // error message missing email address } elseif (!(filter_var($email, filter_validate_email))) { $errors['email'] = inv_addr; // error message invalid email address } if (empty($message)) { $errors['message'] = mia_mesg; // error message missing message } excerpt phpmailer-config.php file: // other stuff here define ('mia_name', 'a full name required.'); ...

php - Is mysql datetime not compatible with strtotime()? -

i'm passing function mysql datetime , returning nothing. mysql datetime not compatible strtotime()? assume foreach loop ending , return variable not being called, why? function timeago($time) { $time = time() - strtotime($time); // time since moment $tokens = array ( 1 => 'second', 60 => 'minute', 3600 => 'hour', 86400 => 'day', 604800 => 'week', 2592000 => 'month', 31536000 => 'year' ); foreach ($tokens $unit => $text) { if ($time < $unit) continue; $numberofunits = floor($time / $unit); return $numberofunits.' '.$text.(($numberofunits>1)?'s':'').' ago'; } } update code gets database, there no quotes in datetime string. while ($row = mysqli_fetch_assoc($result)) { $commenttime = $row["time"]; $commentcomment = $row["comment"];...

java - Ternary association with a composite primary key (JPA & Hibernate ) -

i'm trying make ternary association composite primary key of 3 keys reference 3 tables : report, scanner , risk , have tried implemente using code below, have composite key 2 keys : riskid , reportid : report.java @entity @table(name="report") public class report { @id @notnull @generatedvalue private int reportid; @column private string reportname; @onetomany @mapkeyjoincolumn map<risk, scanner> risks = new hashmap<risk, scanner>(); } scanner.java : @entity @table(name="scanner") public class scanner{ @id @notnull @generatedvalue private int scannerid; @column private string scannername; } risk.java : @entity @table(name="risk") public class risk { @id @notnull @generatedvalue private int riskid; @column private string issuename; } so how implemente composite primary key 3 keys ?

iphone - How to set only portrait orientation for view controller in iOS? -

my project has many view controller (.xib file). want: view controller can have portrait orientation. other view controller can have landscape orientation. or view controller can have both portrait , landscape orientation. want view controller have landscape orientation (no portrait orientation). please me. you. -(bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)tointerfaceorientation { return uiinterfaceorientationisportrait(tointerfaceorientation); } updated: you can creating category of uinaviagationcontroller code .h file is @interface uinavigationcontroller (autorotation) -(bool)shouldautorotate; -(nsuinteger)supportedinterfaceorientations; and code .m file is @implementation uinavigationcontroller (autorotation) -(bool)shouldautorotate { uiinterfaceorientation interfaceorientation = [uiapplication sharedapplication].statusbarorientation; [self.topviewcontroller shouldautorotate]; return yes; ...

Which is the better syntax while including a file in PHP? -

this question has answer here: is php's 'include' function or statement? 9 answers some people include files this: include ('file.php'); and people include files this: include 'file.php'; i think here use of brackets unnecessary. views? style better , why? when brackets unnecessary, it's better remove them (same return instead of return () give better performances). same includes. http://php.net/manual/en/function.return.php note: note since return language construct , not function, parentheses surrounding arguments not required. common leave them out, , should php has less work in case. moreoever, using whole path include better relative.

javascript - RequireJS, KendoUI and KnockoutJS any chance in them working together? -

so want use requirejs , kendo ui , knockout js together. i read using kendo requirejs , knockout js article asynchronous module definition (amd) requirejs , found knockout-kendo library via knockout.js , kendo ui - potent duo , thought myself - awesome - i'm in beautiful world of rainbows, mvvm, amd , html5 lusciousness. but seems more i'm in dark underground world of pain , suffering. here's deal... i have simple web site has js folder has following inside: jquery-2.0.3.min.js knockout-2.3.0.js knockout-kendo.min.js require.js kendo-ui/** kendo files under here and index.html file have put in root containing this: <!doctype html> <html> <head> <meta charset="utf-8" /> <script type="text/javascript" src="js/require.js"></script> </head> <body> <div id="grid" data-bind="kendogrid: items"> </div> <script type=...

mysql - entity framework error on db generation -

i restructured part of db new db (using mysql). on importing website project 62 errors stating "reference required assembly system.core version=4.0.0.0". naturally try add , vs says referenced. i've tried numerous things fix including rerunning code generation tool, re-saving diagram nothing works , errors still exist, thoughts? well, solution rather easy, added own entry in web config info in error. adding line resolved problem. <add assembly="system.core, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" />

angularjs - ng-resource url parameter does not work -

$resource not correctly passing along url parameter when making put request, via custom action. this service creating resource. .factory('cartitemsservice', ['$resource', function($resource) { return $resource('/api/cart/:cartid/items/', {format: 'json'}, { get: {method: 'get', isarray: true}, update: {method: 'put', isarray: true}, }); }]) in controller i'm trying update list of items this. note $scope.cart.id exists , correct (in case 1) $scope.cartitems = cartitemsservice.update({cartid: $scope.cart.id}); however request url is: /api/cart/items/ i'm expecting /api/cart/1/items/ . works fine if .get({cartid: <some_id>}) doesn't seem work update. edit: angular version 1.1.5 in end due request headers setting before making request. i attempting set put headers such: $http.defaults.headers.put['x-csrftoken'] = $cookies.csrftoken; this caused request url in...

php - I need help adding a simple math captcha to my contact form for a website -

i want add simple math captcha php form,,, this complete form code doesnot work. here link code: http://thefairygodsister.com/testtest/index%20-%20copy.txt the basic steps take are: lets add 2 numbers kind of math $num1 = rand(15,50); $num2 = rand(2,9); $salted_answer = $num1+num2 + 187; //thats salt put salted_answer hidden input on form. when checking: if ($_post['salted_answer'] - 187 == $_post['answer']) { echo "all good"; // processing } thats it.

javascript - AngularJS service does not work correctly -

i want create dynamic page title in webapp. i've created service should helps me, not work. pagetitleservice.gettitle() returns undefined. there someting wrong? should corected run code? here code: app.js var app = angular.module('app', ['restangular']) .config(function ($routeprovider) { $routeprovider.when('/index', { templateurl: 'views/main/index.html', controller: 'pagecontroller' }); $routeprovider.when('/pages/:name', { templateurl: 'views/page/show.html', controller: 'pagecontroller' }); $routeprovider.otherwise({ redirectto: '/index' }); }); app.defaultpagename = 'home'; app.name = 'custom name'; pagetitleservice.js: app.factory('pagetitleservice', function() { var title; return { settitle : function(t) { title = t; }, gettitle : function() { return title + ' - ...

c++ - Why am I getting inconsistent conversions between a binary value and a character? -

working arduino. have following code in function run twice during process: int hours = 7; char hour = hours+'0'; debug(&hour); char hour2 = hours+'0'; debug(&hour2); the debug function is: void debug(char message[]) { if (debugenabled == true) { serial.println(message); } } the global debugenabled flag initialized true . i'm getting following output every time full process runs (hence executing first code block twice): 7 7 72 7 i can't see reason i'm getting 72 in there on second time first variable written, hour2 variable printed correctly every time. any suggestions might going wrong or how further debug appreciated. because treat single character string. string in c needs terminated '\0' character. string handling functions continue until find terminator character, , go beyond array limits may have , producing unexpected , undefined results.

flex - How to align the formItems? -

Image
i'm trying create form, having issues aligning formitems. this mx:form namespace. (xmlns:mx="http://www.adobe.com/2006/mxml") does have suggestions on how correct this. appreciated. <mx:vbox paddingleft="0" height="100%"> <form:form width="100%" textalign="left"> <mx:vbox> <mx:hbox id="snapshotselect"> <form:formitem label="my label here" includeinlayout="{model.formitemvisible}" visible="{model.formitemvisible}"/> <mx:vbox> <form:formitem includeinlayout="{model.formitemvisible}" visible="{model.formitemvisible}"> <components:sagetextinput texta...

jquery - django datatables additional data from server to template -

so have implemented datatables plugin django server-side processing. looks little this: template: <script type="text/javascript"> $(document).ready(function() { $('#example').datatable( { "bprocessing": true, "bserverside": true, "sajaxsource": "/datatable/" } ); } ); </script> views: def main_view(request): return render_to_response('index.html') def datatables_view(request): start = request.get['idisplaystart'] length = request.get['idisplaylength'] query = myuser.objects.all() total = query.count() if request.get.has_key('ssearch'): # filtering... query = query[start:start+length] response = {"aadata": [(q.name, q.state, q.email) q in query], "itotalrecords": total, ...additional params datatable... } then use json.dump serialize data ...

java - Open excelfile with an preselected cell -

i have application read excelfile(.xls), make calculations , present result. @ result button implemented opens original excelfile. is possible provide specific cell arguement show cell directly, user not have select cell himself? the selected cell stored within excel file. have study api of excel writing library find out, how set this. e.g. poi http://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/xssfsheet.html#setactivecell(java.lang.string)

php - Retrieve data from mysql through checkbox -

i want search question mysql using combobox. if select chapter number 1 in combobox, want display question chapter 1 have. in suppose chapter 1 contains 2 questions, chapter 2 contains questions , on. when select chapter number 1 doesn't display question chapter 1 have. print last question last chapter. how can solve problem? <?php $sql= "select distinct chapter math"; $q= mysql_query($sql); echo "<select name='fname'>"; while($info=mysql_fetch_array($q)){ $d1 = $info['chapter']; echo "<option> ".$info['chapter']."</option>"; } echo "</select>"; $sql1 = "select question math chapter=$d1"; $sql1_res = mysql_query($sql1) or die(mysql_error()); while($row = mysql_fetch_array($sql1_res)){ $question=htmlspecialchars...

c# - Error in selecting value from RavenDB -

i using ravendb in mvc4 project when store object of class ravendb works fine when performing select operation throws error: object reference not set instance of object on queries ravenbasecontroller.cs public class ravenbasecontroller : controller { public idocumentsession ravensession { get; protected set; } protected override void onactionexecuting(actionexecutingcontext filtercontext) { ravensession = mvcapplication.store.opensession("ravendbtesting"); } protected override void onactionexecuted(actionexecutedcontext filtercontext) { if (filtercontext.ischildaction) return; using (ravensession) { if (filtercontext.exception != null) return; if (ravensession != null) ravensession.savechanges(); } } } activation.cs public class activation : ravenbasecontroller { public string tokenid { get; set; } public bool validate(string tid) { ...

c++ - Comparing two iterators of a different type in a template function -

no c++11 or boost :( i have function following signature. template<class input_itr, class output_itr> void dowork(const input_itr in_it, const input_itr in_it_end, output_itr out_it, output_itr out_it_end, context_data) normally complex processing takes place between input , output.. no-op required, , data copied. function supports in-place operations if input , output data types same. have code. if (noop) { if (in_it != out_it) { copy(in_it, in_it_end, out_it); } } if in-place operation has been requested (the iterator check), there no need copy data. this has worked fine until call function iterators different data types (int32 int64 example). complains iterator check because incompatible types. error c2679: binary '!=' : no operator found takes right-hand operand of type 'std::_vector_iterator<std::_vector_val<std::_simple_types<unsigned __int64>>> this has left me bit stumped. th...

android - App has stopped working AFTER PASSING A VARIABLE between Activities -

this error after tried pass variable between 2 activities example: main activity intent kmh = new intent(options.this,volumecontrolmain.class); bundle distancevalue = new bundle(); distancevalue.putboolean("distance", distancetx); kmh.putextras(distancevalue); startactivity(kmh); second activity bundle distancek = getintent().getextras(); value = distancek.getboolean("distance"); here log cat. 08-28 11:36:18.923: e/androidruntime(841): fatal exception: main 08-28 11:36:18.923: e/androidruntime(841): java.lang.runtimeexception: unable start activity componentinfo{com.example.audiovolumecontrol/com.example.audiovolumecontrol.volumecontrolmain}: java.lang.nullpointerexception 08-28 11:36:18.923: e/androidruntime(841): @ android.app.activitythread.performlaunchactivity(activitythread.java:2180) 08-28 11:36:18.923: e/androidruntime(841): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2230) 08-28 11:36:18.923: e/androidruntime(84...

email - Where MAPI fields of mails are stored -

i trying programatically achieve communication thread tracking outlook. have found this article on msdn. , fiddled bit. seems possible tracking pr_conversation_index developing outlook add in. however achieve similar functionality in java. since quite new mapi development, not quite clear pr_conversation_index stored in .msg file or somewhere in exchange server access using mapi. i want know if possible intercept incoming / outgoing message , obtain pr_conversation_index using java. if pr_conversation_index stored in .msg file must able parse such file in java , obtain same. if not stored in .msg file know stored , how can access using java. i don't think extended mapi header files ever translated java. use c++ (or delphi).

c# - Why use a List over a HashSet? -

may obvious question, i've seen plenty of reasons why use hashset on list/array. i've heard has o(1) removing , searching data. i've never heard why use list on hashset. so why vice-versa? a list allows duplicates, hashset not list ordered it's index, hashset has no implicit order performance overrated, choose right tool job

css - Bootstrap3 migration failed -

i using code create ruler on site: css: .ruler, .ruler li { margin: 0; padding: 0; list-style: none; display: inline-block; } /* ie6-7 fix */ .ruler, .ruler li { *display: inline; } .ruler { background: lightyellow; box-shadow: 0 -1px 1em hsl(60, 60%, 84%) inset; border-radius: 2px; border: 1px solid #ccc; color: #ccc; margin: 0; height: 3em; padding-right: 1cm; white-space: nowrap; } .ruler li { padding-left: 1cm; width: 2em; margin: .64em -1em -.64em; text-align: center; position: relative; text-shadow: 1px 1px hsl(60, 60%, 84%); } .ruler li:before { content: ''; position: absolute; border-left: 1px solid #ccc; height: .64em; top: -.64em; right: 1em; } /* make me pretty! */ body { font: 12px ubuntu, arial, sans-serif; margin: 20px; } div { margin-top: 2em; } html: <ul class="ruler"><li>1</li><li>2</li><li...

php - Ajax Request in Progress suddenly started returning status = 0 -

i have web project in php , accesses java project uses restlet framework. web project running on apache , testing using localhost. restlet framework uses localhost domain, url different: localhost:8888/ this javascript that, using ajax, makes call 1 of java classes (collectionpublic) using url above. var url = "<?php echo $config['restserver_url'] ?>collectionpublic"; var params= "pagelist="+facebookpages+"&time="+time; var client = new xmlhttprequest(); client.open("post", url,true); client.setrequestheader("content-type", "application/x-www-form-urlencoded"); client.onreadystatechange = function () { if (client.readystate != 4) return; if (client.status != 200 && client.status != 304) { alert("error "+client.status); } else { alert("success"); } callback(client); } if (client.readystate == 4) return; client.send(params); i have ...

unity3d - Confusing Input From Joystick Unity -

i working on unity3d project uses xbox-360 controller input. using unity input manager select inputs. of inputs set exact same. however, right joystick keeps acting being pushed in 1 direction or another, while left joystick works should. here setup gravity: 3 dead: 0.001 sensitivity: 3 snap: false type: joystick axis the joystick works using 4th axis joysticks don't work use x , y axes same controller, in games dolphin emulator. set deadzone individually per joystick since seem different, though doesn't go on 16%.

flex - how to clone UIComponents added dynamically in a Canvas -

i facing issue in cloning of uicomponents added dynamically in canvas canvas. i follow example doesn't work components added dynamically because childdescriptors become null in senario. <?xml version="1.0" encoding="utf-8"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal"> <mx:script> <![cdata[ private function clonebutton_clickhandler (event:mouseevent):void { var childdescriptors:array = original.childdescriptors; var descriptorscount:int = childdescriptors.length; (var i:int; < descriptorscount; i++) { cloned.createcomponentfromdescriptor(original.childdescriptors[i], false); } cloned.validatenow(); } ...

Excel how to find values in 1 column exist in the range of values in another -

Image
i have 2 columns- column extends upto 11027(values) , column extends 42000(values).both columns contains code details. something this a b q123 as124 as124 gh456 ff45 q123 dd1 dd2 xx2 xx3 xx4 and on... i want find if names in column exists in column b or not.using excel this need: =not(iserror(match(<cell in col a>,<column b>, 0))) ## pseudo code for first cell of a, be: =not(iserror(match(a2,$b$2:$b$5, 0))) enter formula (and drag down) follows: you get:

Design: c# and Quartz.net for a new project -

i working (or worse, trying figure out how works) quartz.net project. installed windows services , running. in design part of system i'm having quite lot of issues. first: have no idea best way work quartz.net, if stand-alone server , make communication own software or service. want project these 3 tasks in schedule-oriented process: launch reports , save them excel or pdf files in selected folder. these reports have register indicates name give file, type of file, time of execution and, if want repeat it, frequency: daily, weekly, monthly or yearly. download every 10 or 15 minutes files ftp server populate content of reports. info of frequency of download of files registerd inside registers in database, info of ftp server system has conect. update info of dynamic chart show inside of system. determined frequency of refresh, have registered inside database data show in chart , in header of chart have frequency want refresh data shown in chart. maybe in future (long te...

python - django submit two different forms with one submit button -

is possible submit 2 different forms, 1 submit button in django? have 1 form called "instrument" , 4 equal forms "config". i'd submit 1 config , instrument. e.g. instrument + config 1, , instrument + config 2. , every config have own submit button. i have tried 1 button in config form: <input onclick="submitforms()" class="btn btn-primary cfg" type="submit" value="start" > and call js function 'onclick': submitforms = function(){ console.log('ok'); //only testing document.forms["firstform"].submit(); document.forms["secondform"].submit(); } this method in views.py: if request.method == 'post': form1 = dataproviderinstrumentform(request.post) form2 = dynamictimeseriesform(request.post) print(request.post) if form1.is_valid() or form2.is_valid(): # stuff else: form1 = dataproviderinstrumentform() # ...

xaml - c#: Accessing Protected Class Variable From Outside Class? -

i used below type of navigation in app. need var page in class. since used protected class, can't call var page. there anyway call var page. because, need var initialize class. so, how access protected class variable outside of class ? protected override void onnavigatedto(navigationeventargs e) { base.onnavigatedto(e); if (navigationcontext.querystring.containskey("page")) { var page = navigationcontext.querystring["page"]; browser.navigate(new uri("/f" + page + ".html, urikind.relative)); } } i need in class; private void def(object sender, eventargs e) { switch(page) { \\... } } i recommend keep in windows phone settings key,value storage. in first class store it protected override void onnavigatedto(navigationeventargs e) { base.onnavigatedto(e); if (navigationcontext.querystring.containskey("page")) { var page ...

javascript - Toggle class show div content(buttons and text field) above the text -

i using toggle functionality .i facing 1 problem when click button buttons , text field display above text. explain used toggle functionality on button click. here fiddle http://jsfiddle.net/naveennsit/jpvay/16/ if used top :145px working fine.but not . should this. if user click button contend goes down , display buttons , text field.if user click again button contend goes up. $(document).on('click', '#test', function() { $("#searchbar").toggle("slow"); }); change position property of wrapper relative shown below , should work. ( note: have changed top value also). #wrapper { position:relative; //modified z-index:1; top:0px; //modified bottom:48px; left:0; width:100%; height:100px; overflow:auto; } the difference between absolute , relative , when have position absolute , takes position container having relative position, default body of page.here when give position absolute , elemen...

ruby - Why respond_to with initialize() returns false? -

why false when c.respond_to?(:initialize) class c def initialize;end def meth;end end c.respond_to?(:initialize) #=> false c.new.respond_to?(:meth) #=> true expected another variation class c def initialize;end def meth pmeth end private def pmeth respond_to?(:initialize) end end this because #initialize not public method. if want check private,protected methods using #respond_to? , set second parameter true . documentation saying returns true if obj responds given method. private , protected methods included in search if optional second parameter evaluates true. see below: class c def initialize;end def meth;end end c.respond_to?(:initialize,true) # => true c.new.respond_to?(:initialize) # => false c.new.respond_to?(:initialize,true) # => true c.private_methods(false).include?(:initialize) # => true c.new.private_methods(false).include?(:initialize) # => true

node.js - running pig script -

i have pig script , sample application written in node.js. wanted run pig script node.js. i have not used node.js. here find link show how execute unit command in node.js: http://www.dzone.com/snippets/execute-unix-command-nodejs for example, if want run pig script called foo.pig. can try following code: var sys = require('sys') var exec = require('child_process').exec; function puts(error, stdout, stderr) { sys.puts(stdout) } exec("pig -f foo.pig", puts); you can replace pig -f foo.pig command use run pig script.

I got exception when connecting to TFS sources in Visual studio 2012 -

Image
i cannot sources dialog in visual studio 2012. got null reference exception: ideas causes this? system.nullreferenceexception: object reference not set instance of object. @ microsoft.visualstudio.teamfoundation.versioncontrol.pendingchanges.pendingchangesmodelvs.initialize(iserviceprovider serviceprovider, versioncontrolserver versioncontrolserver, workspace workspace) @ microsoft.teamfoundation.versioncontrol.controls.pendingchanges.pendingchangespage.initializemodel(pageinitializeeventargs e) @ microsoft.teamfoundation.controls.wpf.teamexplorer.teamexplorerpagebase.initialize(object sender, pageinitializeeventargs e) @ microsoft.visualstudio.teamfoundation.versioncontrol.pendingchanges.pendingchangespagevs.initialize(object sender, pageinitializeeventargs e) @ microsoft.teamfoundation.controls.wpf.teamexplorer.framework.teamexplorerpagehost.initialize(teamexplorerpagecontext context) vs pro latest updates. i had error too, might same cause, check f...

javascript - No access to an Object in an Array, but to the object itself -

i have following code, creating objects within loop , accessing values of them. came problem, accessing object ok, not array contains object. missing here? camlist = new array(); (var i=0; i<8; i++) { var camobj = new camera(i); camlist.push(camobj); console.log(camobj.id); //this works console.log(camlist[i].id); //this doesnt } ps: in example camobj.id returns current value of i. pps: got typeerror: cannot read property 'id' of undefined. edit: i added full code example. camera object: var camera = function(id, cam) { this.id = id; this.cam = cam; this.res = { "x" : this.cam.get(cv_cap_prop_frame_width), "y" : this.cam.get(cv_cap_prop_frame_height) }; this.overlaydata = new array(); }; exports.camera = camera; main code: var cv = require("opencv-node"); var camera = require("./cameramodule").camera; var caml...

c# - Calling method from class issue format input -

Image
hello guys have got method need insert data to. i'm not sure in format have provide input: as there ( string[] dic, out informaceoplatcitype[] statusplatcedph ) how should input in getstatusnespolehlivyplatce() please? thank much. with of of came wit this: string[] ahoj = new string[] { 28156609.tostring() }; rozhranice.statustype[] ahoj2; rozhranice.informaceoplatcitype[] ahoj3; rozhranice.rozhranicrpdph srv = new rozhranice.rozhranicrpdph(); textbox1.text = (srv.getstatusnespolehlivyplatce(ahoj, out ahoj3).tostring()); next issue need return fields: and when doing (srv.getstatusnespolehlivyplatce(ahoj, out ahoj3).tostring()); i'am able return fields statustype , how possible think receive informaceoplatcitype ? for example this: textbox1.text = (srv.getstatusnespolehlivyplatce(ahoj, out ahoj3).odpovedgenerovana.tostring()); i get: field odpovedgenerovana statustype thought calling out informace...

javascript - JQuery mobile listview items go outside boundary? -

i'm building webpage using jquery mobile interface. come across problem: listview ul not follow style set on projectlisting id, goes out of boundary. the script @ end of page extending content div full screen. this html code <div class="content" data-role="content"> <div id="projectlisting"> <div data-role="header" data-theme="e"> <h5>project list</h5> </div> <div id="wrapper_projectlist"> <ul id="projectlist" data-role="listview" data-filter="true" data-split-theme="c"> <li> <a href="#" data-value="1" data-name="name" class="project-action">project 1</a> <a href="#" data-value="1" data-name="name" class="project-action"...

javascript - Highcharts min y-axis value -

is possible set min y-axis value when series values same? for example: http://jsfiddle.net/6hyfk/1/ i see 0.00019 y-axis value. if change to: series: [{ data: [0.00019,0.00020,0.00019,0.00019] }] it looks lot better. so answer largely depends on data. if example, know values positive, setting yaxis min helps data display bit better. know data better i, i'd @ yaxis settings , see can change better result, example, jsfiddle sets minimum value: $(function () { $('#container').highcharts({ xaxis: { categories: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'], ticklength: 20 }, yaxis: { min: 0 }, series: [{ data: [0.00019,0.00019,0.00019,0.00019] }] }); }); http://jsfiddle.net/g...

javascript - Change behaviour of rendering in MathJax -

where can change behaviour of mathjax in rendering formulas? need 2 cases: don't show formulas until formulas parsed. show formula processed mathjax mathjax offers configuration options modify equation chunking . quote documentation eqnchunk: 50 eqnchunkfactor: 1.5 eqnchunkdelay: 100 these values control how “chunky” display of mathematical expressions be; is, how equations updated processed. eqnchunk number of equations typeset before appear on screen. larger values make less visual flicker equations drawn, mean longer delays before reader sees anything. eqchunkfactor factor eqnchunk grow after each chunk displayed. eqchunkdelay time (in milliseconds) delay between chunks (to allow browser respond other user interaction). set eqnchunk 1, eqnchunkfactor 1, , eqnchunkdelay 10 behavior mathjax v1.1 , below. these settings can set html , svg output separately. see docs: html-output , svg output . edit as davide c...

mongodb - Best way to store/get values referenced from a list in Mongo/RectiveMongo? -

i have quite common use case - list of comments. each comment has author. i'm storing reference comment author using reference, since author can make multiple comments. now i'm working reactivemongo , want try keep database access asynchronous, in case, don't know how. asynchronous access database, comments, each comment have author, , until way know loop through comments , user synchronously: val useroption:option[jsobject] = await.result(userscollection.find(json.obj("id" -> userid).one[jsobject], timeout) //... other that, could: get each user asynchronously have introduce functionality wait until user fetched, in order return response, , code become mess. store complete user object - @ least need comment (picture, name , such) in each comment. redundancy become troublesome manage, since each time user changes (relevant data stored in comments) have go through comments in database , modify it. what correct pattern apply here? i ta...

passing variable value php -

there 2 pages , 1 main , other included it the main page <?php $var_value = 7; $_session['varname'] = $var_value; include 'upload_image.php'; ?> and included page <?php include 'init.php'; if (!logged_in()) { header('location: index.php'); exit(); } include 'template/header.php'; ?> <h3>upload image</h3> <?php if (isset($_files['image'], $_post['image_n'], $_post['image_description'])) { $image_name = $_files['image']['name']; $bytes = $_files['image']['size']; $image_temp = $_files['image']['tmp_name']; $image_n = $_post['image_n']; $image_description = $_post['image_description']; $allowed_ext = array('jpg', 'jpeg', 'png', 'gif', 'rar', 'pdf'); //$image_ext = strtolower(end(explode('.', $image_name))); $image_ext = pathinfo($image_name, pathinfo_extension...

android - how to get json array and object -

below code want parse json data in code bur im not getting array "dish_nutrition": show error on line 6 method getjsonobject(string) in type jsonobject not applicable arguments (int) please heelp me do?? correct way parse data??? "status":1, "data": "dish_nutrition": {"1": {"name":"cholesterol , diet", "qty":"2"}, "2": {"name":"cholesterol , diet", "qty":"1" } }} jsonobject json2 = new jsonobject(str); status = json2.getstring("status"); if (status.equals("1")) { jsonobject school3 = json2.getjsonobject("dish_nutrition"); final tablelayout table = (tablelayout) findviewbyid(r.id.table2); (int j = 0; j < school3.length(); j++) { //line6 show rror method getjsonobject(string) in type jsonobject not applicable a...

java - Classify huge CSV file by tag name -

i have large size csv file 60mb. csv file contains object_name, timestamp, , value. in csv file, there 10 objects listed in csv file based on time sequence, overlap. such : a1,2013-08-24 15:36:47,24.83 a2,2013-08-24 15:36:47,26.56 a3,2013-08-24 15:36:47,25.83 a6,2013-08-24 15:36:47,-40 a8,2013-08-24 15:36:47,-40 a9,2013-08-24 15:36:47,-40 b2,2013-08-24 15:36:47,6 c1,2013-08-24 15:37:18,6 i want classfy records object_name. if size of file small, can it. in situation, spend 10 mins read csv file. not image classify data, crash laptop. expected results 10 list, each of them contain 1 object timestamp , value, such as, object_name,timestamp,val a1,2013-08-24 15:00:00,26.7 ..... ..... could me? basically, want know effective way sorts these data object name , separates it. btw, use opencsv read csv file. thank you.

javascript - How to remove element from JSON array -

i'm new nodejs , mongodb. problem i've json of following type { _id: 199, name: 'rae kohout', scores: [ { type: 'exam', score: 82.11742562118049 }, { type: 'quiz', score: 49.61295450928224 }, { type: 'homework', score: 28.86823689842918 }, { type: 'homework', score: 5.861613903793295 } ] } here want compare score type 'homework' , remove homework has lowest score.to solve i've written code like var low = ''; for(var i=0;i<doc.scores.length;i++) { if(doc.scores[i].type == 'homework'){ if(low == ''){ low = doc.scores[i].score; } if( doc.scores[i].score > low ){ console.log("index lowest score " + i); low = ''; } } } now i'm able find index lowest score, , want removes values @ index. tried use array.splice() method works on array only. can me solve ? use splice so: doc.scores.splice(index, 1); ...

c# - Easiest way to serialize and deserialize a JSON class that has interface properties? -

i have class product { public icomponent[] components; } what easiest way deserialize product object json description like { "components": [ {"type":"componenta", "key":value} {"type":"componentb", "key":value} ] } ? thanks. use json.net string json = jsonconvert.serializeobject(product); or use javascriptserializer string json = new javascriptserializer().serialize(product); and reverse operation var product = jsonconvert.deserializeobject<product>(json) or var product = new javascriptserializer().deserialize<product>(json)

Is this JQuery Masonry do what it is supposedly do? -

Image
i need make grid of images similar page: http://www.clearlyinventory.com/product/screenshots/inventory-management-software-view-5 it image gallery or grid of images. has pagination included, wonder if there existing plugin that. real question here: while searching sample in web, have found jsfiddle code: http://jsfiddle.net/desandro/7zvb7/ i tried in own latest js file, same result appeared. don't think either code snippet below wrong. $( function() { $('#container').masonry({ itemselector: '.item', columnwidth: 70 }); }); the thing is, think doesnt work properly, or it? official website of masonry illustrates: my problem former still result after applying masonry. what problem jsfiddle code above (firebug detected no erros)? (optional question)or if know jquery plugin meet requirements in first place, please give me link don't have make pagination feature.

html - Content appears over a corner when using border-radius -

Image
when using css3 border-radius property create rounded corners how 1 keep content (text, images, etc.) appearing on top of corner? example: might hard tell hope guys understand question. to keep content inside of box, use padding property: .box { width: 400px; height: 250px; background-color: gold; border-radius: 20px; padding: 5px; /* or */ /* padding-left: 10px */ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } box-sizing: border-box; used to calculate width , height of element including padding , probable border . here jsbin demo

iphone - What is the proper way to change a Text View's default content on iOS 6? -

i asked question "following tutorial" app @ http://jonathanscorner.com/project/quotes.tgz , , couple of people pointed out loose wire was; had not connected iboutlet correctly. i thought, playfully, replace text view's lorem ipsum storyboard "hello, australia!", when met unexpected behavior. every single change made iphone storyboard clicking on text view , editing , saving text results black screen on simulator. if undo storyboard edit , restore original state, , save it, app displays original lorem ipsum (which replaced quote if click on button), that's i've gotten display @ start. is there work involved in replacing text displayed in view? change duct tape invoking similar call 1 pulls quotes, i'd know broken approach of "update storyboard wysiwyg." i'd know best engineering way make text view display "hello, australia!" or such string besides "free each install" lorem ipsum. thanks, i don'...