Posts

Showing posts from February, 2015

Is there a way to separately get the Program Files output for Visual Studio setup projects? -

in visual studio setup project, define program files output (amongst other things of course). is there way output folder directly, i.e. output without building , installing msi windows? what looking similar "file system" publish method web projects. alternatively, "portable install" option in msi (similar instance firefox portable install), or switch in msiexec (i did not find in documentation), or way extract folder structure msi via third-party tool. take @ administrative installation . run postbuild command like: msiexec /a "$(targetpath)" /qn targetdir="$(outdir)\extract" please note didn't test command that's general concept. extract msi directory.

tomcat - Using Liferay as a SSO provider for another application -

i understand in non-standard situation violates every liferay best practice on earth, bear me. i have independent web application, contained in own .war, somehow managed deploy on same tomcat has bundled liferay 6.1.0 installation, got liferay respond own context path ( /wise ) , other application respond own, /wip-reports . what need have preexistent web application check if requests coming user has logged in liferay or not, having liferay act sso provider application. i added liferay-plugin-package.xml application's web-inf have liferay believe it's portlet, still don't know how (if) can have liferay tell other application's servlets if requests coming user has signed on or not. i told add liferay's invokerfilter application's web.xml , after doing had no success, , looking @ invokerfilter source code don't see how possibly have been of help. any (preferably simple) ideas? liferay 6.1 ee comes saml provider built in https://www....

css - How to clear the bottom of an image like clear left / right -

Image
is there way clear bottom of image? tried margin-bottom: 100% , , padding-bottom: 100% , not working because have more divs below clears all. i want clear content of image containing div. html <div class="contentpart"> <p> <a href="http://www.s1waterbike.ro/wp-content/uploads/2013/07/contact-feat1.jpg"> <img class="alignnone size-medium wp-image-88" alt="contact-feat" src="http://www.s1waterbike.ro/wp-content/uploads/2013/07/contact-feat1-300x200.jpg" height="200" width="300"> </a> </p> text.... </div> <div class="contentpart"> text..... </div> css .contentpart img { float: left; clear: bottom; } example of how solution should like based on image, can realize layout using the following html : <div class="contentpart"> <a href="#"> <i...

Is it possible to use HTML/Javascript to browse another website -

is possible use html/javascript browse website? i able access website (a wiki) using browser. site has kerberos/sso authentication mechanism, unable log in using other internet explorer. what create backup of contents on site recursively (it wiki). tried java, unable log in. figured, can create html/javascript tool accesses site within ie? tried using frames, having tool in 1 frame , wiki in another, doesn't seem work. thanks, kjeld cross domain not possible. can try plugin: link

ember.js - Handling promise rejection in ember-data with findQuery() -

i cannot seem ember-data reject failed (404's) when using findquery(..query..); find(..id..); works fine. so in route: app.postroute = ember.route.extend({ serialize: function(model, params) { return { post_id: model.get('slug') }; }, model: function(params){ var query = {}; query.slugs = params.post_id; return app.post.findquery(query).then( function (data) { return data.get('firstobject'); }, function (error) { console.log('error'); throw 'boom!'; } ) }, setupcontroller: function(controller, model){ this.controllerfor('post').set('content', model); }, events: { error: function (reason, transition) { console.log('error!'); } } }); i have tried this: return app.post.findquery(query).then( function (data) { return data.get('firstobject'); }).then( null, function (error) { console.log('error...

objective c - Touch method UIImageView inside UIScrollView -

i wondering how can use touch method uiimageview inside uiscrollview in xcode. when add uiimageview subview self.view, can use touch method. when add uiimageview subview uiscrollview, can't. how can solve this? this code: - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event { touches = [event alltouches]; (uitouch *touch in touches) { nslog(@"image touched"); } } - (void)viewdidload { [super viewdidload]; uiscrollview *scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 44, [uiscreen mainscreen].bounds.size.width, [uiscreen mainscreen].bounds.size.height * 0.9)]; scrollview.scrollenabled = true; scrollview.bounces = true; scrollview.contentsize = cgsizemake([uiscreen mainscreen].bounds.size.width, [uiscreen mainscreen].bounds.size.height); scrollview.userinteractionenabled = yes; [self.view addsubview:scrollview]; uiimageview *imageview = [uiimageview alloc] initwithframe:cgrectmake...

c++ - Can members of a derived class can be accessed when its casted to base class? -

this question has answer here: polymorphism in c++ 9 answers i put simple example illustrate question. here base class. #include <mutex> #include <atomic> class task { public: task() { empty.store(true); } std::mutex access; std::atomic<bool> empty; virtual void work() = 0; }; this derived class. #include <stdlib.h> class exampletask : public task { public: void work() { for(int = 0; < 16; ++i) { data[i] = rand(); } } private: int data[16]; }; as can see, example tasks or jobs done asynchronously. imagine, there queue of task s , bunch of worker threads, maybe 1 each cpu core on target machine. the task queue stores tasks casted base class, worker threads can pick next job queue , call work() . std::list<task*> queue; exampletask *exampl...

tt news - typo3 tt_news item visibility and "read more" issue -

i have typo3 site 3 pages each listing latest news , events , vacancies using tt_news. the item listings 3 pages display clickable title, summary , clickable "read more" link each item. one of 3 pages (e.g events ) seems have problem though because item title , "read more" texts not clickable. i've found happens because these specific items not viewable public site (anonymous users). item's full view viewable via backend. my problem don't know how , why happens. ideas on should @ next? this might happen if detail page type of news isn't visible users, typo3 won't display links pages knows they're invisible user. also, make sure correct singlepid (page detail view) assigned. set in settings category concerned elements belong to.

c++ - Scoped Pointer in Boost : What does mean a raw pointer? -

i read in article smart pointers in boost : " scoped_ptr raw pointers , while scoped_array useful dynamic arrays ." but didn't mean "raw pointers", neither sentence. could of explain me this? thanks their wording unfortunate. "raw" pointers, people mean primitive pointer types, regardless of point to. mean is: scoped_ptr pointers single objects, while scoped_array useful dynamic arrays

c# - Edit and Update in Dropdownlist mvc4 -

i trying implement edit , update in dropdownlist in application. list of values dropdownlist displayed model. selected value not displayed on dropdownlist. selected value populated list of values in dropdownlist. my model : public string state public selectlist regionlist { get; set; } public class region { public string id { get; set; } public string name { get; set; } } view @foreach (var item in model.addresslist) { @html.dropdownlistfor(model => item.state, new selectlist(model.address.regionlist, "value", "text", model.address.regionlist.selectedvalue)) } note : item.state populated value not displayed model.address.regionlist populated , displayed controller public actionresult editaddress(addresstuple tmodel,int addressid) { int country; string customerid = 1; list<addressmodel> amodel = new list<addressmodel>(); amodel = getaddressinfo(cu...

c# - Searching data from database using checkbox list for a ecommerce website -

hello sir wanna search data using checkbox aur checkboxlist if select 2 checkbox wanna data of both checkbox id's code giving me 1 data @ time. please give me demo code type of query. private void checkboxlistbind() { sqlconnection con = new sqlconnection("data source=.\\sqlexpress;attachdbfilename=c:\\users\\flagbits\\documents\\visual studio 2010\\websites\\checkboxlist\\app_data\\database.mdf;integrated security=true;user instance=true"); con.open(); string query = "select * student id='" + checkbox1.text + "'"; sqlcommand cmd = new sqlcommand(query, con); sqldatareader dr; dr = cmd.executereader(); gridview1.datasource = dr; gridview1.databind(); } private void checkboxlistbind2() { sqlconnection con = new sqlconnection("data source=.\\sqlexpress;attachdbfilename=c:\\users\\flagbits\\documents\\visual studio 2010\\websites\\checkboxlist\\app_data\\database.mdf;integrated security=true...

How can I get pymongo to always return str and not unicode? -

from pymongo docs: mongodb stores data in bson format. bson strings utf-8 encoded pymongo must ensure strings stores contain valid utf-8 data. regular strings () > validated , stored unaltered. unicode strings () encoded utf-8 first. > reason our example string represented in python shell u’mike’ instead of ‘mike’ pymongo decodes each bson string python unicode string, not regular str." it seems bit silly me database can store utf-8 encoded strings, return type in pymongo unicode, meaning first thing have every string document once again call encode('utf-8') on it. there way around this, i.e. telling pymongo not give me unicode give me raw str? no, there no such feature in pymongo; every string decoded bson decoded utf-8. python represents string internally ucs-2 or other format, depending on python version. see code bson decoder extracts string . in upcoming pymongo 3.x series may add features more flexible bson decoding allow develop...

Java MySQL connetion pool is not working -

i've written function in java runs mysql query , returns results. i've implemented connection pooling using method here: http://www.kodejava.org/how-do-i-create-a-database-connection-pool/ . function working, connection time still same without pooling ~190 ms. can tell me doing wrong? this code: public static arraylist<map<string,object>> query(string q) throws exception { long start, end; genericobjectpool connectionpool = null; string driver = "com.mysql.jdbc.driver"; string url = "jdbc:mysql://localhost/dbname"; string user = "root"; string pass = ""; class.forname(driver).newinstance(); connectionpool = new genericobjectpool(); connectionpool.setmaxactive(10); connectionfactory cf = new drivermanagerconnectionfactory(url, user, pass); poolableconnectionfactory pcf = new poolableconnectionfactory(cf, connectionpool, null, null, false, true); datasource ds = ne...

delphi - Is possible for a menu item to receive an OnClick event even when it's not enabled? -

i'm trying enable administrator enable/disable menu items in main menu of application ctrl+clicking them. i've injected tmenuitem class in main form custom version , overridden click virtual method, so: uses forms, menus; type tmenuitem = class(menus.tmenuitem) public controlactivationstate: boolean; procedure click; override; end; tmymainform = class(tform) ... procedure tmenuitem.click; begin if controlactivationstate , iskeypressed(vk_control) self.enabled := not self.enabled else inherited; end; it works, top level menu. why top level menu items receives onclick events when disabled , other menu items don't? there way make child menu items receive events too? the top level onclick event triggered receipt of wm_initmenupopup message. message sent when top level item disabled. i'm not sure why sent in scenario, is. , same true sub-item has children. however, sub-item without children, onclick triggered wm_comman...

node.js - How can this function be tested with vows? -

how can following function, intended add routes express.js app based on object hierarchy, tested using vows.js cleanly without breaking vows' separation of topic , vow? var addroutes = function(routeobject, app, path) { var httpverbs = ['get', 'post', 'put', 'delete']; path = path || ''; for(var property in routeobject){ var routesadded = false; (var verbindex in httpverbs) { var verb = httpverbs[verbindex]; var completepath, handler; if (property === verb) { if (typeof(routeobject[verb]) === 'function') { handler = routeobject[verb]; completepath = path; } else { handler = routeobject[verb].handler; completepath = path + (routeobject[verb].params || ''); } app[verb](completepath, handler); routesa...

visual c++ - Different values depending on floating point exception flags set -

short question: how can setting _em_invalid exception flag on fpu result in different values? long question: in our project have turned off floating point exceptions in our release build, turned on zerodivide, invalid , overflow using _controlfp_s() in our debug build. in order catch errors if there. however, results of numerical calculations (involving optimisation algorithms, matrix inversion, monte carlo , sorts of things) consistent between debug , release build make debugging easier. i expect setting of exception flags on fpu should not affect calculated values - whether exceptions thrown or not. after working backwards through our calculations can isolate below code example shows there difference on last bit when calling log() function. this propagates 0.5% difference in resulting value. the below code give shown program output when adding new solution in visual studio 2005, windows xp , compile in debug configuration. (release give different output, that's ...

qt - How to specify libraries only for Android platform build in .pro file? -

i'm trying use qtcreator (2.7.2) + qt (5.1.0) build application runs on both desktop (linux) , mobile (android) platforms. to achieve this, need use different pre-built libraries depending on target platform. how specify in .pro file? the wizard offers linux/mac/windows platform choice like unix:!mac { message("* using settings unix/linux.") libs += -l/path/to/linux/libs } i've tried android { message("* using settings android.") libs += -l/path/to/android/libs } but both build targets unix:!mac gets executed/evaluated. so question is: how detect build target (called "kits" in qtcreator) in .pro file , change library definitions accordingly? i've far found out how specify platform (which seems platform i'm building on , not for) or build variant release/debug. other things i've found should prefix lib+= target platform win32:lib+= . again, won't work android . maybe i'm using wrong syntax platform (android...

javascript - Remove self <a> tag -

this question has answer here: jquery replace tag tag text [duplicate] 2 answers i have litte bug, in menu there's links has no hrefs (like empty link). if has no href, want remove keep text. this got: $('.mainmenu a, .mainmenu *').each(function(){ var href = $(this).attr('href'); if(!href) { console.log($(this).html()); //remove <a> element, how? } }); help please? you need unwrap contents then $('.mainmenu a:not([href])').contents().unwrap() :not filter out elements without href tag .contents() returns jquery object contains contents - text .unwrap() removes anchor tag around it

HMAC in client side JavaScript and identity spoofing -

cryptojs has functions create hmac message , secret key. how can secure considering secret key must stored in plain sight in javascript source deployed on client ? anyone can take key , issue similar requests server under identity of original client of api. isn't "identity" problem hmac supposed solve ? all in all, not understand purpose of hmac in client side js since key can't kept secret. is there use case computing hmac in javascript ? javascript has webrtc 2 clients can communicate peer-to-peer, scenario clients can generate , use own "secret". there cases client -> server usable well. if server "dynamically" serving javascript insert "secret" based on clients current session/login. assuming using https (if not there man in middle slurping "secret") it's not unreasonable assume communication server signed specific "secret" (even on unsecured http) belongs client.

php - Putting User Selected Attachments into mysql DB -

i have form customer service reps can insert call logs. want have allows user select file upon form submit uploaded database. can provide example or resource might lead me in right direction? uploading files using post i'm assuming want store file on server , not put database (large numbers of files inserted in database blobs incredibly bad performance). front-end in short, create upload field in form: <form enctype="multipart/form-data" action="__url__" method="post"> send file: <input name="call-log" type="file" /> <input type="submit" value="upload log" /> </form> storing file then handle upload: $uploaddir = '/var/www/uploads/'; $uploadfile = $uploaddir . basename($_files['call-log']['name']); if (move_uploaded_file($_files['call-log']['tmp_name'], $uploadfile)) { echo "file valid, , uploaded.\n"...

wpf - not able to edit a file -

i using vs2010 , want remove namespace because dont need it. got struck. if remove dll, error namespace doesn't exist, , if remove namespace, vs2010 says files edited outside of source editor. if click make changed namespace , same error, if click no, same error namespace doesnt exist. not using namespace anywhere in code. i can keep dll in reference know why error there. bug? regards

multithreading - Excel VBA QueryTable callback function after table refresh -

this question has answer here: excel vba - querytable afterrefresh function not being called after refresh completes 2 answers i writing/maintaining excel vba application there multiple querytables linked ms sql server databases. users of application can alter sql query each table manipulating various ui controls on excel document. one of issues have come across querytables there use of multi threading. each querytable on document has original state must restored after query ran. instance, if querytable1 had base query of select * example_table and user selected inputs on controls create select * example_table object_oid = '10' i need original state restored. code below snapshot of how accomplishing this sub refreshdataquery() 'dependencies: microsoft scripting runtime (tools->references) dictionary (hashtable) object dim querysheet worksh...

twig - Error in my Symfony project after run composer update command -

i have run command composer update on top of project directory , after reload page surprise error , don't know cause or how fix this: runtimeexception: autoloader expected class "twig_extensioninterface" defined in file "/var/www/html/vendor/twig/twig/lib/twig/extensioninterface.php". file found class not in it, class name or namespace has typo. any advice?

c# - Timer Elapsed Event with Kinect SDK -

so i'm using kinect sdk make application, , it's going well! i'm trying make button take picture, want code taking picture delayed people have time pose. i've tried using system.threading.thread.sleep(3000); happens whole thing freezes (yes know that's sleep does...) , uses first frame anyway. i'm trying use timer , timed event, keep getting errors due inability make static (kinect thing). public class timer1 { private system.timers.timer atimer; public void main() { atimer = new system.timers.timer(3000); //this problem is. i'm getting "cannot access non-static member of outer type 'kinectbutton.mainwindow' via nested type 'kinectbutton.mainwindow.timer1' atimer.elapsed += new elapsedeventhandler(takepicture); atimer.interval = 1000; atimer.enabled = true; } } [private void takepicture(object sender, elapsedeventargs e) { bitmapsource image = (bitmapsource)videostream.s...

Installation of RVM on Ubuntu Server 12.04 -

i running vm ubuntu server 12.04. try install ruby on rails application , first of needed install curl (which done) , try install rvm. i following installation guide : ruby on rails installation i @ step when have run rvm check. won't load when try enter : source ~/.rvm/scripts/rvm update : i have folder /usr/local/rvm when try run : rvm requirements he says : program 'rvm' not installed.... but did command : \curl -l https://get.rvm.io | bash -s stable as shown in tutorial, or didn't install ? have no errors... see : thank using rvm! -sh: 1: source: not found any ideas? relatively new ubuntu. in advance as message says: -sh: 1: source: not found where sh current shell - rvm not compatible it, need use bash: sudo apt-get install -y bash && sudo chsh -s $(which bash) i have not tested steps might adjust system.

java - Maximum precision below unlimited? -

i using bigdecimal make calculations. ran into: java.lang.arithmeticexception: non-terminating decimal expansion; no exact representable decimal result. the answer problem posted here: arithmeticexception: "non-terminating decimal expansion; no exact representable decimal result" this means, there division unlimited decimals, bigdecimal tells me cannot calculate result exactly. avoid have call bigdecimal.setscale(something, rounding_mode); edit: the problem set maximum possible value. use mathcontext precision below unlimited ( mathcontext(precision) ) same problem occurrs there. there need value below mathcontext.unlimited ... does know how accomplish that? moved second question to: why there no bigdecimal.setprecision() method? thank you! oliver first question: there no such thing bigdecimal.unlimited . doesn't make sense. 1 less infinity? because docs don't explicitly mention default mathcontext of bigdecimal, have assume mathcon...

postgis - How to expand a polygon to reach a nearby line -

i expand polygon fills empty space between , nearby (and touching in 2 points) line, in the image posted here . can see blue linestring makes empty space on top of pink polygon , want fill polygon. there postgis solution ? havent' found "easy" way. thanks ! the solution similar 1 presented here . in case need buff linestring bit. with p ( select st_makepolygon(st_geomfromtext('linestring(0 0,1 0,1 1, 0 1, 0 0)')) geo ), l ( select st_buffer(st_geomfromtext('linestring(0.0 0.0,0.5 0, 0.7 -1, 1 0)'),0.000000000000001) geo ), bigpoly as( select st_union(geo) geom from( select geo p union select geo l) q ) select st_buffer(st_buildarea(st_interiorringn(geom,i)),0.000000000000001) geo bigpoly cross join generate_series(1,(select st_numinteriorrings(geom) bigpoly)) this give missing piece, need st_union rest, might want check if it's correct 1 if original polygon contains holes.

java - Android makefile include dynamic library runtime error -

i trying write android app making use of jni. i have 1 activity file instantiates class makes call jni function. my cpp code built fine , put @ location libs/armeabi/libapplist.so my java file this. package com.example.applist; public class backend { static { try { system.loadlibrary("applist"); } catch(exception e) { log.d("backend","caught exception" + e); } } public native int creategroup() ; } and makefile below local_path:= $(call my-dir) include $(clear_vars) local_module_tags := optional #only compile source java files in apk. local_src_files := $(call all-java-files-under, src) local_package_name := applist local_certificate := platform include $(build_package) local_prebuilt_libs := libs/armeabi/libapplist.so include $(build_multi_prebuilt) i instantiating class main activity class testing. (new backend();) receive runtime error. can explain doing incor...

java ee - CDI Inject fails on maven-embedded-glassfish-plugin -- org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type -

we have webapp, being developed using java ee 7, jsf 2.2 , glassfish 4.0. there 2 particular managed beans circular dependency. usuariocontroller @named @sessionscoped public class usuariocontroller implements serializable { /** snipet **/ @inject private enderecocontroller enderecocontroller; /** snipet **/ } enderecocontroller @named @viewscoped public class enderecocontroller { /** snipet **/ @inject private usuariocontroller esuariocontroller; /** snipet **/ } when webapp packaged , deployed normal glassfish 4.0 installation, works fine. however, during development use maven-embedded-glassfish test locally inside ide. , app deployment fails following exception. severe: exception while loading app : cdi deployment failure:weld-001408 unsatisfied dependencies type [enderecocontroller] qualifiers [@default] @ injection point [[backedannotatedfield] @inject private net.jhm.exemplo.view.usuariocontroller.enderecocontroller] org.jb...

sql - Heredocs, variables and single quotes in BASH and MySQL -

i'm trying send data remote mysql database using bash script on gnu/linux, various errors.. here's line that's not working: mysql --host=192.168.0.100 --user=petercapaldi --password=mypassword mystartrekcharacterbase << eof insert myfourlegs values ('$person','$thetime','$thetime','$thedate','$dayofweek'); eof and (just in case): mysql --host=192.168.0.100 --user=petercapaldi --password=mypassword mystartrekcharacterbase << eof insert myfourlegs values (\047$person\047,\047$thetime\047,\047$thetime\047,\047$thedate\047,\047$dayofweek\047); eof scrap that. fault - missed first field in database. single quotes work should heredocs.. (i.e. '$variable' prints 'myvariable' $variable prints myvariable).

DNS: if I delete @ A record, will * CNAME be honored? -

without boring on details, site's target must set in dns hostname , not ip . i have cname record of * , appears @ record takes precedence, * cname ignored. can safely delete @ record ? * cname honored? short answer yes. longer answer dns servers give specific answer can , fall less specific. way verify cname working query entry not exist on dns server. long answer can safely remove record , well. the record have ttl (time live). when first delete record take while removed caching dns servers. means continue records answer while, once expires cname start being used.

true type fonts - r wordcloud external ttf vfont not recognized -

i've installed 'extrafont' package in order install external font library duality via ttf_import() method. however, when specifying font via wordcloud method, receive following error: installation command: # assuming font file, duality_.ttf, in working directory (see link font above) font_import(".",false,pattern="duality") wordcloud command: wordcloud(ap.d$word, ap.d$freq, scale=c(8,2), min.freq=10, vfont=c("duality","plain"), random.order=false, rot.per=0, use.r.layout=false, colors=pal2, fixed.asp=false) output: error in strwidth(words[i], cex = size[i], ...) : invalid 'vfont' value [typeface -2147483648] in order verify font indeed installed, issued following commands > choose_font("duality") [1] "duality" > fonts() ....[49] "waree" "duality" how come duality font not visible vfont parameter of wordcloud? , how make visible...

java - how to use utility class to start intent android -

i updating code company app , there 20 activity classes download pdf , display using code: public void showpdf() { file file = new file(environment.getexternalstoragedirectory()+"/pdf/read.pdf"); packagemanager packagemanager = getpackagemanager(); intent testintent = new intent(intent.action_view); testintent.settype("application/pdf"); list list = packagemanager.queryintentactivities(testintent, packagemanager.match_default_only); intent intent = new intent(); intent.setaction(intent.action_view); uri uri = uri.fromfile(file); intent.setdataandtype(uri, "application/pdf"); startactivity(intent); } the code working, has been replicated in 20 classes (seems bad me) , put single class each activity class imports, when try this, things getpackagemanager() , startactivity(intent) no longer work. how can structure class make happen? or going wrong way. public class pdfutlity{ public static void ...

forms - deactivate two buttons until submit is clicked -

i need know how can deactivate 2 buttons until submit button clicked..i using javascript code deactivate 2 not work. here form: <form name="receta" id="receta" method="post"> <div class="row-fluid grid"> <div class="span4"> <label><b>lugar: </b></label> <input type="text" class="input-block-level" value="" name="lugar" /> </div> <div class="span4"> <label><b>nombre : </b></label> <input type="text" class="input-block-level" value="" name="nombre" /> </div> <div class="span4"> <label><b>edad : </b></label> <input type="text" class="span4" value="" name="eda...

symfony - symfony2 contact form error on rendering to the view page -

hey i'm new in symfony2 framework need helo. this code contact form , when i'm trying render form view page gets error see code bellow , error also. if 1 knows might problem please let me know.. thanks! contacttype.php <?php // src/aleksandar/intelmarketingbundle/resources/views/contacttype.php namespace aleksandar\intelmarketingbundle\form\type; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; use symfony\component\optionsresolver\optionsresolverinterface; use symfony\component\validator\constraints\email; use symfony\component\validator\constraints\length; use symfony\component\validator\constraints\notblank; use symfony\component\validator\constraints\collection; class contacttype extends abstracttype { public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('name', 'text', array( 'attr' => array( ...

Calling parent constructors in R with multiple inheritance -

i'm trying have class call parent constructors, callnextmethod calls first parent. namely, if have setclass('a') setclass('b') setclass('c', contains = c('a','b')) and define initialize methods three, printing 'in a', 'in b', , 'in c', respectively, callnextmethod in initialize method of c, prints 'in a'. there way dispatch constructors? (and yes, know multiple inheritance bad; i'm trying implement notion of mixins , happens appropriate way it)

syntax - In CoffeeScript, what is the existential operator for and how do you use it? -

this question has answer here: how coffeescript's existential operator work? 1 answer i see sorts of questions existential operator on so, none of them ask fundamental question of "what for" , "how use it?" thought i'd ask here. the answer here suffice answer question, problem question title doesn't suggest that. result, it's hard find question google search. so, intention here make easier learn operator google search. btw, aware of section in the little book on coffeescript titled "aliases & existential operator", reason don't explanation. doesn't make me feel "i it". the existential operator provides more concise , expressive way handle null , undefined properties. instead of if (user && user.url && user.url.indexof('foo')) you can do if user?....

ruby - Retrieving CallSid for incoming call -

when ruby script makes outgoing calls through twilio, it's piece of cake me find, output, , reuse call sid later such : @client = twilio::rest:client.new account_sid, auth_token call = @client.account.calls.create({ :from=>'inc', :to=>'out', :url=>'url', :method=>'get'}) puts call.sid this works fine outgoing calls make myself. the issue when try call sid incoming calls. get '/greeting' do twilio::twiml::response.new |r| r.say 'hello. welcome.' r.gather :numdigits => '1', :action => '/greeting/handle-gather', :method => 'get' |g| g.say 'for x, press 1. y, press 2. z, press 3.' end end.text puts twilio::twiml::request.callsid callsid = incoming_cid end the incoming_cid stored in mysql database later. i'm not sure if twilio::twiml::request.callsid correct way request parameters twil...

c# - File gets locked after setting attributes -

i have method saves object file. object gets modified , saved multiple times. problem when i'm trying save object second time same file, i'm getting unautorizedaccessexception. here code: public void save(string path) { string filename = string.format("{0}\\{1}", path, datafilename); using (filestream fs = new filestream(filename, filemode.create)) { binaryformatter formatter = new binaryformatter(); formatter.serialize(fs, this); file.setattributes(filename, fileattributes.hidden); } } what's interesting, if comment line file.setattributes(filename, fileattributes.hidden); problem disappears. how comes? , how can solve problem? msdn says filemode.create : specifies operating system should create new file. if file exists, overwritten. requires fileiopermissionaccess.write permission. filemode.create equivalent requesting if file not exis...

how to set file as a variable in bash -

i new in bash scripting set files variables in loop in bash script. have code: a=home/my_directory/*.fasta b=home/my_directory/*.aln in {1..14} # have 14 files in my_directory file extension .fasta clustalo -i $a -o $b # clustalo command of clustal omega software, -i # input file, -o output file done i want use fasta files in my_directory , create 14 new aln files. code doesnt work because clustal program doesnt recognize set files. if can thankful. if know there 14 files, this: for in {1..14}; clustalo -i home/my_directory/$a.fasta -o home/my_directory/$b.aln done if want process of *.fasta files, many there are, do: for file in home/my_directory/*.fasta; clustalo -i "$file" -o "${file%.fasta}.aln" done to understand this, ${file%.fasta} gives $file .fasta extension stripped off. if want store file names in variable first, best thing use array variable. adding parentheses around variable assignment, ...

python - reading an array with multiple items (working on two items not three) -

code below reads text file (containing different arrays) , breaks down separate elements. have working fine arrays 2 sub items, not third. for example - file works fine: ('january', 2, [('curly', 30), ('larry',10), ('moe',20)]) . staff = dict() item in filecontent: month = filecontent[0] section = filecontent[1] name, hours in filecontent[2]: staff[name] = hours print ("month:" + month) print ("section: " + str (section)) print ("".join("%s has worked %s hours\n" % (name, hours) name, hours in staff.items())) overtime = int(input ("enter overtime figure: ")) print ("".join("%s has worked %s hours \n" % (name, (hours + overtime)) name, hours in staff.items())) but have different month third array element (a bonus figure), example: ('february', 2, [('curly', 30, **10**), ('larry',10, **10** ), ('moe',20, **10**)]...

javascript - JS Statement for Client Side Alert in .aspx.vb -

i new hard coding & vs. have created couple applications using .aspx beginning understand little more. i have form (.aspx) has yes/no dropdown box, if user selects yes, it's necessary populate following empty text box (textbox13 "reason/comment"). , need add client side alert message (using js, have found answer) have tried using samples have found. problem is, none of examples need. so far, did create .js page: $('#mp_form').submit(function(e) { if(!$.trim($(this).find('textbox13'="text"').val()).length){ e.preventdefault(); alert('if critical, must provide reason/comment.'); } }); } i added in master page, , understand need statement in aspx.vb page function. think onsubmit want not sure how write if, statement. can please me out? thanks! kathy have @ following jsfiddle . there's input , button. text in input use following: $('#inputid').val(); in case inputid comment, ...

Magento Add Event onlick on System Configuration Custom Module Field -

nowhere can find definition search. in mymodule namespace/modulename/etc/system.xml have: <faq_input translate="label"> <label>question collor: </label> <comment>example: #000000</comment> <frontend_type>text</frontend_type> <sort_order>20</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </faq_input> i need add onclick event like: <input type="text" onclik="code(myevent)" value="xxx" > you need use <frontend_model> , can find examples in core (eg in app/code/core/mage/catalog/etc/system.xml ). the frontend model must block inheriting mage_adminhtml_block_system_config_form_field , has _getelementhtml() method can apply own code form element before rendering it. eg : protected function _getelementhtml(varien_data_form_...

Android-Html: Is there any way to implement spoilers? -

sorry bad english. i'm parsing xml feed , want know, there way replace <blockquote>...</ blockquote> text spoiler? (collapsible block, e.g. "read more") you can write jquery, can reduced markup issue if use jquery mobile's collapsible or bootstrap collapse . edit : actually, if never going run in legacy browser, may able simplify lot css3. see example: http://www.cssportal.com/css3-preview/showing-and-hiding-content-with-pure-css3.php#sec1

paypal - Sandbox server access denied in Java app (works fine with cURL) -

i'm attempting simple pay call using adaptive payments api. receiving following exception: java.security.accesscontrolexception: access denied (java.net.socketpermission svcs.sandbox.paypal.com resolve) here's bit of java code give idea of i'm doing. httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("https://svcs.sandbox.paypal.com/adaptivepayments/pay"); httppost.setheader("x-paypal-security-userid", user_id); httppost.setheader("x-paypal-security-password", password); httppost.setheader("x-paypal-security-signature", signature); httppost.setheader("x-paypal-application-id", application_id); httppost.setheader("x-paypal-request-data-format", "json"); httppost.setheader("x-paypal-response-data-format", "json"); /* bunch of stuff build json , put in entity */ httppost.setentity(entity); httpresponse httpresponse = httpclient.execute(httppos...

ios - Unable to alter UIButton in EKEvent code -

i'm trying create button when pressed creates calendar event, , changes title of said button "event created" or perhaps creates an alertview same effect. code far: - (ibaction)addtocal:(id)sender { ekeventstore *store = [[ekeventstore alloc] init]; [store requestaccesstoentitytype:ekentitytypeevent completion:^(bool granted, nserror *error) { if (!granted) { //code handle not-granted } else { //code create event [event setcalendar:[store defaultcalendarfornewevents]]; nserror *err; [store saveevent:event span:ekspanthisevent error:&err]; [[nsuserdefaults standarduserdefaults] setbool:true forkey:[nsstring stringwithformat:@"%@sub", prevdest] ]; [[nsuserdefaults standarduserdefaults] synchronize]; [addreminder settitle: [nsstring stringwithformat:@"subscribed!"] forstate: uicontrolstatenormal]; uialertview *alert ...