Posts

Showing posts from February, 2010

Inserting into multiple tables with multiple rows into a table in sqlite -

i want insert 2 tables @ time. this needs done way. insert single row 1 table, auto incremented primary key , insert multiple rows other table, using primary key value got first table reference. what best way this? sqlite has built-in last_insert_rowid() function, return value change after next insertion. you have read value in program, , insert manually: db.execute("insert people(name) values (?)", ["joe"]) id = db.last_insert_rowid db.execute("insert pets(owner, name) values (?,?)", [id, "fluffy"]) db.execute("insert pets(owner, name) values (?,?)", [id, "spot"])

c# - Find Text between Html Tags -

i working on htmldocument , want text between tags: <span>location:</span><br/> 50 airport road<br/> ottawa, ca <br/><br/> <span>latitude / longitude:</span><br/> 40.32083 / -71.67275<br/><br/> i want 2 things: 50 airport road ottawa, ca 45.32083 / -75.672775 how this. in advance. english not please ignore. use html agility pack, includes dom parser - never worth writing own parser or regexs html. http://www.nuget.org/packages/htmlagilitypack in example below, can see how easy select element using xpath. because values want aren't in element, i'm using text() them. if part of larger document, expand xpath reflect location in wider document. string html = @"<span>location:</span><br/> 50 airport road<br/> ottawa, ca <br/><br/> <span>latitude / longitude:...

ios - Emulating aspect-fit behaviour using AutoLayout constraints in Xcode 6 -

Image
i want use autolayout size , layout view in manner reminiscent of uiimageview's aspect-fit content mode. i have subview inside container view in interface builder. subview has inherent aspect ratio wish respect. container view's size unknown until runtime. if container view's aspect ratio wider subview, want subview's height equal parent view's height. if container view's aspect ratio taller subview, want subview's width equal parent view's width. in either case wish subview centered horizontally , vertically within container view. is there way achieve using autolayout constraints in xcode 6 or in previous version? ideally using interface builder, if not perhaps possible define such constraints programmatically. you're not describing scale-to-fit; you're describing aspect-fit. (i have edited question in regard.) subview becomes large possible while maintaining aspect ratio , fitting entirely inside parent. anyway, can a...

jquery - Pass checkbox values into an array using ajax to php -

i needing passing checkbox values array using ajax , retrieving values in controller. following code not working. receive error: "invalid argument supplied foreach()". var_dump gives string(42) "educator_classes[]=1&educator_classes;[]=3 thanks can provide. my html form input: <input type="checkbox" id="educator_classes[]" name="educator_classes" class="educator_classes" value="<?php echo $class_number; ?>"/> my jquery: $("#send_invite").click(function() { var form_data = { opportunity_id: $('#opportunity_id').val(), educator_id: $('#educator_id').val(), educator_classes: $('#educator_classes:checked').serialize(), ajax: '1' }; $.ajax({ url: "<?php echo site_url('schedule/update_educator_class'); ?>", type: 'post', data: form_data, success: fun...

php - MySQL Unique Key scenario -

i have table consisted of following columns: table name: user columns: {id, fk1, fk2, username} id : primary key fk1 , fk2 foreign keys coming other tables there 2 cases: 1) fk1 + username = unique value 2) fk2 + username = unique value for example: fk1 = id of country in country table fk2 = id of state in state table in countries have states (ex. usa) what want username of user unique inside state. 2 users different states can have same username, not in same state. in countries no states (ex. spain) two users same country cannot have same username. 2 users different countries can have same username. so, if user registered coming country having states need create unique index columns fk2 , username . [ensure uniqueness per state] if user registered coming country no states need create unique index columns fk1 , username . [ensure uniqueness per country] what did far create table users coming states , table users coming country no states. be...

c++ eclipse odd compiler error messages -

i getting extremely weird errors in code. on line function declared, says string not part of std, , 'variable ‘sdl_texture loadimage’ has initializer incomplete type'. on line after that, says expected ; before curly brace. same snippet of code literally working minute ago. can fix it? if need more information, gladly give it. also, running on linux, might make difference, too. #include <sdl2/sdl.h> #include <sdl2/sdl_image.h> #include "levelrenderer.h" #include "err_log.h" sdl_texture loadimage(std::string path) { return loadtexture(getresourcepath() + path + ".png", getlevelscreen()); } it means haven't included header defines sdl_texture ; 1 declares it. makes incomplete , can limited things it. in particular, can't create instance of it, function when returns value. according google skills , need include <sdl_sysrender.h> . you should include <string> since you're using std::string ....

api - Symfony2 How to authenticate an user on two different firewall with two different method? -

i have 2 firewalls, 1 api calls (wsse secured), 1 application. both works well, need authenticate user on api firewall , in same time on application firewall , can't that. my security.yml firewalls: # firewall api wsse_secured: pattern: ^/api/.* wsse: nonce_dir: null lifetime: 300 provider: fos_userbundle context: user # firewall application main: pattern: /.* form_login: provider: fos_userbundle login_path: fos_user_security_login check_path: fos_user_security_check default_target_path: espace_perso always_use_default_target_path: false failure_path: fos_user_security_login logout: path: fos_user_security_logout target: fos_user_security_login oauth: resource_owners: facebook: "/login/check-facebook" linkedin: ...

java - Adding Libgdx Scrollbar to TextArea -

so i've been searching around , life of cannot figure out how correctly this. have small text area , want able scroll through it. i've been told it's easy adding textarea scrollpane, appears more complicated that. here's gist of code: skin defaultskin = newskin(default_skin_filepath +"uiskin.atlas", default_skin_filepath +"uiskin.json"); textarea textarea = new textarea(levelloader.getcodesnippet(), defaultskin); scrollpane pane = new scrollpane(textarea, defaultskin); pane.setforcescroll(false, true); pane.setflickscroll(false); pane.setoverscroll(false, true); pane.setbounds(0f, 20f, game.getwindowwidth(), 300f); gui.addactor(pane); gdx.input.setinputprocessor(gui); setiscreated(true); levelloader.getcodesnippet() returns string containing multi-line piece of text .txt. textarea appears in game window, , multi-lined text appears. however, can scroll through text arrow keys. forced scrollbar display itself, occupies entire right side of wind...

liquibase diffChangeLog does not reflect any changes -

i´ve been able generate changelog current database using following command: liquibase --driver=org.hsqldb.jdbc.jdbcdriver --classpath=c:\i2s-devenv\apps\hsqldb-2.2.9\lib\hsqldb.jar --changelogfile=c:\i2s-devenv\changelog.xml --url="jdbc:hsqldb:hsql://localhost:9901/test_db" generatechangelog now, i've made changes in database (drop tables) , want update changelog reflect changes. i've execute following command: liquibase --driver=org.hsqldb.jdbc.jdbcdriver --classpath=c:\i2s-devenv\apps\hsqldb-2.2.9\lib\hsqldb.jar --changelogfile=c:\i2s-devenv\changelog2.xml --url="jdbc:hsqldb:hsql://localhost:9901/test_db" diffchangelog --referenceurl="jdbc:hsqldb:hsql://localhost:9901/test_db" what wrong approach. can not see differences in changelog. thanks. tiago you comparing database itself. in order compare 2 databases, have have --url argument , --referenceurl different databases. --url="jdbc:hsqldb:hsql://localhost...

Is this possible to show my own, custom ads on youtube video -

i have question know. , is, possible show custom , own ads on youtube videos? mean, link or banner reffering own blog or website. have searched on google din't find result answaring question. have asked here on stackoverflow. thanks in advance. appericiated. not i'm aware of. options in channel on/off adsense units. imagine if epic status them, you'll account rep potentially work own inventory.

php - How to group by only by one reference in Doctrine 2 -

i have $qb = $this->getfindquerybuilder(); $entityalias = $this->getentityalias(); $qb->select([ $entityalias, 'product', 'category', 'categories', 'productcategoriescategory', 'productcategoriesproduct', ]); $qb->leftjoin("{$entityalias}.product", 'product'); $qb->leftjoin("{$entityalias}.category", 'category'); $qb->leftjoin("product.categories", 'categories'); $qb->leftjoin("categories.category", 'productcategoriescategory'); $qb->leftjoin("categories.product", 'productcategoriesproduct'); and $qb->groupby('product.id'); so when added group expression correctly grouping product.id mistakenly grouping productcategoriesproduct.id, product , productcategoriesproduct same entity... need grouping product.id selec...

hyperlink - Chrome developer tool erroneously interpreting console log string output as links -

when use console.log display string, chrome interpret portions of string links, , decorate console output accordingly. how can prevented? here sample demonstrates issue. notice although there no links in output of second console.log statement, chrome still interprets portion of hyperlink. <!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> </head> <body> <p id="jedi_mind_trick">this not demo looking for. move along!</p> </body> <script> function example() { var test = {data:$('#jedi_mind_trick').html(),obi_wan:"kenobi"}; } console.log(typeof example, example); console.log(typeof example.tostring(), example.tostring()); </script> </html> for else might experiencing problem, have discovered workaround avoids developer console's log output link decoration feature. use chrome devtools co...

sql - Getting lowest level in a tree from any higher level with a self-join -

using sql server 2012, have table looks this: type | code | parent_type | parent_code 4 | 123 | 2 | 1 4 | 234 | 2 | 1 6 | 1234 | 4 | 123 6 | 2345 | 4 | 234 7 | 12345 | 6 | 1234 7 | 23456 | 6 | 1234 7 | 34567 | 6 | 2345 it maps parent type/code combinations child type/code combinations. maps type 2 type 4, 4 type 6 , 6 type 7. if records parent_type of 2 , parent_code of 1 : select * mytable parent_type = 2 , parent_code = 1 it return: type | code | parent_type | parent_code 4 | 123 | 2 | 1 4 | 234 | 2 | 1 what i'm trying figure out best way of type 7 codes live under ultimate parent type 1 code. in addition, need work type level. i'd able type 7 codes under type 4 code, or type 7 code (which returns single matching row). so i'd see, when searching parent_type = 2 , parent_code = 1 is: ty...

Playing online radio using BackgroundAudioPlayer on Windows Phone 8 -

i want play songs online radio , using backgroundaudioplayer windows phone 8. downloaded sample app provided ms , modified bit test whether streaming link working or not. so, new audiotrack object looked one, new audiotrack(new uri("http://live.abcradiobd.fm:8282/;listen.mp3", urikind.absolute), "abc radio", string.empty, string.empty, null) this not working @ all. after generates timeoutexception link working in vlc player , other audio player out there.any solution? solved: tried phonesm , it's working perfectly. can use both audio , video streaming. before building project make sure have downloaded correct version mppf v1.2 here , install extension visual studio.

c - Extracting the string from the delimiter "/" -

#include<stdio.h> #include<malloc.h> #include<string.h> int main(){ char* path = "lost+found/d1/dentry"; char* str = malloc(100); char *temp; if(null == str) perror("malloc failed"); temp = str; while(*path != '/'){ *str++ = *path++; } *str = '\0'; str = temp; printf("\n str : %s \n",str); return 0; } o/p: str : lost+found is there library function can extract string delimiter "/" [strrchr , srchr gives last , first occurences of '/', string search lost+found]. strtok direct way c library has offer tokenize string. there glitches though: the string want tokenize cannot const the given string changed during strtok calls if need first segment in path (as question suggests) , not '/'-delimited tokens strchr may come in handy (along strcpy , pointer arithmetic).

Get Latest on All Open Projects from TFS Server using Eclipse Plug-In -

Image
is there way, in eclipse tfs plug-in, latest tfs server open projects? maybe similar getting latest on entire solution in visual studio. getting latest in entire working set ok too, don't see way either. i realize can using tfs command line utilities or using tfs shell integration. inconvenient though. i'd love able in eclipse can in visual studio. plug-in or fine long integrates cleanly eclipse. i'm using "tfs plug-in eclipse" version "12.0.1.201403041643" against team foundation server 2010. eclipse luna 4.4. projects android java projects, if makes difference. here's shot of doing now. works, have each project individually. goal this, once open projects.

jquery-ui connected lists append output to textarea -

so don't know doing when comes jquery, , pieced script together. trying have 3 jquery-ui lists connected, works, capture content of each list individually. need #sortableequipmentday , #sortableequipmentnight. if @ jsfiddle included you'll see moving items lists gives random output , not id's of 2 lists i'm looking for. also .append doesn't appear clear old data adds onto text inside text area. any awesome! javascript: $(function() { var lists = $( "#equipmentpool, #sortableequipmentday, #sortableequipmentnight" ).sortable({ connectwith: 'ul.droptrue', update: function() { lists.each(function(){ var dayshift = $("#sortableequipmentday").sortable("toarray"); var nightshift = $("#sortableequipmentnight").sortable("toarray"); $("#out1").append( dayshift.join(',')); $("#out2").append( nightshif...

Perl CPAN module object method not found error -

i trying use cpan module: math::vector::real::neighbors i see following error message: can't locate object method "box" via package "math::vector::real" @ /usr/local/share/perl/5.14.2/math/vector/real/neighbors.pm line 12. so, go package , see this: my ($bottom, $top) = math::vector::real->box(@_); next, go real.pm package at: /usr/local/share/perl/5.14.2/math/vector/real.pm i see box sub routine exist in it: sub box {... any idea why error might cropping up? you need add use math::vector::real top of script math::vector::real::neighbors work. following code runs expected: use strict; use warnings; use math::vector::real; use math::vector::real::neighbors; use math::vector::real::random; @v = map math::vector::real->random_normal(2), 0..1000; @nearest_ixs = math::vector::real::neighbors->neighbors(@v); but note did not work without line use math::vector::real .

How do I get a function to retain values I assign? (R) -

this follow-up question posted earlier how assign values vector of names: r: how concisely assign names vector parameter components? i want assign values vector of names , need in multiple different functions of form function2 in code below. rather insert code every function, i'd write subroutine of form function1 below, , call in each function. unfortunately, name assignments kept within function1 when call , don't survive used within "return( adam +...)" part. suspect how specify environment assign function, don't know how fix (i don't want assign names globally). can help? the rough code i'm trying use below: function1 <- function(vector, names){ (i in 1:length(vector){ assign(names[i], vector[,i], envir = environment()) } } function2 <- function(vector){ names1 <- c("adam", "becky", "charlie",...) function1(vector,names1) return( adam + becky^2 - 2*charlie*david +...) } you don...

python - Can I use fdpexpect on a file that's currently being written to? -

i'm trying wait until text written live logfile in python. fdpexect seem right thing this, isn't waiting. hits end of file terminates. i'm wondering if fdpexpect doesn't support , i'll need work around it? the code have this: creating spawn object: # we're not using pexpect.spawn because want # output written logfile in real time, # spawn doesn't seem support. p = subprocess.popen(command, shell=shell, stdout=spawnedlog.getfileobj(), stderr=subprocess.stdout) # give fdspawn same file object gave popen return (p, pexpect.fdpexpect.fdspawn(spawnedlog.getfileobj())) waiting something: pexpectobj.expect('something') this quits , before 'something' event happens eof error. fdpexpect isn't design work on normal files. pexpect read file object until hits eof - pipes , sockets, won't happen until connection closed, normal files, happen entire file ...

Where can I download Access 2003 sample database Northwind.mdb -

i looking find 2003 version of ms access northwind database because want @ switchboard functionality not used in later northwind database versions. since microsoft no longer supports 2003, no longer available download on website. are there other safe websites make available download? if so, kind soul please point me it? thanks. not sure why getting voted down. trying grasp how use switchboard hyperlink websites, pdf files located on our server, , functions. understand older version of database might cover this. see related coding since sample database guide me in direction. want see how switchboard works before asking specific coding questions related this. please enlighten me errors of ways on post. if can't post question here, can i? found sample download here: http://www.accessforums.net/code-repository/microsofts-northwind-database-example-7735.html it did not me though. wasn't using switchboard manager functionality. oh well. know.

javascript - Hide div without showing it first -

is there way hide div without loading first, when want hide div first show 0.5sec , hide self, , animation below, looks ugly, there way avoid this, or using js wrong way? $( document ).ready(function() { $('.errors').hide(1); $('.errors1').hide(1); }); $( document ).ready(function() { $('.errors').animate({width: 'show'},1000); $('.errors1').animate({width: 'show'},1000); }); use css .errors, .errors1 { display: none; } and can remove js $( document ).ready(function() { $('.errors').hide(1); $('.errors1').hide(1); }); js fiddle demo

python - Marketplace App SSO issue with Google Appengine - additional prompts are causing App to be refused by Google Team -

we have google apps marketplace app need upgrade use oauth2 or removed marketplace. we have implemented oauth2 specified @ (example best practices) link: https://code.google.com/p/google-api-python-client/source/browse/samples/appengine/main.py now when user log in app (even thought domain admin has installed app , granted access) user prompted message "your domain administrator has approved access xxxxx". the question why , cause app fail marketplace best practices , rejected marketplace? oauth2 handled following scopes / code using built in python appengine decorators: decorator = oauth2decorator( client_id='ourclientid', client_secret='ourclientsecret', scope='https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile') the same scopes added via marketplace sdk , granted domain admin? i believe google removing apps marketplace month not use oauth2 sso. it turned out oauth2 python...

python - django - get_or_create() is not saving to sqlite db -

i trying save multiple objects in loop. for in range(0,12): some_url = "blabla.com/signnum=" + str(i) req = urllib2.request(astro_url,headers=hdr) str_response = urllib2.urlopen(req) json_str = json.load(str_response) transaction.atomic(): if == 0: capricorn, cp_created = capricorn.objects.get_or_create(astro_date=json_str['daily']['data_date'], defaults={ 'headline': json_str['daily']['headline'], 'headcontent':json_str['daily']['content'], 'rating':json_str['daily']['rating'], 'love_rate':json_str['daily']['love'], }) if cp_created: print 'capricorn saved' ...

c# - Model Values Getting Lost During PostBack -

i'm trying pass model controller. have included fields of model in form 2 parts of model getting lost once makes controller, employees , employeesinmultiplecompanies, both of type ilist. have verified fields present when passed view, don't make controller. .cshtml @using (html.beginform("postemail","import",formmethod.post)) { @html.antiforgerytoken() @html.validationsummary(true) <fieldset> <legend>emailviewmodel</legend> <p> <input type="email" name="emailaddresses" value=" " required="required" /> <span class="btn_orange"><a href="#" class="remove_field" >x</a></span> </p> <p> <span class="btn_orange"><a class="add_email_button" href="#">add email</a></span> </p> ...

javascript - How to filter deprecated HTML elements with jQuery -

i'm aware can use filter() select html elements dom. in order make sure html following current html5 standards, replace elements <u> or bit more exotic <strike /> current standard counterparts or remove them @ all, appropriate. do $('strike, s').each(function(index){ $(this).replacewith('<span>'+$(this).contents()+'</span>').css('text-decoration','line-through'); }); my question: there way select non-valid or deprecated without explictly enumerating them in selector? impossible if uses custom tag <mytag /> or so? thinking of making use of dtd's wouldn't know efficient way so? this used node server-side optimize html.

Google trends in C# -

i need download google trends data in c#. solutions described on stackoverflow not work anymore oauth google trends download csv file . tried log google account in ie , use cookies described here download csv google insight? . not working. when trying google api, described here https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth , not know service use google trends. not know, service enable in google developers console. google trends service not supported here? how can solve problem?

c++ - Is it possible to have VS2010 and VS2012 projects concurrently on the same source code -

i have vs2010 library project use in new app in vs2012. of course when open vs2012 wants update library project. there way of having 2 projects - 1 vs2010 , 1 vs2012? we have large product portfolio , not apps move vs2012 @ same time. generally, long you're running vs2010 sp1, work appropriately opening project both versions of vs. for c++ compatibility specifically: you can use visual studio 2012 open c++ project created in visual studio 2010 sp1. if want use visual studio 2012 build environment build project created in visual studio 2010 sp1, must have both versions of visual studio installed on same computer. the full list of compatibility information can found on msdn

Wordpress admin_menu capability -

i'm having problems menu page. have setup add_action('admin_menu', 'todays_orders_page'); function todays_orders_page() { add_menu_page('todays orders', 'todays orders', 'todays_orders', __file__,'todays_orders'); } however, visiting page user has "todays_orders" capability results in permission denied error. any great. thanks mark the arguments passing add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ) not correct - omitting "capability" , not passing in page function. try following (this example uses edit_posts capability ). should replace "page_function" function used display page contents. add_menu_page( "today's orders", "today's orders", 'todays_orders', 'edit_posts', 'page_function' );

c# - UserControl not rendering correctly -

i have 2 usercontrols , 1 view. have grid button when clicked, sends object parent (the view) , uses object update second control. problem though when debug it, once page renders again, second usercontrol still not visible , textbox remains empty. the first usercontrol called ctrlmyroster ascx: <%@ register assembly="telerik.web.ui" namespace="telerik.web.ui" tagprefix="telerik" %> <telerik:radgrid id="radgmyrosters" cssclass="radgmyrosters" runat="server" allowpaging="true" allowsorting="true" autogeneratecolumns="false" onitemcommand="radgmyrosters_itemcommand"> <mastertableview> <columns> <telerik:gridboundcolumn datafield="rostername" headertext="rostername" datatype="system.string" uniquename="rostername"> </telerik:gridboundcolumn> <telerik:gridtem...

android - Retain DialogFragment after unlocking Screen -

i have created 1 instance of dialogfragment. getting created properly. when lock screen, getting detach , dismiss. when unlock screen, can't see dialogfragment saw 2 secs ago before lock screen. want prevent dismissing of dialogfragment on locking screen. please me. thanking in advance. i think in case simplest way should remove dialog in onpause() , and show again in onresume(). in way dialog change according config changes [like language change].

Android sensor update rate -

i have been working on android sensors , can't confirm when onsensorchanged(sensorevent e) fires. 1)i started sensorlistener 2)i assumed onsensorchanged fired when sensor changed previous value (stored where???) 3)i ended listener (after 60 seconds) i repeated same steps 5 minutes later no phone changes , few different values , whole bunch of zeroes. can point somewhere in documentation answers question? onsensorchanged called if new sensor values can taken. can set frequency of getting sensor values: android.hardware.sensormanager.registerlistener(sensorlistener listener, int sensors, int rate) int sensor_delay_fastest sensor data fast possible int sensor_delay_game rate suitable games int sensor_delay_normal rate (default) suitable screen orientation changes int sensor_delay_ui rate suitable user interface

javascript - Need method create and not update when instance actually does exist -

Image
ruby 2.0.0, rails 4.0.3 i have _new partial. but, render instance exists. necessary can pass instance id around through javascript between view , controller, since cannot pass instance itself. call class.first in new method have existing instance use through process. my problem _new partial submit button recognizes instance exists. causes update instead of create. button literally says update. when pressed, routes update method. not want. want create method, i'll create new instance populated gathered parameters. what do? wrong in carrying dummy instance start process? if so, correct solution? if otherwise acceptable, how force button create instead of update? all assistance , comments appreciated. edit: i've tried variations on button try force trigger new method. continues fire update. last failed effort is: <button type="submit" formaction="new_admin_car_path" class="btn btn-default btn btn-primary">create c...

haskell - Interleave function -

i found code builds list corresponding thue-morse sequence : thuemorse :: [int] thuemorse = 0 : interleave (map (1-) thuemorse) (tail thuemorse) interleave (x:xs) ys = x : interleave ys xs it's perfect , works wonders, cannot wrap head around it. example: > take 8 thuemorse [0,1,1,0,1,0,0,1] if define interleave function globally , use get, , rightly so, exception: > let interleave (x:xs) ys = x : interleave ys xs > interleave [1,2,3] [4,5,6] [1,4,2,5,3,6*** exception: <interactive>:29:5-47: non-exhaustive patterns in function interleave so, how above work? because it's infinite list it's safe interleave forever? yes, works because input pair of infinite lists. definition of interleave handles case first argument not empty, ie uses : constructor. lists have second constructor ( [] ) definition ignores possible. more complete definition this, depending on how want handle empty input: interleave (x:xs) ys = x : interleave ys ...

CSS Media Queries Not Working on Larger Screens -

i have css media query in app not working. media query looks this: .categories { background-color: #2e2e2e; padding-left: 0px; padding-right: 0px; } @media screen , (max-width: 90.063em) { .categories { margin-left: 1rem; margin-bottom: 0.6rem; width:75%; } } basically, want width 75% , left margin of 1rem whenever screen size 90.063em , fewer. however, media query not working. applying styles on larger screens well. wrong media query?

java - ANT - How to append compiled classes to classpath dynamically -

setup: project - pure java project no dependencies. project b - pure java project depends on project a. process: i have build project script in each of project root directory , master script run them both, in correct order, first project , project b. script output relative each project's path. the script works fine project a, when comes project b misses classes output of project a. using ant, there way add "dynamically" compile classpath output of compile project? or, there action can take except explicitly provide project b classes output path of project a? ok, took bunch of hacking. first use add ant-contrib ant can download here . then declared var instead of property in main ant script. in compile macro i've passed javac classpath. after compile done, i've appended new classes output folder classpath var , called next compile. good luck. the compile script: <?xml version="1.0"?> <project name="pdf ...

php - draw multiple circles with imagemagick -

Image
i trying draw multiple circles on background image, im having hard time figuring out how it. ive tried passing multiple imagemagick instances draw function did not work. so tried creating new image object, , setting transparent. tried drawing image on top of that, cant adjust opacity @ all. along lines of trying this: <?php ini_set('display_errors', 'on'); error_reporting(e_all | e_strict); function drawimage(imagick $im) { // $im->setcompressionquality(100); $im->setimageformat("jpg"); header("content-type: image/" . $im->getimageformat()); echo $im; exit; } // define circle mask $layer = new imagick('spc.jpg'); //now need height , width. $width = $layer->getimagewidth(); $height = $layer->getimageheight(); $x = $width/2; $y = $height/2; $endx = $x + 150; $endy = $y + 150; $circle = new imagickdraw(); ...

batch file - Windows cmd: echo without new line but with CR -

i write on same line inside loop in windows batch file. example: setlocal enabledelayedexpansion set file_number=0 %%f in (*) ( set /a file_number+=1 echo working on file number !file_number! something.exe %%f ) setlocal disabledelayedexpansion this result in: echo working on file number 1 echo working on file number 2 echo working on file number 3 . . . i of them on same line. found hack remove new line (e.g. here: windows batch: echo without new line ), produce 1 long line. thanks! @echo off setlocal enableextensions enabledelayedexpansion /f %%a in ('copy "%~f0" nul /z') set "cr=%%a" set "count=0" %%a in (*) ( set /a "count+=1" <nul set /p ".=working on file !count! !cr!" ) the first for command executes copy operation leaves carriage return character inside variable. now, in file loop, each line echoed using <nul set /p o...

javascript - Toggle inline mode - jQuery UI datepicker -

Image
jquery ui datepickers can inline or popup depending on type of element called on. <input> makes them popup , <div> or <span> makes them inline. i need way toggle them popup inline , without clobbering event listeners , other things have been coupled elements. as starting point: this fiddle close actual environment. code needs changes: var toggle = function(){ //toggle #startdate's inline-ness without clobbering }; $node.on('click','#toggle',toggle); as can see, datepickers attached timepickers , eachother through datepair script. re-instantiating them when toggle undesirable. a css solution change #startdate 's class ideal doubt that's possible. edit: photo description of i'm trying achieve: i need toggle button toggle between following: inline mode: popup mode: notice how 1 expanded , other pops when clicked on. in fiddle, currently, difference between startdate , enddate datepickers. i ab...

php - .htaccess Error : Invalid command 'AuthGroupFile' -

before working on windows , project working proper. moved ubuntu , trying setup project on lamp. i have created host (windows running directly through localhost) , when running getting 500 internal server error . when looked in log file got invalid command 'authgroupfile', perhaps misspelled or defined module not included in server configuration . .htaccess file #php_value zend.ze1_compatibility_mode off authname "restricted area" authtype basic authuserfile /opt/lampp/htdocs/uniplex_mobile/.htpasswd authgroupfile /dev/null <files manageurls.html> require valid-user </files> <files addurl.html> require valid-user </files> <files editurl.html> require valid-user </files> addtype application/x-httpd-php .php .htm .html my project on smarty framework. can solve this? thanks in advance you can try this. a2enmod authz_groupfile

Auto-suggest input box from RESTful API using AngularJS -

i have input box fill suggestions incrementally user inputs characters -- know, google style. my challenge suggestions number thousands , seems inappropriate load many webpage. fortunately have build restful api can queried list, or parts of list. thinking maybe leverage api , tie angularjs somehow. how tell angularjs autocomplete (i.e. suggest) input box list generated return value of restful api based on user types in input box? try typeahead angular ui bootstrap (scroll bottom of page)

I need to map a JSON string received from a server to a specific Javascript object -

all, i have following code: $.ajax({ url: '@url.action("getmerchantusers", "merchant")', datatype: 'json', success: function (json) { var mappedtasks = $.map(json.parse(json), function (item) { return new task(item) }); self.tasks(mappedtasks); } }); this calls mvc controller returns list of objects jsonresult method. works totally fine. however, need rewrite method because there never more 1 task being returned server. when return 1 task server, however, .net jsonresult method doesn't put '[' , ']' @ beginning , end of json, $.map() sees properties of object collection, want map 1 object returned server task observable instead of multiple tasks tasks observable. i'm new knockout...how map single json object, i'm doing above collection. i'll happy provide more info if needed! also, i've mapped object generic javascript type, want map task type specifically. since...

Creating an object reference for a java class without invoking it's constructor -

i'm interested know that, possible create object reference java class without invoking of it's constructors? if yes, how? definitely bad idea, use sun.misc.unsafe class allocate instance: public static class testclass { int field = 1; } public static void main(string[] args) throws exception { constructor<unsafe> constructor = unsafe.class.getdeclaredconstructor(); constructor.setaccessible(true); unsafe unsafe = constructor.newinstance(); testclass test = (testclass) unsafe.allocateinstance(testclass.class); system.out.println(test.field); system.out.println(new testclass().field); } output: 0 1

How to use rr.edata in MyDns for DKIM? -

i have got mydns server v1.2.8.31 under postgresql , want write txt record dkim database without using admin.php , other tools. how use rr.edata , rr.edatakey in mydns dkim? psql queries should correct insert data? how enable rr.edata in mydns , should rr.data field? you should first activate option in mydns.conf : extended-data-support = yes after can recreate database structure : mydns --create-tables | mysql -u root -p mydns if have data, adjust mysql scheme : alter table rr add column edata blob; alter table rr add column edatakey char(32) default null; to use directly in code, should detect if data longer data field, if it's case should split data : first split going classic data field, second going the edata field(which blob can long), should md5sum edata put in edatakey. if needed can consult code on admin.php provided in contrib repository of source package.

d3.js - How to repeat rotation using d3 -

i'm trying figure out how repeat transition. i' m using world tour own tsv file. tsv file s smaller ends world tour quickly. how can repeat rotation starts @ beginning? //globe rotating (function transition() { d3.transition() .duration(1500) .each("start", function() { title.text(countries[i = (i + 1) % n].name); }) .style("color", "lightgreen") .style("text-anchor", "middle") .tween("rotate", function() { var p = d3.geo.centroid(countries[i]), r = d3.interpolate(projection.rotate(), [-p[0], -p[1]]); return function(t) { projection.rotate(r(t)); c.clearrect(0, 0, width, height); //clear canvas redrawing c.fillstyle = "black", c.beginpath(), path(land), c.fill(); c.fillstyle = "lightgreen", c.beginpath(), path(countries[i]), c.fi...

c# - WPF Binding with Notifyi does not update UI -

my issue ui not updated when propertychanged fired. xaml: <listbox name="bookshelf" visibility="hidden" selecteditem="{binding selecteditem}" panel.zindex="1" height="auto" grid.column="3" margin="8,50,0,0" horizontalalignment="center" itemssource="{binding bookshelf}" background="transparent" foreground="transparent" borderthickness="0" borderbrush="#00000000"> <listbox.itemtemplate> <datatemplate> <stackpanel verticalalignment="center" orientation="vertical"> <textblock fontsize="14" margin="0,10,0,0" fontweight="bold" foreground="black" horizontalalignment="center" text="{binding path=dbid}" /> <textblock fontsize="16" fontweight=...

ios - Why won't Objective C classes autocomplete in swift? (updated) -

i importing objective c classes in bridging header file swift: bridging header #import "mycustomclass.h" in swift class, trying use code: var x = mycustomclass() x.myfunmethod() however, before run/build "use of unresolved identifier" errors @ above 2 lines. furthermore, cannot use autocomplete type out x.myfunmethod() . once run/build, errors go away , app runs normal.

ruby - Need to get owner's name of the first suitcase unloaded -

i know need make program below give me owner's name of first suitcase unloaded, when method take_from_plane called on cargohold object. created say_owner_name method in suitcase class, don't know how make connection between suitcase , cargohold , in context. module stacklike def stack @stack ||= [] end def add_to_stack(obj) stack.push(obj) end def take_from_stack stack.pop end end class suitcase include stacklike attr_accessor :name def initialize(person) self.name = person puts "#{person}'s suitcase" end def say_owner_name print name end end class cargohold include stacklike def load_and_report(obj) print "loading..." puts obj.object_id add_to_stack(obj) end def take_from_plane take_from_stack end end ch = cargohold.new s1 = suitcase.new("caio") s2 = suitcase.new("john") s3 = suitcase.new("jack") ch.load_and_report(s1) ch.load_and_rep...

vhdl - Compilation error in Vivado -

i downloaded vivado free web pack , try simulate simple project this: library ieee; use ieee.std_logic_1164.all; entity async_rs_trig port ( r : in std_logic; s : in std_logic; q : out std_logic; nq : out std_logic); end async_rs_trig; architecture async_rs_trig of async_rs_trig signal bq,nbq : std_logic; begin bq <= r nor nbq; nbq<= s nor bq; q <= bq; nq <= nbq; end async_rs_trig; when push run simulation vivado try compile code , receve error: error: [xsim 43-3409] failed compile generated c file xsim.dir/async_rs_trig_behav/obj/xsim_0.c. but code right, tried simulate empty architecture , receved same error. have fix it? thank you! regards please rename architecture 'rtl' or ever, don't use entity's name architecture name again. reply comment 1: the simulation uses 2 processes, in case of isim these are: yourtestbench _isim_beh.exe simulator gui (isimgui.exe) ...