Posts

java - Error: No enclosing instance of type zad_II_1 is accessible -

this question has answer here: java - no enclosing instance of type foo accessible 5 answers i'm learning abstract classes in java , have little problem error: no enclosing instance of type zad_ii_1 accessible. must qualify allocation enclosing instance of type zad_ii_1 (e.g. x.new a() x instance of zad_ii_1). wrong? code: public class zad_ii_1 { abstract class pacjent{ string imie; pacjent(string imie){ this.imie=imie; } abstract string nazwiskoo(); abstract string podajchorobe(); abstract string podajlek(); string nazwisko(){ return imie; } string choroba(){ return podajchorobe(); } string leczenie(){ return podajlek(); } } class ch...

php - count mysql values for the week and then start count again from monday? -

i have count query counts how many times user has viewed users profile. counts rows in table, wondering if there way in php use calculation says count rows in table 'ptb_profile_views' monday sunday , start 0 again on following monday , count values week , not include counts previous week, im not sure possible thought because need time of memory aspect behind it, the other option wondering whether theres mysql statement can add every sunday @ 00:00am delete ptb_profile_views , start fresh monday. can please me sort of solution, thanks my table looks like: id | profile_id | viewed_id 1 4 8 2 5 6 mysql function check_profile_views() { global $connection; global $_session; $query = "select count(distinct profile_id) totalcount ptb_profile_views viewed_profile_id=".$_session['user_id']." , profile_id!='-1'"; $check_profile_...

How to generate random Y at specific X from a linear model in R? -

say have linear model f1 fit x , y data points: f1 <- lm(y ~ x,data=d) how can generate new y values @ new x values (that different old x values within range of old x values) using f1 fit in r ? you can use predict this: x <- runif(20, 0, 100) y <- 5*x + rnorm(20, 0, 10) df <- data.frame(x, y) df plot(df) mod <- lm(y ~ x, data = df) x_new <- 1:100 pred <- predict(mod, newdata=data.frame(x = x_new)) plot(df) points(x_new, pred)

javascript - Is it possible to do a real time on hover function? -

i have div #conteudo , 2 links #linkprev , #linknext . when hover on link, .animate() left or right div #conteudo . html: <div id="conteudo"> <div class="boxes" id="content1"> <div class="boxes" id="content2"> <div class="boxes" id="content3"> </div> <a id="linkprev" class="linksnav"></a> <a id="linknext" class="linksnav"></a> css: #conteudo{width:2000;position:relative; height:1080px;} .box{width:0; overflow:hidden; float:left;} js: $('#linknext').on({ mouseenter: function(){ if ($('#conteudo .boxes').hasclass('ativo')) { $('#conteudo .boxes').removeclass('ativo'); $('.boxaberto').animate({width:'0'},600, function(){ console....

c++ - GetShortPathNameW returns the file extension. I want it to ignore the .exe -

i have getshortpathnamew in c++ msvc 2008 free edition. want use can search or return filename without .exe extension. chance me that? code below have: wchar buffer[max_path]; lpcwstr datafilepath = wargv[datafile_argv]; // hack windows in case there unicode chars in path. // normal argv[] array has ????? instead of unicode chars // , fails, instead manually short file name, // using ansi chars. if (wcschr(datafilepath, '\\') == null) { getcurrentdirectoryw(max_path, buffer); wcscat(buffer, l"\\"); wcscat(buffer, datafilepath); datafilepath = &buffer[0]; } if (getshortpathnamew(datafilepath, directorypathbuffer, max_path) == 0) { platform->displayalert("unable determine startup path: getshortpathnamew failed."); game_file_name = null; return; } i want use can search or return filename without .exe extension. sure, use pathre...

javascript - Leaflet marker is not draggable even if draggable=true -

i'm using leaflet map markers . when user clicks "edit" on page, want make markers draggable. if set property draggable true each marker, doesn't work. when create new marker , set property right beginning, works. you gotta this: marker.dragging.disable(); // marker.dragging.enable(); my first attempt changes technical property not the behavior .

python - setting GAE namespace -

this function works fine on interactive console: from google.appengine.api import namespace_manager google.appengine.ext import db namespace_manager.set_namespace("some_namespace") class class(db.model): c = db.stringproperty() x = class(c="text") x.put() but when login executes namespace_manager.set_namespace(user.namespace) data retrieved , stored in datastore belongs root (empty) namespace. that raises questions am setting namespace wrong? do have set each time before retrieve , store data (that wan't case in guestbook example) if namespece set on server side how know post/get() belongs namespace? please dont point me link: https://developers.google.com/appengine/docs/python/multitenancy/multitenancy documentation very... edit answers question "set_namespace(namespace) sets namespace current http request." and guess answer "why guestbook example different" in appengine_config.py . now question - wh...