Posts

Showing posts from June, 2010

math - what will be python code for runge kutta second method? -

is code ok? def rkn(x, fx, n, hs): k1 = [] k2 = [] k3 = [] k4 = [] xk = [] in range(n): k1.append(fx[i](x)*hs) in range(n): xk.append(x[i] + k1[i]*0.5) in range(n): k2.append(fx[i](xk)*hs) in range(n): xk[i] = x[i] + k2[i]*0.5 in range(n): k3.append(fx[i](xk)*hs) in range(n): xk[i] = x[i] + k3[i] in range(n): k4.append(fx[i](xk)*hs) in range(n): x[i] = x[i] + (k1[i] + 2*(k2[i] + k3[i]) + k4[i])/6 return x with numpy seems more readable: code taken http://www.math-cs.gordon.edu/courses/mat342/python/diffeq.py def rk2a( f, x0, t ): """second-order runge-kutta method solve x' = f(x,t) x(t[0]) = x0. usage: x = rk2a(f, x0, t) input: f - function of x , t equal dx/dt. x may multivalued, in case should list or numpy array. in case f must return numpy array same dimensio

database - MySQL Indexing Keys Fields -

can explain me happen , best way create third table on next clausule. should : index (id), index (id_producto), index (id_usuario) be removed? create table producto ( id int not null auto_increment, precio decimal, primary key(id) ) engine=innodb; create table usuario ( id int not null auto_increment, nombre varchar(100) not null, primary key (id) ) engine=innodb; create table ordenes_productos ( id int not null auto_increment, id_producto int not null, id_usuario int not null, fecha_hora datetime not null, primary key(id, id_producto, id_usuario), index (id), index (id_producto), index (id_usuario), foreign key (id_producto) references producto(id), foreign key (id_usuario) references usuario(id) ) engine=innodb; thanks all. id int not null auto_increment, primary key(id, id_producto, id_usuario), index (id), index (id_producto), index (id_usuario), foreign key (id_producto)

c - Why is the offsetof macro necessary? -

i new c language , learned structs , pointers. my question related offsetof macro saw. know how works , logic behind that. in <stddef.h> file definition follows: #define offsetof(type,member) ((unsigned long) &(((type*)0)->member)) my question is, if have struct shown below: struct test { int field1: int field2: }; struct test var; why cannot directly address of field2 as: char * p = (char *)&var; char *addressoffield2 = p + sizeof(int); rather writing this field2offset = offsetof (struct test, field2); and adding offset value var's starting address? is there difference? using offsetof more efficient? the c compiler add padding bits or bytes between members of struct in order improve efficiency , keep integers word-aligned (which in architectures required avoid bus errors , in architectures required avoid efficiency problems). example, in many compilers, if have struct : struct imlikelypadded { int x; char

java - How to configure deployment servlet contexts using jersey test framework -

so trying use junit test apis exposed via jersey 2. have on tomcat server using following context.xml connect oracle db: /meta-inf/context.xml : <context> <resource name="jdbc/deliverydb" auth="container" type="javax.sql.datasource" username="usernamee" password="password" driverclassname="oracle.jdbc.oracledriver" url="someurl" maxtotal="3" maxidle="3" /> </context> and below junit code: @override protected testcontainerfactory gettestcontainerfactory() { return new grizzlywebtestcontainerfactory(); } @override protected deploymentcontext configuredeployment(){ return servletdeploymentcontext .forservlet(new servletcontainer( new resourceconfig( myresource.class ) .packages("provider_package") ) ) .cont

struct - how to access information in a file? C++ -

im having trouble 2 things, first in if statement choice c should take selected record file , change contents, not work reason file contents not change. in choice d need able read , add quantities , sales costs file , add them display them. im not sure start one. know need access info file, lines said data, add them , save them in variable displayed, how can access lines in file have data? #include <iostream> #include <fstream> #include <string> #include "stdafx.h" using namespace std; struct info { // create inventory items info string itemdescription; int quantity; double wholesalecost; double retailcost; string date; }; int main() { //make instance of info , variable user selection info item; char choice; // set functions long bytenum(int); void showrec(info); void changerec(info); //open file

python 3.x - using pyqtdeploy with homebrew installation of Qt5 -

i'm trying out pyqdeploy tutorial @ http://pyqt.sourceforge.net/docs/pyqtdeploy/tutorial.html . i'm working on imac, os 10.11, latest xcode installed, , homebrew installations of qt5.5.1, python 3.5, sip, , pyqt5. can run pyqtdeploy gui okay , seems fine until gets "make" step. @ point "make failed" warning. details read ld: library not found -lqtgui clang: error: linker command failed exit code 1 (use -v see invocation) make: ***[pyqtdeploy.app/contents/macos/pyqtdeploy] error 1 i've been banging head against wall several days now, i'd appreciate suggestions people might have this. lets try figuring out - i'm pure newbie here, have ideas, may helpful. so if try opening makefile project , search "lqtgui" string, find libs definition string, (in case): libs = $(sublibs) -f/users/aimsson/applications/qt/5.5/clang_64/lib -l/users/aimsson/desktop/pyqt_test/osx/python/lib/python3.4/site-packages -lsip -l/users/aimsson/de

html - JavaFX WebView doesn't display masked images in Sencha Touch app -

i working on javafx application uses javafx webview browser display sencha touch webapp. long story short, sencha touch application being accessed through different browser, in future needs accessed on device running javafx webview. makes things little convoluted, it's been pretty seamless transition. the issue i'm having comes our use of -webkit-mask-image css property. using property color number of buttons , other images fit in whatever coloring scheme being used. unfortunately, javafx webview seems pretty confused -webkit-mask-image , , images being distorted. i did homework , came this blog post describes how achieve effects similar -webkit-mask-image in other browsers, using svg's foreignobject. as per article, added following html sencha touch application see how render in javafx webview: <svg width="400px" height="300px"> <defs> <mask id="mask" maskunits="userspaceonuse" maskcontentunits

c# - Why am I getting, "Problemo Loading The designer encountered an error while loading the table definition." when trying to add a Local table? -

in visual studio community winforms app, added local (*.mdf) database. server explorer, right click tables folder , select "add new table" on design page get, " problem loading designer encountered error while loading table definition. " i can add ddl in t-sql pane directly: create table [dbo].[table] ( [id] int not null primary key [weekofassignment] datetime not null [talktype] int not null [studentid_fk] int not null foreign key [assistantid_fk] int not null foreign key [counselpoint] int not null ) ...but don't see "execute" button. how can create table i've got defined? btw: put "problemo" in title, because "problem" not allowed; and, after a, ("problem") is direct quote of err msg. update i'm thinking maybe need create table programmatically: string dbname = "ayttfmdatamdf"; using (var connection = new system.data.sqlclient.sqlconnection( "data s

Java Converting do-while loop with while loop -

i implementing simple sorting class, , wondering how implement using while loop rather do-while loop. the outer loop executed once each item in ‘names’ list. however, it’s do-while loop, executed @ least once. lead incorrect result if ‘names’ empty list. should replaced while loop. sort class public class sort { public static arraylist<name> sort1(arraylist<name> names) { arraylist<name> results; results = new arraylist<name>(); int count = names.size(); { name firstname = new name("zzz", "zzz"); (name name : names) { if (name.getfirstname().compareto(firstname.getfirstname()) < 0 || name.getfirstname().equals(firstname.getfirstname()) && name.getsurname().compareto(firstname.getsurname()) < 0) { firstname = new name(name.getfirstname(), name.getsurname()); } } results.add(first

synchronization - Efficiently synchronize streaming input with large SQL database -

i've got efficiency problem on hands , i'm looking ways solve it. here situation: i have streaming row-based data coming system online source, each unique id . i have sql database existing row-based data, indexed id . i need update sql database new data streaming in if differs existing data in database. the obvious solution is: read incoming row read corresponding row in database if data differs, update database the large number of round-trips making algorithm infeasibly slow. the alternative solution have read entire sql database memory, , compare new incoming data. eliminates round-trips memory required makes infeasible. so, alternatives have? split database multiple parts. (to address size issue) design algorithm cache of these database pieces memory. (speed) based on incoming id, hash query relevant database. if step 2 not possible achieved efficiently, wont work.

javascript - How to dynamically create HTMLElement and update innerHTML using window.setInterval -

i created following script countdown clock. want dynamically create htmlelement (span) , update innerhtml using window.setinterval; problem updating current date without creating new group of spans. this code: var countdownclock; (function (countdownclock) { var countdown = (function () { function countdown(id, enddate, message) { this.id = id; this.enddate = enddate; this.message = message; } countdown.appendchildelement = function (domnode, tagname) { var child = document.createelement(tagname); domnode.appendchild(child); return child; }; countdown.prototype.gettimeremaining = function (enddate) { var t = date.parse(enddate) - date.parse(new date().tostring()); var seconds = math.floor((t / 1000) % 60); var minutes = math.floor((t / 1000 / 60) % 60); var hours = math.floor((t / (1000 * 60 * 60)) % 24);

datagridview - Index was out of range. Must be non-negative and less than the size of the collection. but the column does exist -

i trying thought simple. take value 1 datagridview , add value in datagridview. here code. private sub deletebtn_click(byval sender system.object, byval e system.eventargs) handles deletebtn.click dim sl = saleslinestbldatagridview dim st = stocktbldatagridview dim sti integer = st.currentrow.index dim sli integer = sl.currentrow.index if sl.rowcount = 0 msgbox("no sales lines delete!", msgboxstyle.okonly) else dim delm = msgbox("are sure want delete sales line?", msgboxstyle.yesno) if delm = msgboxresult.yes stocktblbindingsource.filter = string.format("id = '" & sl.item(13, sli).value & "'") st.item(3, sti).value = val(st.item(3, sti).value) + val(sl.item(3, sli).value) st.item(5, sti).value = val(st.item(5, sti).value) + val(sl.item(3, sli).value) saleslinestblbindingnavigator.deleteitem.performclick() resetbtn.

mysql - Date = max(Date) Running Slowly -

i have 6 million records in historical_data table. trying find symbols last recorded row not equal highest date on table. believe query work takes forever run. long in fact, times out connection each time. there way make query run faster? select symbol, histdate historical_data histdate = (select max(histdate) historical_data b a.symbol = b.symbol); you want index query. best index historical_data(symbol, histdate) . you might find faster phrase query as: select hd.* historical_data hd join (select symbol, max(histdate) maxhd historical_data group symbol ) s on hd.histdate = s.histdate; edit: oops. sample query doesn't text says want. that: select symbol historical_data hd cross join (select max(histdate) maxhd historical_data) m group symbol, maxhd having max(hd.histdate) <> maxhd;

database - Swift Code ending during variable set -

i have following code, , reason when gets line let num = data[pagesleft] the code stops, , cant figure out why. it's not fatal error or anything, ends code execution complete. ideas why doing that? i have data variable @ top level access , when print it, looks right me. func passdata (passdata : [scheduleobject]) { data = passdata print(passdata.count) print(data) updatetemplate() } func updatetemplate() { pagesleft = data.count print(pagesleft) let num = data[pagesleft] let weekobj = num.weekobj weekobj.fetchinbackground() customername.text! = num.customername address.text! = num.customeraddress phonenumber.text! = num.customerphone openingweek.text! = globalfunctions().stringfromdateshortstyle(weekobj.weekstart) + " " + globalfunctions().stringfromdateshortstyle(weekobj.weekend) if num.confirmeddate != nil { openingdate.text! = globalfunctions().stringfromdateshortstyle(num.confirmeddate!)

Make absolute paths relative to the project root in Webpack -

i find need type ../ lot require() files. directory structure includes these: js/ components/ ... actions/ ... from components folder, need import foo '../actions/fooaction' . possible make root directory root of project? i.e. want import foo '/actions/fooaction' instead. tried setting webpack's resolve.root option, didn't seem anything. the resolve.root option not modifiy how file modules resolved. a required module prefixed '/' absolute path file. example, require('/home/marco/foo.js') load file @ /home/marco/foo.js. the / resolves root of file system. maybe want resolve js folder modules directory . webpack.config.js resolve: { root: path.resolve('./js') } with configuration added config file tell webpack resolve import or require relative js folder. then, instead of using import foo '../actions/fooaction' you able to: import foo 'actions/fooaction` mind lac

adal.js - authenticate to a Rest web api using Azure -

i have web api rest web service. web api, configure authenticate azure. now want call rest web service web page using angular. question how can access token can send ? thanks help. have seen sample? call azure ad protected web api in angularjs single page app in sample, there's single page application using angularjs, calls backend web api. i hope helps.

asp.net mvc - Entity Framework Mapping. Multiple Foreign keys -

i have 2 tables people relation ------------- ----------------- id (int) id (int) name (string) parentpeopleid (int) childpeopleid (int) i need people relation table union all. relation table has 2 foreign keys. , there 1 problem mapping them. mapping 1 many. people has many relation , relation has 1 people . i mapped them this: hasrequired(r=> r.people).withmany(p=>p.relation).hasforeignkey(r=>r.childpeopleid); so, how can map second foreign key? per each fk column in relations table should have navigation property in relation entity (this not mandatory, mandatory have @ least 1 navigation property between entities involve in relationship). in case have 2 relationships between people , relations , , navigation property represents 1 end in relationship. model way: public class relation { public int id {get;set;} public int parentpeopleid {get;set;} public int child

java - How do I solve GlassFish error 'Glassfish server runtime requires full JDK instead of JRE' while configuring GlassFish server? -

i going through strange problem dont know how fix. trying configure glassfish 4.0 in eclipse. when click on glassfish 4.0 server list , hit next, throws error stating: glassfish server runtime requires full jdk instead of jre i added jdk1.8.0_73 in eclipse, selected drop down. once select throws new error stating: this server runtime requires jre 1.7 or higher. i have jre1.8.0_66 in drop down, when select again goes previous error: glassfish server runtime requires full jdk instead of jre the error goes , forth whenever select jdk or jre , clueless on how proceed. can throw light on here? glassfish 4.0 not support java 8. with version of glassfish, need install select jdk 7. if want use jdk8, try installing glassfish 4.1 or newer, or replace compatible fork called payara .

How to test Branch.io in simulator? -

i'm scratching head how i'm supposed test branch.io integration on simulator. for link generation, i'm using javascript/web sdk instead of ios sdk. when click button 'view content in app' on landing page, generate link , follow it. all works great, when open jump page in simulator, never attempts open local app on phone has same bundle identifier. i guess might because current app store url box blank (because doesn't exist yet)... not sure how i'm supposed test if works if can't deeplink trigger locally. thanks! @tallboy, unfortunately simulator not fit testing deep links 2 reasons: there no app store on simulator, cannot see true redirect behavior the simulator not support universal links you're absolutely right -- can click link manually open app. in case, use our "deferred deep linking" mechanisms determine link clicked. method discussed in our documentation here . if have questions of this, please ask. can

Why there are two servers listed in websphere portal console -

when login websphere portal console , go under servers -> application servers --> see 2 servers listed: server1 , websphere_portal . why there 2 servers? there 1 portal server here. you're right there 1 portal server, there second server there. if recall correctly server1 runs admin console. doesn't have portal running on it. quote change notes version 8, in previous releases, needed start websphere application server server1 before can start websphere portal. server1 needed access websphere integrated solutions console http://infolib.lotus.com/resources/portal/8.0.0/doc/en_us/pt800acd001/overview/change_portal.html

node.js - Node child process can not run detached -

Image
i'm trying fork node child process with child_process.fork("child.js") and have alive after parent exits. i've tried using detached option so: child_process.fork("child.js", [], {detached:true}); which works when using spawn, when detached true using fork fails silently, not executing child.js. i've tried var p = child_process.fork("child.js") p.disconnect(); p.unref(); but child still dies when parent does. or insight appreciated. edit: node version: v5.3.0 platform: windows 8.1 code: //parent var child_process = require("child_process"); var p; try{ console.log(1) p = child_process.fork("./child.js") console.log(2) } catch(e){ console.log(e) } p.on('error', console.log.bind(console)) p.disconnect(); p.unref(); //to keep process alive settimeout(() => { console.log(1); }, 100000); -- //child var fs = require("fs"); console.log(3); fs.writefilesync("test.t

Expand Youtube video when the play button is clicked -

i want embed videos on tumblr http://wealhwealh.tumblr.com/ , block sizes 250x141. when start video, looks this: https://jsfiddle.net/pp4p1efw/ i want video expand when user clicks on play, or on hover. thanks! here's tumblr html video: <video tabindex="-1" class="video-stream html5-main-video" style="width: 250px; height: 141px; left: 0px; top: 0px; transform: none;" src="blob:https%3a//www.youtube.com/48ae4f07-e8b1-4cf0-8890-5a896b7c1c82"></video>

php - Symfony custom routing -

i'm using routing annotations in symfony2 project , need implement new feature. need generate page depends on current city. city passed in actions this: /** * @route("/") * @route("/{name}" */ and need custom requirements city parameter. want match route if passed city contained in dynamic array loaded database, in other case shoud go next route, without throwing exception. i tried use requirements, not figured out how pass object that. expressions same problem, need pass service don't know how. you can try using annotation param converter. use sensio\bundle\frameworkextrabundle\configuration\route; use sensio\bundle\frameworkextrabundle\configuration\paramconverter; /** * @route("/city/{name}") * @paramconverter("city", class="appbundle:city", options={"entity_manager" = "foo"}) */ public function showaction(city $city) { } else, guess can in controller. but please, note using

RethinkDB, add derived columns on result -

i can seem via map+merge map( function(row) { return row.merge( { newcol: 'abc' } ); }); problem if want lookup static map e.g. var lookup_map = {key1: {text: 'key 1'}}; then below doesn't work map( function(row) { return row.merge({ newcol: lookup_map[row('key')].text }); }); row('key'); seems lazily evaluated. idea how this? you can use sth this: var lookup_map = {key1: {text: 'key 1'}}; r.db('salaries').table('salaries') .map( function(row) { return row.merge({ newcol: r.expr(lookup_map)(row('key'))('text') }); });

Using tkinter and python to control arduino -

i have posted question before, , user enough answer it. used suggestions , found code not working @ all, after researching , tinkering it, came impasse. here want do: i want control 2 arduinos using serial connection between arduinos , raspberry pi , using python control them. using gui interface , tkinter library create buttons. the original problem information go through arduino when user stopped pressing button , needed information sent button pressed , continuously until button released. member suggested using lambda. although did not work proposed, feel might have had right idea, here code came after suggestion. import serial running = true ser = serial.serial('/dev/ttyusb0') def send_data(self): if self.char not none: ser.write(self.char) #run again in 100ms. here control how fast #to send data. first parameter after number #of milliseconds wait befor calling function self.job=self.after(100,self.send_data) class application(fram

c# - Autofill with REST API in windows 8.1 phone app -

i implementing city search want autofill functionality when select city want id sent api. populate other fields. private async void autosuggestbox_textchanged(autosuggestbox sender, autosuggestboxtextchangedeventargs args) { if (args.reason == autosuggestionboxtextchangereason.userinput) { string text = sender.text; if (text.length >= 3) { getcities(text); sender.itemssource = await task<string[]>.run(() => { return this.getsuggestions(text); }); } else { sender.itemssource = new string[] { "no suggestions..." }; } } } my response class private async void getcities(string city) { try { string baseaddress = url.url + "searchcities?q="+city+"&access_token=" + tcm;

Configuring node from hub machine Automatically using selenium Grid -

i want set node in different machines using bit of java code not possible start node every time want open nodes automatically hub machine.i tried of executable jars selenium-grid-extras it's not useful. if want start node automatically hub, can write bit of code to start hub starting nodes based on machine details node should execute. can use ssh start node on linux instance. there libraries available doing in java. windows not sure, there should libraries remotely start applications through java. hope helps.

html - Jquery Color Mixer Plugin -

i need color mixer in jquery in can mix 3 color % wise example like: finaloutput=green(20%)+yellow(40%)+ red(%40%) i need please me. thanks idea 1 if use rgb colors : create function calculates colors. eg. red 100% = 255, green 100% = 255, blue 100% = 255. need distribution of 1% , 2.55 color. for ui you, cool slider demo here (the first slider). idea 2 if rather use developed colorpicker. eg. eyecon , spectrum .

Trouble using timer class in C# -

basically i'm trying implement timer in class would-be first game in c#; want use timers update player , provide periodic feedback, can't seem 'timer' class work correctly. if use in loop (as shown below), wait 2 seconds, , keep writing "you're alive!" console 0 delay in-between; , if not use loop, application ends instantly. using system; using system.timers; public class myclass { public static void mytimer_elapsed(object sender, elapsedeventargs e) { console.writeline("you're alive!"); } public static void main(string[] args) { while (true) { timer mytimer = new timer(); mytimer.interval = 2000; mytimer.enabled = true; mytimer.elapsed += new elapsedeventhandler(mytimer_elapsed); mytimer.start(); } } just add below line after mytimer.start(); console.readline(); static void main(string[] args) {

Pairing among the members in same list in java -

in problem statement, have 'n' number of families 'n' number of family members. eg: john jane (family 1) tiya (family 2) erika (family 3) i have assign members in such way person should not pair family member. , output should be: john => tiya jane => erika tiya => jane erika => john i have created object person(name ,familyid, isallocated) . created list , added personname_id in this. i thinking use map association. john_1 key , tiya_2 value. i failing associate pairs through map. how can shuffle members list. also, nice if suggest me better solution. code: getting person: public static list getperson() { scanner keyboard = new scanner(system.in); string line = null; int count = 0; list <person> people = new arraylist<>(); while(!(line = keyboard.nextline()).isempty()) { string[] values = line.split("\\s+"); //system.out.print("entered: " + arrays.tostring(values

javascript - about php full calendar -

Image
when click on item in calendar show particular task. after 1 second calendar disappear. want show task without disappearing. when add function call calendar according item, problem has started. this code jquery { guyid = ""; $('.guyid').click(function (){ this.guyid = $(this).attr('id'); // alert('test:'+this.guyid); calendercall(this.guyid); }); function calendercall(guyid){ //alert(guyid); $('#calendar').fullcalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,basicday' }, editable: true, eventlimit: true, // allow "more" link when many events events: [ { title: guyid, start: '2016-02-04' },

xml - My EditTextPreference is not updaing after adding string to Dialog -

i've added edittextpreference settings.xml code below <edittextpreference android:key="prefdeviceuser" android:title="user name" android:summary="please add user name." /> when run dialog box appears when add name doesn't update , still says 'please add..' have left out? please create own edittextpreference. achieve result need override getsummary method. public class edittextpreference extends android.preference.edittextpreference{ public edittextpreference(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); } public edittextpreference(context context, attributeset attrs) { super(context, attrs); } public edittextpreference(context context) { super(context); } @override public charsequence getsummary() { string summary = super.getsummary().tostring(); return string.format(summary

node.js - Postgres debian server deploy error: no pg_hba.conf entry for host -

i've installed postgres on vpn (debian 7.0). if i'm running node.js server locally , connecting remote pg, works absolutely perfect. when i'm repo vpn , trying run node.js server there, i'm receiving error: error fetching client pool { [error: no pg_hba.conf entry host "111.111.11.111", user "postgres", database "production", ssl off] 111.111.11.111 - ip of vpn, pg database , node.js server should running. here pg_hba.conf host all 222.222.222.2/24 trust # database administrative login unix domain socket local postgres peer # type database user address method # "local" unix domain socket connections local peer # ipv4 local connections: host 127.0.0.1/32 md5 # ipv6 local connections: host ::1/128 md5 # allow

delphi - Login OK to site with TwebBrowser , but not with TidHTTP -

may ask little using indy login website please? firstly, 'proof of concept' used twebbrowser test credentials in following manner ... procedure tfrmmain.cxbutton1click(sender: tobject); begin webbrow.navigate('http://assurance.redtractor.org.uk/rtassurance/services.eb'); end; procedure tfrmmain.webbrowdocumentcomplete(asender: tobject; const pdisp: idispatch; var url: olevariant); var currentbrowser: iwebbrowser2; topbrowser: iwebbrowser2; document: olevariant; doc3 : ihtmldocument3; frm : ihtmlformelement; begin currentbrowser := pdisp iwebbrowser2; topbrowser := (asender twebbrowser).defaultinterface; if assigned(currentbrowser) , assigned(topbrowser) begin if currentbrowser = topbrowser begin doc3 := currentbrowser.document ihtmldocument3; webbrow.ondocumentcomplete := nil; // remove handler avoid reentrance doc3.getelementbyid('el9m9aqxil51ji3_loginpnl_username').setattribute(

javascript - from 1 d3.select hide another div -

i have 2 different divs having different id's #context-menu & #create-context-menu d3.select('#context-menu') .style('display', 'inline-block') .on('mouseleave', function() { d3.select('#context-menu').style('display', 'none'); context = null; }); i want hide #context-context-menu div, not onmouseleave --> d3.select want hide div( #create-context-menu ). d3.select('#context-menu') .style('display', 'inline-block') .on('mouseover', function() { //to hide div id create-context-menu d3.select('#create-context-menu').style('display', 'none'); //or //d3.select('#create-context-menu').style('opacity', 0); }); note: div id context-menu inside mouseover function, can use d3.select(this)

jasper reports - How can I show sum of columns in column header? -

Image
i have design jasper report in ireport 5 tool following constraints: i need show sum of each column in header in image i need show columns vertical in image desired output is possible design report this? using normal detail band , columnheader band achieved creating variable calculationtype="sum" on field sum see: how sum values in column in jaspersoft ireport designer? then display variable using textfield in columnheader band, setting evaluationtime="report" variable calculated before displaying it. to rotate textelement vertical use rotation attribute ( rotation="left" ) example: <?xml version="1.0" encoding="utf-8"?> <jasperreport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jas

asp.net mvc - Issue with data show columns in mvc table -

Image
i have table displays data. have added data-show-columns="true" table. and table likes below. when want hide created date column. table header hides , content in same there. working fine other columns first name , email , below table code. <table class="table table-hover table-bordered" id="table-candidates" data-show-columns="true" data-sort-name="createddate" data-toolbar="#candidate-list-table-toolbar" data-sort-order="desc" data-show-export="true" data-filter-control="false" data-show-multi-sort="false"> <thead> <tr> <th data-field="createddate" data-sortable="true" data-formatter="formatdate">created date</th> <th data-field="fullname" data-sortable="true" data-formatter="formatcandidatefullname">full

how to forward specific log file to a remote rsyslog server -

i have cassandra node (192.168.122.3) , rsyslog server(192.168.122.2). on cassandra node, cassandra dumps log files in /var/log/cassandra/cassandra.log. want pull cassandra.log file remote server(rsyslog server) in /var/log/ directory. how ? $modload imfile #load imfile input module $inputfilepollinterval 10 $inputfilename /var/log/cassandra/cassandra.log $inputfiletag cassandra-access: $inputfilestatefile stat-cassandra-access $inputfileseverity info $inputrunfilemonitor $template cas_log, " %msg% " if $programname == 'cassandra-access' @@remote_server_address:port;cas_log if $programname == 'cassandra-access' stop follow following steps: 1) go /etc/rsyslog.d 2) create empty file named cas-log.conf 3) copy above mentioned code , paste this(cas-log) file. note: replace destination rsyslog server ip/name in second last line remote_server_address & port. 4) restart rsyslog. 5) on sever side can see logs in /var/log/sys

MySQL 5.7.11 mysql_secure_installation don't work -

linux version: ubuntu 14.04.1 lts server version: 5.7.11 mysql community server (gpl) download link below: http://dev.mysql.com/downloads/repo/apt/ when try run mysql_secure_installation set password , reload tasks done. when try login mysql, doesn't require password root user. >>>mysql mysql> select * user; +-----------+-----------+-------------+-------------+-------------+---- ---------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+--------------