Posts

Showing posts from August, 2015

Running Spark on a Cluster of machines -

i want run spark on 4 computers, , read theory of running spark on cluster using mesos, yarn , ssh, want practical method , tutorial this. operating system of these machines mac , ubuntu. i've written code on intellijidea using scala. can me?

In django admin how do you access a function in a child model? -

i access thumbnail function of image model preview in tabularinline. in admin.py class blogwidgetcarouselinline(admin.tabularinline): model = blogwidgetcarousel = 0 readonly_fields = ('display_as', 'thumb', 'print_thumbs',) def display_as(self, instance): return instance.display() display_as.allow_tags = true def thumb(self, instance): return instance.image.thumb() #does not work def print_thumbs(self, instance): return instance.print_thumb() #neither in models.py class blogwidgetcarousel(models.model): entry = models.textfield() blog = models.foreignkey(blog, blank=true, null=true) position = models.positivesmallintegerfield("position") images = models.manytomanyfield("image") class meta: ordering = ('position', ) def display(self): return self.entry display.allow_tags = true def print_thumb(self): return self...

oracle - SQL two table Single-row Subquery returns more than one row -

i have 2 tables, chef , meal. trying reduce salary of every chef has not yet made single meal. query update chef set chef_salary = chef_salary-(chef_salary/100 * 5) chef_id=(select c.chef_id chef c left join meal m on (c.chef_id=m.chef_id) having count(m.chef_id)='0' group c.chef_id);; it returns error says "single-row subquery returns more 1 row" doing wrong ? update chef set chef_salary = chef_salary-(chef_salary/100 * 5) chef_id in (select c.chef_id chef c left join meal m on (c.chef_id=m.chef_id) group c.chef_id having count(m.chef_id)='0' );

c++ - Call function1 || function2 syntax error -

i use || between 2 function calls can result of or of calls. here tried: bool ui() || bool ul() however, getting error saying expected initializer before token . when calling function, don't put function's return type in call. following should work: bool result = ui() || ul();

Java 8 lambdas nested Map -

i trying use java-8 lambdas solve following problem: given list<transaction> , each category.minorcategory require sum of transaction.amount per category.minorcategory , map of transaction.accountnumber sum of transaction.amount per transaction.accountnumber . have working, per code below. have requirement group category.majorcategory , returning map<string, map<string, minorcategorysummary>> keyed on category.majorcategory . i have working until stage of grouping category.majorcategory struggle see solution; paradigm shift of programming lambdas proving steep learning curve. transactionbreakdown action happens , i'd return map<string, map<string, minorcategorysummary>> . public class transaction { private final string accountnumber; private final bigdecimal amount; private final category category; } public class category { private final string majorcategory; private final string minorcategory; } public cl...

c# - How to save an audio capture in a wav file using ASIO and Naudio? -

so far, wrote : private asioout asiodriver; private bufferedwaveprovider buffer; string[] drivernames = asioout.getdrivernames(); asiodriver = new asioout(drivernames[1]); buffer = new bufferedwaveprovider(new waveformat(samplerate, 16, 2)); asiodriver.audioavailable += new eventhandler<asioaudioavailableeventargs>(asiodriver_audioavailable); asiodriver.initrecordandplayback(buffer, 2, samplerate); asiodriver.play(); private void asiodriver_audioavailable(object sender, asioaudioavailableeventargs e) { byte[] buf = new byte[e.samplesperbuffer * 4]; (int = 0; < e.inputbuffers.length; i++) { marshal.copy(e.inputbuffers[i], buf, 0, e.samplesperbuffer * 4); marshal.copy(buf, 0, e.outputbuffers[i], e.samplesperbuffer * 4); if (recorderon && == 1) { recorder.addinputtostream(buf); } } } this part used capture , playback sound guitar asio. no problems far. public void addinputtostream(byte[] buf...

api - How to send data from slack to another service? -

i'm looking how send data slack channel message : @slackbot :create ticket: "check apache configuration settings" to redmine api instance ?? it possible ? i know possible webhooks send slack chan, reverse ?? you use slash command may need server can forward request redmine or use outgoing webhook . you're question pretty generic may need more specific avoid getting downvote.

c# - MVC HandlerError attribute isn't redirecting to error View on Exception -

question background: i have simple 'contact form' on page. user needs supply name, email message subject , actual message itself. i'm trying implement 'error' view display during errors on mailing process such incorrect email format uer supplys. the issue: i'm using mvc handleerror attribute on home controller, page not being shown when error thrown. code: contact form uses ajax submit request action method on home controller: @using (ajax.beginform("sendfmfcmail", "home", new ajaxoptions { updatetargetid = "result", onbegin = "loadingspinner", onsuccess = "messagesent", onfailure = "failedmail" })) { @html.validationsummary(true) <div id="result"></div> <div class="row"> <div class="col-lg-12"> <div class="form-group"> ...

ios - Could not cast value of type '__NSCFNumber' () to 'NSArray' swift -

why can't cast nscfnumber (core data) nsarray? error: could not cast value of type '__nscfnumber' (xxxxxxxx) 'nsarray' (xxxxxxxx). code: //fetch settings func fetchaccounsetting(){ let entitydescription = nsentitydescription.entityforname("usersettings", inmanagedobjectcontext: context!) let request = nsfetchrequest() //let data = usersettings(entity: entitydescription!, insertintomanagedobjectcontext: context) request.entity = entitydescription var dataobjects: [anyobject]? { dataobjects = try context?.executefetchrequest(request) } catch let error nserror { print(error) dataobjects = nil } result in dataobjects as! [nsmanagedobject] { let dataselected = nsarray(array: result.valueforkey("favcategory")! as! nsarray) print(dataselected) } update: how can receive count of datasele...

apache - htaccess url redirect (character "?") -

i have url this: http://mydomain.es/foro.php?topic=9 and want redirect to: http://mydomain.es/foro/9/ but can't work, have tried like: redirectmatch 302 ^/foro.php\?topic=([0-9]+)$ /foro/$1/ but don't work, problem character ?, if remove in url (and use redirectmarch redirectmatch 302 ^/foro.phptopic=([0-9]+)$ /foro/$1/) it works fine, can me? i'm going crazy. answered here - query strings not supported rewritematch. use mod_rewrite instead.

Difficulty reading a matrix as a node in rdflib -

i created rdf file images stored in nodes matrices. when try read them cannot matrix form: example from rflib import literal mm = np.random.normal(0,1,(3,3)) l = literal(mm) it easy matrix l.value in [494]: l out[494]: rdflib.term.literal(u'[[-1.39304728 0.39093531 0.88042378]\n [ 0.22605682 0.56064787 -0.75176713]\n [ 0.57021203 0.31796492 -0.53303191]]') in [495]: l.value out[495]: array([[-1.39304728, 0.39093531, 0.88042378], [ 0.22605682, 0.56064787, -0.75176713], [ 0.57021203, 0.31796492, -0.53303191]]) however when execute sparql stored in image_nodes get: in [501]: res = [q q in image_nodes] in [502]: res[0][0] out[502]: rdflib.term.literal(u'[[ 0. 0. 0. ..., 0. 0. 0.]\n [ 0. 0. 0. ..., 0. 0. 0.]\n [ 0. 0. 0. ..., 0. 0. 0.]\n ..., \n [ 0. 0. 0. ..., 0. 0. 0.]\n [ 0. 0. 0. ..., 0. 0. 0.]\n [ 0. 0. 0. ..., 0. 0. 0.]]') in [503]: (res[0][0]).value out[503]: u'[[ 0. 0. 0. ..., 0. 0. 0.]\n [ 0...

java - JTable not getting data from Vector -

i have problem jtable: seemingly emty , not getting data objects vector pass it. checked related topics sadly dont find reason issue, , same code worked me once. further testing create objects on button click, add them vector , try refresh table. printlns show objects added vector, table still empty. assume, problem must somewhere in table code. post test class , related ones , hope can me. the test class: public class test_table extends jframe { private ppcontrol ppc; private entryfilepm epm; private jtable entrytable; private jpanel entrytablepanel; private jbutton addbutton; private jbutton savebutton; private jbutton loadbutton; private jpanel buttonspanel; private jlabel kursl; private jtextfield kurst; private jlabel cnumberl; private jtextfield cnumbert; private jlabel namel; private jtextfield namet; private jlabel datel; private jte...

Disabling first-run greeter on fresh android emulator -

i writing test requires launching application directly launcher. because can't emulate correctly launching through intent. the problem when running test on fresh emulator (i using travis ci, can reproduced on home pc) emulator starts "first run" greeter overlay. blocks uiautomator code correctly launching application. i have tried add code close greeter unfortunately can appear delay, when "greeter detecting , closing" code has stopped working thinking coast clear. is there guaranteed way disable greeter? preference maybe or example of code reliably kill greeter. have tried using packagemanager.getlaunchintentforpackage(..) ? allow send same intent launcher uses start app. should equivalent clicking on application's launcher icon. if need go through launcher, can use uiwatcher dismiss first-run overlay. whenever uiautomator can't find element, call checkforcondition(..) method each registered uiwatcher , give chance dismiss overlay...

python coding sum the rows and columns of a grid -

i trying use spread sheet format in python coding. trying teach junior high school students how read table matrix.txt file , produce set of rows , columns. want them see if sum of each column matches sum given , same rows. here putting in matrix.txt file 3 3 7 2 5 14 6 3 1 10 3 9 8 20 16 14 14 here code have constructed far cant head around how program calculate sum of each rows first 3 (number of rows) integers. hope can help. k=[] open('matrix.txt') f: grid_data = [i.split() in f.readlines()] el in grid_data[0:]: num in el[0]: k.append(num) row=int(k[0]) in range(1,row): el in grid_data[i]: print(sum(el[0:row-1])) if there better way solve please let me know. past unsw coding comp question 2014. love cool way analysis tables or grids in python. numpy total overkill such simple problem, , require dump whole bunch of background learning on young students. i don't spoon-feeding, there many elements pythonic solution readily explain in p...

Rails 4 Attempting to save Multiple Records to single Model -

i using omnicontacts gem pull list of contacts. far works. can contacts , use them populate form can pass them contacts controller saved in contact model. i have looked @ rails cast #165 guidance , several posts here on stackoverflow. cannot seem crack nut. feels missing basic , driving me batty. edit: issue restatement the trouble having nil contact record getting written memory. please see update log section below. attempting submit multiple records, last being picked up. not getting saved model, causes other issues. appears caused calling new. changing method create saving last item in list. fields not listed in form saving nil causing other issues. works console: $contact.create([{ user_id: '1', first_name: 'sam'}, { user_id: '1', first_name: 'dean'}]) creates 2 new records in contact model. trying figure out how make happen form. basically. can 1 nest form within own model? should save contacts staging table first? sees there ...

c# - What is this called and what does it do? (Part of a Generic Repository) -

i'm reading on generic repositories. keep stumbling bits of code don't understand. don't know if there's specific name them or not. this complicated example i've seen: ienumerable<t> getbyquery( expression<func<t, bool>> query = null, func<iqueryable<t>, iorderedqueryable<t>> orderby = null, string includeproperties = ""); i know (whatever is) apparently returns ienumerable , have no idea how read mess of gobbledygook let alone how go using it. edit: i'm more interested in knowing that's example of breakdown of specific example. need know they're called before can find explains syntax. linq?? edit 2: i'm asking much, simpler question 1 being answered. want know "what few search terms can use in order research above code?" note, of extremely educated guess, based on how iqueryable<t> work. breaking down 3 parts: expression<func<t, bool>...

ubuntu 14.04 - Weird terminal behavior with "git difftool" -

when try use "git difftool", terminal seems enter mode hitting "enter" key outputs ^m instead of accepting default option: $ git difftool --tool=tkdiff file viewing (1/1): 'file' launch 'tkdiff' [y/n]: ^m^m^m^m^m^m^m^m i can control-c out of it, can't difftool work. "git diff" works charm. i struggling google problem. i running ubuntu 14.04.2 lts, term xterm, , .gitconfig simple, has nothing output in it: [user] name = name email = myemail@example.com [alias] co = checkout how can use "git difftool"? probably terminal configuration problem rather git issue. run stty sane see if helps or follow other instructions in similar post: https://askubuntu.com/questions/441744/pressing-enter-produces-m-instead-of-a-newline

php - Link being replaced not expected way when using preg_replace -

i've array regular expressions use replace url's/hashtags links using preg_replace : $regs = array('!(\s|^)((https?://|www\.)+[a-z0-9_./?=;&#-]+)!i', '/#(\w+)/'); $subs = array(' <a href="$2" target="_blank">$2</a>', '<a href="/hashtag/$1" title="#$1">#$1</a>'); $output = preg_replace($regs, $subs, $content); if $content have link, ex: https://www.google.com/ , replaces correctly; if have hashtag followed text, ex: #hello replace too, however, if have link hashtag, ex: https://www.google.com/#top replacement follows: #top" target="_blank">https://www.google.com/#top ^^^^ ^^^^ and highlighted parts turn links. how fix? it because second regex in array matching part after # in string. change regex to: $regs = array('!(\s|^)((https?://|www\.)+[a-z0-9_./?=;&#-]+)!i', '/(?<=[\...

How to receive & process data when I subscribe to youtube api v3 push notification? -

according https://developers.google.com/youtube/v3/guides/push_notifications i can subscribe youtube channel & receive push notification new video. my callback server php script interprets post/get data: <?php if (isset($_get['hub_challenge'])) { print $_get['hub_challenge']; } else { $xml=file_get_contents("php://input"); file_put_contents('endpoint.txt',$xml); } ?> but $xml empty. in docs says: the youtube data api (v3) supports push notifications via pubsubhubbub, server-to-server publish/subscribe protocol web-accessible resources. notifications pushed out subscribers via http webhooks, more efficient polling-based solutions. but not specify how send data....whether in post body or in somewhere else. so how atom feed in script? edit: should ask new question this...but anyway....i tried channel ( https://www.youtube.com/channel/ucatp8lntjzjnllxdarp0myg ); when try subscribe says "restricted ...

ruby on rails - Convert PG::Result to an Active Record model -

pg-ruby allows send multiple queries database in 1 shot, helps minimize number of trips made database: results = [] conn.send_query('query1;query2;query3') conn.block while result = conn.get_result results << result end given result know active record model, what's appropriate way convert result models? right i'm doing following: fields = result.fields models = result.values.map { |value_set| model.new(hash[fields.zip(value_set)]) } the problem method each of active record objects don't appear #persisted? since they've been instantiated .new . i think want activerecord::base.instantiate method. correctly handle new_record? / persisted? issue, finding correct class single-table inheritance. for example: fields = result.fields models = result.values.map { |value_set| model.instantiate(hash[fields.zip(value_set)]) }

php - What is the best way to detect character set of an E-Mail message? -

i developing php script connects remote imap server , fetches body of message, parses , sends data db. inbox contais 50000+ messages, of them having us-ascii , iso-8859-1 encoding. plain body of message must converted utf-8 encoding before submission database. what best way of detecting character set of message's plain text body?

excel - IF THEN VBA MACRO - Update one column if contents of another = 100% -

i have workbook "results" being sheet 3, being worksheet want use. i have tried few formulaes try , add macro following: i have column g percentages. have column there result saying true/false contents of g equal 100%. column g formatted percentage 2 decimals. some considerations: have first row being hyperlink sheet, headings, first row of "results". have 457 rows, if there measurement of range, perhaps on a? i keep getting error 9 range , have got bit stuck. thanks in advance! sub partialhits1() dim rng range dim lastrow long dim cell range sheet3 lastrow = .range("g" & .rows.count).end(xlup).row set rng = .range("g1:g" & lastrow) each cell in rng if cell.value = 100 cell.range("i1:i1").value = 100 end if next end end sub (i have hacked bit, trying set 100 instead of true/false playing around near sheet 3 part got errors.) rangevari...

javascript - navigation on media cant get 100% width -

my navigation cant full width on media, tried every way , cant locate mistake is, attached code, please if 1 have idea how solve this, , set width full width = 100%? html <nav class="navi" id="target"> <div class="menu" id="header"> <li><a class="link-1" href="#">home</a></li> <li><a class="link-1" href="#">second</a></li> <li><a class="link-1" href="#">third</a></li> <div class="logo"> <li><a href="#"><img alt="brand" src="logo.png" height="40px" width="60px"></a><li> </div> </div> <div class="handle"><p>menu</p></div> </nav> the css: nav { width:100%; margin-top: 0; padding: 10px; text-a...

php - how to let only my server access to a webpage? -

how let server access webpage? maybe can ip or that: if(myipserver == visitedip) return true; return false; ? note: server accesses page via cron job. if($_server['remote_addr'] == 'your server ip') { return true; } else { return false; } this should magic.

c# - Reading multiple parts of XML -

i'm building windows app using xml file lot of nesting in - this. i need access attribute go down nodes. need keep doing every "route" object available (which may have multiple destinations , trips). so end trip object have: routeno = o destination = queenspark eta = 28 the xml file: <jproutepositionet xsi:schemalocation="urn:connexionz-co-nz:jp journeyplanner.xsd" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:connexionz-co-nz:jp"> <content maxarrivalscope="60" expires="2015-06-14t20:21:01+12:00"/> <platform name="manchester st & gloucester st" platformtag="3330"> <route name="orange line" routeno="o"> <destination name="queenspark"> <trip wheelchairaccess="true" tripno="5497" eta="28"/> <trip wheelchairacces...

java - Hibernate organization -

i try work hibernate. going ok have problem when want annotate subclass. want have in each table id , fk (id) subclass @entity @javax.persistence.table(name="person") @inheritance(strategy=inheritancetype.joined) public class person{ @id @generatedvalue @column(name="id_person") protected int id_person; @column(name="name") protected string name; .... subclass @entity @javax.persistence.table(name="worker") @inheritance(strategy=inheritancetype.joined) @primarykeyjoincolumn(name="id_person") public class worker extends person { @id @generatedvalue @column(name="id_worker") protected int id_worker; @column(name="salary") protected int salary ; ... i want have unique id worker because class @entity @javax.persistence.table(name="driver") @primarykeyjoincolumn(name="id_worker") public class driver extends worker{ @id @generatedvalue @column(name="id_driver") protected in...

nested clob xmlelemnt oracle sql select -

i error when trying run sql scrip, i've searched alot converting clob varchar2 useless ora-00932: inconsistent datatypes: expected - got clob select xmlelement("ejada:privilegeresourceslist",xmlattributes(noentityescaping get_mcr_parameter('xmlns:core') "xmlns:core", get_mcr_parameter('xmlns:ejada') "xmlns:ejada"), xmlagg(xmlelement("ejada:privilegeresourcesinfo",xmlelement("ejada:privilegerec", xmlelement("ejada:funcid","f_code"), xmlelement("ejada:scid","ps_channel_id"), xmlelement("ejada:srcresourceslist","srclist"), xmlelement("ejada:targresourceslist","trglist"), xmlelement("ejada:status","ps_status") )))) .getclobval() p_privilege_resources_list ( select distinct f_code, ps_channel_id, (...

polymer - Using dom-if for conditionals in arrays -

in 0.5 use expressions in dom-if select things in arrays while looping through them. how achieve same effect in 1.0? it's more efficient use filter/observe feature of dom-repeat instead of nesting dom-if . filter specifies method identifies records display collection, observe tells dom-repeat data observe know when re-run filter. e.g. <template is="dom-repeat" items="{{records}}" filter="haspersonlabel" observe="item.labels"> ... haspersonlabel: function (labels) { return (labels.indexof("person") >= 0); } documentation here ( https://www.polymer-project.org/1.0/docs/devguide/templates.html#filtering-and-sorting-lists ).

xcode - OS X : Swift : Open Safari (or default browser) with POST -

i'm trying build small utility os x (a statusbar app) using swift list our current clients , when client clicked - open safari client url sending post request (such login details clients wordpress, intranet or other webb application). nsworkspace.sharedworkspace().openurl(nsurl(string: "url")!) doesn't seem have way of incorporating post data. it's not app store submission, internal use within team. any ideas or solutions? you can't achieve opening url - result in request, typing url url bar. "javascript:" urls cannot opened via openurl, doesn't either. best option use apple script open site in new window , execute java script post login form.

javascript - Add css class to marked elements in Angularjs -

i have todo list , want checked elements become striked when click on "strike marked" button. this code index.html <!doctype html> <html> <head> <script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> <style> .strike { text-decoration: line-through; } </style> </head> <body ng-app="myapp" ng-controller="todoctrl"> <h2>my todo list</h2> <div ng-repeat="x in todolist"> <input type="checkbox" ng-model="x.done"><span ng-class="" ng-bind="x.todotext"></span> </div> <p> <button ng-click="strike()">strike marked</button> </p> <script src="mynotectrl.js"></script> </body> </html> and mynotectrl.js var app = angular.module('myapp', []); app.con...

excel - Possible Group/Sum and export MACRO? Ideas? -

i have 457 rows of data, has been grouped in squares borders. stands, ordered , grouped name. this example: name (column a) similar% (column g) indicator (column i) john 100 1 john 40 john 100 1 peter 50 peter 60 peter 60 nathan 100 1 nathan 100 1 i want able exclude marked 1 (the 100's) other entries in group. example,john has 2 100%'s, therefore 3 of john excluded. want peter's lines case exported new sheet. some considerations: first row hyperlink, headings, "results" start. contents go a-g. hope there solution, many thanks! i thought of in sql... select [indicator], sum(*) sumvalue results temp1 group name order sum(*) select * results left join temp1 on results.[name] = temp1.[name] wher...

android - blink marker and transparent accuracy circle in OSMDroid -

how make blink marker on osmdroid map? imho redraw it's bitmap (or whole map?) timer expencive. how make transparent accuracy circle? importantly, how calculate visible radius zoom&accuracy? who have examples, have looked, thank you. p.s. saw google maps examples, no, need osmdroid working code. for 2) either use osmbonuspack polygon polygon.pointsascircle or create own overlay inspired osmdroid directedlocationoverlay btw, 2 questions should lead 2 posts.

javascript - using ng-repeat to print out all items sorted by different categories into rows -

so, i've managed print out items list in messy way desperately in need of refactoring say have array of objects var items = [{name: "toaster", price: 10, category: "appliance"},{name: "spade", price: 5, category: "tool"},{name: "hoe", price: 5, category: "tool"},{name: "microwave", price: 10, category: "appliance"}] using ng-repeat, print out name , price of each item row according category without having have lot of messy code. code looks similar this: <section class="container"> <div class="row"> <h3>tool</h3> <ul class="list-group col-lg-2 col-sm-3 col-xs-4" ng-repeat="item in ctrl.items | filter: { category:'tool'}"> <li class="list-group-item"> <p>name: {{item.name}} </p> <p>price: £{{item.price}} </p> </...

c - rdma connection manager driver pattern -

i'm using ofed 3.18r2 implementation of infiniband drivers application. in particular i'm using rdma connection manager wrapper functions. understand better what's going on under hood i'm used @ source code. doing came looks pattern cannot understand it. let's make example. rdma connection manager functions in cma.c. looking example @ rdma_listen call (this common every functions defined in library start "rdma_"): int rdma_listen(struct rdma_cm_id *id, int backlog) { struct ucma_abi_listen cmd; struct cma_id_private *id_priv; int ret; cma_init_cmd(&cmd, sizeof cmd, listen); id_priv = container_of(id, struct cma_id_private, id); cmd.id = id_priv->handle; cmd.backlog = backlog; ret = write(id->channel->fd, &cmd, sizeof cmd); if (ret != sizeof cmd) return (ret >= 0) ? err(enodata) : -1; if (af_ib_support) return ucma_query_addr(id); else return ucma_query_route(id...

spring amqp - Getting "java.lang.NoClassDefFoundError: com/rabbitmq/client/impl/LongString" while retrieving messages from reply Q -

i using spring-integration-amqp 4.1.4 rabbitmq amqp-client 3.5.3. messages being delivered alright reply messages retrieval raises following exception.any insights appreciated in advance. -- org.springframework.amqp.rabbit.listener.simplemessagelistenercontainer - consumer raised exception, processing can restart if connection factory supports java.lang.noclassdeffounderror: com/rabbitmq/client/impl/longstring exception logs please consider formatting question correctly. it seems have dependency depends on old version of rabbitmq-java-client (<2.6). longstring package com.rabbitmq.client not com.rabbitmq.client.impl if using maven, try launch mvn dependency:tree > deps.txt , open deps.txt , find dependency cause issue. you try depend directly on amqp-client , may hide issue: <dependency> <groupid>com.rabbitmq</groupid> <artifactid>amqp-client</artifactid> <version>3.5.1</version> <scope>compile</s...

javascript - Extjs EditorGrid Cell calculation dependency -

im working on writing calculation functionality add dependencies on 1 or more cells different formula's (dynamically supplied formula's) on edit of cell's value. eg: if there 4 cells a,b,c,d formula's a=(editable), b=(a+d), c=(50), d=(a*c/100) where "c" constant. "b" , "d" dependent on edit of "a". wise can supply number of dependencies on "a" more constants , cells formula. i wrote temporary work around evaluate fixed cells formulas there way handle dynamically supplied formulas? , can 2 way sync? please suggest. thanks

keyboard - How to make a scanf() type function in a 32bit os in c? -

i trying make os in c , assembly in 32-bits protected mode. trying create scanf() type function gets keyboard input until enter button pressed. have basic keyboard irq handler setup prints typed , want implement scanf() function have problems return value keyboard handler main kernel. heres code keyboard handler. unsigned int shift_key = 0; unsigned int caps_key = 0; int counter = 0; char *sbuf; int scan = 1; void keyboard_handler(registers_t regs) { // monitor_write("handler called"); unsigned char scancode; scancode = get_scancode(); if(scancode == 0x2a ) { shift_key = 1;//shift key pressed //monitor_write("shift + "); } else if(scancode == 0xaa) { shift_key= 0;//shift key not pressed // monitor_write("unshift"); } else if(scancode == 0x3a && caps_key == 1) { caps_key = 0;//caps key pressed // monitor_write("shift + "); } else if(scancode == 0x3a ...

jpa - Why is my EntityManager not properly injected? -

i tried build project manages employees using jpa , beans , jsf. started trying manipulated existing user manually created in database. (before tried read data database, worked well) tried in various ways, getting different errors, assume somethinbg wrong. server wildfly 8 , database postgresql. 15:09:43,410 error [io.undertow.request] (default task-14) ut005023: exception handling request /time/modifyuser.jsf: javax.servlet.servletexception: bei der ressourcen-einspeisung auf dem verwalteten bean employeemanagertool ist ein fehler aufgetreten. @ javax.faces.webapp.facesservlet.service(facesservlet.java:659) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8] @ io.undertow.servlet.handlers.servlethandler.handlerequest(servlethandler.java:85) [undertow-servlet-1.1.0.final.jar:1.1.0.final] //... caused by: javax.naming.namingexception: jbas011878: failed lookup env/tbp.wam.tools.employeemanagertool/entitymanager [root exception java.lang.nullpointerexception] //... caused by: ja...