Posts

Showing posts from July, 2012

php - how to dropdown option keep selected after page loads onchange -

how can dropdown option keep selected after loading page function onchange? can load page according selected value dropdown. , after loading page it's selected first value default. <select id="extdropdown"> <option>select extension</option> <option value="*">all</option> <option value="zip">zip</option> <option value="rar">rar</option> <option value="php">php</option> <option value="html">html</option> <option value="htm">htm</option> <option value="jpg">jpg</option> <option value="bmp">bmp</option> <option value="txt">text</option> <option value="docs">docs</option> <option value="xlsx">xlsx</option> <opt...

Hide Row from dev gridview vb.net -

Image
i want remove/hide row (in orange) grid, don't know row mean. thanks. i see auto filter row feature enabled on screenshot. feature row allows data filtered on fly - typing text within row. to disable feature set gridoptionsview.showautofilterrow property false . you can restrict option activating end-user via hiding "show auto filter row" check item within column header context menu . this, set gridoptionsmenu.showautofilterrowitem property false .

ios - Could not add private pod as a dependency in other pod? -

i working on private pod, , when tried add dependency private pod getting error while running "pod update": [!] error installing eemypod [!] attempt read non existent folder `/volumes/development/work/projects/pods/eagle-eye-ios-pod/example/pods/eemypod`. i have no clue why happening! but, while running: pod spec lint i getting this: attempt read non existent folder `/private/tmp/cocoapods/lint/pods/eemypod` which think might clue. this podfile: pod::spec.new |s| s.name = "eemypod" s.version = "0.1.0" s.summary = "a short description of eemypod." s.description = <<-desc optional longer description of eemypod * markdown format. * don't worry indent, strip it! desc s.homepage = "https://github.com/codigami/eemypod" # s.screenshots = "www.example.com/scr...

javascript - Copy object with results of getters -

i have object contains getter. myobject { id: "myid", title () { return myrepository.title; } } myrepository.title = "mytitle"; i want obtain object like: myresult = { id: "myid", title: "mytitle" } i don't want copy getter, so: myresult.title; // returns "mytitle" myrepository.title = "another title"; myresult.title; // should still return "mytitle" i've try: $.extend(): doesn't iterate on getters. http://bugs.jquery.com/ticket/6145 iterating properties suggested here , doesn't iterate on getters. as i'm using angular, using angular.foreach, suggested here . properties , not getters. any idea? thx! update setting getter using object.defineproperty as: "title": { get: function () { return myrepository.title; }}, as can read in doc: enumerable true if , if property shows during enumeratio...

oracle - SQL: Merging rows with comma separated values in columns -

we have table this: group | user | team ------------------- grp1 | u1 | t1,t2 grp1 | u2 | t1,t2,t3 grp1 | u3 | t4 grp2 | u4 | t2,t4 grp2 | u5 | t5 i want create view has data this: group | teams ------------- grp1 | t1,t2,t3,t4 grp2 | t2,t4,t5 can please me? tried doing few trail , errors , @ state not sure start now here approach. using cursor can in while loop also. issue teams in new table not distinct think can play string commands , sort issue. create table #tbl1 ([group] varchar(20), [user] varchar(20), team varchar(20)) insert #tbl1 ( [group], [user],team ) values ( 'grp1', 'u1', 't1,t2'), ( 'grp1', 'u2', 't3,t4'), ( 'grp1', 'u3', 't4'), ( 'grp2', 'u1', 't1,t2'), ( 'grp2', 'u2', 't3,t4') create table #tbl2 ([group] varchar(20), team varchar(20)) declare @listofteams varchar(max) declare @grp varcha...

php - Extending an IF statement -

this question has answer here: php if statement multiple conditions 8 answers in wordpress want call specific secondary menu in event page called foo called. i've got beviour working using following: <?php if (is_page('foo') ) : ?> <!-- nav html --> <?php endif; ?> however i'd same secondary menu shown on other pages, such foo2 can call recycling of above: <?php if (is_page('foo2') ) : ?> <!-- nav html --> <?php endif; ?> what best way join these statements? instance doesnt work: <?php if (is_page('foo','foo2') ) : ?> the wordpress docs suggest example code: <?php if (is_page('foo','foo2') ) : ?> should work fine. http://codex.wordpress.org/function_reference/is_page however not particularly familiar wordpress, alternative can use php's...

Bad character encoding in LoadRunner -

when record siebel script, , run it, status error code of error , message this: \xce\xe1\xff\xf7\xe0\xf2\xe5\xeb\xf2\xed\xfb\xe9 ........ what character encoding , how can decode normal text? think it's russian text, describe error, wrong. found answer. it's simple win1251 shows utf8, \x.

haskell - A theorem prover / proof assistant supporting (multiple) subtyping / subclassing -

in short, looking theorem prover underlying logic supports multiple subtyping / subclassing mechanism.( tried use isabelle, not seem provide first class support subtyping. see this ) i define couple of types among subclasses / subtypes of others. furthermore, each type might subtype of more 1 type. example: type type b type c type e type f c subtype of c subtype of b e , f subtypes of b ps: editing question again more specific (because of complains being of-topic!): looking theorem prover / proof assistance in can define above structure in straight forward manner (not workarounds kindly described respectable answers here). if take types classes seems above subtypings easily formulated in c++! looking formal system / tool can define such subtyping structure there , can reason? many thanks pvs has traditionally emphasized "predicate subtyping" lot, system bit old-fashioned these days , has fallen behind other big players more active: coq, isabelle/hol,...

asp.net mvc - Cannot connect to remote SQL Server with SQL Server Management Studio with Visual Studio -

i'm developing small app on own , trying install database on local machine using development. so far have done of these things: install sql server management studio; created server name (fictious) mycpu/sqlexpress created in database named myproject1 and have set sizes best figure out added in security login user named test / password for connection tests; sql server configuration manager tells me sql server service running, sql server agent stopper , sql server browser running; got ip of machine (fictious) 254.254.254.123 in windows firewall, have added inbound rule named sql server port 9999 (9999 being proper port supposed listened server); i have linksys router and, on router, in security tab, single port forwarding, have remote desktop connection external / internal port routing port 9999 ip 254.254.254.123 , enabled; i have authorized tcp/ip protocol on server. this resumes have done best remember have tried many things. objective connect myproject1 usi...

pascal - FPC exitcode 201 while using ansistring. String does not do that -

i have question. wrote little program , working perfectly, until changed s , s2 string ansistring. need use ansistring, because way longer 255 characters. response. {$h+} program test; uses crt; var s,s2:string; konec,radek:boolean; i,a,z:integer; begin clrscr; s:=''; s2:=''; i:=0; a:=0; z:=1; konec:=false; radek:=false; repeat s2:=''; readln(s2); s:=s+s2; until s2=''; while konec=false begin while radek=false begin a:=a+1; if length(s)+1=a begin radek:=true; s:=''; if a<60 writeln(s2); end; if not (a=length(s)+1) begin if s[a]=' ' i:=a; s2:=s2+s[a]; if not (s[a]=' ') if a=60 begin radek:=true; delete(s2,i,60-i+1); writeln(s2); s2:=''; delete(s,z,i); end; if (s[a]=' ') , (a=60) begin radek:=true; writeln(s2); ...

How to set image in tabhost in android? -

i building android application using 4 tablayout. now wanna set image in place of text in handing of tablayout. i using code of link - http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/ here code - mainactivity.java package info.androidhive.tabsswipe; public class mainactivity extends fragmentactivity implements actionbar.tablistener { private viewpager viewpager; private tabspageradapter madapter; private actionbar actionbar; // tab titles private string[] tabs = { "top rated", "games", "movies" }; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // initilization viewpager = (viewpager) findviewbyid(r.id.pager); actionbar = getactionbar(); madapter = new tabspageradapter(getsupportfragmentmanager()); viewpager.setadapter(madapter); actionbar.sethomebuttonenabled(f...

java - How does Google App Engine manage sessions inside cluster? -

a cluster contains several nodes, , if 1 of current node down, other nodes can retrieve current user session. i thinking how same thing myself (session replication) if want create own high availaible paas (cloud). may use key/value database (nosql) in order store/retrieve sessions ? or similar. how google google app engine ? google use filter in order rewrite httpsession api (java) ? thanks in appengine, session kept in datastore. can same or improve adding caching layer memcache.

Finding values and duplicates in large JSON dataset with python -

i have huge data set (b) of json objects. have smaller data set (a) of json objects well. fastest way see if every element in within b? how check if there duplicates of elements in in b? what had in mind creating dictionary of data set b key value pair being same json value. allow fast lookups. same thing set value each key in set empty list. with each key in set looked on set b , appended respective list. once done, length of list determine if of these values not found, matched, duplicated. if length of list key in set 0 --> none found in b 1 --> 1 found in b >1 --> more 1 found in b (duplicates found) i dont think standard dictionaries support duplicates, not sure data structure use support duplicate key, value pairs well, here's best guess. uses dicts instead of json objects, you'll want double check comparison works in case. uses generator make tuples of (object, count). if there 0 instances of obj in in b, false gets inserted. then, ...

Could I read lines from a C++ socket using Ubuntu? -

i wonder if read several lines c++ socket using ubuntu? please note every line used different purpose (e.g. maybe first used string , second char array). i.e. put 2 lines directly after each other without encountering problem? read(socketfiledescriptor, buffer1, buffer_size); read(socketfiledescriptor, buffer2, buffer_size); thanks in advance, regards, you call read twice in sequence without problem in itself. what each call may not correspond single line of input though. read "raw" reading, when reading file on disk--if data available, read data necessary fill buffer gave (up size specified). tcp treats data stream, data pass 2 (or more) separate calls write end being put single packet , transmitted together. on receiving end, data read single call read --or, depending on buffer size pass, might read part of one, or might read of first , part of second, etc. if want read input "lines", (for 1 example) create stream buffer reads data so...

A Comment is causing code to display incorrectly (CSS/Bootstrap) -

Image
this 1 of strangest things have encountered. comment (or lack thereof) causing output change. see below, notice <!-- , --> in middle. <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="row"> <div class="col-xs-6 col-md-8 col-lg-8 vertical-center"> <h2> test <small> <span>test</span> </small> </h2> </div><!-- --><div class="col-xs-6 col-md-4 col-lg-4 vertical-center"> <h2 class="text-right skip-pause-buttons"> <span class="glyphicon glyphicon-step-backward"></span> <span class="glyphicon glyphicon-pause"></span> <span class=...

c# - WPF expand content to outside the window -

Image
i want following effect in wpf the main window looks following when click on friends panel friends list should expanded outside window and when click on item list have able catch event , handle on main window how achieve in wpf? i've tried use expander, isn't showing content doesn't fit size of window. it's showing part of content you can use popup control , set placementtarget , placement depending on button clicked. simple example: <grid> <grid.rowdefinitions> <rowdefinition></rowdefinition> <rowdefinition></rowdefinition> <rowdefinition></rowdefinition> </grid.rowdefinitions> <popup staysopen="false" width="300" height="200" x:name="mypopup"> <popup.child> <stackpanel background="bisque"></stackpanel> </popup.child> </popup> <but...

javascript - Integrating Search Form for Google Maps -

i building search form using google maps javascript v3 api. after performing search, code have below passes geocoordinates map not update. tried moving codeaddress function inside initialize() search button didn't work. how integrate 2 correctly? html: <form> <input type="text" name="address" id="address" /> <input type="button" class="search_button" value="" onclick="codeaddress()" /> </form> javascript: var geocoder; function initialize() { geocoder = new google.maps.geocoder(); var mapoptions = { center: { lat: 48.509532, lng: -122.643852} }; var map = new google.maps.map(document.getelementbyid('map-canvas'),mapoptions); var locations = <?php echo json_encode($locations_array); ?>; var infowindow = new google.maps.infowindow(); var marker, i; (i = 0; < locations.length; i++) { marker = new google.maps.marker({ posi...

interop - Generic PInvoke in C# -

i'm interfacing c api has few functions of following form: int get_info(/* stuff */, size_t in_size, void* value, size_t *out_size); this well-known c idiom return bunch of data of different types single function: in_size parameter contains size of buffer passed value , , actual number of bytes written out written through out_size pointer, caller can read data in value buffer. i'm trying call these kinds of functions c# nicely (i.e. without making overload each different type , having call them individually, butt-ugly , introduces lot of duplicate code). naturally tried this: [dllimport(dllname, entrypoint = "get_info")] int getinfo<t>(/* stuff */, uintptr insize, out t value, out uintptr outsize); to amazement, compiled , worked in mono. unfortunately, hopes slashed vs not wanting compile it, and, indeed, generic methods forbidden dllimport targets. looking for. tried few things: dynamically generating appropriate pinvoke target based on gen...

javascript - D3: What is a Bisector? -

i'm looking making charts d3, , stumbled upon d3.bisector . however, don't understand or documentation. almost examples find in web use date array, similar example in official documentation: var data = [ {date: new date(2011, 1, 1), value: 0.5}, {date: new date(2011, 2, 1), value: 0.6}, {date: new date(2011, 3, 1), value: 0.7}, {date: new date(2011, 4, 1), value: 0.8} ]; var bisect = d3.bisector(function(d) { return d.date; }).right; so bisector do, besides picking date object array elements? *.right return? and of use if have simple 1-dimensional array, var data = [3, 6, 2, 7, 5, 4, 8] ? thanks enlightening me. the underlying idea behind bisect this: consider array mention - var data = [3, 6, 2, 7, 5, 4, 8] you want insert new value let's 3.5 data array , want know how 'partition' it. in other words, want know index of 3.5 if inserted when data array sorted. var data = [3, 6, 2, 7, 5, 4, 8] //sorted data [2,...

xcode - SQLITE_TRANSIENT undefined in Swift -

i'm using xcode 6 , i've imported libsqlite3.dylib , libsqlite3.0.dylib . i've added bridging-header.h file witch imports sqlite3.h i can open sqlite database , simple operations insert select... with if (sqlite3_bind_text(compiledstatement, 2, name.cstringusingencoding(nsutf8stringencoding), -1, sqlite_transient) != sqlite_ok) i have error: use of unresolved identifier 'sqlite_transient' what show do? i'm new in swift, it's first question on stack, pls me! the definitions #define sqlite_static ((sqlite3_destructor_type)0) #define sqlite_transient ((sqlite3_destructor_type)-1) from <sqlite3.h> not imported swift, due "unsafe" pointer casting. a possible swift definition shown in sqlite.swift project, in statement.swift : let sqlite_static = sqlite3_destructor_type(copaquepointer(bitpattern: 0)) let sqlite_transient = sqlite3_destructor_type(copaquepointer(bitpattern: -1)) for swift 2 need let s...

javascript - error on magnific popup youtube video on page load -

i'm finding difficult load youtube video using magnificpopup. i not find solution on following reference: how load magnific popup on page load . here's code: $(document).ready(function(){ $.magnificpopup.open({ disableon: 700, type: 'iframe', removaldelay: 160, preloader: true, fixedcontentpos: false, iframe: { patterns: { youtube: { index: 'https://youtube.com/', id: 'v=somevideo', src: 'http://www.youtube.com/embed/%id%?autoplay=1' } } } }); }); i need video load on page load. throws error stating: uncaught typeerror: cannot read property 'parsed' of undefined why expect code in question work? in, makes think set of properties pass magnificpopup.open function? i've had @ documentation/examples http://dimsemenov.com/plugins/magnific-popup/ , , couldn't see example involved passing...

Php to post on facebook fan page not working -

all, i'm trying post on facebook fan page directly below php code. posting "post on pages" , shown @ side. have wordpress plugin post directly facebook fan page , want replicate same. please check , let me know on update on this. <?php // require facebook php sdk // see: https://developers.facebook.com/docs/php/gettingstarted/ require_once("/your_path_to/facebook_php_sdk/facebook.php"); // initialize facebook class using own facebook app credentials // see: https://developers.facebook.com/docs/php/gettingstarted/#install $config = array(); $config['appid'] = 'your_app_id'; $config['secret'] = 'your_app_secret'; $config['fileupload'] = false; // optional $fb = new facebook($config); // define post parameters (replace own values) $params = array( "access_token" => "your_access_token", // see: https://developers.facebook.com/docs/facebook-login/access-tokens/ "message" => ...

java - Cleaning eclipse project without cleaning depending projects -

i have webpap project depending on many others projects, the clean of webpap project, cause build of others, prevent this? without closing them. well, in eclipse, when selected project -> clean... menu, allows select projects you'd clean. edit 1 disable eclipse's refresh on startup: preferences -> general -> startup , shutdown -> refresh workspace on startup disable automatic build: menu -> project -> build automatically if you're using project management tools such maven, may want take @ specific build settings.

google chrome - Why is my site text dancing when I highlight it? CSS ::selection -

using chrome, highlight of text on my site , crosses on , mumble jumbles. i've got following in sass/css file: // ::selection *::-moz-selection { color: $mulberry; background: none repeat scroll 0% 0% $keylime; } *::selection { color: $mulberry; background: none repeat scroll 0% 0% $keylime; } i first tried without asterisk wildcards, no luck, still shimmy-shake dance. when remove it, it's fine. tips appreciated why chrome might doing this. not happening in safari or firefox. you've got funky font-styles in there, causing problem: -webkit-font-feature-settings: "liga", "dlig" if remove css rule, problem goes away.

android - Why is my onBackup() method for my BackupAgentHelper not being called? -

i've read through documentation , other questions, guess i'm missing something. backupagent's oncreate being called, not onbackup , when call adb bmgr backup <package> , adb shell bmgr run command line. part of equation missing? mybackupagent class: public class mybackupagent extends backupagenthelper { public mybackupagent() { log.d("gradetracker.mybackupagent", "oncreate called"); string str = dbadapter.database_name; filebackuphelper mydb = new filebackuphelper(this, "../databases/" + str); addhelper(dbadapter.database_name , mydb); } @override public void onbackup(parcelfiledescriptor oldstate, backupdataoutput data, parcelfiledescriptor newstate) throws ioexception { log.d("gradetracker.mybackupagent", "onbackup called"); synchronized (dbadapter.dbbackuplockobject) { super.onbackup(oldstate, data, newst...

r - time difference between two same tweet -

how calculate time difference between 2 same tweet(from text perspective) , add column in data frame show time difference timediff(new column name ) td3 = t3-t2. td13 = t13-t12 if t13 , t12 both same text/tweet. input data tweet text time-stamp rt aamaadmiparty arvindkejriwal leaves 2014-03-24 17:18:53 rt aamaadmiparty arvindkejriwal leaves 2014-03-24 22:37:11 rt aamaadmiparty arvindkejriwal leaves 2014-03-24 22:44:51 rt aamaadmiparty arvindkejriwal leaves 2014-03-25 13:24:31 rt aamaadmiparty download aap 2014-03-25 19:31:06 rt aamaadmiparty download aap 2014-03-25 19:34:29 rt aamaadmiparty download aap 2014-03-25 19:42:10 rt aamaadmiparty download aap 2014-03-25 19:53:38 desired output data tweet text time-stamp t-diff rt aamaadmiparty arvindkejriwal leaves 2014-03-24 17:18:53 0 rt aamaadmiparty arvindkejriwal leaves 2014-03-24 22:37:11 5.305 hours rt ...

asp.net mvc - MVC Global Server Side Output Caching -

i'm trying setup global server side output caching our public site. can see there outputcache attribute lets control this. works fine if register globally in filterconfig this filters.add(new outputcacheattribute() { duration = 3600, varybyparam = "*" }); the problem enables caching on client side , causing issue redirect logic have setup. need but if set location property server this filters.add(new outputcacheattribute() { duration = 3600, varybyparam = "*", location = outputcachelocation.server }); then causes following exception on pages child actions. outputcacheattribute child actions supports duration, varybycustom, , varybyparam values. please not set cacheprofile, location, nostore, sqldependency, varybycontentencoding, or varybyheader values child actions is there way enable server side caching globally? can explain why not work? that limitation in mvc. can use custom output caching. follow link you can install mvcdon...

qc - How to get all the defects in Quality Center 11 by Restful API -

This summary is not available. Please click here to view the post.

How to check if SOUND is ON/OFF on HTML5 video -

i need show sound icon on top of video, when sound off , hide when sound on. reason code below not working. if (video.prop('muted') === true) { video.mouseenter( function() {sound.show()} ).mouseleave( function() {sound.hide()} ); } else { sound.hide(); } <video id="video" controls muted preload="none" width="446" height="250"></video> i figured out. works that. video.mouseenter( function() { if (video.prop('muted') === true) { sound.show() } else { sound.hide() } }); video.mouseleave( function() { sound.hide(); }); considering video element: <video id="video" controls muted preload="none" width="446" height="250"> </video> you can determine whether sound on testing volume , muted media properties of element: var video = document.getelementbyid("video"); if (video.muted || video.volume === 0)...

c# - Usercontrol is not working -

i'm create popup in wp8 usercontrol call popup on button click below code private void button_click(object sender, routedeventargs e) { mypopup.verticaloffset = 100; if (mypopup.isopen != true) { mypopup.child = mycontrol; mypopup.isopen = true; } else { mypopup.isopen = false; } mycontrol.settings.click += (s, args) => { mycontrol.settings.navigateuri = new uri("/selectjoketype.xaml", urikind.relativeorabsolute); }; } but navigateuri not working it's not go selectjoketype.xaml page what navigationservice.navigate? additional information here

c - Longer Time Delay When More Then One "while" Polling Instruction -

microcontroller : atmega328p in arduino uno clock frequency : 16mhz void timedelay_ctc(float sec, unsigned char times) //0.1 <= sec <= 4 { ocr1a = (sec / 0.000064f) - 1; tccr1a = 0b00000000; tccr1b = 0b00001101; for( unsigned char = 1; <= times; i++ ) { while( (tifr1 & (1<<ocf1a)) == 0 ); tifr1 |= (1<<ocf1a); } tccr1a = 0; tccr1b = 0; } the above function used calculating number of time delay cycles , implement in ctc mode. works well. now, want write similar function in normal mode. folowing code. void timedelay_norm(float sec, unsigned char times) { unsigned int cycle = (sec / 0.000064f); tcnt1 = 65534 - cycle; tcnt1 = 49910; tccr1a = 0b00000000; tccr1b = 0b00000101; for( unsigned char x = 1; x <= 2; x++ ) { while( (tifr1 & (1<<tov1)) == 0 ); tifr1 |= (1<<tov1); } tccr1a = 0; tccr1b = 0; } however, normal mode functi...

localization - Can't install language pack -

i'm trying install italian language pack on vm instance debian. i've tried still can't find language pack. $ apt-get update $ apt-get install language-pack-it-base $ apt-get install language-pack-it it returns: e: unable locate package language-pack-it it's same other languages. hint? to install language-pack-it-base: $ wget http://archive.ubuntu.com/ubuntu/pool/main/l/language-pack-it-base/language-pack-it-base_14.10+20141020_all.deb $ sudo dpkg -i language-pack-it-base_14.10+20141020_all.deb to install language-pack-it: $ wget http://archive.ubuntu.com/ubuntu/pool/main/l/language-pack-it/language-pack-it_14.10+20141020_all.deb $ sudo dpkg -i language-pack-it_14.10+20141020_all.deb verify installation of packages using dpkg -l $ dpkg -l | grep language-pack-it ‘ii’ status indicates successful installation. if dependency errors during installation, run command below , re-install packages. $ sudo dpkg --configure -a

ruby - Rails forms for has_many through association using cocoon -

i have used has-many-through relation between user , skills bridge table skills_users. have used cocoon gem. getting values skills using dropdown box on each add_association. in adding new skill dropdown shows values want values have not been selected. there way reject values have been selected dropbox of new skills class skillsuser < activerecord::base belongs_to :skill belongs_to :user end class skill < activerecord::base has_many :skills_users has_many :users, through: :skills_users belongs_to :skill_type end class user < activerecord::base has_many :skills_users has_many :skills, through: :skills_users end here drop-down box code skills = f.input :skill_id, as: :select, collection: skill.where(skill_type: skill_type.id), label_method: :name, value_method: :id, label: false, placeholder: 'add skills' in controller add: @available_skills = skill.where(skill_type: skill_type).where("`id` not in ?", @user.skills.pluck(:id))...

javascript - Video not pre-loading and still buffering -

i'm trying video preload before starts playing don't have issues buffering, no matter still seems buffer @ random points through video, here code using: <video preload="auto" height="auto" id="video" width="100%" controls="" autoplay="false"><source src="/media/export/cms/01_cl_sleigh 1280.mp4" type="video/mp4"> <source src="/media/export/cms/01_cl_sleigh 1280.webm" type="video/webm"> <source src="/media/export/cms/01_cl_sleigh 1280.ogv" type="video/ogg"> <img src="http://placehold.it/400x400"> </video> <p><source src="/media/export/cms/01_cl_sleigh 1280.mp4" type="video/mp4"> <source src="/media/export/cms/01_cl_sleigh 1280.webm" type="video/webm"> <source src="/media/export/cms/01_cl_sleigh 1280.ogv" type="video/ogg"...

php - RegisterNamespace in Zend Framework 1.12 -

i've deleted every zend framework class in folder "library/zend", used 1.7 version , wanted upgrade 1.12. after deletion i've uploaded zend framework 1.12 classes in "library/zend". i'm facing issue in loading classes. in "public/index.php" used registerautoload() . depricated changed this: require_once 'zend/loader/autoloader.php'; $loader = zend_loader_autoloader::getinstance(); then, each class use in controller have manually add this: $loader->registernamespace('paths'); $loader->registernamespace('certificate'); $loader->registernamespace('zim_properties'); $loader->registernamespace('zim_controller_dispatcher'); $loader->registernamespace('controller_plugin_actionsetup'); $loader->registernamespace('controller_plugin_history'); $loader->registernamespace('zim_model'); $loader->registernamespace('zim_controller_action'); $loader->...

sql server - Pass field from one dataset to another dataset as parameter In SSRS 2008 R2 -

i have scenario 1 of data-set returns multiple records. have implemented grouping in report display each record data set on different page. now have dataset loads data using fields dataset1 parameter. means need assign fields dataset1 dataset2 parameter each record. for single record, can assign values dataset1 report parameter , use our dataset. but in case, parameter holds value 1st record , passes every page or group. how can achieve this? i had same problem, value first record in parent report dataset each subreport record. in case, resolution remove hidden parameter using in parent report. default value assigning parameter results query. i went properties of subreport, selected parameters , in value dropdown assigned parent report parameter, switched field name of parent report dataset field pass value subreport parameter. hope helps.

reporting services - Rdlc: dynamically hide item in footer -

i want hide or show controls in page footer of rdlc report based on happens in report. body contains couple of tablixes , 1 of tablixes shown on page don not want show controls in page footer. tried couple of things, setting shared variable using custom code , hide based on variable, hides controls on page footers, instead of hiding them tablix on page (when variable set). you can refer report item report body, this: reportitems!mytextbox.value you may need create invisible textboxes in tables or in other area of report body contain visibility criteria. the catch can refer 1 report item in footer, without knowing more logic of report, it's hard if sufficient. may need use table footer instead, example.

javascript - Generate <li> from array in <div> -

im geting error uncaught typeerror: cannot read property 'appendchild' of null , dont know why: im trying make list array , display on div var options = [ set0 = ['option 1', 'option 2'], set1 = ['first option', 'second option', 'third option'] ]; function makeul(array) { // create list element: var list = document.createelement('ul'); (var = 0; < array.length; i++) { // create list item: var item = document.createelement('li'); // set contents: item.appendchild(document.createtextnode(array[i])); // add list: list.appendchild(item); } // finally, return constructed list: return list; } // add contents of options[0] #foo: document.getelementbyid("foo").appendchild(makeul(options[1])); <div id="foo"></div> the following solve problem <html> ...

java - Is it possible to call a JET file within another JET file? If so please explain how it can be done -

i have jet file generating c++ file. want generate various c++ files out of single jet file.the single jet file should call other jet files within it. possible? yes can. ws:file tag: <ws:file path="" template="" replace="true" /> generally done in main.jet file , discouraged in other jet templates, doable. in order use ws tag library in jet template, you'll need use tab lib directive ws library: <%@taglib prefix="ws" id="org.eclipse.jet.workspacetags" %> this directive written top of main.jet default (but not other jet templates) tooling.

java - ArrayList contains -

i don't understand what's happening, if explain me great. so, here's code: public static arraylist<integer> numbers = new arraylist<integer>(); public static void main(string[] args){ for(int =0; != 90; i++){ system.out.println(generate()); } } public static int generate(){ random random = new random(); int rand = random.nextint(89)+1; while(numbers.contains(rand)){ //<---here seems problem rand = random.nextint(89)+1; system.out.println("number: " + rand + " exists!"); } numbers.add(rand); return rand; } i writing program generates random number 0-90, each of different last. unfortunately, seems while loop returns true. you can using collections shuffle public static arraylist<integer> numbers = new arraylist<integer>(); for(int =1; <= 90; i++){ number.add(i) } collections.shuffle(numbers); // @ point number shuffled. read shuffle .

Flattening a shallow list in Python -

this question has answer here: making flat list out of list of lists in python 25 answers is there simple way flatten list of iterables list comprehension, or failing that, consider best way flatten shallow list this, balancing performance , readability? i tried flatten such list nested list comprehension, this: [image image in menuitem menuitem in list_of_menuitems] but in trouble of nameerror variety there, because name 'menuitem' not defined . after googling , looking around on stack overflow, got desired results reduce statement: reduce(list.__add__, map(lambda x: list(x), list_of_menuitems)) but method unreadable because need list(x) call there because x django queryset object. conclusion : thanks contributed question. here summary of learned. i'm making community wiki in case others want add or correct these observations. my o...

Go: Retrieve a string from between two characters or other strings -

let's example have 1 string, this: <h1>hello world!</h1> what go code able extract hello world! string? i'm still relatively new go. appreciated! there lots of ways split strings in programming languages. since don't know asking provide sample way output want sample. package main import "strings" import "fmt" func main() { initial := "<h1>hello world!</h1>" out := strings.trimleft(strings.trimright(initial,"</h1>"),"<h1>") fmt.println(out) } in above code trim <h1> left of string , </h1> right. as said there hundreds of ways split specific strings , sample started. hope helps, luck golang :) db

java - Use a thread to wait until the user has picked a file -

i have mainclass in java, starts gui in swing. ask user open file using jfilechooser. want main wait until user has finished picking file , continue rest of code in main. how do using threads? in advance. here skeleton code: public class mainclass { public static void main(string[] args) { gui gui= new gui(); //wait user input here //continue code system.out.println("user has picked file"); } } gui.java public class gui{ //user picks file using jfilechooser jfilechooser choosefile= new jfilechooser(); //notify mainclass we're done fiction continue code } ok, 2 things. you don't need multiple threads the thing is, can accomplish goal of waiting user select file using modal dialog. works following: import javax.swing.*; public class dialogtest { public static void main(string[] args) { jfilechooser chooser = new jfilechooser(); chooser.showopendialog(null); system...

Javascript check if character is a vowel -

i've looked @ plenty of questions related mine here they're using different methods method have use. i'm aware it's long winded way find out when there simpler ways i'm following instructions. why doesn't below code work? function checks if it's vowel. input checked see if it's length 1. if it's 1, call function. if it's greater 1, ask input until length 1. i see boolean doesn't exist in js. guess question invalid now! function isvowel(x){ boolean result; if(x == "a" || x == "e" || x == "i" || x == "o" || x == "u" ) { result = true; } else{ result = false; } return result; } var input; input = prompt("enter character "); input = input.touppercase(); if(input.length == 1){ isvowel(input); } } else{ while(input.length != 1){ prompt("enter c...

c# - Calling multiple webservices with different certificate types in a multithreaded environment -

my problem: i have webapp (.net 4.5.1) doing multiple calls external webservices. of services communicates on ssl , other on tsl only. i know that, reason, servicepointmanager.securityprotocol can set statically globaly appdomin (why global have no idea), since multiple calls can occure @ same time different external services in different threads - can't change securityprotcol appdomain each service call. question: how should handle in multithreaded web app environment? should make service calls spawn in different appdomains can set securityprotocol? , if - how should that? i had problem , found solution worked me. i use servicepointmanager handle connection certificates servicepointmanager.servercertificatevalidationcallback = new system.net.security.remotecertificatevalidationcallback(validateremotecertificate); private bool validateremotecertificate(object sender, x509certificate certificate, x509chain chain, sslpolicyerrors policyerrors) { ...

grails - Email not sent via Gmail - Username and Password not accepted -

i getting error while trying send email via gmail. here's code, in config.groovy file. mail.mailmessagebuilder failed send email org.springframework.mail.mailauthenticationexception: authentication failed; nested exception javax.mail.authenticationfailedexception: 535-5.7.8 username , password not accepted. learn more @ 535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 ca4sm3178528pbd.79 - gsmtp @ grails.plugin.mail.mailmessagebuilder$_sendmessage_closure1.docall(mailmessagebuilder.groovy:112) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745) caused by: javax.mail.authenticationfailedexception: 535-5.7.8 username , password not accepted. learn more @ 535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 ca4sm3178528pbd.79 - gsmtp @ com.sun.mail.smtp.sm...

python - SQLAlchemy 'character_set_name' error in GAE -

after deploying application google app engine warning raised on (what seems like) random requests. /sqlalchemy/dialects/mysql/base.py:2452: sawarning: no 'character_set_name' can detected mysql-python version; please upgrade recent version of mysql-python. assuming latin1. the sql server google cloud sql. is there way fix (maybe set character_set_name value) or totally dependent on mysql-python version shipped app engine? i got issue if used: create_engine('mysql+gaerdbms:///xxx?instance=xxx:xxx') but, goes away if use: create_engine('mysql://root@127.0.0.1:3306/xxx?unix_socket=/cloudsql/xxx:xxx')

php - Pulling 1000+ records from MySQL, need advice -

i'm attempting pull on thousand records mysql db using php , due long load time i'm curious if there better way write query. function propigatetable($connection) { $sql = mysqli_query($connection, "select `id`, `legalname`, `doingbusinessas`, `creationdate`, `modifieddate`, `status` `merchants` `deleted` = '0' order `creationdate` desc"); while($merchant = mysqli_fetch_array($sql)){ $id = $merchant["id"]; $legalname = $merchant["legalname"]; $doingbusinessas = $merchant["doingbusinessas"]; $creationdate = date('d, m j y', strtotime($merchant["creationdate"])); if ($merchant["modifieddate"] != "0000-00-00 00:00:00") { $modifieddate = date('d, m j y', strtotime($merchant["modifieddate"])); } else { $modifieddate = ""; } if ($merchant["status"] == "inactive") { $s...

html - create if conditional based on css properties -- javascript -

this question has answer here: check if element visible in dom 15 answers how find if css properties set in way? example how find if element has css property of background-color:#ff0000; ? or if element has width etc... this way determine css properties including visibility: works properties set in external css file, internal embedded styles, or inline styles! note: document must loaded before executing script! i have tested out , works css rules set in inline, embedded, , external. html: <div id="element" onload="test();">div content</div> css: #element { visibility:hidden; } javascript: function test() { var element = document.getelementbyid('element'); if(element.style.visibility == 'hidden'){ a...

wordpress - ACF plugin finding ID for image for PHP to display in page -

i have wordpress site using acf plugin. what i'm trying achieve this: using plugin allow php in posts, trying code display image using shortcode given acf what have far is <?php echo wp_get_attachment_image( 'id' ) ?> displays image need <?php the_field('mobile_poster'); ?> displays id image what hasn't worked has been using <?php echo wp_get_attachment_image( '[acf field="mobile_poster"] ') ?> any ideas on how achieve appreciated. kind regards, ben you can try shortcode : <?php echo do_shortcode( '[acf field="{$field_name}" post_id="{$post_id}"]' ) ?> for display acf field value if trying find image have id of custom field can write code <?php $attachment_id = do_shortcode( '[acf field="{$field_name}"]' ) ; wp_get_attachment_image_src( $attachment_id ); ?>

hadoop - namespace image and edit log -

from book " hadoop definitive guide ", under topic namenodes , datanodes mentioned that: the namenode manages filesystem namespace. maintains filesystem tree , metadata files , directories in tree. information stored persistently on local disk in form of 2 files: namespace image , edit log. secondary namenode, despite name not act namenode. main role periodically merge namespace image edit log prevent edit log becoming large. i having confusion these files namespace , edit log . namespace image storing metadata. so, questions what edit log ? , role? can explain statement " its main role periodically merge namespace image edit log prevent edit log becoming large ."? please can explain me edit log? role of log file? initially when namenode first starts fsimage file empty. when ever namenode receives create/update/delete request request first recorded edits file durability once persisted in edits file in-memor...