Posts

Showing posts from June, 2013

gnu make - In Makefile, How to verify if required Linux packages are installed -

gnu make - In Makefile, How to verify if required Linux packages are installed - the below code works in ptxdist makefile, know if there improve solution check if required packages installed before proceeding build? env_verification: @echo ------------start env verification--------------- if ! dpkg -s sudo | grep status | grep -q installed; \ echo error: sudo bundle not installed!; \ exit 1; \ fi if ! dpkg -s scons | grep status | grep -q installed; \ echo scons bundle not installed!; \ exit 1; \ fi @echo ------------end env verification--------------- i run below command in system, nice print same in create log, help improve above code , print below output (if bundle installed) log appreciated. in advance! $ dpkg-query -w -f='${package} ${status}\n' sudo sudo install ok installed you need check see if specific needed component of bundle exists on system. @ check if programme exists makefile different

sql server - Is there a way to automaically migrate stored procedures? -

sql server - Is there a way to automaically migrate stored procedures? - we're migrationg old version of ms sql server much more recent version. problem is, have many as old stored procedures won't run in new version, in particular, many utilize "*=" notation instead of "left join" or right join. upgrading them on-hand extremely error-prone , time consuming (just 1 of databases i'm in charge of has 900+ sp, , i've yet check other four!), i'm wondering if there's software out there can aupgrade these procedures. help appreciated! you don't mention target version of sql server, believe of recent version have corresponding sql upgrade advisor. believe tool useful identify of places utilize obsolete syntax. assuming have server-side code (and no dynamic sql) useful. however, don't think find tool can automatically cases -- old style syntax @ times ambiguous , there other possible problems. you might find article usef

position - iBeacon - how to detect a time a user spends in a room or department? -

position - iBeacon - how to detect a time a user spends in a room or department? - i have app monitors or ranges ibeacons within building. how can observe how long user spends in particular room? i've observed proximity given beacon may jump near far, based on orientation of device. means cannot 1 time range unknown, visit over. should continuously range distance beacon , consider visit start/end 1 time observe x consecutive "near/unknown" states given beacon? there no guarantee number of ranging callbacks proximity "unknown" before beacon disappears. instead, should utilize monitoring apis, , consider room exited when phone call didexitregion . ios give spurious exit notification, need protect against this. starting timer on part exit, , perform exit logic if don't didenterregion callback within 5 seconds. of course, assumes "room" or "department" has beacons transmitter range end exactly @ border of room/de

asp.net mvc - use different name in area url in mvc -

asp.net mvc - use different name in area url in mvc - i have created area named "user" in mvc project. can access area using url mysite.com/user. now can alter name of area in url ? want access area using url mysite.com/admin i can changing folder name of "user" area. need modify lot of files if alter folder name. there other way show different name in url ? using arearegistration.cs ? in userarearegistration file set this: public class userarearegistration : arearegistration { public override string areaname { { homecoming "admin"; } } public override void registerarea(arearegistrationcontext context) { context.maproute( "admin_default", "admin/{controller}/{action}/{id}", new { controller = "home", action = "index", id = urlparameter.optional } ); } } and point controller/action

node.js - Detecting end of stream on streams2 -

node.js - Detecting end of stream on streams2 - i read if stream uses 'data' or 'end' listeners switches "classic" mode , stream-handbook says: note whenever register "data" listener, set stream compatability mode lose benefits of new streams2 api so what's best way utilize benefits of new streams api? if i'm doing this: gulp.src(["./src/server/**/*.coffee"]) .pipe(coffee bare: true ).on("error", gutil.log) .pipe(gulp.dest "./bin/server") .on 'end',-> gutil.log "successfully compiled server coffeescript" how can same thing without registering 'end' listener only calling .resume() / .pause() or adding 'data' listener switch streams2 stream streams1 stream. can hear 'end' without affecting anything. in particular example, if did switch not impact since piping, works in both streams1 , streams2 modes. additionally, ma

AutoMapper and Windsor -

AutoMapper and Windsor - i using automapper itypeconverter , want maintain within castle windsor. in 1 assembly have itypecoverter , load them using approach: container .register(types.fromassembly(assembly.getexecutingassembly()) .basedon(typeof(itypeconverter<,>))); so far can see windsor loading converters properly. then register automapper within windsor mapper.initialize(m => m.constructservicesusing(container.resolve)); container.register(component.for<imappingengine>().instance(mapper.engine)); but when inquire instance of imappingengine conventions not loaded. miss here? i got automapper , windsor play nicely both profiles , typeconverters. think should agnostic plenty you, since automapper automatically pick implementations of itypeconverter. let me know if solves problem. first registered automapper windsor: class="lang-cs prettyprint-override"> public class automapperinstaller : iwindsorinstaller { public v

Heroku Scheduler timezone? -

Heroku Scheduler timezone? - what's heroku timezone scheduler? says "utc" i'm not sure if that's correct. tasks starting @ wrong time despite converting timezone correctly. thoughts? this question's bit old, yes, heroku scheduler uses utc if specify timezone in app. tested code: task :send_test_email => :environment if date.today.strftime("%a").downcase == 'monday' usermailer.send_test_email(time.now.strftime("%z")).deliver end end i'm in pacific time zone. set heroku scheduler run every 10 minutes, , email able send on sunday night pst, mon in utc time. also, string passed mailer, time.now.strftime("%z") , set subject of email indeed read, "utc" one potential source of confusion daylight saving time. example, utc 8 hours ahead of pacific standard time (pst - used winter months), , 7 hours ahead of pacific daylight time (pdt - used summer months). if tasks off hour, measured

perl - Trim trailing and leading spaces in a file fields separated by delimiter using unix command -

perl - Trim trailing and leading spaces in a file fields separated by delimiter using unix command - input file: abc | hello |123 | def | hi ram | 456 | output file should follows abc|hello|123| def|hi ram|456 please allow me know if can accomplish using awk or sed commands. want execute same in perl using scheme command perl -lpe 's/ \s*[|]\s* /|/xg' file output abc|hello|123| def|hi ram|456| perl unix awk sed

How to merge two arrays in Javascript and de-duplicate items -

How to merge two arrays in Javascript and de-duplicate items - i have 2 javascript arrays: var array1 = ["vijendra","singh"]; var array2 = ["singh", "shakya"]; i want output be: var array3 = ["vijendra","singh","shakya"]; the output array should have repeated words removed. how merge 2 arrays in javascript unique items each array in same order inserted original arrays? to merge arrays (without removing duplicates) utilize array.concat : var array1 = ["vijendra","singh"]; var array2 = ["singh", "shakya"]; var array3 = array1.concat(array2); // merges both arrays // [ 'vijendra', 'singh', 'singh', 'shakya' ] since there no 'built in' way remove duplicate (ecma-262 has array.foreach great this..), manually: array.prototype.unique = function() { var = this.concat(); for(var i=0; i<a.length; ++i

ruby - Prawn : Print existing PDF -

ruby - Prawn : Print existing PDF - i have model called mag number , pdf file. i seek access url /magazine/:number.pdf in controller : @magazine = magazine.find_by_number params[:number] but how can display pdf ? thanks in controller: respond_to |format| ... format.pdf pdf = prawn::document.new # don't know how document stored send_data pdf.render, filename: 'report.pdf', type: 'application/pdf' end end don't forget register mimetype in initializer: mime::type.register "application/pdf", :pdf ruby prawn

mapreduce - Is it possible to retrieve a 'time span' from a MongoDB query, using the timestamp within an ObjectId? -

mapreduce - Is it possible to retrieve a 'time span' from a MongoDB query, using the timestamp within an ObjectId? - we have basic enquiry management tool we're using track website enquiries in our administration suite, , we're using objectid of each document in our enquiries collection sort enquiries date added. class="lang-js prettyprint-override"> { "_id" : objectid("53a007db144ff47be1000003"), "comments" : "this test enquiry. please ignore. we'll delete shortly.", "customer" : { "name" : "test enquiry", "email" : "test@test.com", "telephone" : "07890123456", "mobile" : "07890123456", "quote" : false, "valuation" : false }, "site" : [], "test" : true, "updates" : [

c# - How do I ensure I have authorization to the root page of my website? -

c# - How do I ensure I have authorization to the root page of my website? - i have website uses asp.net forms authentication using .net 4.0 on iis 7. have secured site using 3rd party single-sign on provider (jasig cas), , works well. the default documents list in iis has default.aspx @ top. the default page of website default.aspx , opened public below snippet web.config, 1 time again works expected when navigate straight page. <location path="default.aspx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> the problem i'm having when navigate root of website ie www.mydomain.com rather www.mydomain.com/default.aspx redirected forms authentication page. surely same page, , subject same authorization rules? i stuck on this, , not know turn. there similar question in stack overflow: allowing anonymous access default pa

javascript - Make gridster.js tiles stick in specific grid positions (snap to grid) -

javascript - Make gridster.js tiles stick in specific grid positions (snap to grid) - is there way create gridster.js tile(s) stick, not move vertically fill empty space. kind of way layout programme snap-to-grid turned on works... use fork https://github.com/dsmorse/gridster.js shift_widgets_up: false option. see demo : http://dsmorse.github.io/gridster.js/demos/sticky-postion.html javascript jquery gridster

javascript - Child controller $scope property changes not updating for parent -

javascript - Child controller $scope property changes not updating for parent - i'm still new angularjs , scopes, i'm having problem scope values changed in kid controllers not affecting parent value properly. one example: i have kid controller watches changes in textarea. when occur, set boolean flag indicate document has unsaved changes. editor.on('input propertychange', function(){ $scope.unsaved = true; }).focus(); however, never seems filter parent scope. root template has anchor: <a ng-class="{'active': unsaved}" ... the class set on load, never changes when $scope.unsaved does. if set $scope.$parent.unsaved , alter template sec time input event fires. one thing instead of having editor.on('input propertychange', function(){ $scope.unsaved = true; }).focus(); you add together ng-change event: <input type="text" ng-model="a" ng-change="madechange()"/>

javascript - Cant destroy Cookies of Firefox in JAVA EE -

javascript - Cant destroy Cookies of Firefox in JAVA EE - i have problem session cookie, when logout y destroy cookie, in chrome , ie, going well, cant destroy cookie in firefox, , if seek go site 1 time again after logout, allow me in. im using struts 2, , have interceptor read cookies , creates or redirectme home page, depends if cookie exists or not. also, when force button of firefox, action or interceptor not executed. i need code, edit question in java: private deletecookie(string cookiename) { cookie[] cookies = reqest.getcookies(); if (cookies != null) { (cookie cookie : cookies) { if (long.valueof(cookie.getname()).equals(cookiename)) { cookie.setvalue(null); cookie.setmaxage(0); cookie.setpath(thesamepathasyouusedbeforeifany); response.addcookie(cookie); } } } } and phone call deletecookie("my_cookie_name&qu

C Issues with pointers and a queue -

C Issues with pointers and a queue - i using self-written queue library next structure: #ifndef myqueue_ #define myqueue_ #ifndef set_queue_size #define set_queue_size 10 #endif typedef struct queue queue; /* ** creates , initializes queue , prepares usage ** homecoming pointer newly created queue */ queue* queuecreate(); /* ** add together element of generic type queue */ void enqueue(queue* queue, void* element); /* ** delete queue memory; set queue null ** queue can no longer used unless queuecreate called 1 time again */ void queuedestroy(queue** queue); /* ** homecoming number of elements in queue */ int queuesize(queue* queue); /* ** homecoming pointer top element in queue */ void* queuetop(queue* queue); /* ** remove top element queue */ void dequeue(queue* queue); #endif //myqueue_ now, i'm having issues putting in , receiving out circular queue. queue has been tested , shouldn't give issues. running code below (it's extr

perl - Why isn't on_eof called in this AnyEvent::Handle example? -

perl - Why isn't on_eof called in this AnyEvent::Handle example? - this simple server. when run , telnet (port 5222), , have telnet quit connection, why isn't on_eof function called? i.e. why isn't string "catastrophe!!!" printed? #!/usr/bin/perl utilize v5.18; utilize warnings; utilize ev; utilize anyevent; utilize anyevent::socket; utilize anyevent::handle; our $hdl; $server = tcp_server undef, 5222, sub { ($fh) = @_; $hdl = anyevent::handle->new(fh => $fh); $hdl->on_eof(sub { ($handle) = @_; "catastrophe!!!"; }); }; ev::run; tl;dr: without trying read socket, eof cannot detected. utilize ->on_eof or ->push_read. long version: the illustration doesn't effort read handle, , why anyevent::handle doesn't effort read data. without attempting read data, cannot observe eof (a consequence of posix api). this behaviour described indirectly in description start_read/s

asp.net - Ticking timers in Kendo UI grid -

asp.net - Ticking timers in Kendo UI grid - kinda new this. i'm trying implement kendo ui grid command in info of 1 of columns represents how long user has been waiting in queue. imagine display in dmv have list of ticket numbers , running timer next each representing how long ticket has been pending. any pointers on how functionality can achieved? i'm trying see if fire timer every second, iterate on rows in grid when timer fires , update each row individually. approach sound okay? asp.net kendo-ui kendo-grid

objective c - what is the best way to use Openears in iOS app with multiple language support? -

objective c - what is the best way to use Openears in iOS app with multiple language support? - i developing app "speech text", using openears this. aware of language model , dic files. but thought create language model of whole vocabulary? (language model of english language language 125 mb in size) how can implement "speech text" many languages. should create language model each language? , build size if import 10 language model in app? thanks in advance. openears developer here. openears supports 2 languages , doesn't perform big vocabulary recognition. described in docs, check them out answers these questions , more. ios objective-c speech-recognition speech-to-text openears

javascript - Split a multiple JS string by new line -

javascript - Split a multiple JS string by new line - i have next multi-line string has been escaped new-lines: var types = "a\ b\ c\ d"; i'm trying split them new-lines: var info = types.split('\n'); i've had no luck this.. how do this? try splitting regex: types.split(/ */) live demo javascript

using variable to make variable name in shell script -

using variable to make variable name in shell script - i want echo $anmial0 , $animal1 using script below. line 7: ${animal$i}: bad substitution error message. what's wrong? #!/bin/sh animal0="tiger" animal1="lion" i=0 while test $i -lt 2; echo "hey $i !" echo ${animal$i} i=`expr $i + 1` done the problem shell performs single substitution pass. can forcefulness sec pass eval , comes usual security caveats (don't evaluate unchecked user input, etc). eval echo \$animal$i bash has various constructs help avoid eval . shell

linux - Server handling multiple clients - C Systems Programming -

linux - Server handling multiple clients - C Systems Programming - i have server, containing file.txt. have multiple clients can read/write file(found on server). wish lock other write requests, when write request beingness handled. however, read requests never locked. know, best handle such race conditions? thinking can tackle having struct each client in server, each struct contains "ip address of client", , "flag enabling write client" , sort of mutexes. hope clear plenty :) appreciate feedback! it sounds want reader-writer locks. fact actual readers , writers remote clients minor detail, since actual readers , writers threads on server side. the linked wikipedia articles mentions pthread_rwlock_t , defined posix , should available through pthreads on modern linux distributions. update: based on op's comment, trying synchronize file access across processes. implies should using flock, caveats mentioned in this answer. c linux clie

postgresql - Sorting order behaviour between Postgres and Mysql -

postgresql - Sorting order behaviour between Postgres and Mysql - i have faced unusual sort order behaviour between postgres & mysql. for example, have created simple table varchar column , inserted 2 records below in both postgres , mysql. create table mytable(name varchar(100)); insert mytable values ('aaaa'), ('aa_a'); now, have executed simple select query order column. postgres sort order: test=# select * mytable order (name) asc; name ------ aa_a aaaa (2 rows) mysql sort order: mysql> select * mytable order name asc; +------+ | name | +------+ | aaaa | | aa_a | +------+ 2 rows in set (0.00 sec) postgres , mysql both returning same records different order. my question 1 correct? how results in same order in both database? edited: i tried query order collate, solved problem. tried this mysql> select * t order name collate utf8_bin; +------+ | name | +------+ | aa_a | | aaaa | +------+ 3 rows in set (0.00 sec)

angularjs - ASP.NET WebAPI2 CORS: null request in GetOwinContext on preflight -

angularjs - ASP.NET WebAPI2 CORS: null request in GetOwinContext on preflight - i'm creating angularjs (typescript) spa webapi2 backend, requiring authentication , authorization api. api hosted on different server, i'm using cors, next guidance found @ http://www.codeproject.com/articles/742532/using-web-api-individual-user-account-plus-cors-en i'm newcomer in field. all works fine, can register , login, , create requests restricted-access controller actions (here dummy "values" controller default vs webapi 2 template) passing received access token, in client-side service relevant code: private buildheaders() { if (this.settings.token) { homecoming { "authorization": "bearer " + this.settings.token }; } homecoming undefined; } public getvalues(): ng.ipromise<string[]> { var deferred = this.$q.defer(); this.$http({ url: this.config.rooturl + "api/values", method: "ge

c# - string.IndexOf search for whole word match -

c# - string.IndexOf search for whole word match - i seeking way search string exact match or whole word match. regex.match , regex.ismatch don't seem me want be. consider next scenario: namespace test { class programme { static void main(string[] args) { string str = "subtotal 34.37 taxation total 37.43"; int indx = str.indexof("total"); string amount = str.substring(indx + "total".length, 10); string stramount = regex.replace(amount, "[^.0-9]", ""); console.writeline(stramount); console.writeline("press key continue..."); console.readkey(); } } } the output of above code is: // 34.37 // press key continue... the problem is, don't want subtotal, indexof finds first occurrence of word "total" in "subtotal" yields wrong value of 34.37. so question is, there

install - Installing Ruby On OSX Mavericks -

install - Installing Ruby On OSX Mavericks - i have upgraded imac os recent osx mavericks (10.9.3) , unable install ruby 1.9.3. have run proposed solution in book. have installed xcode, command line tools, fixed every warning , error using brew doctor until got "your scheme ready brew" message, , several other methods proposed online. suggestions help greatly. below error getting when utilize command ruby install 1.9.3 other variations command. (this happens every version of ruby well, not 1.9.3). no matter do, exact same error occurs right after "openssl..........." installing required packages: readline, openssl........... error running 'requirements_osx_brew_libs_install readline openssl', showing lastly 15 lines of /users/julian/.rvm/log/1403049978_ruby-2.1.2/package_install_readline_openssl.log ++ /scripts/functions/logging : rvm_pretty_print() 81 > case "$1" in ++ /scripts/functions/logging : rvm_pretty_print() 82 &

java me - j2me - Is it possible to read/write text files without having to use the FileConnection API? -

java me - j2me - Is it possible to read/write text files without having to use the FileConnection API? - i'm developing application taking orders. ok consuming webservices , kind of stuff , problem comes when have save read info device , query data. @ moment i'm using rms. have 2 record stores (one products , 1 clients) i'm not sure performance when i'll have save considerable number of records products. i didn't tried write results webservices text files because the book read before starting develop app stated : reading , writing files requires appropriate permissions, means have cryptographically sign application create sure users aren’t plagued security prompts. read in chapter 5, signing expensive in terms of time , money. contrast, application can utilize rms free. but i've been through pain of having utilize rms store objects (serilized using json) : rs = recordstore.openrecordstore(mrecordstorename, true);

c# - Consume .NET WCF Service (Azure Cloud Service) with Mono -

c# - Consume .NET WCF Service (Azure Cloud Service) with Mono - is possible build standard .net wcf service , consume via mono? specifically mono on raspberry pi? wcf partially supported mono. see details: http://www.mono-project.com/wcf personally have experience using rest api + mono on raspberry pi , recommend going way. c# .net wcf azure mono

c# - Struct on the heap? -

c# - Struct on the heap? - this question has reply here: does using “new” on struct allocate on heap or stack? 8 answers so have this: class simpledatestructuredemo { struct date { public int year; public int month; public int day; } static void main() { ... } } and see example, saying object allocated on heap: date datemoonwalk = new date(); i thought classes ref type, , structs value type. in end, can create struct type object on heap using new, right? you can create struct type object on heap using new, right? no, if within of main , in general, won't allocated on heap. can allocate struct on heap in many ways, though, including using field in class, using in closure, etc. the new date syntax initializes struct it's default (zeroed out) value, doesn't alter how or it's allocated. c# c

Keep alive UDP socket in background for ios -

Keep alive UDP socket in background for ios - my question not code maintain udp socket live when application in background confusion documentation in apple developer site. according apple developer guide if set kcfstreamnetworkservicetype kcfstreamnetworkservicetypevoip socket managed specially scheme when app in background. in cocoaasyncsocket library reported settings not working in udp socket in tcp socket. tested alternative native cfreadsteam interface socket didn't live when app in background. apple developer site never mention it. is true tcp socket can maintain live in background or making error in code? ios udp voip cfreadstream

.htaccess - How to redirect everyone from my website apart from me? -

.htaccess - How to redirect everyone from my website apart from me? - basically, want know in title of question: rewritebase / rewriteengine on rewritebase / rewritecond %{remote_host} !^11.11.11.111 rewritecond %{request_uri} !/www.mywebsite.site10.net/stuff/randomfile.html\.html$ rewriterule .* http://www.google.com [r=302,l] 11.11.11.111 beingness ip address options +followsymlinks rewriteengine on rewritecond %{remote_host} !^xxx\.xxx\.xxx\.xxx rewriterule \.html$ /anotherpage.html [r=302,l] where xxx.xxx.xxx.xxx ip , anotherpage.html redirection page. this 302 moved temporarily redirection http://en.wikipedia.org/wiki/http_302 .htaccess mod-rewrite

ios - When does UITextAutocorrectionTypeDefault not result in autocorrection being enabled? -

ios - When does UITextAutocorrectionTypeDefault not result in autocorrection being enabled? - the developer docs uitextinputtraits state: the default value property uitextautocorrectiontypedefault, input methods results in auto-correction beingness enabled is there documentation on input methods or situations result in auto-correction beingness disabled? i not sure there's such documentation (i couldn't find any), 1 possible illustration of auto-correction beingness disabled when uitextfield instance (which conforms uitextinputtraits default) used secure entering: textfield.securetextentry = yes; in other words, scheme doesn't auto-correct password type expected. if still need info specific cases when auto-correction disabled, may seek asking question on apple developer forums. ios autocorrect

ios - canDisplayBannerAds Issue when Starting in Landscape Mode -

ios - canDisplayBannerAds Issue when Starting in Landscape Mode - i have enabled banner ads via self.candisplaybannerads = yes; on modal view within app. banner shows @ bottom of screen below toolbar. when starting app in portrait mode , moving vc, ads correct. when on vc if rotate landscape mode view resizes correctly , well. however, if start app in landscape mode , navigate vc, toolbar not displayed correctly. buttons forced downwards partially off screen before iad starts. 1 time iad starts bar move up; however, buttons still incorrectly located. if disable ads , start app in landscape mode toolbar fine sure due ad. thinking screwed on orientation since command called in viewdidload cannot phone call afterwards or entire placement gets totally screwed up. how can iad place correctly when starting in landscape mode? so prepare issue had add together constraint on y-axis. had constraint prior bottom of view adding y constraint @ top of toolbar (its nea

winrt xaml - MediaCapture.CapturePhotoToStreamAsync() and MediaCapture.CapturePhotoToStorageFileAsync() throw Argument exception -

winrt xaml - MediaCapture.CapturePhotoToStreamAsync() and MediaCapture.CapturePhotoToStorageFileAsync() throw Argument exception - i'm trying create app can utilize photographic camera windows phone 8.1, using windows rt/xaml development model. when seek phone call either of capture methods off of mediacapture class argumentexception message "the parameter incorrect." here code private async task initialize() { if (!designmode.designmodeenabled) { await _mediacapturemgr.initializeasync(); viewfinder.source = _mediacapturemgr; await _mediacapturemgr.startpreviewasync(); } } private async void viewfinder_ontapped(object sender, tappedroutedeventargs e) { imageencodingproperties imageproperties = imageencodingproperties.createjpeg(); var stream = new inmemoryrandomaccessstream(); await _mediacapturemgr.capturephototostreamasync(imageproperti

web applications - iOS webapp open from another webapp or safari -

web applications - iOS webapp open from another webapp or safari - is there way create links website open in web app if user has installed on home screen? if there link website in facebook app, how tell iphone open web app , not safari? i know native apps can this, , can open 1 app another... can same done web app , native app or 2 web apps (open 1 web app another)? it's super far fetched, nice feature! yeah, nice feature... unfortunately can't yet. ios 8 may be? ios web-applications external-links

jquery - Pass PHP variables without using href in Bootstrap tabs -

jquery - Pass PHP variables without using href in Bootstrap tabs - i'm trying send php variables using <a> tag , info attribute on same php page using bootstrap tabs: html (bootstrap tab option): <a style='padding:20px;' href='#tab_e' data-page='$page' class='passrss' data-rssid='$rssid' data-toggle='tab'>test</a> php (stored in #tab_e tab): $rsspassedid = $rssid tag (data-rssid) i'd value stored in data-rssid on click , pass variable farther downwards in same php file when tab opened using #tab_e , mysql statement run based on value provided in $rssid , display results of query. i'm not sure if jquery/ajax required possible info stored in info attribute of <a> tag in php? update i've tried storing variables in pagination links still no luck, here's xhr object created: <script> $(document).ready(function () { $('.passrss').click(function () {

jquery - How to make header height relative to (tab) content height? -

jquery - How to make header height relative to (tab) content height? - hard explain need added image create things more clear: example: see image below i'm building website tabbed content on single page. want header , content height bigger , smaller when there more or less content total page height nog bigger 100% when content smaller maximum content size want header become bigger/animate slide down. how can create header , content resize relative each other , tabbed content size? please see above image more clear explanation. building on @vlrprbttst's fiddle, more or less need: working demo css :root, body { margin:0; padding:0; height:100%; overflow:hidden; } .cont { background:black; } .wrap { height:100%;} #header { height:75%; background:red; } #content { height:25%; padding:0; margin:0; background:tan; } #tabbed.dynamic-height { background:violet; max-height:80%; } javascript $(func

java - memory management using linked list -

java - memory management using linked list - this homework question in relation memory management implementation using linked lists. each memory process requests of particular size of memory must contiguously big plenty fit memory , allocate process.when job terminates,its allowed memory becomes free. java code wrote this. public class partitionnode{ int beginaddress; int endaddress; boolean holefree; int processid; partitionnode next; public partitionnode(int begin,int end){ beginaddress=begin; endaddress=end; holefree=true; processid=-1; next=null; } public partitionnode(){} public partitionnode(int begin,int end,int i){ beginaddress=begin; endaddress=end; holefree=false; processid=i; } } public class partition{ private partitionnode head; public partitionnode current; public int begin; public int end; public partitionnode newpartition; pub

how to get a reference to python caller of a C api function -

how to get a reference to python caller of a C api function - i implementing embedded python interpreter next https://docs.python.org/3/extending/embedding.html there way me create own apis c programme user can phone call own internal c functions python script. this works fine, able know script function got called. every function must have these parameters according manual: static pyobject *someapifunction(pyobject *self, pyobject *args) but manual doesn't explain self assumed self reference module called function, wrong. tried phone call pymodule_getname on self , returned internal name of application set during initialization (using pymodule_create ). is there way recognize module called c function? if doing in python, utilize next line: module_path = sys._getframe(1).f_code.co_filename you might able similar in c api, have never worked it. python c

ruby on rails - Heroku nil class error -

ruby on rails - Heroku nil class error - i pushed local rails 4 app heroku, , i've got unusual error. case, works fine locally no issues. think heroku db / environment same local (as far know anyway!) the error in heroku logs is: actionview::template::error (undefined method 'empty?' nil:nilclass) it's trying tell if association empty or not-- if empty display no results partial-- if it's not empty loop through results , display result partial each. controller: @polls = poll.where('team_id = ? , expires_at >= ?', params['id'], datetime.now()) view: <% if @polls.empty? %> <%= render partial: "noresults" %> <% else %> <% @polls.each |p| %> <%= render partial: "poll", locals: {poll: p} %> <% end %> <% end %> i opened heroku console , ran @polls query, returned proper association, able test empty? , worked expected. any thought causing

javascript - Custom gulpfile path that is not an ancestor directory -

javascript - Custom gulpfile path that is not an ancestor directory - i read issue requesting custom gulpfile path, documentation liftoff, , its utilize in gulp. can't work me. want phone call gulp using shared gulpfile in directory. node_modules in $pwd , , modules in symlinks. $ tree . |-- node_modules . |-- gulp -> /.../gulp . . . . i've tried few incantations, none of work. promising far (fewest errors) has been this: $ gulp --gulpfile ../../path/to/gulpfile.js --cwd . --require gulp [01:31:42] requiring external module gulp [01:31:42] local gulp not found in $pwd [01:31:42] seek running: npm install gulp what missing? javascript node.js gulp

html - Internal link in WordPress footer.php file not working -

html - Internal link in WordPress footer.php file not working - i creating kid theme , have added link in footer.php file page within website. used wordpress recommended: <a href="<?php echo esc_url( get_permalink( get_page_by_title( 'page title' ) ) ); ?>">page title</a> which displays proper url when link clicked, 404 error. determined if set permalink setting default bring page, url permalink id, not slug. want utilize post name permalinks seo purposes. suggestions? with out seeing resulting url it's hard problem is. i'm guessing you're using illustration here on get_permalink() function page. guess don't need utilize esc_url() function. according stephen harris get_permalink() performs it's own sanitation using esc_url() on not necessary despite beingness "recommended" on codex. it more helpful if posted link page or @ to the lowest degree resulting code. php html wordpress wordpre

windows - Batch File Choice Command Loops -

windows - Batch File Choice Command Loops - i've written simple batch file selection command. code follows: choice /c yn /m /t 5 "do want continue" if errorlevel 2 goto no if errorlevel 1 goto yes goto end :no echo selected no goto end :yes echo selected yes :end problem when run it doesn't wait input .. loops through , doesn't stop. don't know or why doesn't work. created batch file @ work selection command more complex , works fine. file wouldn't work on computer either. also if type selection command straight in cmd works fine batch file loops any suggestions? thanks here link video shows doing http://youtu.be/4tkwlr7ymb8 the /m switch message, need write text after /m . need include /d switch (for default), because specified how long have create selection /t . default alternative option selected automatically if user doesn't create selection in, example, 5 seconds. below illustration automatically take n

java - Passing not form data from jsp page to a servlet -

java - Passing not form data from jsp page to a servlet - does exist way pass info not within form printed in jsp page servlet. if info form easy when info illustration div possible send servlet? try this: <form action="{your action}?name=jigar joshi"> ... </form> java javascript html jsp servlets

javascript - Why is my || (OR) behaving like an && (and)? -

javascript - Why is my || (OR) behaving like an && (and)? - i hoping 1 can help me here: i want validate user input (email address) on html form. want both '@' (at sign) , '.' (period) nowadays in user input string. here code check if case: function email_checker(id_name){ var email = document.getelementbyid(id_name).value; if (email.indexof('@') == -1 && email.indexof('.') == -1){ code } } the weird thing thing works || (logical or) operator instead of &&. so, suppose question doubles in sense; a) if (logical or) works in code, why (logical and) not work? b) why (logical or) work - work if (logical and) , not or? (hope makes sense :) i'm missing something. help much appreciated. demorgan's laws answers why. if want have both, have check has@ , has. ; failure of not(has@ , has.) , breaks downwards not(has@) or not(has.) , can write hasnt@ or hasnt. . current code checks hasnt

c++ - Does swap() cause undefined behaviour? -

c++ - Does swap() cause undefined behaviour? - i'm trying understand conditions on std::swap [c++11: utility.swap]. template defined as template <typename t> void swap(t &, t &) (plus noexcept details) , having effect of "exchanging values stored @ 2 locations". is next programme have well-defined? #include <utility> int main() { int m, n; std::swap(m, n); } if wrote swap code myself (i.e. int tmp = m; m = n; n = tmp; ), have undefined behaviour, since effort lvalue-to-rvalue conversion on uninitialized object. standard std::swap function not seem come conditions imposed on it, nor can 1 derive specification there lvalue-to-rvalue , ub. does standard require std::swap perform magic well-defined on uninitialized objects? to clarify point, consider function void f(int & n) { n = 25; } , never has undefined behaviour (since not read n ). very nice question. however, covered [res.on.arguments]§1: each

Mobile Number Verification during registration by message from api like that in "viber" for android -

Mobile Number Verification during registration by message from api like that in "viber" for android - i have url, username , password of message api. , beginner. have tried codes failed. want working code integrating api parameters have , receiver code reading message received message api. the process follows.. during user registration user enters number. the number sent url of api , user receives message random code. the application verifies if random code same sent. if same user gets registers , sees application content. this activity happens 1 registration. do help me in serious confusion...thank alot in advance i think https://github.com/cognalys/cogdemo will meet requirement . new way of mobile number verification free. :) android api sms message verification

ruby on rails - PG::TRDeadlockDetected: ERROR: deadlock detected -

ruby on rails - PG::TRDeadlockDetected: ERROR: deadlock detected - i restarting 8 puma workers via bundle exec pumactl -f config/puma.rb phased-restart works fine. getting more , more postgres errors: pg::trdeadlockdetected: error: deadlock detected i found 50 of idle postgres processes running: postgres: myapp myapp_production 127.0.0.1(59950) idle postgres: myapp myapp_production 127.0.0.1(60141) idle ... they disappear when running bundle exec pumactl -f config/puma.rb stop . after starting app bundle exec pumactl -f config/puma.rb start , 16 idle processes. (eight many in opinion.) how can manage these processes better? help! update my puma.rb: environment 'production' daemonize true pidfile 'tmp/pids/puma.pid' state_path 'tmp/pids/puma.state' threads 0, 1 bind 'tcp://0.0.0.0:3010' workers 8 quiet i might have found solution question: had queries outside of controllers (custom middleware), seem have caused pr

cordova - “Remember Me” functionality in a PhoneGap application -

cordova - “Remember Me” functionality in a PhoneGap application - i new phonegap development. phonegap application has login page , need implement "remember me" alternative login page. have no thought functionality can help me. want sample code functionality. please refer tried code following, function checkpreauth() { /* console.log("checkpreauth");*/ if(window.localstorage.getitem("remember") == true) { if(window.localstorage.getitem("username") != undefined && window.localstorage.getitem("password") != undefined) { var form = $("#loginform"); $("#username", form).val(window.localstorage.getitem("username")); $("#password", form).val(window.localstorage.getitem("password")); $("#remember_me", form).attr('checked', true).checkboxradio("refresh"); handlelogin();

php - How to get a list of uploaded custom-background images in wordpress? -

php - How to get a list of uploaded custom-background images in wordpress? - i'm building theme , i'd utilize 'supersized' script rotate background images. i've used wp built-in customizer upload couple of background images. show in customizer under "background image"->"uploaded" tab. what looking the code retrieve urls of images - done in customizer, utilize in script. i looked through 'customize.php' in /wp-admin/ invokes function , code function elsewhere. has knowledge on code located? interestingly, images uploaded through customizer not show in media library... anyone help that? edit: in other words - what query homecoming urls of custom-background images uploaded through customizer? thanks. if static page can seek addon acf plugin repeater field <div id="mycarousel" class="carousel slide" data-ride="carousel"> <div class="carousel-inner">

objective c - sqlite3_prepare_v2 failing -

objective c - sqlite3_prepare_v2 failing - could explain me why if statement not triggering? database opens fine, it's can't retrieve values database. also, table name right well. if (sqlite3_prepare_v2(database, [query utf8string], -1, &statement, nil)== sqlite_ok) { while (sqlite3_step(statement) == sqlite_row) { int uniqueid = sqlite3_column_int(statement, 0); char *namechars = (char *) sqlite3_column_text(statement, 1); char *addresschars = (char *) sqlite3_column_text(statement, 2); nsstring *name = [[nsstring alloc] initwithutf8string:namechars]; nsstring *address = [[nsstring alloc] initwithutf8string:addresschars]; personinfo *info = [[personinfo alloc] initwithuniqueid:uniqueid name:name address:address]; [returnarray addobject:info]; } sqlite3_finalize(statement); } homecoming returnarray; } objective-c sqlite3

c++ - What are the rules for automatic generation of move operations? -

c++ - What are the rules for automatic generation of move operations? - in c++98, c++ compiler automatically generate re-create constructor , re-create assignment operator via member-wise copy, e.g. struct x { std::string s; std::vector<int> v; int n; }; the compiler automatically generates re-create constructor , re-create assignment operator x , using member-wise copy. but how things alter in c++11 move semantics? are move constructor , move assignment operator automatically generated, re-create constructors , re-create assignment operators? are there cases in move operations not automatically generated? from standard ch. 12 - special fellow member functions par 12.8 copying , moving class objects (emphasis mine) 9 . if definition of class x not explicitly declare move constructor, one implicitly declared defaulted if , if — x not have user-declared re-create constructor, — x not have user-declared re-create assi

mysql - How to add leading zeros into existing Column? -

mysql - How to add leading zeros into existing Column? - i have 1 column (zip varchar(10)) in mysql. giving value examples of columns. 1. 576 2. 5768 3. 57689 i want replace 3 digits adding 00 prefix, 4 digits adding 0 prefix. after doing operation values should be, 1. 00576 2. 05768 3. 57689 is possible mysql query? ideas? the next query uses lpad function suggested georstef. update <tablename> set zip = lpad(zip,5,'0'); mysql sql

zip - ZipArchive in PHP does not unzip file -

zip - ZipArchive in PHP does not unzip file - here code use <?php $zip = new ziparchive; $res = $zip->open('file.zip'); if ($res === true) { $zip->extractto('myextractdir/'); $zip->close(); echo 'extracted'; } else { echo 'failed'; } ?> it outputs extracted, no files show up. file zip file.. please check file permissions. directory read-only? if directory read-only, please set file permissions in either windows or linux. php zip ziparchive

ruby on rails - Infinite process -

ruby on rails - Infinite process - i'm creating rails app, scraps few website's contents. let's - 15 shops , products. scraping infinite process scraps each shop 1 1 , when lastly shop scrapped, worker goes first 1 , whole process starts beginning. my first thought utilize kind of recursive sidekiq worker scrap shop no. 1 , after success, scraps next shop fireing itself class fetcherworker include sidekiq::worker def perform(shop_id) shop.find(shop_id).fetch_products fetcherworker.perform_async(next_shop_id) end end however, have absolutely no experience on ground (such long-running processes) wanted inquire if there best-practive or obvious solution should utilize in next situation? it's quite of import me able access info what's going on , shop beeing scrapped (and sidekiq provides such tools). in advance. i separate performing work , scheduling it. if job crashes might not reschedule itself. there bootstrap issue (let