Posts

Showing posts from August, 2014

MySQL query to search in between two time range between two dates using timestamp data -

i have timestamp values in db. has values 2014-11-25 10:30:00. need records between 2 dates , has time between range between 2014-10-20 2014-11-25 , between 9am 7pm.. i need query this... you can use internal mysql functions convert datetype. i think need date() , time() functions. details can find here

html - javascript function crashes my browser -

i coded simple program take 2 textareas , combine every single line of 1 textarea lines in second textarea , browser crushes after 6000 lines. resul of check needs 100,000 lines. this javascript code: function go() { var lines1 = $('#text1').val().split(/\n/); var lines2 = $('#text2').val().split(/\n/); var textarea1 = []; var textarea2 = []; var textarea3 = []; (var = 0; < lines1.length; i++) { if (/\s/.test(lines1[i])) { textarea1.push($.trim(lines1[i])); } } (var j = 0; j < lines2.length; j++) { if (/\s/.test(lines2[j])) { textarea2.push($.trim(lines2[j])); } } (var k = 0; k < lines1.length; k++) { (var q = 0; q < lines2.length; q++) { textarea3.push($.trim(lines1[k] + ' ' + lines2[q])); var msg = textarea3.join("\n"); document.getelementbyid('text3').value = msg; } } }

android - binary xml error in pagersliding tab script -

my xml file following impotred library github .i want 2 tabs showing events. <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#f5f5f5" > <com.astuetz.viewpager.extensions.pagerslidingtabstrip android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="48dip" /> <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/tabs" > </android.support.v4.view.viewpager> </relativelayou

Calculate days in between given start date and end date in php -

i have $start_date & $end_date. i need find out number of days name's of days. i tried following code snipet : $start_date = '20-07-2012'; $end_date = '22-07-2012'; $start = strtotime($start_date); $end = strtotime($end_date); $interval = 2; $out=''; $int = 24*60*60*$interval; for($i= $start;$i<= $end; $i += $int ){ echo date('d-m-y',$i).'<br />'; } output : 28-11-2014 30-11-2014 but expected out : 28-11-2014 => friday 30-11-2014 => saturday let me know should php code yeild expected output. // $array[desc:day count starting w 1][desc: 'date' or 'day']; // $array[2]['day']; <?php $start = '27-11-2014'; $end = '1-12-2014'; function date_difference($start, $end) { $first_date = strtotime($start); $second_date = strtotime($end); $offset = $second_date-$first_date; $result = array(); for($i = 0; $i

mysql - upload and show(select) video in php -

i make form through can upload images , videos, file's stor in folder , path stored in mysql table, when select image file show properly, image selection code is... $smt=$conn->prepare('select * post'); $smt->execute(); <?php while($gdata=$smt->fetch(pdo::fetch_obj)):?> <a href="#" class="media-left col-md-4 clearfix"><img src="posts/<?php echo $gdata->post_path; ?>" alt="image" class="post-image"/></a> <div class="media-body col-md-8 post-image-space pull-left"> <div class="post-overview"> <ul> <li class="post-category"><?php echo $gdata->category;?></li> <li class="post-timestemp">post on <?php echo $gdata->post_date;?></li> </ul> <a href="post-descr

performance - Calculate execution time of a program based on CPI, instructions, etc -

i'm trying calculate execution time of application. assuming stall penalty occurs on memory access instructions (100 cycles being penalty). how supposed find out execution time in seconds info? cpi (cpucycles?) = 1.0 clockrate = 1ghz totalinstructions = 59880 memoryaccessinstructions = 8467 cachemissrate = 62% (0.62) (5290/8467) cachehits = 3117 cachemisses = 5290 cachemisspenalty = 100 (cycles) assuming no other penalties. totalcycles = totalinstructions + cachemisses * cachemisspenalty ? i assume cache hits cost same other opcodes, included in totalinstructions. that's 588880 cycles, 1ghz 1000000000 cycles per second. code take 0.58888ms execute (5.8888e-7 second). this value of course purely theoretical estimate, modern cpu doesn't work (1 instruction = 1 cycle). if interested in real world values, profile it.

ios - cannot find interface declaration for 'NSObject', superclass of 'GPXType' -

Image
i have done research on issue , have not found similar yet. i using ios gpx framework draw path on map using gpx file. have import ios gpx.framework on project. have face issue. please guide me, if has advice... just modify header file, add line on top of file #import <foundation/foundation.h> seems thought have pch file, foundation , uikit imported, xcode 6 removed pch default support, problem came. (see previous answer )

c++ - Random number generator help needed -

i using random number generator in code randomly select if process fails or not. trying use large range of numbers make fail rate low far keeps coming true every time. how fix this? //random number generator int crash_chance(double dis) { int chance; chance = 0; while (chance < (dis/100), chance++){ int x = rand() % 1000000000000 + 1; //generate integer between 1 , 1000000000000 return x; } } edit: even when fix code move return outside of loop, still indicates crash. i'll add code calls function, requested. rand = crash_chance(d); bool crash; if (rand = 1){ crash = true; }; if (rand != 1){ crash = false; }; **edit 2 ** code below cannot fixed? #include<iostream> #include<cmath> #include<vector> using namespace std; //the 3 functions below ask user required input. double altitude(){ double alti; cout << "please input change in altitude in meters:"; cin >> alti; return alti; } double roc() { double climbr; c

bash - How to use DATE command with an external variable? -

i'm working on time convertion script. supposed this: echo $(( ($(date -d '00:10:2.00' +%s) - $(date -d 0 +%s) ) )) this line working fine giving me result 602 but want put the first part of date string ( 00:10:2.00 ) under a) command line argument read $1 like: echo $(( ($(date -d '$1' +%s) - $(date -d 0 +%s) ) )) or variable: echo $(( ($(date -d '$myvariable' +%s) - $(date -d 0 +%s) ) )) when i'm trying this: foo="00:10:2.00" echo $foo echo $(( ($(date -d '$foo' +%s) - $(date -d 0 +%s) ) )) all is: 00:10:2.00 date: invalid date `$foo' -1417042800 so it's echoing aint working time command... variables expanded inside double quotes, they're not expanded inside single quotes. use date -d "$1" +%s

css - Dropdown not working in Contact Form 7 -

i have added contact form using plugin contact form 7 drop-down area. http://www.edsys.in/contact/ 1 the trial software field has dropdown.but s not displayin properly. t searched on net , applied following css: select { background: transparent; width: 268px; padding: 5px; font-size: 16px; line-height: 1; border: 0; border-radius: 0; height: 34px; -webkit-appearance: none; } ...but didnt work. i need this: http://www.zebraprintandcopy.com/upload-file/ when checked source code, couldn't find helpful styles. thanks in advance!! edit: this code have added dropdown in form: <p>trial software of : <br />[select* dropdown multiple "test1" "test2" "test3" "test4"]</p> i think have uncheck option "allow multiple answers" when create field. or can remove "multiple" option tag.

java - How to specify an item in an object array within an object array? -

i have object array named objects i've used loop create 5 new object arrays within it. print contents this: system.out.println(arrays.tostring((object[]) objects[1])); returns: [1, 1, 3] these contents of second array, return 3, how so? try this: object[] temparr = (object[]) objects[1]; system.out.println(temparr[temparr.length - 1]); hope helps...

jquery - How parsing xml from url get attribute javascript -

i need parsing xml url url xml <?xml version="1.0" encoding="utf-8"?> <exchangerates> <row> <exchangerate ccy="rur" base_ccy="uah" buy="0.33291" sale="0.33291"/> </row> <row> <exchangerate ccy="eur" base_ccy="uah" buy="18.60253" sale="18.60253"/> </row> <row> <exchangerate ccy="usd" base_ccy="uah" buy="14.97306" sale="14.97306"/> </row> </exchangerates> i whant attribute using "14.97306" convert currency (like mycurrency = 10 ) (like usd = 14.97306 ) (mycurrency * usd = 149.7306) here's rudimentary setup java. you'll need read on xpath queries, , need add exception handling etc. i'm sure started. // open url url url = .... inputstream = url.openstream(); // build document parser documentbuil

javascript - Reverse animation on a second click -

i have submenu elements has on click, slide out spread out fill space. on second click i'd animation reverse before sliding in, jquery knowledge isn't enough achieve this. can please? my js: $('.box').click(function(){ var flag = $(this).data('flag'); $('.tab1').toggle("slide", { direction: "left"}, 500); $('.tab2').toggle("slide", { direction: "left" }, 500); $('.tab3').toggle("slide", { direction: "left" }, 500); $('.tab1').animate({top: (flag ? '+=50px' : '-=50px')}); $('.tab3').animate({top: (flag ? '-=50px' : '+=50px')}); $(this).data('flag', !flag) }); jsfiddle the animations element run after previous 1 has finished, @ moment left slides run , when has finished, vertical animation kicks in. when flag true, want vertical animation run first. need vertical animat

python - Using PyCharm Professional and Vagrant, how do I run a Django server? -

i have set configuration run server remotely. when click run, see command used: ssh://vagrant@localhost:2222/usr/bin/python -u "c:/users/myname/projectname/config/manage.py" runserver localhost:8080 (i've replaced directory names anonymity reasons). when run this, fails (obviously) because it's using windows path manage.py error is `/usr/bin/python: can't open file 'c:/users/myname/judgeapps/config/manage.py': [errno 2] no such file or directory what can't figure out after extensive googling, how force django use path on vagrant machine. how can go doing this? the trick creating python interpreter in pycharm, , configuring project use interpreter. note: following applies pycharm professional 4.0. create python interpreter vagrant start vagrant machine pycharm navigating tools->vagrant->up ssh vagrant box: tools->start ssh session . select vagrant @ [vagrantfolder] list appears. from terminal appears, run which

CSS Styling won't work in outlook? -

i use styling in outlook. style not work. border-radius: 5px; could please me? try this: <style type="text/css"> padding: 5px 10px; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px; -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0; -moz-box-shadow: rgba(0,0,0,1) 0 1px 0; box-shadow: rgba(0,0,0,1) 0 1px 0; text-shadow: rgba(0,0,0,.4) 0 1px 0; color: white; font-size: 14px; font-family: georgia, serif; text-decoration: none; vertical-align: middle; mso-line-height-rule: exactly; </style>

gorm - Transactional backgorund jobs with grails -

is possible enforce transactionality in background job jesque grails? im using jesque-grails plugin can inyect other services including gorm ... may mark job @transaction , expect payload executed in isolated transaction rollbak on failure? @transactional works on controllers , services (though it's use on controller actions not recommended). don't know if work on jesque jobs, should pretty easy find out, i.e. save something, throw runtimeexception , see if saved data rolled back. if can't annotate method @transactional instead wrap method in withtransaction

visual studio 2010 - Can we read dbisam .dat files through vb.net -

i using 3rd party account software uses dbisam database , have tables .dat extension. is there way read dbisam tables in vb.net? i getting quite difficult read dbisam in visual basic, there guide of tip available, please provide input. here code tried nothing working dim contents new stringbuilder() dim enc encoding = new asciiencoding() 'fldatfile source of .dat file using fstream filestream = new filestream(fldatfile, filemode.open, fileaccess.read) ' maximum bytes read. dim toread int32 = 1024000 ' 1kb ' buffer read bytes. dim buffer(toread - 1) byte ' number of bytes have been read. dim read int32 = fstream.read(buffer, 0, toread) ' while there data has been read while read > 0 ' string byte array. msgbox(enc.getstring(buffer, 0, read)) ' read next batch of data buffer. read = fstream.read(buffer, 0,

why left+(right-left)/2 will not overflow? -

in article: http://googleresearch.blogspot.sg/2006/06/extra-extra-read-all-about-it-nearly.html , mentioned quick sort algorithm had bug (left+right)/2, , pointed out solution using left+(right-left)/2 instead of (left+right)/2 . solution given in question bug in quicksort example (k&r c book)? my question why left+(right-left)/2 can avoid overflow? how prove it? in advance. you have left < right definition. as consequence, right - left > 0 , , furthermore left + (right - left) = right (follows basic algebra). and consequently left + (right - left) / 2 <= right . no overflow can happen since every step of operation bounded value of right . by contrast, consider buggy expression, (left + right) / 2 . left + right >= right , , since don’t know values of left , right , it’s entirely possible that value overflows.

sql server - Update date to a specific format tsql error -

i need add current date , existing data table , date needs in specified format 'ddmmyyyy'. column in table of datatype 'date'. my approach follow error conversion failed when converting date and/or time character string. code declare @datenow varchar(10) set @datenow = replace(convert(varchar(10), getdate(), 103), '/', '') update usertable set datecreated = convert(date, @datenow, 104) employeenumber = 'emp00001' i bit rusty in sql sorry if approach seems silly regards why converting datetime returned getdate() varchar(10) first, , date ?? seems utterly point- , needless.... try instead: declare @datenow date set @datenow = cast(getdate() date) update dbo.usertable set datecreated = @datenow employeenumber = 'emp00001' and sql server nice enough not require of converting @ - work fine, too: update dbo.usertable set datecreated = getdate() -- or preferably: sysdatetime() employeenumber = '

java - Getting an index from an array and converting it -

i novice programmer , stuck ages. have got array of strings , wanted hold of last word after splitting 5 words , converting interger array of strings. have tried out not close working. please how do this? :(. thanks string failsome = "tests run: 12, failures: 4"; string[] words = failsome.split("\\s+"); (int = 0; < words.length; i++) { integer.parseint(words[4]); system.out.println(words[i]); } i hope, understood want split failsome, store in string array , want convert last value of array int, then display i hope work you, string failsome = "tests run: 12, failures: 4"; string[] words = failsome.split("\\s");//splitting goes here int lastindexofarray=(words.length)-1; int value=integer.parseint(words[lastindexofarray]); system.out.println(value);//if want print converted value output : 4 thanks

javascript - How to control a HTML5 website through Kinect v2? -

i'm trying build html5 website can controlled through kinect v2, meaning navigation through pages, pushing buttons, playing videos, etc. able start project kinect v1 using zigfu requirements of project changed , have use kinect v2. zigfu not compatible kinect v2. have other suggestions, should use in order achieve this? thanks i think not possible, way can use javascript api kinect v2 in winjs store app. try embed web browser on app. check this: https://social.msdn.microsoft.com/forums/en-us/c285b9ae-a8d3-4ed7-bcf6-0b05b03deebf/developing-with-javascript-vs-wpf-c?forum=kinectv2sdk

Arranging auxiliary tasks for a Haskell project -

there repetitive auxiliary tasks have run when developing or testing project. example: downloading data, setting database, cleaning logs, etc. in ruby land, handled rake while other languages prefer make or else (tasks depend on other tasks, may need 1 task perform subtasks depends on). so, is there conventional way organize tasks in haskell project? i assume cabal used that, not of auxiliary tasks running haskell code: it's case of performing rm -r logs/*.log or downloading data wget or curl . make sense make cabal's test target depend on other cabal targets that, ugh, run shell scripts/commands haskell code? (if it's possible have dependent targets in cabal @ all?) alternatively, use make , "an average haskeller" (an "outside" project contributor, example) find intuitive? believe 1 first try cabal test before discovering requires setting database testing first, running whole chain of other tasks. 1 notice makefile in first place? i

How to write ArrayList Objects into text file in java -

i'm trying output arraylist text.file, arraylist has 2 object,librarybook , book. how can print 2 objects text.file? there 4 classes related write text.file. help! class book { // declare data members protected int bookid; protected string bookname; protected boolean isavailable; private int borrowerid; public static int totalnoofbook = 0; public static int totalnoofavailablebook = 0; // constructor private book() { // initialization bookname = ""; isavailable = true; totalnoofavailablebook++; } public book(string name) { this(); // initialization bookid = totalnoofbook; bookname = name; totalnoofbook++; } // methods // borrow book public void borrow(librarycard card) { isavailable = false; borrowerid = card.getcardid(); card.incrementborrowednum(); totalnoofavailablebook--; } // print book in

android - Changing fragment from Navigation drawer -

i having exact same problem op here: how change fragments using android navigation drawer also using template navigation drawer activity in android studio. i tried dreagan's answer, stuck cycle of errors. here code import android.app.activity; import android.app.actionbar; import android.app.fragment; import android.app.fragmentmanager; import android.app.fragmenttransaction; import android.content.context; import android.os.build; import android.os.bundle; import android.view.gravity; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.support.v4.widget.drawerlayout; import android.widget.arrayadapter; import android.widget.textview; public class mainactivity extends activity implements navigationdrawerfragment.navigationdrawercallbacks { /** * fragment managing behaviors, interactions , presentation of navigation drawer. */ pri

How to get log from remote JMeter Node (jmeter-server)? -

i'm new jmeter , got problem - wasn't able jmeter log if i'm using jmeter remote node. i'm starting jmeter maven plugin, command looks like: jmeter -n -t my_settings.jmx -l my_result.jtl -r -r <ip_of_remote_node> -x and on remote node i'm starting jmeter server command like: ./jmeter -djava.rmi.server.hostname= -dserver_port=1099 -s in logs of our product , in logs of jmeter see testing going correctly, in case 'my_result.jtl' file empty, expecting remote node should send logs , 'master' should put 'my_result.jtl', seems got wrong. could please advise - possible in case *jtl report remote node? or @ least point remote node put *jtl report. the last message in jmeter log (not jtl) of 'master' node (from i'm running mvn plugin) is: jmeter.jmeter: remote engines have been started

java - Getting values from JOptionPane and using them to create a new instance of a class -

i want retrieve user values joptionpane, want use values parameters creation of new instance of class. code: protected void addcar() { string[] size = {"large","small"}; string[] value = {"valuable","not valuable"}; jtextfield regnum = new jtextfield(); jlist carsize = new jlist(size); jlist carvalue = new jlist(value); carvalue.getselectedvalue(); system.out.println(carsize.getselectedvalue()); object[] fields = { "registration number", regnum, "car size", carsize, "car value", carvalue }; joptionpane.showoptiondialog(rootpane, fields, "wish continue?", joptionpane.default_option, joptionpane.yes_no_option, null, null, regnum); }//end addcar you can user input components passed showoptiondialog() after has returned. one thing note: 4th parameter of showoptiondialog() option type should yes_n

php - Magento Customer Module Override is not working -

i want override magento custom account my folder structure like local practise coreextended controllers frontend customer accountcontroller.php etc config.xml and accountcontroller.php <?php require_once mage::getmoduledir('controllers', 'mage_customer').ds.'accountcontrollerq.php'; //we need add 1 since magento wont recognize automatically class practise_coreextended_frontend_customer_accountcontrollerextends mage_customer_accountcontroller {//here, extended core controller our public function indexaction() { die('here1'); parent::indexaction(); //you can use default functionality } public function myactionaction() { die('here2'); //my code //you can write own methods / actions } public function mymethod() { die('here3'); //my code

javascript - Bootstrap stateful button not working as expected -

i trying bootstrap button show "loading..." while time consuming function (fetching data external source) executed. interestingly, reference implementation using settimeout works perfectly. it seems me somehow $(button).button('loading') command executed after function closes , settimeout works around waiting in background. how can replicate result of settimeout command code something? jsfiddle demonstrating problem. here html code: <button type="button" class="btn btn-warning" id="comb" data-loading-text="loading..." autocomplete="off" onclick="comb()">combinations</button> <button class="btn btn-primary" id="timer" data-loading-text="loading..." autocomplete="off" onclick="timer()">set timeout</button> and here javascript: function combinations(str) { var fn = function (active, rest, a) { if (!active &

mqtt - Mosquitto library usage with iOS -

i trying use mqtt protocol , amateur this. tried objective-c code on mosquitto library using mqttkit ( https://github.com/jmesnil/mqttkit ). i able use publish messages test servers , things working fine still have basic questions, not clear me: does mosquitto library include web sockets underneath? is possible create connection, subscribe topic , server can publish messages device realtime behavior? in other words, can use real time communication between server , client (the ios device in case) bidirectional? the mosquitto library not support websockets, mqtt only. yes, mqtt bidirectional protocol. believe there difficulties keeping long term socket open on ios mean isn't straightforward support might like. i'm not familiar ios @ though.

How to create bandwidth usage aggregation for each user in kibana -

Image
i want create plot/table of each user bandwidth usage. how do in kibana? have sent byte , receieved bytes each user. in short want output of select users, sum(sentbyte + receievedbyte) table_name group users order users desc kibana : updated question : today, came know there no support of aggregation in kibana 3.x version. have use kibana 4.x. have used following form of request elastic search , gives desired result. how represent in graphical form in kibana 4 beta 2? post logstash-2014.12.02/_search { "size": 0, "aggs": { "group_by_bandwidth": { "terms": { "field": "user", "order": { "totalbandwidth": "desc" } }, "aggs": { "totalbandwidth": { "sum": { "script" : "doc['rcvdbyte'].value + doc['sentbyte'].value" }

Meteor connect to DB problems -

we trying meteor framework , in different environments have problems connections mongo database, hosted on external server. problem occurred when rebooted laptop (debian linux). after reboot application cannot read or insert in database , no errors thrown. can access database robomongo shell. also, have autopublish on. how can debug/fix this? try exporting mongo_url before starting application. export mongo_url="mongodb://myserver:27017/db_name"

ios - A custom view in between table view cells -

i wish display custom view in between table view if particular cell's attribute matches condition. this row 1 row 2 row (n) (matches condition) --------------------------- (custom view) row (n+1) row (n+2) i using tableview , tableviewdelegate in viewcontroller you need tabledatasource delegate. return cell class, depending on condition of object in source array in tableview cellforrowatindexpath: method of table delegate. -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ myobjectclass * objectfromarray = [sourcearray.objectatindex: indexpath.row]; if(condition on myobjectclass or index row){ static nsstring *myidentifier = @"myreuseidentifier"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:myidentifier]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:myidentifier]; } return cell; } }else{

javascript - getting jquery fields from a List -

in below jsp code fields hard code can fields using loop list may grow dynamically list list=[userid,firstname,lastname,email]; for every new request list may grow or shrink dynamically depends on columns of table present in database ,so there way field name without hard coding.. <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <!-- include 1 of jtable styles. --> <link href="css/metro/crimson/jtable.css" rel="stylesheet" type="text/css" /> <link href="css/jquery-ui-1.10.3.custom.css" rel="stylesheet" type="text/css" /> <!

Transforming puzzle written in pure javascript to javascript using jquery -

javascript script: function move(cellid, cell) { if (cellid==emptycell) return; rest = cellid % 5; toppos = (cellid>5) ? cellid-5 : -1; bottompos = (cellid<21) ? cellid+5 : -1; leftpos = (rest!=1) ? cellid-1 : -1; rightpos = (rest>0) ? cellid+1 : -1; if (emptycell!=toppos && emptycell!=bottompos && emptycell!=leftpos && emptycell!=rightpos) return; cell1 = document.getelementbyid(emptycell); img1 = cell1.firstchild; img = cell.firstchild; cell.removechild(cell.firstchild); cell1.removechild(cell1.firstchild); cell.appendchild(img1); cell1.appendchild(img); emptycell = cellid; } html: <table> <tr> <td id="1" onclick="move(1,this);"></td> <td id="2" onclick="move(2,this);"></td> <td id="3" onclick="move(3,this);"></td> <td id="4" onclick=&quo

sql - create a trigger on a view -

i have time-dependent view uses now() function , hence changes values passage of time. simplistic code below: drop view if exists av; drop table if exists a; create table (when_epoch_seconds integer, x varchar); insert a(when_epoch_seconds, x) select cast (extract (epoch now()) int), 'x'; create view av cte (select max(when_epoch_seconds) latestentry a) select cast (extract (epoch now()) int) - cte.latestentry > 5 too_old cte; select too_old av; my question how can create trigger continuously monitors value of column too_old in view av and, e.g., inserts row in "notifications" table whenever value flips true false or vice-versa? or there maybe other mechanism that's more suited accomplishing same effect? a view "virtual" table, meaning reflects values stored 1 or more tables. trigger set of instructions executed when specific event (insert, delete, etc) happens on table. how can create trigger continuously monitors valu

linux - list username and SIP number for users Asterisk -

i have installed asterisk , have file users.conf want create shell script can list usernames , sip number the users listed in file shown below: [6001] type=friend host=dynamic dtmfmode=rfc2833 disallow=all allow=ulaw fullname = john doe username = jdoe secret=secret context = work you can use simple regexp this: grep -e '\[[0-9]+\]|username' users.conf is output ok? can list these without brackets, or username = part. if need more add comment

ruby on rails - ActiveAdmin hide Delete action by condition -

i have problem. in activeadmin need hide delete action condition. i did #index page. don't know how trick #show page. here's code: index selectable_column column :id |package| link_to package.id, admin_subscription_package_path(package) end column :title column :plan_status column :duration |package| if package.duration == 1 "#{package.duration} day" else "#{package.duration} days" end end column 'price (usd)', :price |package| number_to_currency(package.price, locale: :en) end column :actions |object| raw( %( #{link_to 'view', admin_subscription_package_path(object)} #{(link_to 'delete', admin_subscription_package_path(object), method: :delete) unless object.active_subscription? } #{link_to 'edit', edit_admin_subscription_package_path(object)} )

android - Sending ArrayList<Object> through socket. Java -

what i'm trying send , arraylist through socket android client java server. here code of client sends arraylist : private void sendcontacts(){ apphelper helperclass = new apphelper(getapplicationcontext()); final arraylist<person> list = helperclass.getcontacts(); system.out.println("lenght of contacts array : " +list.size()); // (person person : list) { // system.out.println("name "+person.getname()+"\nnumber "+ person.getnr()); // } handler.post(new runnable() { @override public void run() { // todo auto-generated method stub try { //**151 line** os.writeobject(list); os.flush(); } catch (ioexception e) { // todo auto-generated catch block log.e(tag, "sending contact list has failed");

Using Chrome Extension contextMenu, how to open a small view right next to the context menu on click? -

Image
this question has couple bits it. want make context menu behave sidebar pops out box html. get height , location of users context menu? open interactable html view next menu without closing menu? close both menu , popout on off-click. so user can right click on page, and click contextmenu item open page can hold html

statistics - R sentiment analysis score for tweets -

i trying perform sentiment analysis on twitter data set. using few positive , negative dictionaries. want below tweet the movie intersteller insanely awesome positive dictionary: 2 awesome 5 negative dictionary: bad -2 insanely -3 so score of tweet should = -3 (insanely) + 5(awesome) = 2 i have been able match dataset against these dictionary create posmatch variable looks below: posmatches <- match(words, afinn_list$word) posmatches na na na na 1104 na na na na na na na na na na na na 1836 na know location contains match. need sum of weigts of location 1104 , 1836 in above example what need sum on posmatches not considering nas: sum(posmatches, na.rm = true)

Applying majority of page CSS to a jQuery FadeOut? -

i have jquery fadeout code: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript"> $(window).load(function () { $(".loader").fadeout("fast"); }) </script> and css .loader is .loader { position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 9999; background-color: #000000; } so when page loads, user seeing black screen (background-color element) , other page elements fadein black screen. all pages using masterpage/css layout - i'd instead of applying background color .loader, apply of elements when postback occurs, borders, margins, images , menus etc frozen, new elements new controls , text change between pages fadein. what's best way of doing this? so want parts off page fade in, not whole page. can if change in css file width,height,left,top tributes. next can create new entry in css file loader2. here e

sql - How to write this postgresql dynamic query -

i have custom spatial function , working parameters (coordinates): select get_nearest_station (-80.364565, 26.070670); now, want update column "source" rows in table 'employees_wgs' function. coordinates in columns x , y each record have replace real coordinates value columns. how write query ? need dynamic sql or else ? thanks update employees_wgs set source = get_nearest_station(x,y); commit;

everything related to maven is missing from eclipse -

for reason related maven has disappeared eclipse kepler installation. can't update project or build it, can't start new maven project , there no trace of maven related menu. any idea how solve it? thanks. try in eclipse marketplace see if maven integration eclipse installed. if not, maybe can install it. if installed, can not you, recomendation new eclipse web.