Posts

Showing posts from April, 2010

angularjs - Angular: access ngResources from a directive -

i'd access ngresources directive possible? basically directive $scope has object points other via ids, other objects can populated via existing ngresource. i'd load them render them correctly. you can pass $resource, or own $resource-based service directive. .directive('mydirective', function($resource, myservice) { });

mysql - Shell script extract data from a file -

i started programming in shell script , have file looks this: stuff doesn't matter doesn't matter matter *line 35*school: xxxxx -> name: xxxxx age: xxx description: xxxxxxxxxx school: yyyyy -> name: yyyyy age: yyy description: yyyyyyyyyy school: zzzzz -> name: zzzzz age: zzz description: zzzzzzzzzz school: aaaaa -> name: aaaaa age: aaa description: aaaaaaaaaa 6 lines of stuff after important information my main goal in migrate students mysql database, code this: nstudents=(( $(wc -l file | cut -d ' ' -f1) - 41) #41 comes 35+6 i=1 while [ $i != $nstudents ] $school=[i don't know how extract school number $i] $name=[i don't know how extract name number $i] $age=[i don't know how extract age number $i] $desc=[i don't know how extract description number $i] mysql #upload $i= (( $i + 1 )) done i know need use sed or it, can't figure out how. in advance. just point in shell-ish solution problem basd on best guess @ data lo

drupal - Conditional display of field in Views -

i have custom (i.e. view) menu based on taxonomy vocabulary, in wich each term has image field. so far, each term displayed picture, want know if possible display image field relative active term, while maintaining label+link whole vocabulary. result have illustrative picture in top of menu, changing according item clicker. is there way directly inside view configuration ? with use of contextual filter, can display information term passed argument/ in url.

sitecore6 - Sitecore: Programmatically Exit Edit Mode in Page Editor -

when in sitecore's page editor mode clicks edit button, have div's style set top: 0; so appears on top of page editor buttons (save, save , close, insert, etc..). div prevents content editor using normal page editor buttons , forces them use custom save, save , close, , close buttons have added div. is there way programmatically exit edit mode whenever click on custom close or save , close button? not want log them out of page editor (just exit them out of edit mode). have 1 page doing this, rather not changing configurations in sitecore achieve this. check out post: in sitecore, how change or set pagemode it looks can do: context.site.setdisplaymode(sitecore.sites.displaymode.normal, sitecore.sites.displaymodeduration.resetafterrequest); or, can add sc_mode=normal or sc_mode=preview url's query string.

ruby on rails - ActiveRecord includes not doing what I expect -

class program attr_accessible :open, ... has_many :rounds has_many :open_rounds, :class_name => 'round', :conditions => ['open = ?', true] end class round belongs_to :program attr_accessible :open, :status, :begin ... end [64] pry(main)> = program.includes(:rounds) program load (0.2ms) select "programs".* "programs" round load (0.2ms) select "rounds".* "rounds" "rounds"."program_id" in (4, 6) +----+-------------+-------------+------------+-------+--------+-------------+------------+-------------+ | id | name | moderato... | descrip... | open | locked | suppress... | created_at | updated_at | +----+-------------+-------------+------------+-------+--------+-------------+------------+-------------+ | 4 | advanced... | | summer ... | false | true | false | 2013-04... | 2013-04-... | | 6 | introduc... | | summer ... | false | true | false

angularjs ng-repeat list not updated when element is added/removed -

there list of users retrieved rest api. here template <div ng:controller="usercontroller"> <a ng-click="createuser()">create user</a> <div ng-view> <ul> <li ng-repeat="user in users"> {[{user.first_name}]} {[{user.last_name}]} </li> </ul> </div> </div> the js: function usercontroller($scope, user, group){ $scope.users = user.query(); $scope.createuser = function(){ //$scope.users = null; //$scope.users.pop(); //$scope.users.push(new user({id:'5'})); console.log($scope.users); } } the service: http://dpaste.com/1065440/ all users retrieved , listed correctly. problem cannot manipulate rendered list @ all. no matter push, pop or set null. list not change in template. last log statement shows changes, prints e.g. null when users array set null. any ideas probl

c# - Generics explicit conversion -

i implemented explicit conversion string object called foo. so => foo f = (foo)"foo data"; works i need implement function cast string generic t, t in case foo datatype. public t get<t>(object o){ // return false if (typeof(t).isassignablefrom(typeof(string))) { // when pass if above throws invalid cast exception return (t)(object)str; } return null; } // when call this, generated error // invalid cast 'system.string' foo foo myobj = get<foo>("another foo object"); // when use dynamic keyword works c# 4.0+ feature, function in older framework return (t)(dynamic)str; an example uses reflection: class program { static void main(string[] args) { foo myobj = typeresolver.get<foo>("foo data"); } } class typeresolver { public static t get<t>(object obj) { if (typeof(t).canexplicitlycast

C++: Reallocating memory without cstdlib -

couldn't find exact answer question: is freeing memory , allocating again way reallocate memory without using cstdlib? if not so, possible solutions? thanks in advance. if implementing own vector class, need copy contents of vector, not use realloc , since don't know object doing when being copied (or in c++11 relevant cases, moved). imagine example have object this: class b; class { private: b* bp; public: a(b *p) : bp(p) { } }; class b { public: a; b() : a(this) { ... } }; myvector<b> v; if copy object different address, without calling constructor, bp pointer in a point "random" place. pretty nasty bug try find. [and yes, there bunch of stuff missing in above classes - not meant complete class declaration, etc, etc]

segmentation fault - Fingerprint calls cause segfaults in c++ -

i'm trying write simple fingerprint scanning program in c++ using libfprint, intermittently segfaults when run. valgrind says error in call fp_enroll_finger consistent debugging, beyond have absolutely no idea causing error. of times program run fine, times seems consistently segfault period of time whenever program run? heres code: #include <iostream> extern "c" { #include <libfprint/fprint.h> } using namespace std; fp_dev * fpdev; fp_print_data ** fpdata; bool createdevice(); int main(int argc, char **argv) { int r = fp_init(); if(r != 0) { return r; } while(createdevice()) { cout << "scan right index finger" << endl; int enrollstatus = fp_enroll_finger(fpdev, fpdata); if(enrollstatus != 1) { cout << "bad scan" << endl; fp_dev_close(fpdev); } else { cout << "good sc

Register form with Password check android sdk -

all bit of code need add if password != password2 abort register, im unsure of how that, can please assit me? httpclient=new defaulthttpclient(); httppost= new httppost("http://purelymean.com/android/adduser.php"); // make sure url correct. //add data namevaluepairs = new arraylist<namevaluepair>(4); // use same variable name posting i.e android side variable name , php side variable name should similar, namevaluepairs.add(new basicnamevaluepair("username",usern.gettext().tostring().trim())); // $edittext_value = $_post['edittext_value']; namevaluepairs.add(new basicnamevaluepair("password",password.gettext().tostring().trim())); namevaluepairs.add(new basicnamevaluepair("password2",password2.gettext().tostring().trim())); namevaluepairs.add(new basicnamevaluepair("email",email.gettext().tostring().trim())); if (password != password2) { toast.maketext(register.thi

xml - Parsing WordPress RSS Feed with JQuery -

i using jquery read , parse self-hosted wordpress atom feed. here's example of xml generated wordpress: <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="en-us" xml:base="http://example.com/wp/wp-atom.php" > <title type="text">feed title</title> <subtitle type="text">feed subtitle</subtitle> <updated>2013-04-19t21:33:48z</updated> <link rel="alternate" type="text/html" href="http://example.com/wp" /> <id>http://example.com/wp/index.php/feed/atom/</id> <link rel="self" type="application/atom+xml" href="http://example.com/wp/index.php/feed?feed=atom&#038;cat=10" /> <generator uri="http://wordpress.org/" version="3.5.1&q

Length of a sequential table in Lua may skip indices? -

this question has answer here: an interesting phenomenon of lua's table 2 answers in lua seems if single numeric key missing table, length still continues counting: > print(#{[1]=1,[2]=2,[4]=4}) 4 but skipping 2 indices stops @ break > print(#{[1]=1,[2]=2,[5]=5}) 2 it's not unconvential constructor. if skipped index created after creation of table still counts past it, long break one. > x={1,2} > print(#x) 2 > x[4]=4 > print(#x) is implementation error or how lua supposed work. why this? references documentation of interesting. this how works. length of table defined if table sequence, no holes. see http://www.lua.org/manual/5.2/manual.html#3.4.6 .

java - how to make a sorting letter as alphabets -

am new android ,i juz wanna know how make when click button1, button2 text view show 1 2,,, if clicked button2 button1 show 2 1 this codes when click button1 button2, or if clicked button2 button1 shows same,, plz me thanx. now did using gettext & settext working wanted condition if correct or not not working plz !! wrong , method correct? protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setrequestedorientation (activityinfo.screen_orientation_portrait); // full screen requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.wordgame2); bu1 = (button) findviewbyid(r.id.bu1); bu2 = (button) findviewbyid(r.id.bu2); bu3 = (button) findviewbyid(r.id.bu3); bu4 = (button) findviewbyid(r.id.bu4); bu5

internet explorer - Fine Uploader fails in Facebook iframe -

i have built facebook app requires image upload functionality , implement i'm using fine uploader. the facebook app built wordpress , working fine. wordpress website (which app) going live on facebook in iframe , it's here things getting interesting. when test app on local machine works (all browsers). when test app outside iframe on staging environment works (all browser). however, when test app in test page on facebook (iframe) image upload fails, in ie. for reference show server , client code: public static function upload_receiver() { $uploader = new qqfileuploader(); $uploader->allowedextensions = array("jpg", "jpeg"); $uploader->sizelimit = 2024 * 1024; $wp_upload_dir = wp_upload_dir(); $wp_upload_url = $wp_upload_dir['baseurl']; $wp_upload_base = $wp_upload_dir['basedir']; $upload_dir = $wp_upload_base; $upload_filename = md5(mt_rand())/*.'_'.$uploader->getname()*/.".j

dart - Building rsp pages since update not working -

since updating stream 0.70+1 whenever try build rsp file i'm getting errors listed below. filesystementity._throwiferror (dart:io:1637:7) filesystementity.identicalsync (dart:io:1627:18) compilefile (package:stream/src/rspc/build.dart:36:37) build.<anonymous closure> (package:stream/src/rspc/build.dart:126:20) _streamsubscriptionimpl._senddata (dart:async:1586:12) _streamimpl._senddata.<anonymous closure> (dart:async:1362:29) _singlestreamimpl._foreachsubscriber (dart:async:1446:11) _streamimpl._senddata (dart:async:1360:23) _streamimpl._add (dart:async:1162:16) streamcontroller.add (dart:async:1077:35) _directory.list.<anonymous closure> (dart:io:609:40) _receiveportimpl._handlemessage (dart:isolate-patch:81:92) it bug. please follow issue 25

php - Magento Default one page checkout Not Working - Jquery Conflict -

i have configure 2 magento stores on 1 installation. in these two, primary store 1 page checkout not working fine [ not move next step - billing step ] in step2. when view source via browser not require billing.html file is there solution this http://i.stack.imgur.com/napzp.png check if jquery conflicting prototype problem when prototype functions doesnt work use noconflict that good news getting jquery included in magento 2.0 :)

jquery -- how to set one radio button based on another getting clicked -

let's have form includes this: <input type='radio' name='o37_field1' value='aaa'>aaa <input type='radio' name='o37_field1' value='bbb'>bbb <input type='radio' name='o44_field1' value='aaa'>abcdef <input type='radio' name='o44_field1' value='bbb'>baksdf <input type='radio' name='o58_field1' value='aaa'>wisdof <input type='radio' name='o58_field1' value='bbb'>safhwr here's need jquery having trouble: if "aaa" clicked on in 1 of sets, set/check "aaa" other ones, , same other radio buttons have "field1" part of name , "aaa" value. ditto bbb any ideas? this set radios value of "aaa" when 1 checked: $(document).ready(function() { $(':radio[value=aaa]').change(function(){ $(':radio[value=aaa]').prop('ch

ios - Custom UIButton rounder corners become squared on highlight? -

i have following code custom uibutton: btnlogin.layer.cornerradius = 10; [btnlogin setbackgroundcolor:[uicolor colorwithpatternimage:[uiimage imagenamed:@"bluetint.png"]]]; [btnlogin setalpha:1]; [btnlogin settitlecolor:[uicolor whitecolor] forstate:uicontrolstatenormal]; [btnlogin setbackgroundimage:[uiimage imagenamed:@"reallybluetint.png"] forstate:uicontrolstatehighlighted]; [btnlogin setbackgroundimage:[uiimage imagenamed:@"reallybluetint.png"] forstate:uicontrolstateselected]; when highlight button becomes squared though has rounded corners in normal state. any ideas? try code work, btnlogin.layer.cornerradius = 10.0; [btnlogin setclipstobounds:yes];

jquery - How to send the variable to different php while using uplodify -

i want integrate uploadify legacy application. i not able find way send variable (name of file) current legacy file. (that file has database code store file along other form parameter in common table). could please tell me how can send name of files being uploaded uplodify legacy php file. in uploadify, once have filename of uploaded file, can call old code using: file_get_contents("http://yoursite.com/legacy.php?filename=" . urlencode($filename)); and in legacy.php: if($_files['picture1']['name']){ $filename = $_files['picture1']['name']; }else if(isset($_get['filename'])){ $filename = $_get['filename']; } it idea sanity check , make sure $_get['filename'] located in directory you're expecting uploaded files, , isn't "/etc/shadow" , since legacy.php accessible outside web. this isn't best or secure way accomplish want, it's quickest , simplest.

jquery - Give an element a width when display:none; -

i have little css transition want use have element slide out behind parent. element: #contact-form{ background: #f2f2f2; text-align: center; top:-20em; display:none; position: relative; padding: 2em 0; width:100%; -webkit-transition: top 0.2s ease; -moz-transition: top 0.2s ease; -ms-transition: top 0.2s ease; -o-transition: top 0.2s ease; transition: top 0.2s ease; } jquery: $('#contactbtn').click(function(){ $('#contact-form').css('top', 0).toggle('display'); }); as might have guessed, results in element sliding in top-left corner, rather top (because when element "display none" doesn't have width). what's best way ensure transition targets height of element, rather width well? needs start @ top:-20 because attached navbar appears halfway down page. you try $("#contact-form").slidetoggle(); perhaps example help: http://jsfiddle.net/djs4g/

java - FileNotFoundException when running a jar file -

i got path .\\src\\aee\\user\\scorepercentage.csv . it's running when execute in netbeans. when created jar file, scorepercentage.csv can't found. you should either export directory application running, or use class.getresource , embed in jar. if use src directory anywhere in code, doing wrong.

Order received mail in wordpress -

i have shopping cart in wordpress used payments, @ last generate page message , information user entered @ time of shopping. want build functionality user can send(email) information xyz friend. add hidden fields , create form in html, pass values on onsubmit event. use wp_main function send email.

jquery - Get child of element by attribute value -

i have jquery object representing div: $rel = $('#rel_'+rel.id); in div, there button custom attribute "rid" set rel.id i need select button, works this: $("[rid='"+rel.id+"']").html(); but think that's not fastest possible solution needs parse whole dom , because know button inside div, avoid that. i tried following code: $rel.children("[rid='"+rel.id+"']").html(); but didn't work. thanks help. if may not immediate child, you'll want find rather children (which looks @ immediate children): $rel.find("[rid='"+rel.id+"']").html();

attributes - XSLT 1.0: how to get print of first non-empty value of two (see inside) -

i want first non-empty value of 2 , put "value" attribute of text input. so, do: <input type="text"> <xsl:attribute name="value"> <xsl:choose> <xsl:when test="some/@attr != ''"> <xsl:value-of select="some/@attr" /> </xsl:when> <xsl:otherwise> <xsl:value-of select="some/another/@attr" /> <!-- non-empty, --> </xsl:otherwise> </xsl:choose> </xsl:attribute> </input> question is: there way make less lines of code?.. maybe, that: <input type="text" value="some/@attr or some/another/@attr" /> or something?.. in, say, perl: my $val = 0 || 5; thanks in advance help upd xslt 1.0 the relay magic in answer form @martin honnen. enhancement,to make little shorter can use "attribute value templates" <input type="text" value="{so

java - Android intent selecting image bug -

whenever open gallery, have select image 3 times before loads image on activity. this code intent bchange.setontouchlistener(new ontouchlistener(){ public boolean ontouch(view v, motionevent e) { try { intent intent = new intent(intent.action_pick, android.provider.mediastore.images.media.external_content_uri); startactivityforresult(intent, select_photo); } catch (exception e2) { toast.maketext(getapplicationcontext(),e2.getmessage(),toast.length_long).show(); log.e(e2.getclass().getname(), e2.getmessage(), e2); } return false; } }); then here activity result code @override protected void onactivityresult(int requestcode, int resultcode, intent data){ super.onactivityresult(requestcode, resultcode, data); if (resultcode == result_ok && null != data) { uri selectedimage = data.getdata(); string filemanager

hdfs - Wrong Hadoop Home Directory -

i new hadoop. facing strange problem. trying install hadoop un-tar ing tar.gz file. i set java_home variable. did bin/hadoop fs -ls i expecting home directory inside hdfs(/user/hadoop-user) , has empty. but, saw ouputting local unix directory.(/home/< username >) how can happen both 2 diferent filesystems... please me out.

ios6 - NSNotification & didReceiveMemoryWarning in iOS 6 -

as of ios 6.0 , viewdidunload method deprecated. before ios 6 used removeobserver of nsnotification in viewdidunload method. since deprecated , have moved didreceivememorywarning. if app receives low memory waring , notification removed. code written in nsnotification doesn't work. can tell me how can solve issue ? thanks in advance. i assume added observer in viewdidload . problem on ios 6 views not unloaded, in low memory situation. therefore, if remove observer in didreceivememorywarning , viewdidload not called again. there 2 relative simple alternatives can choose from: add observer in viewwillappear , remove in viewwilldisappear . add observer in initxxx method , remove in dealloc . i is possible add observer in viewdidload , remove in didreceivememorywarning . have "manually unload" view in didreceivememorywarning , viewdidload later called again. see e.g. https://stackoverflow.com/a/15805715/1187415 sample code how forcibly unload

java - Hibernate Error: org.hibernate.InvalidMappingException: Could not parse mapping document from resource -

when run project, occurs exception below. before add view table in hibernate, everyting got include blame.hbm.xml , others. , read data database. exception occurs in showorderdaoimpl.java @ sentence: session=hibernatesessionfactory.getsession(); my exception org.hibernate.invalidmappingexception: not parse mapping document resource pojo/blame.hbm.xml @ org.hibernate.cfg.configuration$metadatasourcequeue.processhbmxml(configuration.java:3415) @ org.hibernate.cfg.configuration$metadatasourcequeue.processhbmxmlqueue(configuration.java:3404) @ org.hibernate.cfg.configuration$metadatasourcequeue.processmetadata(configuration.java:3392) @ org.hibernate.cfg.configuration.secondpasscompile(configuration.java:1341) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1737) @ session.factory.hibernatesessionfactory.rebuildsessionfactory(hibernatesessionfactory.java:75) @ session.factory.hibernatesessionfactory.getsession(hibernatesessio

How to upload a larger file from a java mobile app? -

i have done backup , restore application java phone including nokia, works fine pictures larger 1 mb cannot uploaded possible upload file larger 1 mb, if please suggest me whether possible on http or ftp. thank you. have @ step step tutorial. need send files in multiple parts on persistent http connection. uploading files http server using post on android.

php - Struggling to get this to upload into my database -

// check status. if (!empty($_session[username])) { echo "hi, <b>$_session[username]</b>."; if ($_post['submit']) { //get file attributes $name = $_files['myfile']['name']; $tmp_name = $_files['myfile']['tmp_name']; if ($name) { //start upload process $location = "avatars/$name"; move_uploaded_file($tmp_name,$location); $query = mysql_query("update members set imagelocation='$location' username='$username'"); die("your image has been uploaded! <a href='dashboard.php'>back</a>"); } else die("please select file"); } echo "upload image: <form action='profile.php' method='post' enctype='multipart/formdata'> file: <input type='file' name='myfile'> <input type='submit' name='submit' value='upload'></form>";

eclipse - Integrate Sublime Text with Tomcat -

Image
at work, develop java applications , using eclipse. frontend dev switch sublime, it's missing feature of eclipse, can't work without it. when developing, had build project maven , publish tomcat server. eclipse automatically , republish changed files. i came far, building app maven , publish tomcat maven-tomcat plugin. tomcat 7 republishing isn't possible , changed files aren't copied working directory. have leave eclipse open , refresh workspace everytime changed files in sublime. would possible integrate functionality sublime plugin? eclipse has feature this. select "refresh using native hooks or polling" , "refresh on access" . should select both. have tried selecting "refresh using native hooks or polling" , works when keep open specific file in eclipse , modifying outside. "refresh on access" not working alone. these options combined works charmingly. ps: native hooks available in windows . linux ,

php - When Requesting a page from ajax and submiting the form that requested page shows nothing['Solved'] -

i have 4 options single,multiple, matrix , true false kinds of question having value 1-4 respectively in addquestions.php.now have requesting page through id using ajax using method , in requested page have given condition if id ==1 include file singlequestion.php , on.now problem has been arises in singlequestion.php, there 4 options radio buttons. when ajax request files shows contents of singlequestion.php, whenever submitting form in addquestions.php not retrieving value of singlequestion.php inputs. below code:- addquestions.php <form action="insertquestion.php" method="post"> <select name="selectquestiontype" class="questioninput" onchange='showuser(this.value)' id="selectquestiontype"> <option value="0" selected>select question type</option> <option value="1">single choice </option> <option value="2">multiple

Jquery validation for label field -

is possible validate or make required field label this. <label id="company" name="company"> <% if (request.getparameter("company") != null) { request.getparameter("company"); } %> </label> for text area make require giving company: required. label. ? you can label text using $('label[for="' + this.id + '"]').html(); .so can write jquery validation label <label for="company" class="con_name">insert name</label> $("#formid").validate( { rules:{ con_name:{required:true, minlength:3}, } messages: { con_name: 'insert name' } }); see here

python - What would be the non-comprehension list way of doing this sum -

def nested_sum(l): return sum( nested_sum(x) if isinstance(x, list) else x x in l ) this solution given eugenie in following post: sum of nested list in python i trying recreate without using comprehension list, i'm not able it. how it? the code uses generator expression , not list comprehension. use loop , += adding results: def nested_sum(l): total = 0 x in l: total += nested_sum(x) if isinstance(x, list) else x return total or, if want conditional expression expanded if statement well: def nested_sum(l): total = 0 x in l: if isinstance(x, list): total += nested_sum(x) else: total += x return total

Zend Framework 1.12 favicon shortcut icon -

i have problem getting <link ...> tag added html code in output. problem is, link tag never shows (false paths irrelevant, need tag first). added variations of $this->headlink()->headlink(array....); that can find google topic. think have problem of understanding how , zf php-code has added. stuck this. added in bootstrap, in controller, in view, in form... var_dump shows array field added (when no error occurs), has no effect html output. any hints or great! try 1 :- <?php echo'<link rel="shortcut icon" href="'.$this->baseurl("/images/favicon.ico").'"/>' ?> i sure work..

jquery - Two column masonry with single gutter -

i have created following codepen: http://codepen.io/anon/pen/wmjhy the idea being have 2 column masonry of boxes should have 20px of spacing in between them. have set box-sizing border-box ignore border , inner padding of each item. however second column collapsing under first... presumably because 50% , 20px on both boxes (left , right) adding it. any ideas on how fix this? i've looked @ perhaps doing: 'columnwidth': $('.masonry').width() / 2 , having .item set 100% in css doesn't seem work either... perhaps because gutter appending right column boxes too? js: $(document).ready(function(){ $('.masonry').masonry({ 'itemselector': '.item', 'gutter': 20 }); }); css: * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } body { margin: 0; font-family: sans-serif; padding: 20px; } .masonry { background: #ff0000; } .masonry .it

php - How do I set a default query string in my URL? -

i trying build webapp shall filter results based on users current button select , slider choice, achieving via php, sql , ajax calls need sending correct data url. db dip - $ptype = $_get['s']; $fpsival = '15000'; $fgpmval = '10000'; $hpsival = '30000'; $hgpmval = '10000'; $sql = "select * pumps pump_type = '$ptype' , flow_psi <= '$fpsival' , flow_gpm <= '$fgpmval' , high_psi <= '$hpsival' , high_gpm <= '$hgpmval'"; i want set default value ptype of ?ptype=continuous instead of having static variable, how pass url when page called initially? in order handle user result filtering created form method of understand should send data url upon submission, nothing happens , not quite sure have done wrong get form - <form name="pumpcat" action="?s=<?php echo $ptype ?>" method="get" a

c++ - overloaded operator<< outputs an address instead of data members -

i'm trying overload operator<< keep getting address output. for example card *c = new card(5,3); then if try output card overloaded operator<< , the address outputs instead of '5 of clubs' cout << c; //0x100100ff0 ????????????? //card.h #ifndef js_card_h #define js_card_h #include <ostream> using std::ostream; #include <string> using std::string; #include <vector> using std::vector; namespace js { class card { friend ostream &operator<<(ostream &out, const card &rhs); public: enum suit { diamonds, hearts, spades, clubs }; enum rank { ace = 1, jack = 11, queen = 12, king = 13 }; card(int rank, int suit) : rank(rank), suit(suit){} string getrank() const; string getsuit() const; int getrankvalue() const; int operator+(const card& rhs); void displaycard(const card &rhs); private: int rank; i

mediawiki - how to deny access to all pages and allow only for certain on wiki -

i'm using mediawiki 1.13.3 running on freebsd 7.4 i've got confused following task: how deny access pages users (who has account in wiki) or group of these users allow readonly access pages on wiki. goal achieve have no access pages on wiki except allowed few users. i've tried extensions can't find solution ~20000 pages , few hundreds of users. see manual:preventing access on mediawiki.org, section "restrict viewing of pages" . specifically, allow read (but not edit) main page , page named public stuff , , allow sysops read , edit pages, you'd add following lines localsettings.php: # prevent editing , reading anons (except exception listed below): $wggrouppermissions['*']['edit'] = false; $wggrouppermissions['*']['read'] = false; # same normal registered users: $wggrouppermissions['user']['edit'] = false; $wggrouppermissions['user']['read'] = false; # allow read access

java - changing generated tomcat jsp files -

i'd testing on jasper generated jsp files (not original jsp webapp), edited java files contained in tomcat/work/catalina/localhost/mywebapp , recompiled them on own. but every time when restart tomcat, jasper recompiles jsp webapp , overwrites changes. tried editing generated files after server has started, tomcat still recompiles them originals. suspect tomcat somehow detecting if original , generated files in sync. there way disable that? this should not happen if have not made changes jsp in webapps. jsps monitored tomcat updates , recompiled if date on jsp after date on it's compiled .class file. exception when hot code replacement configured server.

tfs2010 - How to configure TFS burndown chart to be for effort points not task hours? -

Image
my question simple, answer too. you know task burndown in tfs online right ? here's example obviously, y-axis remaining hours of tasks. want change remaining effort points of product backlog items , bugs. can ? if so, how ? yes. have edit "sprint burndown.rdl" file in process template (it's in reports folder). particularly, have change field: <field name="remaining_work"> <datafield>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;field xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xsi:type="measure" uniquename="[measures].[microsoft_vsts_scheduling_remainingwork]" /&gt;</datafield> <rd:typename>system.int32</rd:typename> </field> to reference effort point field. isn't change you'll need make file work (the measure in select statement needs altered), sh

linux - Joomla Directory Permissions -

hello have problem joomla directory premissions. using fedora 19 kde. success install joomla , start develop own component. when start install component error: warning: failed move file! ok next. check premissions in system information > directory premissions , there unwritable . what next. first check owner: cd /var/www/html [ikac@localhost html]$ ls -l drwxrwxrwx+ 17 ikac apache 4096 aug 15 15:07 joomla-2.5 again unwritable: i try sudo chown -r apache:apache joomla-2.5 and try this sudo chmod -r 777 joomla-2.5/tmp sudo chmod -r 777 joomla-2.5/component sudo chmod -r 777 joomla-2.5/administrator nothing again unwritable. try put chmod 775 nothing. any other solution how make writable directories. dont have more idea. change owner, mode, , more else. here full dir premission: [ikac@localhost joomla-2.5]$ ls -l total 204 drwxrwxrwx+ 10 ikac ikac 4096 aug 1 04:01 administrator drwxrwxrwx+ 2 ikac ikac 4096 aug 1 04:01 cache drwxrwxrwx+ 2 ikac ikac

html - website shows spam page which doesn't appear in ftp -

there seems spam e-mails being sent out site, not e-mail address, link site. the page links not 1 placed there, though "simple enough, go ftp, delete page , change passwords" ... nope. went ftp, , file doesn't seem exist. the link below, warning - spam page on site without permission, make sure pc thoroughly protected before following link. any tips? tlc-sussex(dot)com/christianslump/ edit - oh joy - it's redirecting 404. have changed password hosting account yet? now. how site coded? suspect controller files have been heavily modified. update: i'm asking on how site coded. i'm guessing either framework or sort of content management system (cms, joomla or drupal) programmer of site, or perhaps key user maintaining site? oops.. see wordpress cms site, , i'm guessing key admin updating site. somewhere 1 of php controller files has been hacked, , needs replaced. did install site, or did else it. can replace wordpress core

onclick - Why does R# tell me, "Not all code paths return a value" in a click handler? -

at end of submit button click handler, resharper warns that, "not code paths return value." what value expecting event handler? in deference full disclosure, event handler: $("#submit_button").click(function() { // http://stackoverflow.com/questions/18192288/how-can-i-compare-date-time-values-using-the-jqueryui-datepicker-and-html5-time var begd = $.datepicker.parsedate('mm/dd/yy', $('#begindate').val()); var endd = $.datepicker.parsedate('mm/dd/yy', $('#enddate').val()); if (begd > endd) { alert('begin date must before end date'); $('#begindate').focus(); return false; } else if (begd.tostring() == endd.tostring()) { var dtestring = begd.getfullyear() + "/" + (begd.getmonth() + 1) + "/" + begd.getdate(); var begt = new date(dtestring + " " + $('#begintime').v

Navigation bar in IBM Connections for Profiles and Files application is hidding -

first of all, time deployed ibm connection navigation bar (this 1 lists applications: home, profiles, blogs , etc.) worked correctly. time ago started go away(hide) when switch profiles or files apps. in other applications working charm(visible). so, possible correlation: some time ago i've applied cr3 update; still trying integrate ibm connections websphere portal (configuration of sso , stuff connected authorization both sides: wp , connections servers); any tips on how resolve problem? after time i've discovered problem customization of headers , footers of applications (profile , files apps). while integrating websphere portal there made changes footer.jsp , header.jsp wrong values. in whole, there 2 ways customize , feel of ibm connections: change , feel applications (jsp files in folder *%connections_install_dir%\data\shared\customization\%app_name%\nav\templates*) change , feel every application\feature (every .war file has nav directory c

ReportLab pdf with only black and white colours (grey scale)? -

is possible generate pdf document black , white colours (grey scale) in reportlab python? i dont want other other colours appear in document. https://www.reportlab.com/software/opensource/ of course. don't set color other black or white. there's literally nothing else it. don't draw in color.

c++ - Deleting by Index? -

i created linked-list program using following source code, #include <iostream> using namespace std; struct node { int data; node *next; }; struct headnode { int count; node *headptr; }; class linkedlist { public: linkedlist(); ~linkedlist(); void addtohead( int ); bool removefromhead(); // bool addtotail ( int ); // bool removefromtail(); void addnode ( int ); bool deletenode ( int ); void deleteallnodes(); bool isempty(); int getnoofnodes(); void displayallnodes(); private: int datacmp ( int, int ); void displaynode ( node* ); headnode head; }; linkedlist::linkedlist() { head.count = 0; head.headptr = null; return; } linkedlist::~linkedlist() { deleteallnodes(); return; } void linkedlist::addtohead ( int newdata ) { node *pnew = new node; pnew ->

Custom Cordova IOS keyboard -

i working on cordova app client insists have custom keyboard numeric input looks native; goal similar keyboard comes paypal. here problem: need without touching way things work android in our app. means need create cordova plugin, have read creating custom keyboard looked down on folks on @ apple (see this old post it). i've had difficult time finding documentation on how cordova on ios, makes me lean towards rolling solution inside of cordova using jquery library. question has 2 parts: 1: if possible, how 1 create custom keyboard html5 inputs in cordova ios plugin? 2: if lost cause, existing jquery plugins recommend instead?

jasper reports - Excel datasource in JasperReports/iReport: Unable to get value for field 'Date' of class 'java.sql.Date' -

Image
i've used excel file datasource building report ireport . xls file contains dates yyyy-mm-dd format. i've set date field class java.sql.date , click on preview in ireport . there error: unable to get value for field 'date' of class 'java.sql.date'. i have tried java.util.date too. have ideas? it quite simple. i've xls file ( birhdays.xls ) this: the datasource definition (in ireport ) is: as can see image above i've set yyyy-mm-dd format date field in ds definition. the date field definition in jrxml file: <field name="birthday" class="java.util.date"/> the full jrxml file: <?xml version="1.0" encoding="utf-8"?> <jasperreport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.so