Posts

Showing posts from September, 2015

c# - XPath query not working -

hello making httpwebresponse , getting htmlpage data need example table date info need save them array list , save xml file example of html page <tbody> <tr class="odd"> <tr class="even"> <td class="padding5 sorting_1"> <span class="datehover" sort="14/03/18/22/56" title="18.03.14" ref="18.03.14">18.03.14</span> </td> <td class="cellstyledefaulttext"> <span class="transspan">info</span> </td> <td class="cellstyledefaulttext" title="usernumber123">usernumber123</td> <td class="cellstylesignednumber floatophomepage"> <span title="701,554.23 ">701,554.23 </span> </td> <td class="cellstyleamount cellstyleamountnew"> <div title="-3354999.71">-3354999.71</div> ...

xcode - IOS 7 - Update an UILabel with value computed in background using delegation -

i having problem trying update uilabel.text using value calculate in background using delegation (which seems slow). @interface btaviewcontroller : uiviewcontroller <exchangefetchermanagerdelegate> @property (weak, nonatomic) iboutlet uilabel *bidpricelabel; @property (strong, nonatomic) fetchermanager *fetchermanager; @end my btaviewcontroller.m - (void)viewdidload { [super viewdidload]; self.fetchermanager = [[fetchermanager alloc]init]; double calculatevalue = [self.fetchermanager fetchpricesfor]; self.bidpricelabel.contentmode = uiviewcontentmoderedraw; [self.bidpricelabel setneedsdisplay]; self.bidpricelabel.text = [[nsstring alloc] initwithformat:@"%f", calculatevalue]; }]; the label has been correctly initialised in method not shown here , shows correct default value @ startup. once execute code, label value 0.00000000, because calculatevalue has not been calculate yet. how can wait value calculated , display h...

How does the "this" keyword in Java inheritance work? -

in below code snippet, result confusing. public class testinheritance { public static void main(string[] args) { new son(); /* father father = new son(); system.out.println(father); //[1]i know result "i'm son" here */ } } class father { public string x = "father"; @override public string tostring() { return "i'm father"; } public father() { system.out.println(this);//[2]it called in father constructor system.out.println(this.x); } } class son extends father { public string x = "son"; @override public string tostring() { return "i'm son"; } } the result is i'm son father why "this" pointing son in father constructor, "this.x" pointing "x" field in father. how "this" keyword working? i know polymorphic concept, won't there different between [...

Rooted tree impossible constructs -

for uva problem, working on constructing rooted tree following constraints. a tree of depth d means tree should contain @ least 1 node d distance away root , there no node of more d distance root. the degree of node of tree cannot greater v . degree of node measured number of nodes directly connected to, via single edge. the goal determine maximum possible number of nodes. find that, looking sum on v^i , ranges 0 d. summation appears give maximum number of nodes correctly in many cases, i'm assuming it's correct. however, question states 'if not possible construct tree, print -1'. can think of no possible case might occur. think supposed be printed when user enters v , d outside range given in problem. maximum number of nodes = 1 + ( v * ((v-1)^(d-1)) ) , v>=2, d>=1 . explanation: 1 root node, 1st level can have v nodes, 2nd level on wards can have v-1 nodes, restrict maximum degree v. it not possible construct tree if: case 1: d=1 ,...

c# - Where to store information about point in console application? -

Image
i need create struct storing 4 points. wanted create point variable, looks can't use system.drawing in console application. should use? you should add reference system.drawing.dll , add using system.drawing; using system; using system.collections.generic; using system.linq; using system.text; using system.drawing; namespace consoleapplication5 { class program { static void main(string[] args) { point point = new point(); } } }

c# - Incorrect number of type parameters in reference class MyClass<F,T> - Generic entity framework -

i've got following generic abstract class: public abstract class myclass<f, t> tcurrencyfrom : book tcurrencyto : book { public int id { get; set; } public virtual f first{ get; set; } public virtual t second { get; set; } } and got 3 classes implement class like: public class implementation1 : myclass<booktype1, booktype2> { } public class implementation2 : myclass<booktype2, booktype1> { } now got "entitytypeconfiguration" looks like: public class myclassconfiguration<tmyclass> : entitytypeconfiguration<tmyclass> tmyclass: myclass { public myclassconfiguration() { ... } } and try use like: public class implementation1map : myclassconfiguration<implementation1> { public implementation1map () { ... } } but following error: incorrect number of type parameters in reference class myclass how can solve problem , make sure have generic approach on entit...

javascript - Wordpress post slideToggle with each() issue -

i feel i've been trying work, problem i'm not familiar javascript nor jquery. guess it's simple adding 1 line, because i've got work. i have wordpress blog loops out numerous of posts, i've added unique id's of them, i'm able grab problem doesn't work slidetoggle show content. <script type="text/javascript">//<![cdata[ $(window).load(function(){ $(document).ready(function() { $(".togglecontainer").hide(); $('.show_hide').click(function() { event.preventdefault(); var pid = $(this).data('id'); var cid = $(this).data('container'); $(pid).add(cid).each(function() { $(cid).slidetoggle(1000); }); }); }); });//]]> </script> then there's container: <div class="togglecontainer" data-container="<?php th...

Does python make a copy of opened files in memory? -

so search filenames os.walk() , write resulting list of names file. know more efficient : opening file , writing each result find them or storing in list , writing whole list. list big wonder if second solution work. see example: import os fil = open('/tmp/stuff', 'w') fil.write('aaa') os.system('cat /tmp/stuff') you may expect see aaa , instead nothing. because python has internal buffer. writing disk expensive, has to: tell os write it. actually transfer data disk (on hard disk may involve spinning up, waiting io time, etc.). wait os report success on writing. if want write small things, can add quite time. instead, python keep buffer , actually write time time. don't have worry memory growth, kept @ low value. docs : "0 means unbuffered, 1 means line buffered, other positive value means use buffer of (approximately) size (in bytes). negative buffering means use system default, line buffered tty devices , buffered o...

loops - How do i nest div elements in HTML? -

is there possibility code loop in html nest div elements in way(the child elements interesting ones): <div class="parent"> <div class="child"> <div class="child"> <div class="child">... i don't know main language of project, simple solution comes mi mind , think works doing this: <div class="parent"> <% simple statement in main languaje %> <div class="child"> <% end %> <% same simple statement in main languaje %> </div> <% end %> </div>

Mobile geolocation precision - cordova / phonegap -

i want develop app detects how far user/device points on map. calculating distance easy, when close 30meters need precise possible. basically want lights on ui brighter closer target/point. how achieve if gps position bounces around 5-10 meters or more? ideas on how approach this? thanks! in general there inaccuracy position, , indeed meters, bouncing there , rather impossible rid of it, anyways, 1 suggestion collect last few (3-10 , logic really) locations , calculate average them. fast movements position lagging of course, when doing slow movements position shown should more stable.. of course have additional logic on determining movement direction, , accepting location change towards faster etc.

xampp - How to run a codeigniter controller function using exec command in php -

i using xampp local window system. day working codeigniter, trying run mycontroller function background job. like class admin extends mx_controller{ function __construct(){ parent::__construct(); } function index(){ echo "working"; $command = "d:\xampp\php\php d:\xampp\htdocs\client\newslatter\index.php admin preget"; echo $out = exec( $command); echo "here"; } function preget(){ echo "<br/>done!!!!!!"; } } i not able run function using exec command can 1 out problem?. codeigniter has page in it´s manual this: http://ellislab.com/codeigniter/user-guide/general/cli.html note that, in command, put path file, didn´t add "php" $command = "php d:\xampp\php\php d:\xampp\htdocs\client\newslatter\index.php admin preget"; maybe solve problem. is php.exe in "path" enviroment variable of windows? the process should pre...

plugins - Eclipse Subclipse shows in the bottom of eclipse -

i create views in eclipse , after subclipse plugin on action synchronize repository shows panel @ bottom of eclipse (not clickabel or dragable). tried reset perespective doesn't help. i try oper view windows view same result panel . posiible return plugin on working state?

java - Datatables Plugin 'ColumnFiltering()' -

i have 2 codes. why no filtering options code below? want regular filtering each column $(function(){ otable = $('#escapetbale).datatable().columnfilter({ "aocolumns": [ { type: "text", bregex: true, bsmart: true }, { type: "text", bregex: true, bsmart: true }, { type: "text", bregex: true, bsmart: true } ], "sdom": 'tc<"clear">lfrtip', "bjqueryui":true, "spaginationtype": "full_numbers", "processing": true, }); my html code: </tbody> <tfoot> <tr> <th>name</th> <th>address</th...

forms - Send part paid cart to PayPal -

i need send cart paypal payment using form integration method cart value has had part payment made against it, means, 'on account' or gift card example. is there accepted way this? the thing can find sending paid amount discount amount that's not 100% ideal isn't in reality discount. the other option came send single line cart item of 'balance of order xxxx' not ideal customer wouldn't see actual items listed when on paypal. many thank. i can think of 3 paypal features might possibly use this: authorization , capture authorization & capture, or auth/capture, allows authorize availability of funds transaction delay capture of funds until later time. useful merchants have delayed order fulfillment process. authorize & capture enables merchants modify original authorization amount due order changes occurring after initial order placed, such taxes, shipping or gratuity. recurring payments paypal recurring payments allows bill...

mysql - Rails 4 migration not adding fields to an existing database -

i have order database trying add 2 new fields it 1) seller_id 2) buyer_id when run command rails generate migration addfieldstoorders buyer_id:integer seller_id:integer it shows invoke active_record create db/migrate/20140414094632_add_fieldsto_orders.rb after running rake dd:migrate , rails s shows == 20140414094632 addfieldstoorders: migrating ================================ == 20140414094632 addfieldstoorders: migrated (0.0000s) ======================= it should give me seller_id table , buyer_id table. have double checked orders database model via sqlite database model viewer , both fields have not appeared both fields have been added user.rb , order.rb models user.rb class user < activerecord::base # include default devise modules. others available are: # :confirmable, :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable validates ...

java - matrix multiplication on hadoop -

i'm looking best , easy way of matrix multiplication on hadoop java. meanwhile looked @ link http://www.norstad.org/matrix-multiply/index.html felt tough understand it. overall: i've 2 files matrixa(m x n) , matrixb(n x m). want matrixc(m x m) multiplying , b. i'll pass above 2 files mapreduce program. please me.. could reprocess matrix 2 files as: system.out.println( column + " , " + row + "\t" + value ); i thinking can map on both outputting: context.write( new text( column + " , " + row ), new intwritable( value ) ); then reduce iterator , multiply values. for( int val: value ) { int result *= val; } context.write( key, new intwritable( result ));

javascript - JQuery - Adding class onto element, and then interacting with that class doesn't work -

when click ( ".toggle-button a" ) , adds .close class itself. , fades in .info-overlay this works fine, when click again, want info-overlay fade out again, , close class removed. doesn't work. am missing here? http://jsfiddle.net/bazzle/xps9p/1/ html <div class="toggle-button"> <a>click</a> </div> <div class="info-overlay"> content </div> css .info-overlay{ display:block; width:100px; height:100px; background-color:green; display:none; }; js $( ".toggle-button a" ).click(function() { $( ".info-overlay" ).fadein("500"); $(this).addclass('close'); }); $( ".toggle-button a.close" ).click(function(){ $( ".info-overlay").fadeout("500"); $(this).removeclass('close'); }); use event delegation: change $( ".toggle-button a.close" ).click(function(){ $( ".info-overlay").f...

unix command to copy multiple files from different directories to one new directory -

i newbie unix command usage. ask if there way copy multiple files multiple directories 1 new directory? example: in /tmp/dira --> contains file a.run.log , a.skip.log in /tmp/dirb--> contains file b.run.log , b.skip.log in /tmp/dirc --> contains file c.run.log , c.skip.log and have a.run.log a.skip.log b.run.log b.skip.log c.run.log c.skip.log into new folder called /tmp/dirnew is there unix command able it? appreciate it. thank you. js use : cp /tmp/dir?/* /tmp/dirnew

java - MyBatis - JUnit test shows 'out of memory' -

i doing junit test spring 3.1.1 , mybatis. made resultmap , put customized typehandler handling null value. my map looks below : <resultmap type="map" id="program"> <result property="serviceid" column="id_svc" typehandler="stringhandler"/> <result property="programid" column="id_event" typehandler="stringhandler"/> <result property="programname" column="nm_title" typehandler="stringhandler"/> <result property="directorname" column="nm_director" typehandler="stringhandler"/> <result property="actorname" column="nm_act" typehandler="stringhandler"/> <result property="ratingcd" column="cd_rating" typehandler=...

c - How to terminate an ncurses program with the `raw()` setting turned on? -

in order save time, i'd know if there's professional way terminate unresponsive ncurses program (from terminal) raw() setting turned on. here, ctrl+c won't help. example progam: #include <ncurses.h> int main() { initscr(); raw(); while(1) { printw("yello\n"); } refresh(); endwin(); return 0; } whenever hit control-c ( c-c ) combination, terminal parses , sends signal (sigint) whatever application running in foreground. control-c has no special meaning operating system, terminal. when call ncurses' raw() or cbreak() function, instructs terminal ignore these special characters , pass them on directly whatever's running in foreground, instructing terminal application "knows it's doing". so yes, have "manually" (i.e. terminal) kill running application: ps aux | grep your_executable_name kill the_pid yes, can while in tty. , yes, can jam whole system if lock...

c# - Remaining time until weekend is over -

i want calculate how many seconds there left until weekend on (say until sunday 11.59pm). when operation called in weekend needs return timespan. need on weekly basis cant set 'hard-coded' enddate new datetime(2014, 04, 17, 23, 12, 33); how set correct enddate calculate remaining seconds now? try: public static void main(string[] args) { //your code goes here timespan span = (next(datetime.now, dayofweek.sunday).date + new timespan(23, 59, 00)).subtract(datetime.now); console.writeline(span.totalseconds); } public static datetime next(datetime from, dayofweek dayofweek) { int start = (int) from.dayofweek; int target = (int) dayofweek; if (target <= start) target += 7; return from.adddays(target - start); } here demo

android - How to send image to server using json -

anybody please check code tell me whats error in please. m uploading image server first upload show me memory out of error , after upload small image don't know gone please me. here code uploadbutton = (button)findviewbyid(r.id.uploadbutton); btnselectpic = (button)findviewbyid(r.id.button_selectpic); messagetext = (textview)findviewbyid(r.id.messagetext); imageview = (imageview)findviewbyid(r.id.imageview_pic); btnselectpic.setonclicklistener(this); uploadbutton.setonclicklistener(this); uploadserveruri = "http://10.0.2.2/chatapp/upload_image_android/upload_image.php"; imageview img= new imageview(this); } @override public void onclick(view arg0) { if(arg0==btnselectpic) { intent intent = new intent(); intent.settype("image/*"); intent.setaction(intent.action_get_content); startactivityforresult(intent.createchooser(intent, "complete actionusing"),1); } else...

java - How to split a string or get the right text from string -

this question has answer here: java: simplest way last word in string 5 answers i need split string. right now, string contains this: "rm 8 text" now want text printed in string builder using append, how rid of rm 8 in start of string? right have done way, there has easier way. string[] lines = fromserver.split("\\s+"); string line2 = lines[2]; logbuilder.append(line2); assuming standard format string lastword = fromserver.substring(fromserver.lastindexof(" ")+1);

c# - CA2000 and I don't see the reason -

i'm writing project , use microsoft code analysis , receive following error: ca2000: dispose objects before losing scope. this on code i've written around entity framework. public bool isinstalled(installationcontext context) { var dbcontext = new scheduleframeworkdatacontext(); var repository = new taskrepository(dbcontext); try { // check if there task same name. if (repository.get().select(x => x.name == context.installationparameters.name).any()) { return true; } } { dbcontext.dispose(); } return false; } now, think context disposed because it's in block. (the context ef code first db context). however, still receive error. am missing here? the code analysis tool right in instance. if taskrepository() constructor throws, finally block won't run (since exception thrown outside of try block), , dbcontext not disposed. moving constructor call , assignment repository inside try bl...

ruby on rails - Bundle install issue - gemspecs installed read only root - and then cannot be read by bundler? -

i'm trying run "bundle install" install required gems rails project. wasn't issue - new machine i'm working on... i've been installing ruby (1.9.3 545) rails etc. , @ point of bundle install. some sample output below (some gemspecs snipped out keep quote short!): [shall@mars2-stream14 qa_web]$ bundle install /usr/local/lib/ruby/1.9.1/yaml.rb:84:in `<top (required)>': seems ruby installation missing psych (for yaml output). eliminate warning, please install libyaml , reinstall ruby. fetching gem metadata https://rubygems.org/......... fetching additional metadata https://rubygems.org/.. using rake 10.2.2 using i18n 0.6.9 installing json 1.8.1 errno::eacces: permission denied - /usr/local/lib/ruby/gems/1.9.1/specifications/json-1.8.1.gemspec error occurred while installing minitest (5.3.2), , bundler cannot continue. make sure `gem install minitest -v '5.3.2'` succeeds before bundling. [shall@mars2-stream14 qa_web]$ ls -l /usr/local/li...

database partitioning - "drop partition" functionality in Neo4j, to delete a lot of nodes -

i'm evaluating use of neo4j (2.0, 1.0 used well) project, lot of data (millions of nodes) loaded daily different sources , @ point arbitrary days , sources have entirely deleted, must done quickly. in oracle use partitioning , create different partition each date/source comination, drop partition removal of them fast. there way same result in neo4j? for now, fastest way found label , possibly delete lot of nodes use "partition node" linked them when inserting data , when necessary traverse relationships of , delete of them, both in cypher or using java apis transaction fails because amount of nodes remove cannot stored in memory. is there fastest way remove of nodes label assigned ? an alternate approach partitioning might apply custom label nodes in partition. nodes can carry many labels like, so: neo4j-sh (?)$ create (n:person:partitionblah {name: "bob"}); +-------------------+ | no data returned. | +-------------------+ nodes created: 1...

c++ - When should I use serialization library in boost -

Image
recently, found boost's serialization library. when use save data file, found library not expected be. because i'm not using interface iserializable , implement methods save , load of interface. instead, should add friend class, , implement function template. personally, think it's ugly ( although design idea may kind of nice , tricky). , when try store 2 points text file, file this: obviously it's hard human read. question is: 1. in kind of situation should use library serialization work. example, should use store 3d points file? or should use in more complex scenarios. 2. there way me control format of output file? because think figure above hard understand.

javascript - Use quotes within quotes inside Bootstrap element options -

edit: solves problem https://stackoverflow.com/a/12128784/1162817 i'm using html inside bootstrap popover, got stuck. can't use quotes or single quotes inside onclick because closes wrong things. how can bypass it? <a href="#" data-toggle="popover" data-placement="bottom" data-html="true" data-content=" <div class='div-social-icons'> <ul> <div onclick='location.href="link.html"' class='social-icons icon-facebook'></div> <li class='social-icons icon-youtube'></li> <li class='social-icons icon-vimeo'></li> <li class='social-icons icon-instagram'></li> </ul> </div> <div id='div-form'> <form action='mail.php' method='post'> <input type='email' name='email' placeholder=...

security - C# offline OTP for service authentication -

i'm searching way of authentication blizzard (authenticator). creates off-line otp. know larger companies use "tokens" however, i'm still unable find proper library. so, want; project able create otps on client side without having client connect internet , yet able generate exact same on servers-side. i think can take @ library: https://code.google.com/p/otpnet/ it c# port of popular totp/hotp php. there seems few outstanding issues in library have not yet been fixed developers can patch on side recommendations have been submitted.

javascript - jQuery dynamic selector returning undefined -

i'm sure have overlooked something, confounding me. starting html: <div id="col-header-1"> ... </div> using instafeed (js plugin) instagram images - working fine. outputs following correctly (within col-header-1): <div class="instagram-headers" data-highres="http://origincache-frc.fbcdn.net/10175356_1376290249321406_570358524_s.jpg"></div> this not work, url returns undefined: function replacecssbackgroundwithimage(target){ var url = $('#' + target + ' > .instagram-headers').attr('data-highres'); $('#' + target).css('background-image','url(' + url + ')'); } result <div style="background-image: url('undefined');" id="col-header-1"> so gets target correctly. stepping through in (firefox's) console yields correct result: target = 'col-header-1' //=>"col-header-1" var url = $('#...

xslt - xsl replacing of an empty element with another -

i have xml stylesheet takes multiple xml documents , converts , combines them. xml documents contain same detail, node names different. in 1 gives me problems, have a: <description> text... <newline/> text... <newline/> text... </description> how can change to: <details> <p>some text...</p> <p>some text...</p> <p>some text...</p> </details> using xslt obtain result expect, source xml provided: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="1.0"> <xsl:template match="description"> <details> <xsl:apply-templates /> </details> </xsl:template> <xsl:template match="description/text()"> <p><xsl:value-of select="normalize-space(.)"/></p> </xsl:template> </xsl:stylesheet> if source more complex, have ...

input - OSx Keyboard presses C -

i'm coding experimental design , need able play sounds number of speakers/channels , have user press corresponding key when believe sound coming speaker/channel. (ie: participant thinks sound coming speaker 4 presses key 4). want able record how long takes between sound being played , time takes user press key. as i'm playing sounds same application don't want lock application continually waiting user input. i'm guessing throw user input on thread what's best way achieve this? don't want user have press enter after each key press. i'm using osx , c. in synopsis form , code contain among other things 2 threads. run in secondary thread, ios tone initiator . in primary thread, elapsed timer, while loop includes key trap, , escape condition, whereby loop can exited when condition met. some pseudo code: (using windows functions concept illustration) int grunning = 1; //initiate tone in secondary thread //initialize elapsed time keeper st...

mysql - mysqldump error while exporting all databases -

i exporting , importing new server of databases 900 databases magento, joomla , wordpress while exporting getting type of error. please me export , import command without getting errors. i used command. mysqldump -u root -p --all-databases > /var/www/html/softwares/all-database.sql enter password: mysqldump: got error: 1146: table 'rewardinator.reward_app_users' doesn't exist when using lock tables please me.

dynamically change CSS on window resize using jQuery -

Image
i'm building restaurant menu system whereby chosen menu slides on over click. everything's working correctly, however, i'm trying make dynamically resize window. having massive difficulty this, jquery coming along well, hit wall... jquery var $mmenu = $('.menu__main'); if ($mmenu.length > 0) { var $mnav = $('.menu__nav'), $mnav_a = $mnav.find('a'), m = parseint($mnav.outerheight(true), 10), $contain = $mmenu.closest('.menu-container'), h = 0, l = 0; $mmenu.not(':eq(0)').hide(); $mmenu.eq(0).addclass('active'); $mnav_a.eq(0).addclass('active'); $mmenu.each(function(z) { var $this = $(this), $mmenuheight; $(window).smartresize(function () { $mmenuheight = parseint($this.outerheight(true), 10) + m; }); $this.css('height','auto'); $this.css({ zindex: ...

how to toggle between bootstrap's navbar-default and navbar-inverse with a fade using jquery -

i'm trying toggle default/inverse nav bars in bootstrap, can't fade going between them. ideas? // toggle default/inverse navbar $('#inverse-toggle-button').click(function() { $('#top-navbar').toggleclass('navbar-inverse navbar-default', 1000); }); http://jsfiddle.net/waspinator/65wlg/ you can include jquery ui to animate css change over: <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" /> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> updated fiddle

php - Simple search feature, MySQL prepared statement issue -

i'm in process of creating simple search feature website in user able search database events using number of different criteria (from 1 many, varied number) , i'm experiencing issue prepared statement i'm using, bind_param() in particularly. here relevant php code: ... ... $title = (empty($_post['eventtitle'])) ? null : $_post['eventtitle']; $venue = (empty($_post['venue'])) ? null : $_post['venue']; $catid = (empty($_post['catid'])) ? null : $_post['catid']; $start = (empty($_post['start'])) ? null : $_post['start']; $end = (empty($_post['end'])) ? null : $_post['end']; $price = (empty($_post['price'])) ? null : $_post['price']; include 'database_conn.php'; $sql = 'select eventid, eventtitle, venueid, catid, eventstartdate, eventenddate, eventprice te_events 1'; $sqlcondition = ''; $bindfirstarg = '"'; $bindsecondarg = ''...

reporting services - SSRS Report to run based on an event -

here scenario user wants... etl completed @ 5 , row inserted in table upon successful load. starting @ 5 ssrs report should row inserted, every 30 seconds. when sees row inserted , ssrs report should run in turn sends email users specified in subscription. is there way achieve without sql -rd? please give me direction new msbi. regards, chakrapani m it's not ideal solution, if you're running enterprise edition, set data driven subscription check inserted row, , if it's present, return list of email addresses - use returned value populate "to:" field in data driven subscription. if no data present, no email addresses returned, , subscription "fail". alternatively, if have access so, find job subscription creates on ssrs sql host, , alter add necessary conditional logic run subscription when appropriate.

android - Ant build configuration resources folder -

i trying use ant android built. using 1 code base trying deploy 2 different applications use different resources. @ moment solution below working seems bit of hassle when working because copy , paste entire structure "res" folder every time want build, not knowing build resources in "res" folder, plus excluding layout folder common in "res". i know if there way in ant change name of folder "res" else during build time. way gna project root in "res" folder , bsf have folder , no need copy paste. i appreciate this! thank you. <target name="gna" description="gna application deployment" depends="clean"> <copy todir="${basedir}/res" overwrite="true" force="true" includeemptydirs="true" > <fileset dir="${basedir}/res-gna" > <exclude name="**/layout" /> </fileset> </copy...

php - Displaying the name of a users id -

i have table set-up friends using 1 user's id , user's id , trying take logged in user's id , search every other user's id paired friends grab id's , match id in table called s_users , display names of users in table specific user logged in. assistance? this code showing logged in , grabbing id (working). <? require("includes/db.php"); session_start(); $member_id = $_session['member_id']; //employee login database $result = mysql_query("select * s_user id='$member_id'") or die(mysql_error()); $row = mysql_fetch_assoc($result); $name = $row['user_nicename']; echo "'$name'"; ?> this code have displaying information needed , have no idea i'd begin it: <?php $query = 'select * s_user inner join s_friends b on a.id = b.user_id'; $statusresult = mysql_query($query); while($row = mysql_fetch_array($statusresult)) { $postdate = strtotime($row['status_time']); ...

sql - Best practices for daily MySQL (partial and filtered) replication? -

i have reasonable large database > 40 tables. need replicated few tables (+/- 5). , each tables filtered. i'm looking best practices replicating data (daily enough), can select few tables , included clauses each table. i'm thinking of starting mysqldump each table (with clause) , make each table separate .sql file. can truncate tables (all data daily overwritten) on destination db, , run mysql importing each table separate. example: # dump each table mysqldump -u repl_user my_database my_table -w 'id between 1000 , 1005' > my_table.sql im aware of replicating full database , use blackhole table type. since 35 tables not needed, seems somehow overkill. besides, tables needs filtered version, , can't solve via blackhole. any better solutions? mysql natively supports replication filters , @ database or table level. doesn't meet requirement filter subset of rows these tables. flexviews tool read binary log , replay changes ...

ruby on rails - Working with instance variables within a model -

i want instantiate "battle" upon creation variables can manipulate without accessing database , first when method calls , calculation has been done, save battle result database. want "player" method return sorted array created in callback, @ moment returns nil class battle < activerecord::base after_create @battlelog = "" @field = [] @conditions = [] @player = sort_by_initiative(action.character.army.members.map{ |m| [m.unit, m.amount]}) @computer = sort_by_initiative(action.instance.members.map{ |m| [m.unit, m.amount]}) end # associations belongs_to :action def sort_by_initiative(array) array.sort { |a, b| b.first.initiative <=> a.first.initiative } end def player @player end i think looking attr_accessor :player , (this ruby, see ruby classes more) creates accessible attribute (read , write) on model instance. attr_reader :player give read-on...

javascript - Getting issue while doing validation using jQuery with JSON call -

i have 1 text box in view in mvc , have validate text box client side before submit.i'm using jquery validation following: $("input[type='submit']").click(function () { //validation @ client side //------------------code 1------------------- if ($("#txtname").val() == "") { alert("please enter name."); return false; } //------------------code 1------------------- //------------------code 2------------------- //call database validation $.getjson("/producy/isexist?productname=toy", function (data) { if (data.isexists == "1") { alert("product exist."); return false; } }); //------------------code 2------------------- }); validation working code 1 not code 2 when click o...

jquery - JSON passed from Python (Flask) into JavaScript is displaying on screen -

i passing json python back-end front-end javascript i'm running webgl (three.js) animation. json holds numerical values determine happens in animation. problem while have basic ajax request working, json being printed screen (in lieu of animation) rather becoming variable can iterate through control aspects of animation. 2 halves of call shown below. i asked related question 1 before , got great help, still missing piece of puzzle. i've been reading docs , sorts of sources, yet need nudge in right direction working. appreciated! in python backend: from flask import response, json, render_template, jsonify app import app motifs import get_motif, get_motif_list @app.route('/') def index(): motifs = get_motif_list(10) # first version of return below sends data, yet printed # screen, rather being stored data in variable. return response(json.dumps(motifs), mimetype='application/json') # version of return not work: # return render...

javascript - Box2dWeb call function when objects collide -

i'm new javascript , box2d, wondering if knows how can call custom function when 2 objects collide. tried using examples uses b2contactlistener without succes. i've placed object above , let standard box2d physics it's thing. i recieve 2 console outputs, first null , second ball following code: var listener = new box2d.dynamics.b2contactlistener; listener.begincontact = function(contact) { console.log(contact.getfixturea().getbody().getuserdata()); console.log(contact.getfixtureb().getbody().getuserdata()); };. the 2 objects need collide b2_dynamicbody (ball) , b2polygonshape . (rectangle). using bodydef.userdata = "ball"; in ball.js , bodydef.userdata = "mouse"; in mouse.js try identify if hit. instead ball displayed. next i'm sure not correct way detecting collision :p hope i've explained enough, steer me in right direction? ok solved myself, apparently had add custom event world create box2d. so, issue solv...

Android maps auto zooming -

hi im having little issue displaying points on map. use arraylist store multiple lat/lng values , loop add point , auto zoom. works fine when there 2 or more markers. problem when 1 marker added zooms in close. anyone know how resolve this? public static void processmap() { (int = 0; < lat.size(); i++) { markeroptions markeroptions = new markeroptions(); latlng latlng = new latlng(lat.get(i), lng.get(i)); markeroptions.position(latlng); markeroptions.title("title"); markeroptions.snippet("description"); mmap.addmarker(markeroptions); bounds.include(new latlng(lat.get(i), lng.get(i))); } mmap.movecamera(cameraupdatefactory.newlatlngbounds(bounds.build(), 150)); } updated code public static void processmap() { int num = 0; double lat2 = 0; double lng2 = 0; (int l = 0; l < lat.size(); l++) { lat2 = lat.get(l); ...

forms - PHP Return text field data only if box is checked -

i'm creating simple email order form, php skills lacking. have 4 text fields, , want them returned if checkbox selected <input type="checkbox" class="checks" name="cards" id="cards" value="yes" /> business cards <label for="cardname1">name (exactly should appear on card): </label><input type="text" name="cardname1" id="cardname1"> <label for="title1">title: </label><input type="text" name="title1" id="title1"> <label for="phone1">phone: </label><input type="text" name="phone1" id="phone1"> <label for="fax1">fax: </label><input type="text" name="fax1" id="fax1"> i'm returning $body = "from: $name\n e-mail: $email\n phone:\n $phone"; from part of form. simplest way includ...

ftp - PHP web file manager -

im having troubles load images web file manager php page. have in page: <?php define("ftp_connect_ip", ip); define("ftp_connect_port", port); // set username , password define("ftp_login_user", username); define("ftp_login_pass", pw); // connect ftp server $conn = ftp_connect(ftp_connect_ip, ftp_connect_port); // log ftp srever $login_result = ftp_login($conn, ftp_login_user, ftp_login_pass); if(ftp_pasv( $conn, true )){ echo 'works'; }else{ { echo 'dont works'; } } ftp_close($conn); ?> the problem is, have no clue how directly access files nas (web file manager). can list of files in directory specify, have no idea how load them, , if direct file access alowed done. appreciated, since lack knowledge kind of things. if(ftp_pasv( $conn, true )){ $contents = ftp_nlist($conn, '/'); try adding line above in place of echo 'works'; line, check var_dump($contents); shows...

android - Download images in async task and show them in ListView -

i've list of urls , each corresponding image . i need display these images in listview . currently, approach pass list<string> containing urls customadapter (extending baseadapater) . each row item in listview inflated imageview . then in getview() method, if currentimageview == null , i'll start asynctask , download bitmap imagelist.get(position) . then in postexecute() , i'll set currentimageview.setbitmap(downloadedbitmap) . in manner,from inside adapter, i'll call asynctask one-by-one each image. if think, there wrong in approach please let me know. also, please suggest correct approach. one pitfall approach i've found in when asynctask list element in progress & user scrolls down up, same async task called again. how can prevent this? when views recycled, currentimageview not null , keep displaying same images. suggest using universal image loader . takes care of of you, tons of features caching , not.

android - Sending text from EditText to friend with app installed -

i looking way send text edittext, friend app installed, friend recieves "message" inside app, , not on actual facebook. in edittext when have written x amount of characters, redirected listview fetches friends facebook, how bring text edittext next activity, , send facebook friend? any tips on how should go here appreciated :) here listview have: // populate list list<string> values = new arraylist<string>(); (profile profile : friends) { //profile.getinstalled(); values.add(profile.getname()); } arrayadapter<string> friendslistadapter = new arrayadapter<string>(getapplicationcontext(), r.layout.list_items2, values); friendslistadapter.sort(new comparator<string>() { @override public int compare(string lhs, string rhs) { return lhs.compareto(rhs); } }); ...

vb.net - IndexOutOfRangeException was Unhandled. Cannot find table 0 -

can please on how fix error? im getting error "error:syntax error(missing operator)in query expression '''ans'." code: imports system.data imports system.data.oledb public class frmexam : inherits system.windows.forms.form dim ds new dataset() dim qno() integer dim pos integer private sub btnfinish_click(byval sender system.object, byval e system.eventargs) handles btnfinish.click processanswer() dim i, marks integer dim dr datarow marks = 0 = 0 noq - 1 dr = ds.tables(0).rows(qno(i)) if not isdbnull(dr.item("ans")) andalso dr.item("correctans") = dr.item("ans") marks += 1 end if next try con.open() dim cmd new oledbcommand("insert stud values(stud.nextval,'" & subjectcode & "','" & username & "','" & marks & ")", con) msgbox(cmd.commandtext) c...