Posts

Showing posts from July, 2014

sql - DELETE in [validating two fields] -

i (and find) seeking ways validate 2 fields delete. i.e. delete x_table idreserva in (.........) , might work, there series associated same numbers, , likelihood of more things eliminate me accurate, 100%. possessing different series, different numbers. ie baao/300. caao/300. with above statement, deleted 2 records, , above wanted eliminate: baao/300. i looking like: delete x_table idreserva , serie in (.........) or if there otherwise grateful. your statement right, it's not sql valid, can use following valid statement: delete x_table idreserva in (...) , serie in (....)

java - How to put JFrame with jmathplot graph in JPanel -

Image
note : question follow question this question . i have learned following last question: jpanel has flowlayout (with same output nulllayout ! on resize), accepting preferredsize , child aren't resizable container, required use borderlayout / gridlayout simple graph a demonstration of principle given: import java.awt.borderlayout; import java.awt.dimension; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.swingutilities; import org.math.plot.plot2dpanel; import java.awt.borderlayout; import java.awt.dimension; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.swingutilities; import org.math.plot.plot2dpanel; public class myplot { private jframe frame = new jframe("jmathplot library in swing application."); private jpanel panel = new jpanel(); public myplot() { double[] x = new double[]{0, 1, 2, 3, 4, 5}; double[] y = new double[]{10, 11, 12, 14, 15, 16}; plot2dpanel plot = n

matlab - How to save the life of my process? -

i have following problem: want run cumbersome calculation on server via putty in matlab. not want keep notebook whole time connected server, why searching solution problem. know screen in general works not sure whether me here too. problem following: each time start matlab program have no longer control on terminal, since matlab program still running. therefore forced abort process, not want happen. there me. what need this: 1.)start matlab application on server 2.)disconnect server 3.)connect server 4.)have access matlab again i highly appreciate it, if give me reference commands might helpful in situation. as @peter said, screen 1 solution. brief tutorial: connect server screen -s sectionname matlab -nosplash -nodesktop or -nodisplay or -nojvm depending if have allowed x11 forwarding on putty (you can check open figure , check if can see -nodesktop option) ctrl+a d detach log out reconnect server if using x11 forwarding, may need update display o

Creating a user-defined function with SQL::Statement::Functions in Perl creates a syntax error -

i trying work udfs, defined through sql::statement::functions in perl mysql database in backend. playing book, stated in http://metacpan.org/pod/sql::statement::functions#user-defined-functions , however, before leave square one, error in create function statement rearing ugly head. here's code first ($dbh given , works fine, part of bigger construct of framework working with, don't want spam question of it; if replace foo() in select 22, or "_pk locations", , 22 or value corresponding query in data::dumper, so, connection ok): use data::dumper; use sql::statement::functions; sub foo { return 999; } #$dbh defined elsewhere $dbh->do("create function foo") or die "error creating function foo(); " . $dbh->errstr; $sth = $dbh->prepare("select foo(22)") or die "error preparing query: " . $dbh->errstr; $sth->execute or die "error executing query: " . $sth->errstr; $row = $sth->fetchrow_arr

javascript - Where is the `listen` Function in Node.js Defined -

i'm poking around node.js internals, , came across following method definition //file: node/lib/net.js socket.prototype.listen = function() { debug('socket.listen'); var self = this; self.on('connection', arguments[0]); listen(self, null, null, null); }; within socket object's listen method, there's call (seemingly) global function, named listen . listen(self, null, null, null); where javascript method/function defined? i've scoured javascript files in code-base , can't seem find it. (there's no specific task i'm trying accomplish here, other tracing node's execution path , trying understand patterns in use deep in system.) it's defined farther down in net.js . of 0.11.5, it's @ line 1089 : function listen(self, address, port, addresstype, backlog, fd) { if (!cluster) cluster = require('cluster'); if (cluster.ismaster) { self._listen2(address, port, addresstype, backlog, fd);

Using jquery to dynamically choose an audio file to load into HTML5 player -

i'm trying populate html5 player in modal via jquery. goal play 1 of 2 mp3s based on whether invited website, or registered on own. have hidden field stores src path , want jquery function load audio file based on src. on page load, audio file isn't loading player. not sure i'm missing, appreciated. html <asp:hiddenfield id="hidmodalmsg" runat="server" /> /*unrelated code*/ <div class="audio" runat="server"> <audio id="modalplayer" onload="('#modalplayer').src='';" controls="controls"> <p>your browser not support audio element.</p> </audio> </div> jquery in header $(function () { var audplayer = $('#modalplayer'); audplayer.src = $('#<%= hidmodalmsg.clientid%>').val(); }); as audio source different file different browsers, changing audio src directly not work. has changed based on b

php - Auto Refresh a Html table every x seconds -

i attempting refresh table have variables in there updated , want re-update variable every few seconds. have done code on part giving table id , creating div it. code explain actually. in advance ! edited: added var table , var refresher. code still wont reload table !any ideas?? test.php <html> <head> <script type='text/javascript'> var table = $('#tableid'); // refresh every 5 seconds var refresher = setinterval(function() { table.load("1103242b/processing/js.php"); }, 5000); settimeout(function() { cleartimeout(refresher); }, 1800000); </script> </head> <body> <?php include_once'js.php'; ?> </body> </html> js.php <?php require_once 'connect.php'; include 'start.php'; include 'functions.php'; header("cache-control: no-cache,no-store"); $query = "select * opentrades"; //you don't need ; in sql $result = mysql_query($

linq xml select node -

i have xml document: <users> <user_tuple> <userid>u01</userid> <code> <name>tom jones</name> </code> <rating>b</rating> </user_tuple> <user_tuple> <userid>u02</userid> <code> <name>mary doe</name> </code> <rating>a</rating> </user_tuple> <user_tuple> <userid>u03</userid> <code> <name>dee linquent</name> </code> <rating>d</rating> </user_tuple> how select (and child nodes/elements) element("userid").value=="u01" , element("name").value=="tom jones" etc ie want results: <user_tuple> <userid>u01</userid> <code> &

windows phone - Setting ApplicationBarButton.IconUri with icon from Isolated Storage -

i working on windows phone application in need change applicationbarbutton icon dinamically, example show current date in default windows phone calendar app. regarding this article , can use png images added solution , reference them relative uri. it not problem me generate correct png image ( this way , using toolstack c# png writer library) , save isolated storage, when i'm initializing appbarbutton absolute uri image , trying add applicationbar, app throws argumentexception. am doing wrong or have draw 366 icons , add them project? :) thanks in advance!

python - unpickling HasTraits object: how to prevent assignment of certain traits -

i have hastraits object written , read disk using cpickle. object has trait computationally expensive assign . traits documentation , understand of traits being re-asigned when object read disk. i prevent expensive trait being re-assigned when object read disk. possible? make trait transient described here: http://docs.enthought.com/traits/traits_user_manual/advanced.html#persistence (btw, note newer version of docs linked to, though section in both versions.)

How to make django-photologue autorotate image with info from EXIF? -

i need change orientation of image according info in exif on upload. there "standard" way this? im trying patch models now, not sure right way. well, did file photologue/models.py: image_exif_orientation_map = { 6: 0, 3: 2, 8: 3, 1: 4, } def pre_cache(self): if self.exif.get('orientation', 1) not none: im = image.open(self.image.path) im = im.transpose(image_exif_orientation_map[self.exif.get('orientation', 1)]) im.save(self.image.path) cache = photosizecache() photosize in cache.sizes.values(): if photosize.pre_cache: self.create_size(photosize)

javascript - Meteor: IronRouter does not trigger notFound rule -

i meteor app use ironrouter client-side routing. my routing code looks follows: router.map(function() { this.route('story', { path: '/story/:_id', data: function() { return stories.findone({displayid: +this.params._id}); }, notfound: 'storynotfound' }); }); i have 2 templates corresponding route: <template name="story"> welcome story: {{this.displayid}}. </template> <template name="storynotfound"> story not found </template> problem : 'storynotfound' template never rendered, not when stories.findone({displayid: +this.params._id}) returns undefined. instead, 'story' template rendered text "welcome story: ". what missing? have tried replacing notfound: notfoundtemplate ? iron router example uses notfound find notfoundtemplate in source code , worked me. router.map(function() { this.route(&

c++ - How to allow range-for loop on my class? -

this question has answer here: how make custom type work “range-based loops”? 5 answers i have class this: class foo { private: int a,b,c,d; char bar; double m,n public: //constructors here }; i wanna allow range-for loop on class, e.g. foo foo {/*...*/}; for(auto& f : foo) { //f specific order such c,b,d,(int)m,(int)bar,a,(int)n } how can achieve this? looking @ iterator don't know requirements range-for loop. (please don't ask me use array or stl type) the loop defined equivalent to: for ( auto __begin = <begin-expr>, __end = <end-expr>; __begin != __end; ++__begin ) { auto& f = *__begin; // loop body } where <begin-expr> foo.begin() , or begin(foo) if there isn't suitable member function, , likewise <end-expr> . (this simplification of specification

SVN commit issue when using SVNKit Libraries in Java -

couldn't commit modified file svn repository using svnkit libraries in java. no stack trace information available me debug disappointing. the file modified using java program , have commit modified file using svn. (svn commit -m "updated"). the file has been modified , appears below when run 'svn status' command. svn status filename m filename here code: try { string url = "http://repository url"; file file = new file("<path file>"+inputfile); davrepositoryfactory.setup(); svnurl svnurl = svnurl.parseuridecoded(url); svncommitinfo commitinfo; string uname = <username>; // auth details connect svn repo string pwd = <password>; pw.println("<br> svn url : "+ svnurl); //pw reference object of response.getwriter() davrepository repo = (davrepository) davrepositoryfactory.create(svnurl); isvnauthenticationmanager authmanager = svnwcutil.createdefaultauthenticationmanager(uname, pwd); repo.setaut

jquery - How can i process this form alone -

this question exact duplicate of: how can make onclick function submit form.php 2 answers i have function on html form, form script there <script type="text/javascript"> var conf = { isvip:false, ismem:false }; </script> and here the button, button process 2 form in html, here button. <li class="current"> <a href="#" onclick="submitaction('process.php')">免费邮箱登录</a> </li> <li> <a href="#" onclick="submitaction('process.php')"><span class="vip"></span>vipsubmit</a> </li> <a href="#" class="loginbtn" here form <form name="vip_login" method="post" action="process.php"> &

c# - How to change Location(Url) of a Web Service and Update Web Reference programmatically? -

i have web service: http://127.0.0.1/something/somews.asmx i adding web reference app wont localhost... might change http://www.something.com/something/somews.asmx . how change url programmatically of web reference? simple as: using (var service = new myapi.myapi()) { //txturl site service.url = "http://" + txturl + "something/somews.asmx"; } also, once change it, how update programmatically? (equivalent right-clicking , selecting "update web reference") side-note: trying accomplish dropdowns of available methods based on asmx webservice available on server (service.url) as john saunders commented way trying take talk 2 versions of service not technically possible. trying mix compile/design time action ("update web reference") runtime one. easy approach @ problem talking 2 different data sources providing similar data. researched approach plenty of samples - data repository 1 of search terms. implementation:

java - What is the inverse of OutputStreamWriter -

an outputstreamwriter wraps outputstream behind writer interface. if want inverse, want outputstream interface writer? instance want serialize object stringwriter. the semantic of outputstreamwriter take text , transform according character encoding bytes. common pattern (low level bytes interpreted high level text) isn't surprising find class part of standard java api. so want writeroutputstream . forgot tell semantics expect such class. can imagine several use cases outputstream wrapping writer : convert bytes base64 encoded string convert bytes table of hex values assuming byte stream encrypted text message: decrypt bytes , write original unencrypted text. assuming byte stream values of kind of measuring device: write human readable table containing measured values. but there no obvious default use case makes sense broad usage. there no writeroutputstream class in standard library. no 1 prevents write such class of own.

java - is it possible backup and RESTORE a database file in android? non root devices -

this question has answer here: backup , restore sqlite database sdcard 4 answers in app need backup of database, after i'll need restore again, i have read somethings, not sure if necessary have rooted device, need backup/restore data in non root devices, possible? my first idea creating txt file write select, , later insert again. but believe "problem" don't know if possible copy database , paste in sd card backup, , copy sd card , paste in path of database restore non root devices. here code make work private void importdb() { try { file sd = environment.getexternalstoragedirectory(); file data = environment.getdatadirectory(); if (sd.canwrite()) { string currentdbpath = "//data//" + "<package name>" + "//databa

sql - Transpose/Pivot Rows to Columns and Sum -

here query select * requirementrange peakrange , daysofreq columns nvarchar datatype , total int datatype table below peakrange daysofreq total 1 - 3.99 >2 days 2 9.01+ day 2 3 1 - 3.99 day 0 1 4 - 5.99 day 0 1 6 - 8.99 day 2 2 9 day 0 1 9.01+ day 0 1 expected result peakrange day 0 day 1 day 2 >2 days total 1 - 3.99 1 0 0 2 3 4 - 5.99 1 0 0 0 1 6 - 8.99 0 0 2 0 2 9 1 0 0 0 1 9.01+ 1 0 3 0 4 here need output converted rows columns finding total , placing in last column each range. you should able use similar following: select peakrange, coalesce([day 0], 0) [day 0], co

How do I schedule a JBoss task? -

i have scheduled task in jboss: <?xml version="1.0" encoding="utf-8"?> <server> <mbean code="org.jboss.varia.scheduler.scheduler" name="acme:service=scheduler"> <attribute name="...">...</attribute> ..... </mbean> </server> how write task, execute @ 1:00 on first day of every month? thank you! you'll need create scheduling class. org.jboss.varia.scheduler.scheduler since want perform monthly , cannot state attribute. you'll need have class handles setting next interval. java monthly timer have scheduler class call monthly timer next interval , set it. maybe pass values @ initial start. <mbean code="org.jboss.varia.scheduler.scheduler" name="jboss.docs:service=scheduler"> <attribute name="startatstartup">true</attribute> <attribute name="schedulableclass">org.jbo

PHP PDO bind dynamic field and value from search box -

i trying run query using pdo prepared statements allows me have user select field , enter value field, , include in query. so in basic query: $sql = "select lastname, firstname administrators status=:status "; $stmt->bindparam(':status',$status, pdo::param_str); works great. but have search form allows user select drop down shows firstname, lastname , text box enter search term $sql = "select lastname, firstname administrators status=:status **and field = term**"; i have not found examples online far. guidance appreciated. i using: $params = array(); if (!empty($searchfield) && !empty($searchfor)) { $params['searchfield'] = $searchfield; $params['searchfor'] = $searchfor; } but getting error: fatal error: uncaught exception 'pdoexception' message 'sqlstate[42s22]: column not found: 1054 unknown column 'searchfield' in 'where clause'' updated c

javascript - simple ajax nothing happens -

i trying create small ajax script add text div. nothing happen, it's killing me. please help. html: <!doctype> <html> <head> <script type="text/javascript" src="ajax.js"></script> <script type="text/javascript" src="jquery.js"></script> </head> <body onload="process()"> ok, made far <br/> <div id="thed"> </div> </body> </html> ajax.js: var xmlhttp= createxmlhttprequestobject(); function createxmlhttprequestobject(){ var xmlhttp; if (window.xmlhttprequest)( xmlhttp = new xmlhttprequest(); )else{ xmlhttp = new activexobject("microsoft.xmlhttp") } return xmlhttp; } function process(){ alert('hi'); if (xmlhttp){

jasperserver - Reloading/Refreshing Part of a Report Only -

i have use case control displayed on map using linear gauge (in edit mode) maps pro , widgets pro. in other words, when change value on linear gauge, values on map change. know can refreshing whole report. however, wondering if there better ajax way of doing using ireports designer , jaspersoft reports server. there other tables , such on page, have no need refresh. i guessing answer no, based on know of jasper far. however, due diligence , ask? please let me know if there way this. how cool be? cooler if change values on map pointer on linear gauge changing. thanks in advance.

cordova - Phonegap application issue -

i'm developing app on timeout update data on db , consequently change view on page relative data. app works on chrome , firefox when run on device data doesn't update on db update. maybe memory cache problem? line maybe has error?maybe "$(window)"? current_user.set_last_activity(); $(window).bind('onload',setinterval(function(){current_user.set_last_activity();},5000)); this.check_users_online() ; $(window).bind('onload', setinterval(function(){self.check_users_online();},5000)); in logcat appeared error: 08-20 00:12:57.023: e/suman-statusbarpolicy(1658): <!>com.android.systemui.statusbar.policy.statusbarpolicy 1069<!> mservicestate.getroaming()false cordova applications need declare urls plan pull data from. list of known host names "whitelist". your browser may more flexible cordova needs whitelist entry. here documentation on adding domain whitelist . =edit= try binding deviceready event inste

How to query for an entry that falls between start and end date - DynamoDB -

i new dynamodb, , had question how can find of live entries in dynamodb table. each entry in table has start , end date. confused on how can query entries current date falls between start , end date. ideas how can this? i understand can have primary , range key. possible query other columns in entry? each entry looks this: id: xxxxxx startdate: 123456 // epoch time enddate: 334243 // epoch time if not know hashkey of item(looks 'id' in case) way query dynamodb using full table scan. you can table scan using multiple conditions, inefficient.

windows - Java - Unable to find a file path which certainly exists -

i sure relatively simple question, , think may more of problem windows java. i have method copying file new directory, takes 2 file objects, file created path of original, , file created desired path of copy. sure method works because have used copy file onto desktop. however, using actual desired path creates error: java.io.filenotfoundexception: path (the system cannot find path specified) where path path attempting use. here guess: making program use on machine. such, path trying use is: c:\users\xxxxxx\rest_of_path\filename.file where xxxxxx primary user on machine writing program for. this directory exists on system, xxxxxx not user on system. guessing windows causing problem because of that. i'm changing code use solution depends on machine, , not hardcoded (system.getproperty). however, i'd know why problem occurring, academic standpoint, windows , java user. thanks in advance. edit: accidentally used forward slashes when meant

css - moving an article tag to the centre of the page? -

i want article centered in order in want it. not want in in centre, want little inch left , same top. what should following code? article{ background:white; width:650px; height:325px; border-radius:7px solid; padding-left:10px; padding:right:10px; color:red; margin:auto; margin-bottom:40px; } ok, giving shot here... think requesting. basically, using container div center content, , positioning inner div inside offset relative centered div. codepen sketch here: http://cdpn.io/lthnf html <article class='container'> <div class='inner'>content</div> </article> css body { height: 100%; margin: 0; padding: 0; } .container { background: #ccc; bottom: 0; height: 325px; left: 0; margin: auto; position: absolute; right: 0; top: 0; width: 650px; } .inner { background: #efefef; position: relative; left: -20px; top: -20px; }

osx - Reformat how a number is displayed in a line of text file with sed -

i have text file has several lines , looking replace lines formatted like: cat: -0600, dog: +0900 cat: -1000, snake: -0500 cat: -0900 cat: +0100 to say cat: -6, dog: +0900 cat: -10, snake: -0500 cat: -9 cat: +1 there other lines are: dog: -0700 dog: +1000 that shouldn't touched. i've searched, can't quite figure out. prefer use sed, unless there's better way. given composite data file, script gives sample output below: sed 's/^\(cat: [-+]\)0\{0,1\}\([1-9]\{0,1\}[0-9]\)00/\1\2/' data it looks cat: followed + or - , optional 0 (which not captured), optional [1-9] followed [0-9] followed 2 0 's, , replaces 2 remembered parts. convert +0000 +0 . if last 2 digits not 00 , modify first regex match [0-5][0-9] or [0-9][0-9] . sample output: cat: -6, dog: +0900 cat: -10, snake: -0500 cat: -9 cat: +1 dog: -0700 dog: +1000

java - Not going in for loop -

i have following code arraylist<integer> analysis = new arraylist<>(); arraylist<integer> designinitialbuild = new arraylist<>(); arraylist<integer> production = new arraylist<>(); arraylist<integer> strategy = new arraylist<>(); arraylist<integer> testing = new arraylist<>(); system.out.println("jtablelength: " + jtable1.getrowcount()); for(int xn=0;xn==jtable1.getrowcount();xn++){ system.out.println(jtable1.getmodel().getvalueat(xn, 3).tostring()); switch(jtable1.getmodel().getvalueat(xn, 3).tostring()){ case "analysis": analysis.add(xn); break; case "design & initial build": designinitialbuild.add(xn); break; case "production": production.add(xn); system.out.println("production"); break; case "strategy": strategy.add(xn); break;

big o - What is asymptotic complexity for CRUD operations on basic Java containers -

i trying figure out complexities (using big-o notation) of operations on java basic collections. in question c++ language. here have, using common sense: lists arraylist add(e e) o(1) add(int index, e e) o(n) set(int index, e element o(1) get(int index) o(1) remove(e e) remove(int index) o(n) contains(e e) o(n) list concatenation (addall) o(n) linkedlist add(e e) o(1) add(int index, e e) o(n) set(int index, e element o(n) get(int index) o(n) remove(e e) remove(int index) o(n) contains(e e) o(n) list concatenation (addall) o(1) sets hashset , linkedhashset add(e e) o(1) remove(e e) o(1) contains(e e) o(1) find/get element using iterator o(n) treeset add(e e) o(log n) remove(e e) o(log n) contains(e e) o(log n) addall o(n log n) find element using iterator o(n) or perhaps o(log n) when implementing binary search maps hashmap , linkedhashmap put(k key, v value) o(1) get(k key) o(1) remove(e e) o(1) con

tsql - varchar(max) equivilent in MySQL for T-SQL varchar(max) comparison -

i have following clause where ( target.sender_name <> source.sender_name ) target aliases table in microsoft sql server while source aliases identical table on mysql server linked via linked server originally had sender_name in both tables text field, trying keep 2 tables incidental, query above clause when, when tried run spat out the data types text , text incompatible in not equal operator. doing bit of looking around learned text in tsql depreciated , should using varchar(max), doing outputted error the data types varchar(max) , text incompatible in not equal operator. looking around seems equivalent varchar(65535) using cause problems in table has 4 text fields , error i'm getting believe same other 3 fields have in same clause so wondering if there equivalent varchar(max) in mysql can use in clause varchar(max) field in tsql note: query clause in runs in tsql, it's table on linked server mysql edit: clause goes update query, checks ev

In Ruby/Rails, how can I create one column in a table based on the value of two other columns in the same table? -

i trying create reddit type app order of list depends on combination of number of upvotes link has , created date. plan create new column in "links" table combines "created_date" , "upvotes" "rank value" , sort list "rank value". is right approach? if so, how create table column using activerecord? if there meta attribute used purely display purposes, creating method generate on fly appropriate. if want use sorting objects well, it's better store in column. hopefully, doesn't depend on things current time, , on other attributes: before_save :calculate_rank def calculate_rank self.rank = self.upvotes + self.clicks * 5; end unfortunately, use case said column depends on creation date, in terms of "how fresh it" -- moving target. you can solve 2 ways: increasing rank values newer links indefinitely, or putting items time buckets , updating them periodically (degrading scores when day or week

scala - Suppress main class in sbt-assembly -

in multi-project sbt build, how should 1 explicitly suppress mainclass attribute in sbt-assembly? i've searched extensively cannot seem find out how prevent main class being set in jar built sbt-assembly in multi-project build. in single-project build, seems work long there @ least 2 classes might potentially invoked command line: import sbt._ import keys._ import sbtassembly.plugin._ import sbtassembly.assemblyutils._ import assemblykeys._ object testbuild extends build { lazy val buildsettings = defaults.defaultsettings ++ assemblysettings ++ seq( version := "0.1-snapshot", organization := "com.organization", scalaversion := "2.10.2", mergestrategy in assembly := mergefirst ) lazy val root = project(id = "test-assembly", base = file("."), settings = buildsettings) settings( mainclass in assembly := none ) lazy val mergefirst: string => mergestrategy = { case "referenc

ios - Can someone tell me why the new beta version of Xcode does not simulate io7 on an iphone 4/4s -

Image
dumb question: i downloaded new version of xcode version 5.0 (5a11365j), , when build new iphone app , go to products -> destination -> iphone -> i see ios6 + ios5. where hell ios7??? i know iphone 4/4s going support ios7, simulator it? thanks update: have attached image dont believe me the problem i'm seeing you're selecting "iphone", believe corresponds non-retina simulator doesn't have support ios 7. have run in 1 of retina simulators.

html - How can I make a video as a full page background? -

i way folks @ http://chopdawgstudios.com/ made there homepage seems render video in background. how can create similar? there background-video it? this isn't css issue, it's javascript. there's plenty of scripts this. here couple: http://dfcb.github.io/bigvideo.js/ http://www.seanmccambridge.com/tubular/

mysql - Using GROUP_CONCAT -

i have 3 tables. tb_main table of entities. tb_boardmembers table of people. tb_boardmemberslink bridging table references other 2 ids , has start , end dates when person on board of entity. these dates incomplete. i have been asked export part of report csv 1 row per entity per year in have list of board members year occupations in single field delimited newlines. i don't need bml.entity in result added try debug. i'm getting 1 row expect 85. tried , without group , fact result same suggests misusing group_concat. how should construct result want? select group_concat( distinct concat(bm.first, ' ', bm.last, if (bm.occupation != '', ' - ', ''), bm.occupation) separator "\n") board, bml.entity tb_main arfe, tb_boardmembers bm, tb_boardmemberslink bml year(bml.start) <= 2011 , (year(bml.end) >= 2011 or bml.end null) , bml.start > 0 , bml.entity = arfe.id group bml.entity order board there few issu

c# - Program Flow using Events -

i'm trying write program step 1 -> kick off step 2 -> kick off step 3. variables passed in between each step. can use events way in c#? might best way write program this? public class programflow // listener program { eventargs args = null; public delegate void eventhandler(string str, eventargs e); public static event eventhandler step1reached; public static event eventhandler step2reached; public programflow() { step1 step1 = new step1(); // print string , kick off step2 step2 step2 =new step2(); // print string kick off next step } } public class step1 { string charread; public step1() { console.write("input step1: "); charread = console.readline(); console.writeline(); programflow.step1reached += programflow_step1reached; } void programflow_step2reached(string str, eventargs e) { console.writeline(charrea

android - mediacontroller does not work on nexus 7 tab -

i have android code playing video using videoview , control buttons such pause,rewind , forward using mediacontroller. works on nexus s many samsung phones, mediacontroller buttons dont seem work on nexus 7! need work on devices. there need do? mediacontroller mediacontroller = new mediacontroller(activity.this); mediacontroller.setanchorview(videoview); uri video = uri.parse("path/to/video"); videoview.setmediacontroller(mediacontroller); videoview.setvideouri(video); videoview.start(); just stumbled upon answer in unable pause/forward/backward video using mediacontroller in android . lg devices seem have issue well. as mentioned @vineela yarlagadda, need override videoview methods below @override public boolean canseekforward() { return true; } @override public boolean canseekbackward() { return true; } @override public boolean canpause() { return true; } tested & works on nexus 7. alternate solution: use surfaceview instead of vid

c++ - 'vector iterators incompatible' -

this question has been asked number of times on so, answers not apply situation, afaict. following piece of code triggering error upon hitting i != std::end(observers_); . void visualgeometry::signalpoppointflags(const point_2r& p, const uint32_t msec_delay) const { for(auto = std::begin(observers_); != std::end(observers_); ++i) (*i)->slotpoppointflags(p, msec_delay); } looking <vector> , following triggers error: void _compat(const _myiter& _right) const { // test compatible iterator pair if (this->_getcont() == 0 || this->_getcont() != _right._getcont()) { // report error _debug_error("vector iterators incompatible"); _scl_secure_invalid_argument; } } since not comparing iterators different containers, seems first check this->_getcont() == 0 might problem, i'm not sure how tell. the same problem occurs if swap out begin(v

mysql - querying unique latest post by topic -

i'm trying create active topics section, i'm running query problem. i have 3 tables: posts, topics, categories (smallest greatest). every post associated topic, every topic associated category. now, problem displaying recent topic posted uniquely. here's quick scenario: user x posts in topic a, , in topic b. user y creates topic c , posts in topic a. before user y posted on a, user z posted on topic a. on active topics list i'd show following: topic - y's msg topic c - y's msg topic b - x's msg my current sql merely grabs sequence correctly, get's same topics well: topic - y's msg topic - z's msg topic c - y's msg topic b - x's msg topic - x's msg select topic_subject, post_date, post_msg, post_by, cat_color topics, posts, categories topic_id = post_topic , topic_cat = cat_id order post_date desc if add group topic_subject or id, original topic creators, such following: topic c - y's msg topic b

java - How to install java7 version to Run an applet in web broswer -

i running applet program in browser.when running applet browser asking me install java7.and redirecting this link .when download java , install applet working fine. when install got jre only.i did not jdk. my question is: i heard 1 thing previously.browser contains java.so if correct ,why need install java7 in system.only browser need java7 version.is there possibility install in browser only. thanks in advance... jre includes browser plugins applet execution. need java runtime run applet. jdk development kit(which btw includes jre) don't need in case. for applet's execution environment read corresponding java docs . it says an applet run in existing jre if following conditions met: the jre version required applet matches existing jre. the jre's startup parameters satisfy applet's requirements. so need correct jre version run applet.

html - How to allow http content within an iframe on a https site -

i load html iframe when file referenced using http, not https, following error: [blocked] page @ {current_pagename} ran insecure content {referenced_filename} is there way turn off or way around it? the iframe has no src attribute , contents set using: frame.open(); frame.write(html); frame.close(); based on generality of question, think, you'll need setup own https proxy on server online. following steps: prepare proxy server - install iis, apache get valid ssl certificate avoid security errors (free startssl.com example) write wrapper, download insecure content (how below) from site/app https://yourproxy.com/?page=http://insecurepage.com if download remote site content via file_get_contents or similiar, can still have insecure links content. you'll have find them regex , replace. images hard solve, Ï found workaround here: http://foundationphp.com/tutorials/image_proxy.php

sql - getting error as too many values in my query -

dpt_no salary period start_date end_date ------ ----- ------ ---------- -------- 100 12580 15months 12-dec-07 10-dec-10 101 15500 19months 10-jan-07 10-dec-11 102 7777 18months 11-jul-07 21-apr-11 103 9999 11months 07-jul-07 31-jan-11 104 8500 9months 12-mar-07 27-mar-11 105 10000 20months 17-sep-07 01-aug-11 106 25000 7months 17-nov-07 26-jul-11 107 100000 6months 05-may-07 21-jun-11 108 35000 16months 28-feb-08 21-jun-11 109 5000 16months 02-dec-08 19-aug-11 i'm write query giving rank salary , getting rank using ampersand. query select salary salary &rank=(select salary, rank() over(order salary desc) "rank" salary salary). but i'm getting error "too many values". can 1 me please it should this: select t1.salary (select salary.salary, rank() over(order salary desc) "rank" salary) t1 "ra

How to get information in info box of Wikipedia articles using Wikipedia api? -

i'm trying lead actor's name movie's wikipedia article. i tried different values prop, prop=info seems relevant. doesn't contain information in info box of wikipedia article. see: http://en.wikipedia.org/w/api.php?action=query&prop=info&titles=casino_royale_(2006_film)&format=jsonfm is possible extract information in infobox using wikipedia api? the mediawiki api doesn't understand infoboxes. so, have 2 options: parse infobox yourself. can either parse wikitext directly or generated html table (both available api). let else parsing. dbpedia does. wikidata tries similar, won't contain enough data usable long time; see growth statistics .

Android animation ends quickly -

i having following problem: have animation in android app moves ui elements @ screen, i.e. translate animation, works fine. let moving position (0,0) (0, 200) in screen. problem is, happens (like 0.001 seconds) , program loaded, not see movement of object see @ final position(0,200). here code: handler handler = new handler(); float height; private relativelayout relativelayoutdoughnutandlogotogether; private relativelayout logo_donut_together2; private imageview imgsplash, image2; private doughnutview doughnutview; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); relativelayoutdoughnutandlogotogether = (relativelayout) findviewbyid(r.id.logo_donut_together); logo_donut_together2 = (relativelayout) findviewbyid(r.id.logo_donut_together2); imgsplash = (imageview) findviewbyid(r.id.turkcell_logo); image2 = (imageview) findviewbyid(r.id.imageview02); int logoheight = i

sql server - Not able to pass input parameters to stored procedure -

i have store procedure getting values database based upon search criteria passing ones input parameters procedure getting error @ @statusselection create procedure [dbo].[tp_selecttransactionhistorysearch] ( @offsetrowno int, @fetchrowno int, @statusselection nvarchar(max), @isreviewed bit, @projectcasenumber varchar(max), @costpagenumber varchar(max), @transactiontypechange varchar(max), @descriptionchange varchar(max), @trasactioncreateonbegindate datetime, @transactioncreatedonenddate datetime, @transactionupdatedonbegindate datetime, @transactionupdateonenddate datetime, @itemid varchar(max) ) select th.transactionid, th.isreviewed, th.itemid, th.costpagenumber, th.comments, th.createdby, th.createddatetime, th.updatedby, th.updateddatetime, th.transactiondescription, th.transactiontypeid,