Posts

Showing posts from March, 2012

javascript - Scroll Function Firing Multiple Times Instead of Once -

i trying create website automatically scrolls each section upon single scroll action. means code has check if page scrolled or scrolled down. believe code below solves problem scroll action fired more once while page scrolling. see first alert in if statement reaches 5 instead of desired 1. on matter highly appreciated. [note] using velocity.js library scroll each section within container. var page = $("#content-container"); var home = $("#home-layer-bottom"); var musicians = $("#musicians"); var athletes = $("#athletes"); var politics = $("#politics"); var bio = $("#politics"); var pages = [ home,musicians,athletes,politics,bio ]; var pagecur = 0; var lastscrolltop = 0; page.scroll(function(){ var st = $(this).scrolltop(); var pagenex = pagecur + 1; if (st > lastscrolltop){ alert(pagenex); pages[pagenex].velocity("scroll", { container: $("#content-container") }); } else { alert(pagec

c - getting a segfault coredump when restarting the Lanczos method after 3 iterations -

so i'm working on convergence of lanczos algorithm. implemented in c language, first calculate both matrix v orthonormal associated krylov subspace, , triadiagonal symetric matrix t, after compute eigenvalues , eigen vectors of t , ritz vectors define init vector upcoming iteration if tolerance isn't reached. in while loop, verify before proceeding upcoming iteration if tolerance reached or not. program compiles, when execute segfault core dump after 3 iterations, i'm compiling -g, gdb tells me have core dump in loop computes ritz matrix (or ritz vectors matrix eigen vectors): for(int = 0 ; < n ; i++) ritz[i][k] = temp[i]; i think wrote program properly, don't know problem. i'd appreciate on guys! p.s : compile gcc -g -wall -std=c99 test.c -o test -llapacke -lm the code: #include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #include <unistd.h> #include <errno.h> #include <flo

node.js - Mongoose- How to reference embed document element? -

i have users.js schema embeded document array pets. each user, user can have multiple pets(usually no more 3 think). for each pet, there daily chart. many daily charts pet. have read embedded documents each array element indexed. in daily.js, how can reference pet belong populate() function? var mongoose = require('mongoose'); var schema = mongoose.schema; var userschema = new schema({ firstname: { type: string, required: true }, lastname: { type: string, required: true }, username: { type: string, required: true, unique: true }, location: string, pets: [{ name: 'string', animaltype: 'string'}], //could have more 1 pet created_at: date, updated_at: date }); var mongoose = require('mongoose'); var schema = mongoose.schema; var dailyschema = new schema({ tite: string, _pet: { type: number, ref: 'user.pet' }, // not sure how reference name in user.pets[#] array created_at: date, updated_at: date });

css - Change background whit local hour -

this code system hour , change background image victorhora = new date if (victorhora.gethours() > 5) { imagem = 'my image. im not allowed post link'; } else if (victorhora.gethours() > 18) { imagem = 'my image. im not allowed post link'; } else { imagem = 'my image. im not allowed post link'; } </script> <script> $('body').css('background-image', 'url( + imagem + )'); </script> </head> but background don't appears think suck's this: $('body').css('background-image', 'url( + imagem + )'); can me? note: if put document.write(imagem) , link appears. you're not concatenating string. this $('body').css('background-image', 'url( + imagem + )'); should this: $('body').css('background-image', 'url( '+ imagem + ')');

Eclipse installer "Java for Windows Missing" -

Image
i'm trying install eclipse use java, when try run installer, browser window opens , this: i have both jdk , jre installed, , path set correctly. version 1.8.0, , update number 65. need start coding school project, appreciated! just download oracle jdk 1.8 - 1 of links got below message u mentioned. dont worry message.

Character Control using Python -

i wondering if knows how import sprite , let move when pressing arrow keys in python, without using pygame, or other library. purely out of curiosity, because thinking sort of personal challenge, , that's came mind: python game, without of pygame or libtcod. possible, or need library you? i'd appreciate anyone's input on one. thanks. what comes mind using tkinter's canvas class. quite possible simple program described using bindings on class. a example of may found in mark lutz's programming python ( http://shop.oreilly.com/product/9780596158118.do ), moving pics example. if don't own this, can still @ code reference downloading code using link on right side of page. path appropriat folder /pp4e-examples-1.3.1/examples/pp4e/gui/movingpics/ .

android - Google Tag Manager loads container version that is older than the default container included in the resources -

i'm using google tag manager android sdk , have run problem. both loadcontainerprefernondefault , loadcontainerpreferfresh methods download , load published version of container if lower version default container binary file have stored in application. i realize there loadcontainerdefaultonly method available semi-useful testing doesn't achieve need. my end goal able add variables container new versions of application rely on. since using container update checking cannot publish new container user's prompted update version hasn't been pushed play store yet. so long story short, there way override behavior , load container network/disk it's version greater on default container? or option use more 1 container? unfortunately signs point being design. google tag manager cares published version of container.

admob - google Adview in Android - how to set disabled in xml -

i have situation disable adview , prefer xml. adview looks in layout file: <com.google.android.gms.ads.adview android:id="@+id/adview" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adsize="banner" ads:adunitid="ca-app-pub-12345678934343/85666666"> how can disable ? 1 way wrap around linearlayout , hide layout want disable actual network call too, there attribute in adview can use etc ? necessary xml because im going incorporate data binding turn ad on , off. how can disable ? as long don't call method load ad similar disabled. not display ad. one way wrap around linearlayout , hide layout want disable actual network call too, there attribute in adview can use etc ? it view. common attributes visibility, width, height, gravity etc applicable well. its necessary xml because im going incorporate data binding turn ad on ,

osx - Swift/OS X - Remove Application Title Bar and Add Custom Close Button -

i'm working on little mac app want pretty specific style window. want remove application's menu bar completely, , go adding custom close button. (just little white 'x' no borders.) reason want i'm looking make application's background image cover entire window, not view controller area , gray title bar splotched above. far, window controller contains this: self.window!.titlevisibility = nswindowtitlevisibility.hidden; self.window!.titlebarappearstransparent = true self.window!.movablebywindowbackground = true all remove gray bar, buttons left were. thanks reading, appreciated. to show/hide window buttons want set visibility of nswindowbutton : these constants provide way access standard title bar buttons: enum nswindowbutton : uint { case closebutton case miniaturizebutton case zoombutton case toolbarbutton case documenticonbutton case documentversionsbutton case fullscreenbutton } so use such set visibil

javascript - img onHover & onClick effects for navigation -

the website i'm working on: stipz.50webs.com p.s. home nothing now since i've nailed onhover , onmouseout part want add navigation effects each div/img let end-user know div clicked / active when div active want change src , onmouseout means have change rest of div/img default ones using possible have multiple declarations on multiple div id in single function? i might figure out code if there possibility work currently working on: $('#orgn').click("mouseenter", function() { $(this).attr('src', 'elements/mp_onhover/origin_on.png'); }).on("mouseleave", function() { $(this).attr('src', "elements/mp_onhover/origin_off.png"); }); edit: i've tried working on 1 again, think it's beyond me coder. made jsfiddle it's not working jsfiddle link alternative link: http://stipz.50webs.com/div_navigation.html what tried add/remove class onclick each div $("#div-origin").click( function

xmpp - XEP-0060 pubsub auto subscribe node to other users Smack -

i implementing pubsub model achieve group chat. things working well. able create node, other users subscribe node, publish item owner or subscriber , item getting subscriber. now have requirement, owner(user creating node) should able subscribe node roster users , subscribed user start getting item publish. there way achieve this? node creation code below: configureform form = new configureform(dataform.type.submit); form.setpersistentitems(false); form.setdeliverpayloads(true); form.setaccessmodel(accessmodel.open); form.setpublishmodel(publishmodel.open); setsubscribers(form); leafnode node = (leafnode) manager.createnode(nodename, form); as document says possible autosubscribe node, based on access model may roster/presence/open access model.

python - AttributeError in python3 -

i want adapt this code work in persian text. i changed can seen in code bellow in english_frequency , orda changed. but, has error uppercase in line: cleaned = [ord(c) c in input.upper() if c.isupper()]. can me adapt it? from string import ascii_uppercase operator import itemgetter def vigenere_decrypt(target_freqs, input): nchars = len(ascii_uppercase) orda = ord('ا') sorted_targets = sorted(target_freqs) def frequency(input): result = [[c, 0.0] c in ascii_uppercase] c in input: result[c - orda][1] += 1 return result def correlation(input): result = 0.0 freq = frequency(input) freq.sort(key=itemgetter(1)) i, f in enumerate(freq): result += f[1] * sorted_targets[i] return result cleaned = [ord(c) c in input.upper() if c.isupper()] best_len = 0 best_corr = -100.0 # assume if there less 20 characters # per column, key's long guess in xrange(2, len(cleaned) // 20): pieces = [[] _ in xrange(i)] j, c i

Java iCalendar invite as free in outlook -

i working on code generate calendar invite can accepted/declined in outlook. have used java icalendar generate calendar invite. my requirement is, when calendar invite accepted in outlook, should default show "free" time. current implementation, shows "busy". appreciate help! thanks! according the spec should set transp property transparent .

python - Must I always reference a variable as global in my function if I were to use it? -

firstly, it's related function: a = 3 def b(): = a+1 return returns error. isn't when local environment of b couldn't find 'a' , goes parent environment b defined, is, 'a' found 3 ? why must reference global a in order work? meaning, have when immediate parent environment global environment? because below function seems able reference parent environment: def b(): def c(): print c return c() this such common issue is in python faq : [...] when make assignment variable in scope, variable becomes local scope , shadows named variable in outer scope. since last statement in foo assigns new value x, compiler recognizes local variable. so, python sees you're assigning local variable a = .. , thinks, hey, local variable, i'm fine this. but, when bumps content of assignment ( a + 1 ) , sees same name a complains because you're trying reference before assigning it . this why following doesn&

java - Scanner.nextBigInteger(int radix) -

why code: public static void main(string[] args) { string s = "23 hello world! 3 + 3.0 = 6 "; // create new scanner specified string object scanner scanner = new scanner(s); // scan next token big integer radix 4 system.out.println("" + scanner.nextbiginteger(4)); // close scanner scanner.close(); } output 11 ? it reads first token in string 23 number in base 4. value 2 * 4 + 3 = 11 printed result.

c++ - Friend member function definition conflicts with in-class initializer -

i reading c++ primer , trapped same code in question (with little difference), question different. know there lot of similar questions, after searching around, seems no answer answer question. at beginning, code worked fine when didn't add friend member function. /* first class */ class screen { public: using pos = std::string::size_type; using content_type = char; screen() = default; screen(pos ht, pos wd, content_type c) : height(ht), width(wd), contents(ht * wd, c) {} // other inline functions omited. private: pos width = 0; pos height = 0; std::string contents; }; /* second class */ class window_mgr { public: using screen_index = std::vector<screen>::size_type; private: std::vector<screen> screens{screen(24, 80, ' ')}; // use `screen` ctor }; then, want add friend member function clear . wrote 2 versions of code according code near page 281 in book. first version uses in-class initializer init

c# - Populate ComboBox from XML -

i'm trying populate combobox in c# using field xml file, no luck... don't know wrong here (it doesn't show anything): private void combobox1_selectedindexchanged(object sender, eventargs e) { xmldocument doc = new xmldocument(); doc.load("baza_de_cunostinte.xml"); var datasource = new list<persoane>(); string persoanaplacuta; foreach (xmlnode node in doc.documentelement) { string persoanaplacuta = node["persoanaplacuta"].innertext.replace("\"", ""); combobox1.items.add(persoanaplacuta); } } this xml file: <root> <persoane> <nume>"bob"</nume> <ismale>true</ismale> <varsta>30</varsta> <persoanaplacuta>"iulia"</persoanaplacuta> </persoane> <persoane> <nume>"bogdan"</nume> <ismale&

ios - How do I add a rate me button to an app that has not been released? -

so launch app app store. issue have rate app please button not know right code insert there. my fiends tried on app , said no good: does know how can fix issue? let itunesreviewpagelink = "http://itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?id=1073785561&pagenumber=0&sortordering=2&type=purple+software&mt=8" // go directly review page on app store if let url = nsurl(string: itunesreviewpagelink) { uiapplication.sharedapplication().openurl(url) } if app not yet released, haven't got app store link. that's impossible. in order implement functionality when app released, can use following code: swift 2 let appidstring = "app_id" // app id let reviewsurlstring = "http://itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?pagenumber=0&sortordering=1&type=purple+software&mt=8&id=\(appidstring)" let reviewsurl = nsurl(string:

globalplatform - Why I can't delete unused packages from my JavaCard? -

i have gemalto top dl v2 java card. when list contents, there lot of packages loaded in card: globalplatformpro:> gp -visa2 -key 47454d5850524553534f53414d504c45 -list aid: a000000018434d00 (|.....cm.|) isd op_ready: security domain, card lock, card terminate, default selected, cvm (pin) management aid: a0000000620001 (|....b..|) exm loaded: (none) aid: a0000000620002 (|....b..|) exm loaded: (none) aid: a0000000620003 (|....b..|) exm loaded: (none) aid: a0000000620101 (|....b..|) exm loaded: (none) aid: a000000062010101 (|....b...|) exm loaded: (none) aid: a0000000620102 (|....b..|) exm loaded: (none) aid: a0000000620201 (|....b..|) exm loaded: (none) aid: a0000000030000 (|.......|) exm loaded: (none) aid: a000000018100201 (|........|) exm loaded: (none) aid: a000000018100101 (|........|) exm loaded: (none) a000000018534441 (|.....sda|) aid: a00000015100 (|....q.|) exm loaded: (none) now, want dele

asp.net - export gridview to excel is not working with Ajax and Update panel -

i have grid-view in update panel. there link button inside grid-view fire export command in row command event. there grid-view exported on command code. debug, pointers goes in export not happening. know missing here, not able after spending lot of hours. script manager on master page. can 1 please. below code. <asp:updatepanel id="updatepanel2" runat="server"> <contenttemplate> <asp:gridview id="grd_report" runat="server" showfooter="true" cssclass="ui-jqgrid-btable table-hover" autogeneratecolumns="false" allowpaging ="true" pagesize ="12" > <columns> <asp:templatefield headertext="name"> <itemtemplate> <asp:label id="lbl_campaignname" runat="server" text='<%#eval("name") %>'></asp:label>

php - Keeping track of user's views on pages -

this question has answer here: tracking unique visitors only? 6 answers i've built simple forum made of categories, topics, , posts. keep track of how many unique views each post has received. not suspect daily traffic each post posts designated specific users. if had estimate, 500 1000 views (as maximum) per day each post; realistically 200 - 300 views. what thinking of doing: all posts loaded through php script named topic.php . @ beginning of script include code first checks if cookie exists, , if not check database user's ip , post @ hand. if database found user's ip , post-id, create cookie let script know on next page load no bother database query. question: is storing user's ip , post-id (perhaps along timestamp) proper way keep track of unique post views? is method i've described above considered "best practice" or effi

Execute a list of commands from an ArrayList using JSch exec in Java -

using jsch "exec" channel, connect remote server , execute command. can't execute list of commands stored in arraylist . use loop pass each element .setcommand(elem); odd reason, last command gets executed. arraylist<string> lists = new arraylist<string>(); lists.add("hostname"); lists.add("df -l"); channel channel=session.openchannel("exec"); (string elem : lists){ ((channelexec)channel).setcommand(elem); } full code public class exec{ public static void main(string[] arg){ try { jsch jsch=new jsch(); string host=null; if(arg.length>0){ host=arg[0]; } else{ host=joptionpane.showinputdialog("enter username@hostname", system.getproperty("user.name")+ "@localhost"); } string user=host.substring(0, host.indexof('@')); host=hos

r - knitr plots: Points (geom_point(), pch=20, pch=19...) not showing -

i'm bit troubled behaviour of knitr. working example should show 4 plots, showing same data using 2 different plot-methods. preamble: \documentclass{article} the first 2 plots made using plot command of r-base: <<one.one,fig.width=4,fig.height=3,fil.align='center',fig.show='asis'>>= par(mar=c(4,4,1,1),mgp=c(2,1,0),cex=0.8) plot(cars,pch=20,col='darkgray') @ <<one.two,fig.width=4,fig.height=3,fil.align='center',fig.show='asis'>>= par(mar=c(4,4,1,1),mgp=c(2,1,0),cex=0.8) plot(cars,pch=18,col='darkgray') @ the outputs given (deleted): for same plot ggplot2 code examples are: <<two.one,fig.width=4,fig.height=3,fil.align='center',fig.show='asis'>>= library(ggplot2) test1<-ggplot(cars,aes(x=speed,y=dist)) test2<-test1+geom_smooth(method="lm",se=false,color='red',data=fit) test3<-test2+ ggtitle("") + geom_point(size=1,colour='red

node.js - Run DLL on Azure Cloud Service -

i've worked lot azure websites not cloud services. need spin cloud service uses third party dll generate pdfs ( http://wkhtmltopdf.org/ ). however, write server in nodejs , examples in asp.net. need know how reference , execute dll (or exe, if that's easier) node js in azure web role when request comes in. i'd appreciate pointers. thanks, sam edit: it's not matter of referencing or using dll code have issue with. it's how install dll on azure web role. can in azure cloud service / web role upload project package no explanation on how add dll or exe (except in asp.net, not using. i'm using nodejs). you can put installer in web role package, , set startup task in servicedefinition.csdef file roles. here sample on official site install .net on cloud service role , guiding install .net in cloud service, steps , scenario should same.

JSP include directive tag -

jsp include directive tag: by understanding,when include file directive tag,any change made in included file not processed unless including file recompiled. when making change in included file,the changes shown when press refresh!how possible since dint recompile including file?the changes should not shown. i made change included file,saved , refreshed browser , change being shown! it depends on application server using. for reference, jsp specification states in section jsp.1.10.3: a jsp container can include mechanism being notified if included file changes, container can recompile jsp page. however, jsp 2.2 specification not have way of directing jsp container included files have changed. if using websphere application server, default, include via include directive not cause parent jsp recompiled if child (included jsp) has changed. if user wants behavior set "trackdependencies" jsp attribute "true" in application's web-inf/

How to convert c# datetime into oracle timestamp? -

i trying store c# datetime oracle database timestamp storing without problems, when trying select data database particular date giving me error not valid month.. datetime sessiondate =datetime.now(); int userid_int = 101; string usertypeis ='engineer'; string get_log_query = "select log_id jointing_login_log user_id="+userid_int+" , user_type='"+usertypeis+"' , session_start='"+sessiondate+"'"; string get_log_query = "select log_id jointing_login_log user_id="+userid_int+" , user_type='"+usertypeis+"' , session_start='"+sessiondate+"'"; you should never use string concatenation building queries parameters. parameterized queries faster , avoid sql injection , troubles type conversion. if session_start timestamp, code - string get_log_query = @"select log_id jointing_login_log user_id= :user_id , user_type= :user

java - Issue with the GCM in android -

in android application implementing push notification.its first time using gcm. in application need reference code enter application after google+ login.if user referral enter code successfully, referred user receive notification following fields: $message = array("type" => "ref","title" => "joined on application"); but don't know how implement logic in application.i tried following per tutorial..but not working mainactivity.java @override protected void onpostexecute(void avoid) { dialog.dismiss(); log.d("jspn ", json); if (json != null) { if (status==1) { if(reference_code.equals("0")) { final dialog dialog = new dialog(mainactivity.this); dialog.setcontentview(r.layout.popup); button id_save = (button)dialog.findviewbyid(r.id.save_btn); fi

generics - Netbeans unchecked conversion for List<> -

i'm learning netbeans platform , i'm in process of following tutorial: link netbeans tutorial i've reached point of running prototype i'm getting following warning in output window: warning: [options] bootstrap class path not set in conjunction -source 1.6 warning: no processor claimed of these annotations: javax.annotation.generated ~/bdmanager/customerviewer/src/org/shop/viewer/customerviewertopcomponent.java:53: warning: [unchecked] unchecked conversion list<employee> resultlist = query.getresultlist(); required: list<employee> found: list 3 warnings my entitymanager follows: entitymanager entitymanager = persistence.createentitymanagerfactory("customerlibrarypu").createentitymanager(); query query = entitymanager.createnamedquery("employee.findall"); list<employee> resultlist = query.getresultlist(); (employee c : resultlist){ jtextarea1.append(c.getfirstname()+"

sql server - MS Access import image into table -

in ms access i'd able search image, or images, on system , save them ole fields in tables linked sql server. having preview in form ideal well. this seems simple task i've given after hours of searching. , i'm storing images varbinary(max) in sql database, no i don't want store link images. after setting image field, attached button: private sub commandopenpicture_click() dim strfilter string dim strinputfilename string strfilter = ahtaddfilteritem(strfilter, "jpeg files (*.jpg, *.jpeg)", "*.jpg;*.jpeg") strfilter = ahtaddfilteritem(strfilter, "bmp files (*.bmp)", "*.bmp") strfilter = ahtaddfilteritem(strfilter, "all files (*.*)", "*.*") strinputfilename = ahtcommonfileopensave( _ filter:=strfilter, _ openfile:=true, _ dialogtitle:="choose image file...", _

ios - swift - Convert a String to a Date and then to a String in a different format -

suppose have simple string, extracted array of strings (representing dates) - var mydatestring = "2015-11-25 04:31:32.0" now, want convert string looks nov 25, 2015 . for that, assume need - get nsdate date object string using nsdateformatter get string nsdate object using functionality (which i've been unable find) i've been trying in playground, have been unable solve such simple problem. here have tried - line 1| var dateformatter = nsdateformatter() line 2| dateformatter.locale = nslocale.currentlocale() line 3| dateformatter.dateformat = "yyyy-mm-dd hh:mm:ss.a" line 4| let somedate = dateformatter.datefromstring(str) line 5| let somedatestring = dateformatter.stringfromdate(somedate!) in sidebar of xcode, line 4 prints "nov 25, 2015, 12:00 am" , when try print string somedate , "2015-11-25 00:00:00.0" . i haven't found single proper explanation of nsdates anywhere. this easier in java parse() , format(

angular - Is there a way to use value from template in Angular2 dependency injection? -

i have angular2 component uses 2 sub components. template looks like <component-a/> <component-b/> i inject component-a instance constructor of component-b. there way refer component-a in provider on root component? that breaks whole purpose of making 2 components in first place. since making 1 dependant on other can't reuse them separately, might make them one. create parent holds both components inside , info both need , set info each children component @input s: https://angular.io/docs/ts/latest/api/core/input-var.html some raw example: <component-a (modeselected)="selectedmode==$event"/> <component-b [mode]="selectedmode" /> or: <component-a #modeselector/> <component-b [mode]="modeselector.selectedmode" /> () means output, [] means input. in first example selectedmode property of parent controller holds both , b components inside. in second example selectedmode property of co

ios - NSJSONSerialization creates garbage -

i have problems creating nsstring -representation (json-string) of nsdictionary using nsjsonserialization . have used jsonkit before, since kind of deprecated in ios9 (and crashes), switched nsjsonserialization . this code: // `usersettings` of type nsmutabledictionary* nsdata* data= [nsjsonserialization datawithjsonobject:usersettings options:0 error:&error]; nsstring* settingsstring= [nsstring stringwithutf8string:data.bytes]; currentuser.settings= settingsstring; // nsstring* property now, time time, code works, settingsstring nil . , when inspect data object in debugger, bytes property shows json-string followed random garbage, this: 1 = 0x00007ff1ba814000 "{\"residua ... lculateplanned\":\"0\",\"wizarduserid\":\"\"}uitextcolor\x91uisystemcolorname\x94uibaselineadjustment\x8cuisystemfont\x89ns.intval\x8euishadowoffset\x94uiautoresizesubviews\x8duicontentmode\x85nsrgb\x8auifontname\x8buitextlabel\x8ensinlinedvalue\x

android - How to show Spinner items on specific condition occured? -

i have 1 spinner in app. want show items of spinner automatically. in scenario, not touching/clicking on spinner choose item. is possible call spinner show item automatically when specific condition occur? please, guide me how do this. yes can use spinner.performclick(); when paricular condition occur.

python - How to invoke the super constructor? -

class a: def __init__(self): print "world" class b(a): def __init__(self): print "hello" b() hello in other languages i've worked super constructor invoked implicitly. how 1 invoke in python? expect super(self) doesn't work. super() returns parent-like object in new-style classes : class a(object): def __init__(self): print "world" class b(a): def __init__(self): print "hello" super(b, self).__init__() b()

laravel - PHP Fatal error: Call to undefined method Illuminate\Foundation\Application::bindShared() in ..Entrust/EntrustServiceProvider.php on line 72 -

i've installed entrust add role-based permissions application based on laravel 5.2 . when try execute php artisan vendor:publish i error : php fatal error: " call undefined method illuminate\foundation\application::bindshared() in ../vendor/zizaco/entrust/src/entrust/entrustserviceprovider.php on line 72 " can me? you using previous version not compatible laravel 5.1.+. make sure using latest version or run composer update zizaco/entrust update package latest version defined in composer.json if @ this commit set has been changed while ago.

unix - What is context in xv6? -

what usage of context in xv6 os ? job of each register in context ? struct context { uint edi; uint esi; uint ebx; uint ebp; uint eip; }; context set of information allows resume execution of task exact same point stopped due context switch (i.e. scheduler selects task run , suspends current one, hence has save execution information of current task , restore of next task run). the purpose of each of registers is: edi : destination index, string operations esi : source index, string operations ebx : base index, use arrays ebp : stack base pointer, holding address of current stack frame eip : instruction pointer, points instruction executed

sql - Translate query combined max and min from mysql to mongoDB -

my documents this: { "_id": objectid("5698fcb5585b2de0120eba31"), "id": "26125242313", "parent_id": "26125241841", "link_id": "10024080", "name": "26125242313", "author": "gigaquack", "body": "blogging = creative writing", "subreddit_id": "6", "subreddit": "reddit.com", "score": "27", "created_utc": "2007-10-22 18:39:31" } and using mysql databse. , use query: select max(score), author (select sum(score) score, author author reddit author in (select distinct author reddit) group author) union select min(score), author (select sum(score) score, author author reddit author in (select distinct author reddit) group author) now want translate query mongodb. how should that? sorry unclear question. want query calculates how score users ha

android - How do I prevent device rotation from generating duplicate output? -

Image
after user inputs parameters in mainactivity app (shown below), taps search , calls matchesactivity , generates output on new screen (shown further below), exited via tapping back . but matchesactivity active, every time device rotated, search again executed because activity restarts. in screenshot below, rotated device vertical horizontal vertical horizontal vertical. looks silly. the output generated in matchesactivity invoked in oncreate in mainactivity so: intent matchesintent; matchesintent = new intent(mainactivity.this, matchesactivity.class); startactivity(matchesintent); here's essence of oncreate matchesactivity : @override protected void oncreate(bundle savedinstancestate) { mainactivity.dbc.setdbprocesslistener(this); // know txamatches has been defined mainactivity.dbc.finddbmatches(); // generate output } i did research. found complicated ways of preventing activity restarting when device rotated. for example . i'm hopin