Posts

Showing posts from August, 2011

c - Segmentation Fault on fclose -

i getting segmentation fault error while running program in linux. working fine in aix. and seg fault message in gdb... program received signal sigsegv, segmentation fault fclose@@glibc_2.2.5 () /lib64/libc.so.6 <pre><code> #include<stdio.h> #include<string.h> #include<unistd.h> #include<time.h> #include<sys/types.h> #define _monthly "99992016" file *source,*list,*wlist,*movlist,*biflis; char sf[85],sf1[85]; char filename[85],filename1[85],name[140],fstring[140],iname[140],account[85]; char *ptr="",*st=""; int i,len,x,y,z,bif_count,pin_count,your_monthly_count,count1,count2; char suffix[4]=".pin"; char *nptr=" "; file *biflis; int p; int main() { long t;

How to find a random entered number in a stack -

so i'm doing creating stack , find way search random number in stack. if code is: stack thisstack = new stack(); scanner userinput = new scanner(system.in); = userinput.nextint(); b = userinput.nextint(); c = userinput.nextint(); showpush(thisstack, a); showpush(thisstack, b); showpush(thisstack, c); my question how find number user inputs, , able throw exception if number isn't there. if stack user inputs [42, 543, 12] , 42 shows 42 if 43 says "number not in stack" since stack class inherits vector class, have access contains() method. contains() returns true if object in stack; false if not, 1 trivial implementation of showpush() method be: void showpush(stack stack, int num){ if (stack.contains(num)){ system.out.println(num); } else { system.out.println("number not in stack"); } } where num search target, , stack ... stack. one thing note here when

hadoop - Insert Timestamp in Hive table -

i trying create hive table putting data hdfs, while inserting data want add data insertion time in table. don't know how it, if guys can wonderful. thanks from_unixtime(unix_timestamp()) insert timestamp in table. select column1 ,columns2 , from_unixtime(unix_timestamp()) timestamp table , work you.

python - Working with user roles in Django -

i have question in project have need of work users of 3 (may more) types of them have different roles: physician patient administrator i have been thinking use of django model users , extend creating userprofile model ... ignore how manage different roles because, userprofile model have fields of user model, althought don't know how address roles topic. 1 user have many userprofiles may be? don't know or may should create roles model/table in specify roles types , create relation users model. possibility. another possibility (as comment more below) check django permissions system, in can create user groups, , assign permissions these groups, althought here can edit, create , delete models really? i few confuse of how address subject searching found app. https://github.com/dabapps/django-user-roles if can orient me it, grateful best regards you work django's built in permissions that may more need though. simple solution userprofile model role f

html - UIWebView scrolls slowly in iOS9 after load 50+ times -

i have uiwebview app contains local html files&css&js. in ios8 or previous,when load html string 50+ times in app bundle,it scrolls normal , not lag. in ios9,when load html string 50+ times,the scrollview of uiwebview become more , more slow. i have create new project.just reload local html string.after load many times(50~100+),the scrollview becomes slow.a url request can cause slow well. here new proj,you can run in device or simulator in ios9.it can reproduce.but when run in ios8,everything allright. - (void)viewdidload { [super viewdidload]; uiwebview *wv = [[uiwebview alloc] initwithframe:self.view.bounds]; [self.view addsubview:wv]; self.webview = wv; self.webview.delegate = self; self.request= [nsurlrequest requestwithurl:[nsurl urlwithstring:@"http://www.google.com"]]; [self.webview loadrequest:self.request]; self.refreshcount = 0; } - (void)webviewdidfinishload:(uiwebview *)webview { [self.webview loadrequest

java - Weird Characters Displayed on Build, but not on Debug -

Image
i'm developing java application using netbeans, while run app in debug, or plain running netbeans, screen looks so: . yet, when try run built jar in dist folder, looks so: . here method in using receive content. method intended source of text file web. public static arraylist<string> geturlsource(string urlf) throws ioexception { url url = new url(urlf); scanner s = new scanner(url.openstream()); arraylist<string> filelines = new arraylist<>(); while (s.hasnextline()) { filelines.add(s.nextline()); } return filelines; } the default charset may different depending on how launch application. try specifying charset explicitly : scanner s = new scanner(url.openstream(), "utf-8");

Complexity of two algorithms -

i studying algorithms complexity, , have question difference between following 2 algorithms: algorithm #1: sum = 0 = 1 while (i < n) { j = 1 { sum = sum + 1 } = i*2; } return sum algorithm #2: sum = 0 = 1 while (i < n) { j = 1 n { sum = sum + 1 } = i*2; } return sum the difference 'for' loop, difference between time complexity of these algorithms ? when have multiply or add complexity of nested loops? let simplisity n power of 2 i.e. 2^k . obvious outer loop proceed k times , on each step inner loop proceed: 1 1 i.e. 2^0 1 2 i.e. 2^1 1 4 i.e. 2^2 ... 1 2^k so need find sum 2^0 + 2^1 + ... + 2^k it knows 2^(k+1) - 1 = 2^k * 2 - 1 = 2*n + 1 so omitting constants o(n) second 1 simple. outer loop log(n) , inner n o(n*log(n)) .

.net - Can't connect to SQL LocalDB from Windows Service, WPF app & SSMS work fine? -

having trouble system i'm developing. layout far question concerned wix built msi installer installs sql localdb 2012, wpf app, , windows service. both windows service , wpf app communicate same database, app driven user interaction , service on timer. everything gets installed cleanly, db instance gets installed in mixed mode , database initializer creates new login , user instance , db, , in ssms both appear configured correctly. can log in , query tables fine using new login. here code used create login: if not exists (select loginname master.dbo.syslogins name = 'bp_servicelogin') begin create login[bp_servicelogin] password = 'pw'; create user[bpuser] login[bp_servicelogin] default_schema = dbo; use databasename; exec sp_addrolemember 'db_owner', 'bpuser' end so reiterate; login works fine in ssms , allows me log in , access database created wpf app's initializer. however, not able login database windows

Devstack cannot ssh into VM when using Heat -

i using devstack on mac. when launching instance via console, can ssh new instance using appropriate key. however, if launch instance using heat stack-create, defining same key pair , same image , that, cannot ssh vm. does have idea why may happening? keep getting "permission denied (publickey).", indicates key apparently not injected new vm, said, breaks if use heat. problem solved. found heat-deployed instances, need log in ec2-user. using 'ubuntu' login user, works manually launched instances (for ubuntu image, of course).

vegan - Error when using R betadisper function -

the 'betadisper' funtion in vegan [r] calculates multivariate dispersion of group of sites based on distances i have distance matrix multiple groups of sites: dis <- vegdist(correct_tree_data) i created 'groups' using 'factor' function (23 levels 23 groups of sites), , each group has different no. of sites groups <- factor(c(rep(1,144), rep(2,49), rep(3,121), rep(4,81), rep(5,81), rep(6,81), rep(7,36), rep(8,289), rep(9,324), rep(10,225), rep(11,256), rep(12,225), rep(13,289), rep(14,289), rep(15,144), rep(16,225), rep(17,225), rep(18,225), rep(19,225), rep(20,225), rep(21,225), rep(22,225), rep(23,225)), labels = c("s1_05","s2_05","s3_05","s4_05","s5_05","s6_05","s7_05","s1_10","s2_10","s3_10","s4_10","s5_10","s6_10","s7_10","s8_10","s1_15","s2_15","s3_15","s4_1

c# - Why my code fails to replace a string with empty string in RDLC column expression? -

i want replace particular text blank space in rdlc column. i want replace .aspx "" in every string. i tried writing =replace(fields!auditsuseractivity.value, ".aspx", "") it works kinda lines page applicants.aspx viewed but not these kinda lines: data added in inspectors.aspx i.e. removed '.aspx' lines in .aspx appears in in-between not in '.aspx' appears @ end of string. know why? update: i used not working =replace(fields!auditsuseractivity.value, "@"+".aspx", string.empty)

events - gtk keyval for keypad/numpad keys? -

this might silly question, i'm trying handle keyboard event in gtk program. , can't find in documentation ( https://git.gnome.org/browse/gtk+/plain/gdk/gdkkeysyms.h )the keyval keypad/numpad keys such '+' or '-'. the gdk_key_plus , gdk_key_minus reffering '+' , '-' @ top of keyboard, not on numpad. thanks reading. ps : i'm using azerty keyboard. the numpad constants gdk_key_kp_* (which stands keypad ) constants. gdk_key_plus gdk_key_kp_add , gdk_key_minus gdk_key_kp_subtract .

SSAS excel remote connection -

i migrated sql server 2014 2008 version. have windows server 2012 iis 8.5. i'm trying configure remote access olap database . followed steps described here: https://msdn.microsoft.com/it-it/library/gg492140(v=sql.120).aspx . the iis version mentioned 8.0, fit 8.5 too? when try test configuration using management studio error: title: connect server cannot connect http://localhost/olap/msmdpump.dll . additional information: the connection either timed out or lost. (microsoft.analysisservices.adomdclient) the remote server returned error: (405) method not allowed. (system) program location: @ microsoft.analysisservices.adomdclient.xmlaclient.endrequest() @ microsoft.analysisservices.adomdclient.xmlaclient.sendmessage(boolean endreceivalifexception, boolean readsession, boolean readnamespacecompatibility) @ microsoft.analysisservices.adomdclient.xmlaclient.discover(string requesttype, string requestnamespace, listdictionary properties, idictionar

docker - Error response from daemon: Unexpected status code 404 -

Image
i configuring docker registry on nexus 3 configuration. running nexus behind apache , has https enabled. on command line, when dcoker search, below error docker search my.nexus.net/ubantu error response daemon: unexpected status code 404 here daemon log on debug mode. debu[7519] calling /images/search info[7519] /v1.19/images/search?term=my.nexus.net%2fubantu debu[7519] pinging registry endpoint https://my.nexus.net/v0/ debu[7519] attempting v2 ping registry endpoint https://my.nexus.net/v2/ debu[7519] hostdir: /etc/docker/certs.d/my.nexus.net debu[7519] attempting v1 ping registry endpoint https://my.nexus.net/v1/ debu[7519] hostdir: /etc/docker/certs.d/my.nexus.net debu[7519] error unmarshalling _ping registryinfo: invalid character '<' looking beginning of value debu[7519] registryinfo.version: "" debu[7519] registry standalone header: '' debu[7519] registryinfo.standalone: true debu[7519] attempting v1 ping registry endpoint https://my.n

file io - C Program fscanf skips lines -

this program takes file , supposed transfer files contents struct the contents of file is: 11.0, 11.0, 11.0, 14.0 22.4, 22.4, 22.4, 28.9 12.7, 13.8, 14.6, 14.5 23.5, 13.5, 42.5, 21.8 18.0, 16.0, 21.0, 42.9 21.0, 21.0, 21.0, 100.0 the output of file is: 22.4, 22.4, 22.4, 28.9 23.5, 13.5, 42.5, 21.8 21.0, 21.0, 21.0, 100.0 it skipping every other line contents of file , not sure how fix issue. #include <stdio.h> #define max_items 100 struct item { double item1; double item2; double item3; double item4; }; int main(void) { struct item myitems[max_items]; int = 0; file *input; input = fopen("items.txt", "r"); if(input == null) { printf("error opening file\n"); return 1; } while(fscanf(input, " %lf,%lf,%lf,%lf", &myitems[i].item1,&myitems[i].item2, &myitems[i].item3, &myitems[i].item4) == 4) { fscanf(in

javascript - access array of objects inside template -

i make 1 collection recipes , define schema , have 1 array of objects ingredients in schema , want access array of objects in template unable show them can please guide me how it? collections.js recipes = new mongo.collection('recipes'); recipes.attachschema(new simpleschema({ name: { type: string, label: "recipe name", max: 100 }, ingredients: { type: [object], mincount: 1 }, "ingredients.$.name": { type: string }, "ingredients.$.amount": { type: string }, description: { type: string, label: "how prepare ", }, time: { type: number, label: "time (minutes)", }, image: { type: string, autoform: { affieldinput: {

asp.net mvc - Populating a SelectList with Parent/Child Tables -

i trying populate html.dropdownlist in mvc. problem i'm having have child table called "odsessiontopics" has foreign key (id) "odsessiontype" table contain headers topics. here models: public class odsessiontopic { public int id { get; set; } public string description { get; set; } // foreign key public int odsessiontypeid { get; set; } // navigation property public virtual odsessiontype odsessiontype { get; set; } } public class odsessiontype { public int odsessiontypeid { get; set; } public string description { get; set; } // navigation property public virtual icollection<odsessiontopic> odsessiontopics { get; set; } } i use following code populate viewbag: viewbag.odsessiontopicid = new selectlist(db.odsessiontopics, "id", "description", "odsessiontypeid", odsession.odsessiontopicid); here od session topic data: id description

excel - Issues with Multiple Runtime errors: updated code - still having issues -

thank far - appreciated!! still having issues i new user of vba in excel , i'm sure answer simple. i have gone through lots of attempts @ fixing reading existing questions each time different error , have not been able fix issue. as such have gone through many iterations of code trying fix problems welcome advice on how proceed. apologies if don't format / ask question appropriately. background i have 2 excel files: wb1) 1 sheet table of company names , ids (list changes every week) wb2) workbook multiple tabs template. for every company listed in wb1 need copy company name , id appropriate cell in wb2 , save company name & date. as above have gone through many iterations , had below still not getting work. the various errors have been getting depending on how amend code runtime error 5, runtime error 438, compile error , possibly others didn't write down. current issue: if macro saved in wb1 - macro runs , creates first workbook "system

ruby on rails - rspec tests randomly failing -

circleci testing, ruby on rails environment, using redis caching , postgres db. rspec + cucumber testing. have tried still failing tests, in quite few different spec files, randomly. whenever run tests individually, pass. this means there's data left on previous tests, or of random factorygirl data messing sometimes. but, pass individually. first, tried fix tests manually, realized bigger problem. now, i'm trying flush db , redis on each , every test, doesn't work. i have flushall in before/after each in spec_helper, should apply every single test. know shouldn't need before , after, why not. then, use database cleaner gem following settings: rspec.configure |config| config.before(:suite) databasecleaner.clean_with(:truncation) end config.before(:each) databasecleaner.strategy = :transaction end config.before(:each, :js => true) databasecleaner.strategy = :truncation end config.before(:each) databasecleaner.start end

c++ - Trouble writing video to file using opencv -

i trying write captured video file using opencv in c++ inside visualstudio 2013. programs seems capture video webcam on laptop , able save each frame image when write frames video file, end 6kb file. program gives me no error have followed instruction opencv document. i pasting program review. please suggest how may make successful program. thank you. #include <stdio.h> #include <iostream> #include "opencv2\core\core.hpp" #include "opencv2\highgui\highgui.hpp" using namespace std; using namespace cv; int main() { videocapture video_capture(0); if (!video_capture.isopened()) { cout << "error in opening video feed!" << endl; getchar(); return -1; } // creating window view video feed string window_name = "video_feed"; namedwindow(window_name, cv_window_autosize); // mat frame; // filename string filename = "...\\first_recording.avi";

sql server - SQL INSERT INTO: comma as decimal -

my problem customer runs sql server on windows box , country settings set "germany". this means, decimal point not point . , it's comma , ! inserting double value database works this insert mytable (myprice) values (16,5) works fine, far. the problem comes if there more 1 value decimal places in statement like insert mytable (myprice, myamount) values (16,5,10) i error number of query values , destination fields not same. can somehow "delimit" values? tried add brackets around not work. unfortunately cannot change language settings of os or database because writing add-ons existing application. thank you! ev you must put data in format allowed database. if put data using comma... may loose out numerical calculations. if such situation.. check if comma required visibility.. display values in comma format while store them in decimal format. this way data can processed numeric. need change , fro ui or display. based on m

Guaranteed termination of external process in Haskell -

i have launched ghci external process this (just hin, hout, _, pid) <- createprocess (proc "ghci" ["-fdefer-type-errors"]) { std_in = createpipe, std_out = createpipe, std_err = usehandle stdout } which control writing hin , reading hout . used load haskell file external ghci process, call 1 of functions, , read results, problematic. my problem there function runs indefinetely when called, f n = sum [n..] , , when happens want terminate external ghci process. to so, have tried calling function terminateprocess pid not kill process reliably; in general, external process stops working, yet still appears when type $ ps @ console. example, example of top's output when ghc external process eating processor: pid command %cpu time ... 38312 top 3.3 00:00.89 38309 ghc 99.9 00:21.46 38306 ghc 0.0 00:00.82 and when try end using terminateprocess pid brings down process 0% cpu, still there: p

php - Parse error: syntax error, unexpected T_IF on line 4 -

<?php include('connect.php') if(isset($_request['submit'])!='') { if($_request['firstname']=='' || $_request['email']=='' || $_request['password']==''|| $_request['lastname']=='' || $_request['username']==='' ) { echo "please fill empty field."; i getting error. doing wrong? looked twice. should work you're missing semi-colon @ end of include statement. change: include('connect.php') to: include('connect.php'); the reason you're seeing if cause error, because have done. missed out vital point of php, tells interpreter stop processing current command (hence semi-colon). so, php still expecting process include , confused when comes following line. throwing error on can seen wrong line.

node.js - express res.send as result of promise -

i'm not understanding what's going on... using q promises, works: const deferred = q.defer(); deferred.resolve('hellow'); const mypromise = deferred.promise; router.get('/items', (req, res) => { mypromise.then((result) => res.send(result)); }); but doesn't, keeps browser if request never ends: router.get('/items', (req, res) => { mypromise.then(res.send); }); what's wrong? below fragment of express library related res.send : res.send = function send(body) { var chunk = body; var encoding; var len; var req = this.req; var type; // settings var app = this.app; // allow status / body if (arguments.length === 2) { // res.send(body, status) backwards compat if (typeof arguments[0] !== 'number' && typeof arguments[1] === 'number') { deprecate('res.send(body, status): use res.status(status).send(body) instead');

R shiny - stop() in eventReactive without error message in console -

i new in shiny, , have problem. have event reactive , stop function inside. when run code(no checkbox , click button), shiny work well. in console display error message "eventreactivehandler". have solution problem? want no error message in console. , not expect solution opt <- options(show.error.messages=false) on.exit(options(opt)) because error not display in code, want in error. thank you... code... rm(list = ls()) library(shiny) library(shinybs) var.x<-reactivevalues() shinyapp( ui = fluidpage( sidebarlayout( sidebarpanel( checkboxgroupinput("indepvar","independent variable", choices = c("1"=1,"2"=2)), actionbutton("tabbut", "view table") ), mainpanel( uioutput("coba"), uioutput("popup4") ) ) ), server = function(input, output, session) { o

Dimention and disksize for Images downloaded from web on android apps -

Image
in app, show list of images in gird-view. these images downloaded website. when specific image selected next page shows close full-screen size version of selected image. my plan create 256x256px images (30-40 kb) girdview , 512x512px (100-150kb)images full-screen version. not asking icon sizes(this know). related images downloaded phone or tablet. is plan? doing wrong when different devices considered? how can improve performance, gridview images. using picasso api image download , scaling. download image , bitmap. resize bitmap used following method per require car resize bitmap. private bitmap getresizedbitmap(bitmap bm) { try { int newwidth = 0, newheight = 0; log.i("image size", "height= " + bm.getheight() + "width= " + bm.getwidth()); if (bm.getwidth() > 400 || bm.getheight() > 700) { newwidth = bm.getwidth(); newheight = bm.getheight();

Django add inlines to CreateView -

i have following admin.py class ainlineadmin(admin.tabularinline): model = class badmin(admin.modeladmin): fields = ['name'] list_display = ['name'] ordering = ['name'] inlines = [ainlineadmin] admin.site.register(b, badmin) class aadmin(admin.modeladmin): fields = ['identifier'] list_display = ['identifier'] ordering = ['identifier'] admin.site.register(a, aadmin) and following models.py: class b(models.model): name = models.charfield(max_length=100) def get_a(self): return "\n".join([i.identifier in self.a.all()]) def __unicode__(self): return self.name class a(models.model): identifier = models.charfield(max_length=200, blank=false, default="") c = models.foreignkey(b, related_name='a', default=0) def __unicode__(self): return self.identifier and following views.py: class bcreate(createview): model = b

floating point - Leading zeros for float in Swift -

here float value: 5.3 23.67 0.23 and want them be 05.30 23.67 00.23 using string(format: "%.2f", floatvar) can make 2 digit following decimal point cannot add 0 before it. i've tried string(format: "%04.2f", floatvar) suggest here display same %.2f is there clean way of doing within swift standard libraries? try this: string(format: "%05.2f", floatchar) from this documentation : 0 means pad leading zero. 5 minimum width, including dot character.

reactjs - Could we compose different Redux applications to create a bigger one? -

i building redux application scope has changed have move app inside 1 it's redux application well. this looks like: <mainapp > <components /> <myapp props={myappprops} /> </mainapp> the main problem found how deal property changes myapp's store. so doubts are: is there proper way handle different redux apps? how split huge app can develop different parts independently? what redux app in opinion? redux data management solution application: if have 2 sets of reducers created combinereducers() rootreducerforapp = combinereducers({reducer1, reducer2, reducer3}); rootreducerforsomethingelse = combinereducers({r1, r2, ...}); you combine , have 1 reducer app combindedrootreducer = combinereducers({ rootreducerforapp, rootreducerforsomethingelse }) then create single store let store = createstore(combinedrootreducer) now can use actions need both of semantically separated app-parts same place

inheritance - Could I inherit from a custom module in odoo? -

Image
i have custom module in odoo called "x_vehicles" could possible inherit module overwrite create method?? i've code class extend_vehicle(models.model): _inherit = 'x_vehicle' @api.model def create(self, vals): # something... return super(extend_vehicle, self).write(vals) but error 2016-07-04 15:05:20,488 9217 error pro werkzeug: error on request: traceback (most recent call last): file "/users/jose/work/odoo/env/lib/python2.7/site-packages/werkzeug/serving.py", line 177, in run_wsgi execute(self.server.app) file "/users/jose/work/odoo/env/lib/python2.7/site-packages/werkzeug/serving.py", line 165, in execute application_iter = app(environ, start_response) file "/users/jose/work/odoo/openerp/service/server.py", line 246, in app return self.app(e, s) file "/users/jose/work/odoo/openerp/service/wsgi_server.py", line 184, in application return application_unprox

c# - Update bound control -

i'm learning wpf. figured out how bind list box using following code. xaml <listbox name="lstupdates" grid.row="1" grid.column="0" margin="5,0,5,5" itemssource="{binding historydata}" scrollviewer.horizontalscrollbarvisibility="disabled" loaded="lstupdates_loaded"> <listbox.itemtemplate> <datatemplate> <stackpanel > <textblock text="{binding header}" fontweight="bold" /> <textblock text="{binding description}" textwrapping="wrap" height="46" /> </stackpanel> </datatemplate> </listbox.itemtemplate> </listbox> cs public class historyrow { public string header { get; set; } public string description { get; set; } public int articleupdateid { get; set; } } public ienumerable<historyrow> historydata {

osx - OS X getting window size when double clicking -

if double click top of window in os x, resize previous size. how programmatically trigger behaviour? in other words, there cocoa function resizes window previous size? are looking [mywindow zoom:self] ? - (void)zoom:(id)sender action method toggles size , location of window between standard state (provided application “best” size display window’s data) , user state (a new size , location user may have set moving or resizing window).

serialization - Experiment with incompatibility of Java serilization -

i understand java serialization conceptually, pretty bewildered version compatibility of serializable object. when "version" referred, mean: either 2 classes of hierarchical relationship, , 1 of has addition/deduction of attributes? or 2 classes complied different compilation versions? or both? my understanding have keep suid consistent, checked jvm version compatibility. as result devised experiment trying test version incompatibility of java serialization, code snippet below, in made suid different: public static class incompatible implements serializable { private static final long serialversionuid = 1l; private int i; public incompatible(int i){ this.i = i; } public int geti(){ return i; } } public static class incompfoo extends incompatible { private static final long serialversionuid = 2l; public incompfoo(int i){ super(i); } } @test public void incompatibletest() throws ioexception, class

Xcode 7.1 Simulator showing black screen? -

Image
i'm trying start app in simulator it's showing me screen: i tried resetting content , settings, nothing has worked. know how fix this? that screenshot indicates data migration still running. can gather more detailed information progress looking @ device's system.log (debug -> open system log).

Creating an image gallery using html image tag in a php for loop -

i want create online image gallery. have folder containing n number of thumbnails , name tn_1.jpg, tn_2.jpg , on .this code planning implement. <?php ($i=1;$i<=n;$i++) { echo '<img src="images/tn_'.$i.'.jpg"/><br>'; } ?> do think way of creating online gallery or should follow method? unless running framework on top of vanilla php (either php or javascript), way display images in folder on web page. you need add logic names of files within directory , run loop. $files = scandir('/path/to/image/directory'); foreach($files $file){ echo '<img src="/path/to/image/directory/' . $file . '"/><br>'; }

python 3.x - In Python3/tkinter is there a way to temporarily stop accepting clicks in a Treeview widget? -

i have gui based in python 3 , tkinter has big ttk.treeview . have defined methods row selection (one click) , opening advanced info panel (double-click). need ensure that, after being double-clicked, next 1 or 2 seconds, treeview state won't changed click. possible deactivate treeview mouse bindings, buttons? doing little more research, able come solution this. created empty method called when tree widget supposed inactive. so, can use "unbind" mouse events , re-bind them few seconds later, needed: def nothing(self, *event): """ # hacking moment: function nothing, times need it... """ pass def bind_tree(self): """ # bind mouse , keyboard events respective functions or methods... """ self.tree.bind('<<treeviewselect>>', self.selectitem_popup) self.tree.bind('<double-1>', self.show_details) self.tree.bind("<button-2>"

listview - list view makes android app crash -

i working on health related android app. in this, using floating action button in indexpage.java switch activity foodentry.java(having listview food items). in whenever click on floating button app crashes. 1 thing found out app crashing due listview. please me find solution of it. this indexpage.java public class indexpage extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_index_page); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); floatingactionbutton fab = (floatingactionbutton) findviewbyid(r.id.fab); fab.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { intent in = new intent(indexpage.this, foodentry.class); startactivity(in); } }); } } foodentry.java public class foodentry extends appcompatactivity { //

r - avgokmts returning incorrect maximum rain from ok mesonet data -

Image
i'm using okmesonet package data on rainfall. i've tried using avgokmts package calculate rainfall each day, i'm getting non-sensical values. get rain data norman, ok (cumulative rain in mm on day @ 5 min intervals) library(okmesonet) raindat <- okmts(begintime="2016-06-21 00:00:00", endtime="2016-07-04 00:00:00", station="nrmn", variables="rain", localtime=true) calculate max rain per day avgokmts(raindat, by="day", metric="max") which returns these values stid stnm day month year rain time date 1 nrmn 121 21 06 2016 0.00 23:55:00 2016-06-22 2 nrmn 121 22 06 2016 0.25 23:55:00 2016-06-23 3 nrmn 121 23 06 2016 59.70 23:55:00 2016-06-24 4 nrmn 121 24 06 2016 0.00 23:55:00 2016-06-25 5 nrmn 121 25 06 2016 0.00 23:55:00 2016-06-26 6 nrmn 121 26 06 2016 0.00 23:55:00 2016-06-27 7 nrmn 121 27 06 2016 0.00 23:55:00 2016-06-28 8

ajax - ASP.NET Page refresh instead update panel -

in project there number of repeaters in page.each repeater contains number of sub items.i want refresh page without using updatepanel control.how can achieve through ajax.again mentioning page contains large number of controls. since i'm not quite sure trying achieve i'm going give couple of possible solutions problem whithout using update panels (which in opinion, think should use in case). from server side can try: page.response.redirect(page.request.url.tostring(), true); client side: after page rendered client browser there 2 possible ways force refresh. can use javascript or meta tag. javascript: settimeout("location.reload(true);", timeout); meta tag: <meta http-equiv="refresh" content="600"> you can set refresh intervals on server. hope helps.

php - How to change javascript call to index my pages naturally -

i have serious problem indexing of sites pages getting them on sitemap. asked on google forums , told me looking ont source code of 1 of pages brand page ( http://www.kelklope.com/marque/liste-des-marques-all.html ) doesn't use normal linke , link mechanism javascript function call makes hard search engines discover brand pages naturally. here's code of file <?php require_once('inc/header.php'); ?> <body> <script> $('.category').click(function(){ var idvalue = $(this).attr('id'); if(idvalue =='category_all'){ $("ul").hide(); return false; }else{ $("ul").hide(); if($("ul."+idvalue).length){ $("ul."+idvalue).show(); $(this).addclass('categoryopen'); } } }); function changeproductbymanufacture(categoryid,subcategoryid,marqueid,marquename,sortby,bo

using Standard Values Instead of constant in Autolayout IOS -

i have started learning ios development knowledge little. i building layout app. need app run on devices . have read somewhere should never use constant magic number when creating constraints , use standard values. want support app resolutions whenever set standard value it's '0' means have play multiplier values have similar spacing and kindly let me know when can use constant value , when have avoid. most of times need space views evenly in screen . makes view similar on devices (like on bigger screen should equivalent scaled version of how looks on smaller screen). for eg. if need space 3 views horizontally , equally on view. if set height/width of buttons magic number, 100 pixels. 3 subviews relatively smaller on iphone6+ screen on iphone5 screen. when use multipliers. height/width of buttons = 0.2 of superview. on other hand need use magic numbers in cases. for eg. creating canvas on screen in user draw menu panel on left. know menu panel fit

Can I use Android Studio's 'Find Useage' for Android SDK Source Code? -

Image
one of useful functions in right-click , 'find useage' or 'see declaration'. code, 'find useage' show instances of function/object used. i have sdk source code in too, can't 'find useage' on code. there way set projects can use 'find useage' on android sdk code? example, go android/platform /frameworks/.../configuration.java, right click on configuration, , see class being used elsewhere. failing that, there way find useages short of grepping around massive sdk project? yes, possible. can configure scope of search function. move cursor on symbol want analyse, press ctrl+shift+a (search action) , search find usage setting or menu select edit -> find -> find usage setting , select project , libraries in scope section. if menu item grayed out, it's because no symbol has been selected. furthermore, if looking particular feature in search action function huge time saver. btw: if project , libraries not ava