Posts

Showing posts from August, 2012

Python 3.5 tkinter: resizing widgets to window -

i reading, reading , reading still unable find appropriate answer issue. plan create 'masterwindow' in implement several frames (currently navigation panel left, 'rootframe', shows up, when no process running, statusbar @ bottom, alerts , processings , main frame. running code below, works fine, frames not adjust resize of window. now, know, need sticking in main- , subclasses , set grid_column- , rowconfigure weight of >0 still nothing happens. i cannot see reason why. missing? need put in masterframe?? stick masterwindow? can't right since inheriting frames everywhere... thanks effort , input. rgds p.s: oh way: can any1 tell me how iterate through rows in grid method can 'grid widget in next row' (relative) , dont have use absolute integers? # -*- coding: utf-8 -*- import tkinter.ttk tkinter import * class mainapplication(tkinter.frame): @classmethod def main(cls): root = tkinter.tk() ...

ios - UIStackView inside UIScrollview -

i've added uiscrollview in added uistackview in storyboard. i'm trying add uistackview having 2 uilabels dynamically in parent uistackview although i'm giving height of child view ,it takes space of parent uistackview how solve or other way achieve this? my code is func createsummaryview() { let labelsummary:uilabel = uilabel(frame: cgrectzero) labelsummary.text = "summary" labelsummary.heightanchor.constraintequaltoconstant(30).active = true let summaryparentview:uistackview = uistackview(frame: cgrectzero) summaryparentview.axis = .vertical summaryparentview.alignment = .leading summaryparentview.spacing = 1 let summaryviewwidth = width!-50 summaryparentview.heightanchor.constraintequaltoconstant(180).active = true //summaryparentview.heightanchor.constraintequaltoanchor(summaryparentview.heightanchor, multiplier: 2).active = true summaryparentview.addarrangedsubview(labelsummary) _ in 1...5 { ...

python - Flask - delegate response to child process -

i'm using flask/python implement rest api , run each response in child process. need since want apply seccomp security extension after forking. so far i'm doing following in request handler: fork in child - return response in parent - wait child what's puzzling, in parent after child done. flask requires me return some response parent - returned child. there way signify flask nothing should done in parent handler? clarification : want child write response - amount of returned data can quite massive , don't want relay through parent. different other questions, because parent should not touch socket @ (even not 204 response, writes headers anyway) - should somehow dispatcher "ok, i'm done response" once child has finished.

javascript - Functions within a loop called multiple times. How could I go about this in a different way? -

my movemask function in code below called x amount of times each html element class .layout-box . i'm struggling think of way of re-writing code runs functions once, each time event listener invoked. i understand might not simple fix, if some idea of direction need heading in, i'd appreciate it. // store svg container element variable var layoutbox = document.queryselectorall(".layout-box"), xpos = 0, ypos = 0, elover = true, clicked = false, rect, coords, split = document.queryselectorall('.words h2, .words h3, .words p, .words li'); // gsap tweens/functions require access coordinates function movemask(valuex, valuey) { [].slice.call(layoutbox).foreach(function(el, i) { console.log("test"); var img = el.queryselectorall('.img'); // mask move animation var tlmove = new timelinemax({ paused: true }); tlmove.set(img, { webkitclip...

I am getting following error when i try to show category products on homepage [Magento 1.8] -

i getting following error when try show featured products on homepage fatal error: call member function getbackend() on non-object in /home/superhit/public_html/eoffixplanet.com/app/code/core/mage/eav/model/entity/abstract.php on line 816 can help? here website . you trying filter collection non-existing attribute. review ->addattributetofilter('...') calls.

codeigniter - Code igniter update function on dropdown menu -

Image
i have update function on codeigniter my controller is public function updatepersonalinfo(){ $id = $_get['id']; $data['content'] = $this->employees_model->personalinfo($id); // current information updated $data['content1'] = $this->employees_model->nationality(); // select box value $data['content_view'] = 'employees/edit_personalinfo'; $this->templates->admin_template($data); } then view 1 of select box is <select class="form-control" name = "blood_type"> <option value="<?php echo $content->blood_type; ?>"><?php echo $content->blood_type; ?></option> <option value="a"> </option> <option value="b"> b </option> <option value="ab"> ab </option> <option value="o">...

python - Django: reload variable's value in the template -

imagine there django html-template variable foo : <div> {{ foo }} </div> is possible reload foo 's value somehow without api call , without page reload? after searching answer, came conclusion there no way update without page reload or api-call. so, solution change approach.

eclipse - Project configuration is not up-to-date with pom.xml. -

project configuration not up-to-date pom.xml. select: maven->update project... project context menu or use quick fix. <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.safdar.jba</groupid> <artifactid>java-blogs-aggregator</artifactid> <version>0.0.1-snapshot</version> <packaging>war</packaging> <!-- shared version number properties --> <properties> <org.springframework.version>4.0.2.release</org.springframework.version> <apache.tiles>3.0.3</apache.tiles> <spring.security.version>3.2.3.release</spring.security.version> </properties> <dependencies> <dependency> <groupid>postgresql</g...

android - Setting a global minHeight and/or minWidth -

i've drawable xml file, in set global parameters butons, using code like <shape android:shape="rectangle"> <corners android:radius="4dip" /> <stroke android:width="1dip" android:color="#555555" /> <solid android:color="#dddddd"/> <size android:height="20dip"/> </shape> that's ok, of course, default minheight of button seems 48dp, height of 20 nothing. know can use android:minheight="0dp" android:minwidth="0dp" but want set these values "global" buttons. searching in android doc ( https://developer.android.com/guide/topics/resources/drawable-resource.html#shape ), seems minheight , minwidth not part of shape drawable. can set minheight , minwidth in global way? thanks you want define custom button style , apply theme. for example: <style name="apptheme" parent="theme.appcompat....

scala - Event cannot find basic function on spark.apache.org -

i'm newbee spark, need searching basic function meanning of rdd functions "join", "reducebykey". official website comes first choice. when input function name on left top of page. the small input i cannot find functions above make me confucius. can search usage on google 1 one. could tell me how search functions, should know package functions come ? or cannot fuzzy search function? you can find docs joins under pairrddfunctions class. agree search feature not good, have few suggestions. read rdd class docs. contains many of fundamental operations , text @ top informative. i find programming guide useful reference docs. might helpful because programming guide comes more explanation.

How to copy files from Windows host to Docker container -

Image
looking quick solution copy local files docker container on windows. wasn't able find in other stack overflow solutions. you might call mounting local drive on windows within docker container. open docker settings icon on taskbar: go 'shared drives' , enable local drive made accessible containers: now can add folders shared drive volume in container. using nginx example docker getting started guide : docker run -it -v c:/users:/data nginx /bin/bash that give shell access, can find local files (c:/users) in /data directory of nginx container.

Reading data from HBase through Spark Streaming -

so project flow kafka -> spark streaming ->hbase now want read data again hbase go on table created previous job , aggregation , store in table in different column format kafka -> spark streaming(2ms)->hbase->spark streaming (10ms)->hbase now don't know how read data hbase using spark streaming. found cloudera lab project sparkonhbase( http://blog.cloudera.com/blog/2014/12/new-in-cloudera-labs-sparkonhbase/ ) library, can't figure out how inputdstream stream processing hbase. please provide pointers or library links if there me this. splice machine (open source) has demo showing spark streaming running. http://community.splicemachine.com/category/tutorials/data-ingestion-streaming/ here sample code use case. https://github.com/splicemachine/splice-community-sample-code/tree/master/tutorial-kafka-spark-streaming

android - java and xml file not linking -

i have been trying make food recipes application on android studio 2.1. everytime make new project or open old project, there's error in "setcontentview" line showing r can't linked ( please see image attached) image of problem in code .even try call id's of buttons,webview,etc, there's error in "r" part,which think due fact "res" not getting linked java file. have tried following things none worked , error still there: downloaded android studio 2.1 again google.developers website cleaned , run project again. downloaded every tool in sdk manager except google play. i have java se 8u101 (latest , downloaded oracle site). did gradle sync in project. checked respective xml files , it's error free. same error every java file , every project made on studio. same project running without error in "setcontentview" line in android studio 1.2 version.thanks. assuming app's application id com.example.intel , ...

assembly - Why do I only need to increment for change a asm instruction using hexa editor -

i'm trying modify program , display "it's not same" using objdump , hexadecimal editor. #include <string.h> #include <stdio.h> int main(int argc, char *argv[]) { int return_value; return_value = strcmp("test", "test"); if (return_value == 0) printf("it's same\n") else printf("it's not same\n"); return (1); } do used objdump -d , found line of jne instruction. first question know jne instruction , why not je ? because jne mean "jump not equal" wrote in condition if return value equal 0. my second question in title, why need increment change instruction ? (as in following link) how 1 change instruction hex editor? 400526: 55 push %rbp 400527: 48 89 e5 mov %rsp,%rbp 40052a: 48 83 ec 20 sub $0x20,%rsp 40052e: 89 7d ec mov %edi,-0x14(%rbp) 400531: ...

Importing a class within an npm module in meteor -

i trying import class allhtmlentities npm module html-entities i'm not able it. tried import entites 'html-entities' it's giving me error. tried doing var entities = require('html-entities').allhtmlentities; , worked , meteorjs docs suggests using import instead of require. does know import equivalent of var entities = require('html-entities').allhtmlentities; is? import {allhtmlentities entites} 'html-entities';

CSS style sheet doesn't link to my HTML -

for reason css style sheet isn't opening html file. i've attached images of html code , css code. my css style sheet saved .css. spelling correct. i've looked through similar questions on forum. i've tried solutions no avail. i'd grateful help. many thanks my html code my css code are having files in same folder? becouse if not, should link css path file this: <link rel="stylesheet" href="foldername/codeacademy.css"> //this version work if have html file , folder css file in same place btw: why div outside of body o.o? , don't need specify type of stylesheet link anymore ;) edit

python - deploy flask application on ubuntu/apache2: virtual host configuration -

Image
i'm trying deploy python/flask application on apache2 installation on ubuntu (14.04), following instructions @ link the application seems work , if point browser http://mywebsite.com/ correctly see message returned flask application. my problem is, if want install second site different virtual host on same machine (say non-python application)? virtual host mapped url http://mywebsite.com/flaskapp , while having possibility define virtual host @ http://mywebsite.com/myotherwebapp this flaskapp.conf file per instructions on mentioned article: <virtualhost *:80> servername mywebsite.com serveradmin admin@mywebsite.com wsgiscriptalias / /var/www/flaskapp/flaskapp.wsgi <directory /var/www/flaskapp/flaskapp/> order allow,deny allow </directory> alias /static /var/www/flaskapp/flaskapp/static <directory /var/www/flaskapp/flaskapp/sta...

php - Can solve my "SMTP Error: Could not authenticate" error -

i have problem phpmailer function. i want registration form send mail every new registered member. i error code. smtp error: not authenticate. i have contacted webhost, , have right username,password, smtp server etc. include "class.smtp.php"; include "class.phpmailer.php"; $host = "mail.smtp.com"; // smtp servers $username = "support@mymail.com"; // smtp password $password = "mymailpassword"; $from = "support@mymail.com"; $fromname = "my name"; $toemail = $mail; $toname = $username; $header = str_replace('%homepage_url%', $hp_url, $_language->module['mail_subject']); $message = str_replace(array('%nickname%', '%username%', '%password%', '%activationlink%', '%pagetitle%', '%homepage_url%'), array(stripslashes($nickname), stripslashes($us...

debugging - How to debug silent crashes? Multiprocessing python -

i have program spawns bunch of worker daemons using multiprocessing library. sometimes these daemons sporadically fall on , die. isn't caused python-level exception. crashes seem totally silent... can provide tips on how may go debugging issue?

Agda: type isn't simplified in `with` block -

i'm trying solve bonus exercise on page 23 of this tutorial, can't fill in hole: lem-all-filter : {a : set}(xs : list a)(p : -> bool) -> (satisfies p) (filter p xs) lem-all-filter [] p = all[] lem-all-filter (x :: xs) p p x ... | true = {! !} :all: lem-all-filter xs p ... | false = lem-all-filter xs p if type c-c c-, in hole message: goal: istrue (p x) -------------------------------- xs : list .a p : .a -> bool x : .a .a : set but expect goal have type true, since p x true , istrue true = true . missing something? when pattern match on p x , p x gets rewritten pattern everywhere in context, hole not in context @ time of rewriting: appears later , hence p x in type doesn't rewritten. can remember p x equal true using inspect idiom (deprecated in favour of inspect on steroids ) described later in paper, can following: lem-all-filter : {a : set}(xs : list a)(p : -> bool) -> (satisfies p) (filter p xs)...

Acumatica Web API: Reading SO303000.InvoiceSummary.Type Field only returns "Invoice" -

using soap service api, i'm trying read field so303000.invoicesummary.type determine if invoice of type invoice, debit memo, credit memo, cash return or cash sale. i've made multiple invoices of each type , called basic read referencenbrs , types using similar version of code below. able retrieve of invoices (of types), type field each invoice populated "invoice" different so303000 screen. reading wrong field or else? thanks! public void getallinvoicetypes() { so303000content so303000 = context.so303000getschema(); context.so303000clear(); var fields = so303000.invoicesummary; list<command> commands = new list<command>(); commands.add(so303000.invoicesummary.servicecommands.everyreferencenbr); commands.add(so303000.invoicesummary.referencenbr); commands.add(so303000.invoicesummary.type); string[][] so303000content = context.so303000export(commands.toarray(), new filter[] { }, 0, true, true); } this screen h...

continuous integration - How to reproduce Codeship's non-Docker CI environment locally? -

is there way reproduce codeship's ci environment locally when not using codeship's docker support? we don't share build vms our classic infrastructure publicly @ moment. i'll bring our engineering team, can't make promises right on they'll decide. we have ssh debug feature available, allow access build vm code cloned via ssh , run & tweak commands way. see https://codeship.com/documentation/continuous-integration/ssh-access/ more information.

java - Getting SQLiteException: no such column -

public class mydbhandler extends sqliteopenhelper { private static final int database_version = 1; private static final string database_name = "winkelskortrijk.db"; private static final string table_users = "users"; private static final string table_favourites = "favorieten"; public static final string column_id = "id"; public static final string column_username = "username"; public static final string column_password = "password"; public static final string column_id2 = "id2"; public static final string column_name = "naam"; public static final string column_straat = "straat"; public static final string column_huisnr = "nr"; public static final string column_postcode = "postcode"; public static final string column_deelgemeente = "deelgemeente"; public static final string column_gemeente = "gemeente...

Excel VBA to Word bookmark with Excel cell format retained -

i have vba code snippet extracts excel cell data word template, using bookmarks in template assign values specific template locations. able export excel cell values in text format bookmarks, cannot retain native excel formatting. the code uses .value property extract data in text formatting. i'm trying minimize manual formatting second time in word (converting text exported value of 150001.22 dent_90 excel range $150,001.22 dent_90 bookmark in word, example). any idea on how might done, such can export word using excel currency cell formatting? i've looked @ explanations formattext, can't seem work following snippet: sub testmemogen() dim objword object dim ws2 worksheet application.screenupdating = false set ws2 = thisworkbook.sheets("word export") set objword = createobject("word.application") objword.visible = true objword.documents.open "c:\users\ tester\word test sim.docm" objword.activedocument .bookmarks("dent_90")....

linux - Subtract a constant number from a column -

i have 2 large files (~10gb) follows: file1.csv name,id,dob,year,age,score mike,1,2014-01-01,2016,2,20 ellen,2, 2012-01-01,2016,4,35 . . file2.csv id,course_name,course_id 1,math,101 1,physics,102 1,chemistry,103 2,math,101 2,physics,102 2,chemistry,103 . . i want subtract 1 "id" columns of these files: file1_updated.csv name,id,dob,year,age,score mike,0,2014-01-01,2016,2,20 ellen,0, 2012-01-01,2016,4,35 file2_updated.csv id,course_name,course_id 0,math,101 0,physics,102 0,chemistry,103 1,math,101 1,physics,102 1,chemistry,103 i have tried awk '{print ($1 - 1) "," $0}' file2.csv , did not correct result: -1,id,course_name,course_id 0,1,math,101 0,1,physics,102 0,1,chemistry,103 1,2,math,101 1,2,physics,102 1,2,chemistry,103 you've added column in attempt. instead set first field $1 $1-1 : awk -f"," 'begin{ofs=","} {$1=$1-1;print $0}' file2.csv that semicolon separates commands. set deli...

xml - Import NVD data feed to MS access database -

with reference existing question how parse nvd cve xml , import database managed give partial answer to, need extend question (and not comment on existing question) i need import xml data https://nvd.nist.gov/download.cfm ms access. [edit] the structure in database looking create follows: maintable(entry) element(vuln:cve-id) element(vuln:vulnerable-configuration) element(vuln:summary) element(vuln:published-datetime) element(vuln:last-modified-datetime) element(cvss:score) element(cvss:access-vector) element(cvss:access-complexity) element(cvss:source) element(cvss:generated-on-datetime) atribute(entry id) atribute(vuln:assessment_check system) atribute(vuln:assessment_check href) atribute(vuln:assessment_check name) atribute(vuln:cwe id) atribute(vuln:vulnerable-configuration id) atribute(cpe-lang:logical-test operator) atribute(cpe-lang:logical-test negate) childtable(fact-ref) element(vuln:cve-id) [from entry table] atribute(cpe-lang:fact-ref...