Posts

Showing posts from June, 2011

jquery - AJax does not work with bootstrap-select -

jquery - AJax does not work with bootstrap-select - i found flask-jquery-ajax example user selects item vehicle "make" drop downwards menu, vehicle "model" drop downwards menu populated making ajax request list of models create selected. i tried replace drop-down menus bootstrap-select , include class="selectpicker form-control" in sec drop-down menu not more populated after first drop-down has been chosen. this html template: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>flask jquery ajax drop downwards menu example</title> <link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" > <link rel="stylesheet" type="text/css" href=//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.2/css/bootstrap-select.min.css> <link rel=&quo

common lisp - Scope of variables inside functions -

common lisp - Scope of variables inside functions - this question has reply here: why function homecoming different value every time? 4 answers unexpected persistence of info [duplicate] 1 reply i have written function returns prime factorization of numbers n less 20. function uses allow create list of exponents, , increments exponents when finds n divisible prime. in lisp interpreter (both gcl , clisp), when phone call next function once, right factorization when phone call sec time, sum of factorizations of first , sec function - isn't scope of exponents limited within of let!? why isn't exponents beingness re-assigned value '(0 0 0 0 0 0 0 0) ? how can re-write function withstand multiple calls? (setf primes '(2 3 5 7 11 13 17 19)) (defun fac

bash - Unix shell user input phone number -

bash - Unix shell user input phone number - i trying write script check whether user has entered valid phone number , check against records.txt file. i have next code. when come in phone number not recognize it. i not sure how implement check against text file? echo "enter phone number xxxxxxxx: " read phonenumber while [ "$phonenumber" != [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ] echo "please come in phone number xxxxxxxx: " read phonenumber done echo $$phonenumber pause you need include start , end anchors in regex if want validate phone numbers of 8 digits or otherwise, take numbers has more 8 digits. #!/bin/bash echo "enter phone number xxxxxxxx: " read phonenumber pat="^[0-9]{8}$" while [[ ! $phonenumber =~ $pat ]] echo "please come in phone number xxxxxxxx: " read phonenumber done echo $phonenumber bash shell unix

validation - JideFX validators don't work -

validation - JideFX validators don't work - am newbie javafx. want create simple form out-of-the-box validation. library have chosen jidefx. tried repeat showcase (which poor taste) - http://www.jidesoft.com/jidefx/jidefx_validation_developer_guide.pdf. have stackoverflowerror result only. validator called. haven’t exception if validation ok. using javafx-8, java 8, eclipse luna, jidefx 0.9.1 (tried 0.9.1-b128 too). have suggestions? code bellow. simplevalidator.java public class simplevalidator implements validator { @override public validationevent call(validationobject param) { if (param.getnewvalue() != null && !param.getnewvalue().tostring().isempty()) { homecoming validationevent.ok; } else { homecoming new validationevent(validationevent.validation_error, 1, "error"); } } } logincontroller.java public class logincontroller { private stat

Is it possible to add a facebook like button in the web app using python flask? -

Is it possible to add a facebook like button in the web app using python flask? - i trying implement simple webapp on click of button pulls info database , displays on webpage.as part of need implement facebook button , comment box it? possible using python flask framework? presumably, you're using templates build flask app. if so, you'd add together image link facebook page flask template controls headers/footers (assuming want 'like' button in header/footer), e.g. <a href="http://www.facebook.com/your.facebook.page"><img src="/path/to/facebook/icon/facebook.png" alt="friend on facebook" title="become [your.company] fan"></a> python flask

jpa - Ignore persistence unit definitions that have PersistenceUnitTransactionType = RESOURCE_LOCAL -

jpa - Ignore persistence unit definitions that have PersistenceUnitTransactionType = RESOURCE_LOCAL - i have wildfly 8 container , ear persistence.xml inside. there multiple persistence units defined. is there way ignore process of persistence unit definitions have persistenceunittransactiontype = resource_local @ deployment of ear ? i able tell wildfly ignore specific peristence-unit in peristence.xml adding property <properties> <property name="jboss.as.jpa.managed" value="false" /> </properties> so wildfly not ignore peristence-units persistenceunittransactiontype=resource_local property set. jpa wildfly

php - Using next AUTO_INCREMENT id within query? -

php - Using next AUTO_INCREMENT id within query? - i know similar questions have been asked, none of them seem work i'm attempting. i'm developing scheme mysqli/php takes sound files, uploads them, renames them, , stores name. problem is... need name of file "uploadedfile_[$id_here].mp3" i've got entire upload scheme working properly, i'm on lastly step... getting id work. the id column in table auto_increment. need find out how "predict" auto_increment id given upcoming new row , tag on end of sound file name means of variable. one method i've attempted is: $result = mysqli_query($conn, "show table status 'test_table'"); $row = mysqli_fetch_array($result); $nextid = $row['auto_increment']; print $nextid; but doesn't homecoming results. connections file should configured i've used other queries , works fine. thanks in advance! it depends on how frequent code run, surely? auto-

forms - Sitecore WFFM, how to create separate "To" email address for languages -

forms - Sitecore WFFM, how to create separate "To" email address for languages - we have form created , send email action created when click submit. after that, when click send email action modal window opens can set "to" , "from" email addresses. our issue this, have client global. want form utilize different languages. reason send email action not allow language versions. if set english language us, go french, have same "to" email address of those. is there way have field alter per language culture? we raised sitecore back upwards in past (ticket 412571). acknowledged issue said following; save actions not designed multilingual setup. each used action save actions stored in form item in save actions field, marked shared , unversioned. that’s why, can’t add together language version send mail service action. recommend using email campaign manager sending out emails in different languages. so seem best b

create php SOAP request -

create php SOAP request - i wanna create soap request below <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/axl/api/10.0"> <soapenv:header/> <soapenv:body> <ns:updateuser sequence="?"> <!--you have selection of next 2 items @ level--> <uuid>{74932749237942794729473927493829}</uuid> <userid>?</userid> <associatedgroups> <!--zero or more repetitions:--> <usergroup> <name>standard cti enabled</name> <!--optional:--> <userroles> <!--zero or more repetitions:--> <userrole>standard cti enabled</userrole> </userroles> </usergroup> <usergroup> <name>standard

ios - A container view and scroll view present an representation which is offset -

ios - A container view and scroll view present an representation which is offset - i have app uiscrollview contains ui elements. 1 of elements in container has embedded uiviewcontroller uiscrollview containing uiimage , uilabels drawn on it. i having problem presentation in uiscrollview of container, uiimage, supposed filling whole scrollable content, there bar @ top. offset annoying, throws off calculation of points. (the image supposed fill whole rounder border. i set size (using constrains) of container view in viewdidload of containing uiviewcontroller (and result, box, expected): [self floorplancontainerwidthconstraint].constant = [self view].frame.size.width - self.marginwidthconstraint.constant * 2; if([delegate isipad]){ [self floorplancontainerheightconstraint].constant = 300; } [_floorplancontainer layoutifneeded]; then in uiviewcontroller of container, on viewwilldisplay, update uiimageview dimensions contained edges of scrollview distance '0':

python - Django Form Selection Change Value in URL -

python - Django Form Selection Change Value in URL - python 3.3.2, django 1.6.5, fedora 20 i have django form set default selection value in url, , limit queryset of form based on value. for example: url: http://fakesite.com/myapp/add_activity/?sport=run relevant views.py: urlsport = sport.objects.get(name = request.get.get('sport')) form.fields["sport"].initial = urlsport form.fields["gear"].queryset = gear.objects.filter(sport_id=urlsport) i'd create such if user selects different sport, url change/reload form.fields["gear"].queryset filter re-applied. any ideas how can this? right approach? python django django-forms

html - Unwanted space on left side of header -

html - Unwanted space on left side of header - i have spacing on left side of header having troubles getting rid of. if can help me out appreciate it. here html , css below. html <!doctype html> <html> <head lang="en"> <meta charset="utf-8"> <link rel="stylesheet" href="style.css"/> <title></title> </head> <body> <header> <div id="logo"></div> <nav> <ul> <li><a href="index.html">home</a></li> <li><a href="about.html">about me</a></li> <li><a href="portfolio.html">portfolio</a></li> <li><a href="blog.html">blog</a></li> <li><a href="contact.html">contact</a></

html - Polymer: scrollbar underneath core-scroll-header-panel? -

html - Polymer: scrollbar underneath core-scroll-header-panel? - as of 2014-10-22, header part of core-scroll-header-panel widget drawn on top of browser's scrollbar. suboptimal, can create thumb inaccessible until scroll down. (and first have notice there's scroll bar.) the standard polymer demo widget demonstrates this: https://www.polymer-project.org/components/core-scroll-header-panel/demo.html this happens in both chrome , firefox. does know of workaround? html scroll polymer

terminal - send command to every running instance of urxvt -

terminal - send command to every running instance of urxvt - i'm trying write script alter color scheme of running terminals (im using urxvt). thought have keyboard shortcut switch between lite , dark solarized themes. far tried dynamic-colors script https://github.com/sos4nt/dynamic-colors , works expected, can alter between lite , dark solarized colors of running terminal. thinking maybe execute command in every running instance of urxvt, have no thought how acomplish that. please share suggestions how tackle main problem (creating script alter colorscheme of running terminals). currently i'm using dynamic-colors script https://github.com/sos4nt/dynamic-colors , bit of python code changes terminals lite or dark (version) pts = os.listdir('/dev/pts/') each_pts in pts: if is_number(each_pts): subprocess.call('echo "`.dynamic-colors/bin/dynamic-colors switch solarized-{0}`" > /dev/pts/{1}'.format(version,each_pt

java - trying to align JcheckBox in a GridBagLayout -

java - trying to align JcheckBox in a GridBagLayout - i'm working gridbaglayout , can't figure why jcheckbox don't align. i've tried set alignement jcheckbox parameter(i.e checkbox.setalignementx(left_alignement) ). did'nt worked. i first tried using borderlayout , turned out worst what i'm trying acheive this i want threee main categories(physique, psychologique , social) set on finish left, , want sub-categories set bit offset. way you'll know it's sub-categorie(according lines i've drawn). there uis 3 jpanel , 1 each category. not original code reproduce problem have. public class window extends jframe { private jbutton button = new jbutton("generer"); private jcheckbox physique = new jcheckbox("traits physiques"); private jcheckbox psychologic = new jcheckbox("traits psychologiques"); private jcheckbox mass = new jcheckbox("masse"); private jcheckbox quality = new jcheckbox("qualit

import to eclipse from android developer tools -

import to eclipse from android developer tools - please help. when re-create project folder , past eclipse, don't work it. what tools can utilize export android app android developer tools android eclipse? i think mean "android studio" instead of adt, so, tried few weeks ago, have no results, did this. i created new android project in eclipse same name of original project then created same packages original project then copied .java files (sources) fkeeping same structure finally added media elements , libraries. hopping work, pressed build button , vualá!! you can import eclipse android studio haven't found improve way inverse opperation. hope helps you android eclipse

F# stream of armstrong numbers -

F# stream of armstrong numbers - i seeking help, because new f# environment. need utilize f# stream generate infinite stream of armstrong numbers. can 1 help one. have done mambo jumbo have no clue i'm going. type 'a stream = | cons of 'a * (unit -> 'a stream) allow rec take n (cons(x, xsf)) = if n = 0 [] else x :: take (n-1) (xsf());; //to test if 2 integers equal allow test x y = match (x,y) | (x,y) when x < y -> false | (x,y) when x > y -> false | _ -> true //to check armstrong number allow check n = allow mutable m = n allow mutable r = 0 allow mutable s = 0 while m <> 0 r <- m%10 s <- s+r*r*r m <- m/10 if (test n s) true else false allow rec armstrong n = cons (n, fun () -> if check (n+1) armstrong (n+1) else armstrong (n+2)) allow pos = armstrong 0 take 5 pos to honest code seems bit mess. the basic version think of this:

How get Event "item Selected" with AutoComplete in C#? -

How get Event "item Selected" with AutoComplete in C#? - i have code "autocompletestringcollection" private void txts_textchanged(object sender, eventargs e) { textbox t = sender textbox; string[] arr = this.dbservice.getall(); if (t != null) { if (t.text.length >= 3) { autocompletestringcollection collection = new autocompletestringcollection(); collection.addrange(arr); this.txtserial.autocompletecustomsource = collection; } } } but how can event "item selected" after user selects autocomplete suggestion? , value of field? there's no such thing chosen item event textbox, believe you're using autocomplete. add together key downwards event textbox. there verify if come in key pressed (clicking on suggested link same pressing enter). that: private void textbox1_key

ddms - Accessing device/emulator file system In Android Studio -

ddms - Accessing device/emulator file system In Android Studio - i have programme saves .json file on emulator or device have debugging android studio program. want re-create file off of device can't seem find way it. i know reasonably easy in eclipse can't find way in studio. goto android device monitor in android studio , new poup window open devices list in left pane , in right pan select file explorer tab , that's it original post here android ddms

mule - Scatter Gather for One Way -

mule - Scatter Gather for One Way - mule 3.5 has replaced router scatter gather. have need send payload more 1 message routes . 1 way , no need aggregate response. how possible? documentation seem request/response , aggregating data. you can add together each one-way outbound endpoint in turn flow, so: <flow name="myflow"> <set-payload value="important message" /> <vm:outbound-endpoint path="vm.inbox" /> <jms:outbound-endpoint queue="jms.inbox" /> <jms:outbound-endpoint queue="jms.inbox2" /> </flow> in flow, payload "important message" sent 1 vm queue , 2 jms queues, in parallel. endpoints one-way because vm , jms transport one-way default. mule

node.js - "Secondary" vs "Slave" in Mongodb -

node.js - "Secondary" vs "Slave" in Mongodb - i trying clarify terminology difference, if any, between "secondary" , "slave" in mongodb. confusion stems connecting w/ node-mongodb-native documentation of db constructor: db_opts = {db: { readpreference: readpreference.secondary slaveok: true }} mongoclient.connect('mongodb://example', db_opts, ...) what difference between readpreference alternative , slaveok alternative there? don't caught on secondary vs. slave here. you're asking slaveok vs readpreference. slaveok deprecated in favor of using readpreference . mongoclient docs explicitly state slaveok: "legacy alternative allowing reads secondary, utilize readprefrence instead". state setting readpreference overrides slaveok value. node.js mongodb

uibutton - ios - set / unset button background color -

uibutton - ios - set / unset button background color - using method: - (ibaction)buttonclicked:(id)sender { mybutton.backgroundcolor = [uicolor blackcolor]; } i can set black color mybutton. how can toggle between 2 color, each time button clicked? tx in advance in h file initialize bool property @property (nonatomic, assign) bool mybool; in m file set next line in viewdidload self.mybool = yes; then in ibaction, - (ibaction)buttonclicked:(id)sender { if (self.mybool) { self.button.backgroundcolor = [uicolor blackcolor]; self.mybool = no; } else { self.button.backgroundcolor = [uicolor blackcolor]; self.mybool = yes; } } colors uibutton

asp.net - How to access page controls inside [WebMethod] method? -

asp.net - How to access page controls inside [WebMethod] method? - i using ajax phone call method database method takes parameters page , gets values db want populate result page controls accessing these controls in web method. below code. using collapsible panel extender. on click event collapses & should phone call verifyfunction method written in code behind. <asp:toolkitscriptmanager id="toolkitscriptmanager1" runat="server" enablepagemethods="true"></asp:toolkitscriptmanager> <asp:panel id="panel1" runat="server"> </asp:panel> <asp:linkbutton id="linkbutton1" runat="server">linkbutton</asp:linkbutton> <asp:collapsiblepanelextender id="cpesop" runat="server" collapsecontrolid="linkbutton1" collapsedsize="0" collapsed="true" collapsedimage="~/imgages/addrow.gif" expandcontrolid=&quo

c++ - gmock ignore "interesting" function call -

c++ - gmock ignore "interesting" function call - i want utilize gmock in unit tests. wrote simple illustration , fails. isymboltable interface want mock. mocksymboltable mocked object. in test phone call insert , check if insert called. gmock warning: uninteresting mock function phone call - returning directly. function call: insert(8-byte object <24-7c 4c-04 03-00 00-00>) stack trace: lexertests.cpp:25: failure actual function phone call count doesn't match expect_call(symboltable, insert(::testing::_))... class isymboltable { public: isymboltable() {} virtual ~isymboltable() {}; virtual void insert(const entry entry) = 0; virtual int lookup(const std::string text) = 0; }; class mocksymboltable : public isymboltable { public: mock_method1(insert, void(const entry entry)); mock_method1(lookup, int(const std::string text)); }; test(lexer, n) { mocksymboltable symboltable; symboltable.insert(entry("dsgft", 3));

dart - Setting a bool published attribute with @published -

dart - Setting a bool published attribute with @published - i have next .dart component class="lang-dart prettyprint-override"> @customtag('description-form') class descriptionform extends polymerelement { @observable map<string, dynamic> datamap = {}; @observable string description = ''; @published string label => readvalue(#label); set label(string value) => writevalue(#label, value); @published bool isvisible => readvalue(#isvisible); set isvisible(bool value) => writevalue(#isvisible, value); descriptionform.created() : super.created(); void publish() { datamap['description'] = description; } @override void attached() { super.attached(); datamap['receiver'] = dataset['receiver']; } } to utilize published attributes, next in form class="lang-dart prettyprint-override"> <description-form label = 'others' isvisible =

html - Footer on bottom but not sticky -

html - Footer on bottom but not sticky - i'm trying footer flush bottom of page, not sticky - @ bottom in case user scrolls downwards there. this "works" there seems bit of white space @ bottom after footer appears looks little awkward. know best way css flush footer bottom , maintain @ bottom without making sticky? let me know if want me post html/css. there number of examples on web of this. here supposedly updated version: http://mystrd.at/modern-clean-css-sticky-footer/ ; have no experience one. and classic version has been around long time , used many: http://www.cssstickyfooter.com/html-code.html here's own edited version of sec link i've had luck with. /* sticky footer stuff */ html,body { height: 100%; } #sticky-wrap { min-height: 100%; } .footer { height: 160px; margin-top: -160px; } /* end sticky footer stuff */ <div class="wrapper" id="sticky-wrap"> <div class="content-ar

c# - NSubstitute - TestFixture 1 causes AmbiguousArgumentsException in TestFixture 2 -

c# - NSubstitute - TestFixture 1 causes AmbiguousArgumentsException in TestFixture 2 - i writing c# unit tests using nunit , nsubstitute. testing class effort retrieve objects config provider implementing next interface: public interface iconfigprovider<t> { t getconfig(int id); t getconfig(string id); } the class beingness tested uses int version of getconfig in setupfixture next set mocked config provider homecoming same dummy object: iconfigprovider<configtype> configprovider = substitute.for<iconfigprovider<configtype>>(); configprovider.getconfig(arg.any<int>()).returns<configtype>(new configtype(/* args */); this runs absolutely fine if testfixture 1 beingness run. however, in different testfixture in same assembly, check received calls this: connection.received(1).setcallbacks(arg.any<action<message>>(), arg.any<action<long>>(), arg.any<action<long, exception>>()); if th

javascript - Angular: get Template URL from parent directive -

javascript - Angular: get Template URL from parent directive - i understand can dynamically set templateurl base of operations on alternative dom attribute template-url="foo.html" given next code: angular.module('foo').directive('parent', function() { homecoming { restrict: 'e', link: function(scope, element, attrs) { // code }, templateurl: function(elem,attrs) { homecoming attrs.templateurl || 'some/path/default.html' } } }); however, need take step farther , pass string 1 level deeper, kid directive. given html: usage in main project <parent parent-template="bar.html" child-template="foo.html"></parent> the kid not exposed in cases, if child-template set, needs implicitly replace templateurl kid <child></child> elements located in parent foo.html . the require: '^parent' attribute passes info

php - Laravel $_GET parameters are not received in controller -

php - Laravel $_GET parameters are not received in controller - i newbie laravel framework. i trying out simple url " http://localhost/test?code=value " , when trying access value of code in controller $_get["code"] or input::get('code') , not access value in controller. i using digitalocean server nginx server. here .htaccess file in project <ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes... rewriterule ^(.*)/$ /$1 [l,r=301] # handle front end controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] when tried simple php script in test.php file <?php print_r($_get); ?> can access values. so, believe there no problem server settings. i tried reply mentioned similar issue laravel stripping $_get parameters didnt work me. any help appreciated. stuck long time

java - Platform independent way to read ZIP archives with TrueZip -

java - Platform independent way to read ZIP archives with TrueZip - this may obvious question couldn't seem find answer. we using truezip 7.7.1 , creating instances of zipfile read zip archives. when getting entries or input streams zipfile have specify entry name may contain path separator file scheme created on. current implementation naive , uses file.separator provided jvm doesn't work if archive created on file scheme different separator. it seems there way tpath can apparently utilize either file.separator or "/" on either platform. what's best way read zip archives in platform independent manor truezip 7.7.1? according zip file format specifications (link), paths should stored '/' (thus beingness platform independent): 4.4.17.1 name of file, optional relative path. path stored must not contain drive or device letter, or leading slash. slashes must forwards slashes '/' opposed b

php - Counting inside an if/else statement -

php - Counting inside an if/else statement - i have log in page, users asked come in code. want count how many times users enters wrong code, , if more 3 times, show page telling them restart processes, counter outputs 1, though type wrong code multiple times. <div class="container"> <div class="alert alert-success" role="alert" align="center"> <p>a code has been sent email</p> <p>please consult email proceed login</p> </div> <form class="form-signin" method="post"> <h2 class="form-signin-heading">enter code</h2> <input type="hidden" name="partneremail" value="<?php echo $_post['partneremail']; ?>"> <input class="form-control" type="text" name="partnercode" placeholder="code"> <button class="btn btn-lg btn-primary btn-b

django - installing python modules that require gcc on shared hosting with no gcc or root access -

django - installing python modules that require gcc on shared hosting with no gcc or root access - i'm using hostgator shared production environment , had problem installing python modules, after using: pip install mysql-python pip install pillow results in: unable execute gcc: permission denied error: command 'gcc' failed exit status 1 server limitations no root access sudo doesnt work (sudo: effective uid not 0, sudo installed setuid root?) no gcc questions is there alternative bundle pillow. want utilize django imagefield. (just pymysql as capable alternative mysql-python) i have modules mysql-python , pil installed in root, i.e. pip freeze without virtualenv lists these modules. cannot install other required modules in root environment , in virtualenv cannot install mysql-python , pil. can done? can import/use packages installed in root somehow in virtualenv? is hostgator shared php , not python/django webapps. have limited traffic using host

c# - List of all Visual Studio compiler errors and warnings, with their numbers -

c# - List of all Visual Studio compiler errors and warnings, with their numbers - i want disable specific kind of warning i'm having problem finding warning number can blacklist depths of hell in project settings. particular warning isn't showing in console output (only in error list ui), isn't revealing number. does have list of compiler errors , warnings along numbers? regardless of whether haven't looked plenty either specific warning number or list, faith in humanity suffered harm when couldn't find such list on internet. think exhaustive list useful. if want generate single table of c# error codes , respective message (e.g. reference purposes), can utilize this useful script, parses msdn list , compiles html table (could utilize styling though). c# visual-studio

Python 2.7 Segfault on Debian 7 -

Python 2.7 Segfault on Debian 7 - when run mod_wsgi app, segfault python. got debug symbols python, have no thought how python sources debian 7. when apt-get source python not actual python interpreter source files. to begin with, getting crash within mod_wsgi code. after ran apt upgrade starting getting segfault json module. both segfaults occurred on line 788 of obmalloc.c in pyobject_malloc. if find proper source code figure out what's going on bit better! here top few frames of backtrace: #0 pyobject_malloc (nbytes=46) @ ../objects/obmalloc.c:788 #1 0x00007fffef3db145 in pystring_fromstringandsize.part.17 (size=<optimized out>, str=0x0) @ ../objects/stringobject.c:88 #2 pystring_fromstringandsize (str=str@entry=0x0, size=size@entry=9) @ ../objects/stringobject.c:57 #3 0x00007fffed57b644 in ascii_escape_str.2660 (pystr=pystr@entry='message') @ /home/jmm/py/python2.7-2.7.3/modules/_json.c:302 #4 0x00007fffed57d25e in py_encode_basestring_ascii (py

android - "Don't play soundPool because of a recording" on LG phone -

android - "Don't play soundPool because of a recording" on LG phone - i have app records via audiorecord , play sounds @ same time via: play(int soundid, float leftvolume, float rightvolume, int priority, int loop, float rate) the audiorecord lastly minute, , during there several short sounds soundpool lasting 2 seconds each. sounds pre-loaded. and works expected on devices such (e.g. galaxy s3; nexus 7 device). when testing exact same code on lg-p875 (probably modern other 2 devices , running android 4.1+), message: "don't play soundpool because of recording". comes soundpool filter. the same code soundpool, without recording, running on lg-p875, plays sounds fine. issue playing soundpool , recording on lg phone. i'd appreciate ideas or directions take find workaround / find root source of issue. expect there many devices similar lg-p875 error occurs. thanks. the workaround used automatically generate midi files , play them usin

android - Open a URL with default broswer? -

android - Open a URL with default broswer? - i'm new developer in qpython (experienced python), want open url user's default browser. i tried androidbrowser().open("...") but, surprise, got segmentation fault! said ok, let's seek open manually activity, tried import jnius , got segmentation fault well. any suggestion how prepare or other ways open browser? apparently, happens in console mode, in other qpython mods works fine. android segmentation-fault android-browser qpython pyjnius

Perl Moose add instance attribute not class attribute -

Perl Moose add instance attribute not class attribute - i need add together attribute moose class instance. in code below, when create instance of class kid , add together attribute "app" it, find attribute added when create next instances. doing wrong, 1 time again need attribute per created instance. #!c:\perl\bin\perl.exe #!/usr/bin/perl utilize v5.10; utilize moose; utilize data::dumper; { bundle child; utilize moose; utilize utf8; sub name { "my name richard"; } } sub add_attribute { ($object, $attr) = @_; $meta = $object->meta; if (!$object->can("app")) { $meta->add_attribute(app => (is => 'rw', default => sub{$attr})); $object->app($attr); } else { #$object->app($attr); "attr $attr exists: object=". ref($object) . ", attr=".($object->app); } } $child = child->new; $child->name; ad

qt - Javascript doesn't use QWebView cookies/session -

qt - Javascript doesn't use QWebView cookies/session - i trying develop basic browser web in order surf on specific net site using qt framework. created mywindow class inherits qwebview, in order handle opening of potential pop-ups in new browser window. in mywindow class recreated createwindow function. moreover, created qnetworkaccessmanager , qnetworkcookiejar objects within mywindow class , without recreating farther new function. thought sufficient surf on website targeting, has log-in form in homepage, while can surf on other pages of same site using info contained within server-generated cookies @ log-in. works during "normal" navigation, while error when clicking on links such as <a class="lien_default lienperso" href="javascript:popupperso('foo.php?login=bar')">bar</a> in case, new window prompted (i discovered javascript function simple window.open) seems cannot retrieve info cookies: current session not u

With OpenTK and VB.NET, how to use GLControl with OpenGL 3.x features? -

With OpenTK and VB.NET, how to use GLControl with OpenGL 3.x features? - i'm using opentk rendering through glcontrol. however, cannot find examples on net or figure out how utilize opengl 3.x features (disregarding short mention in opentk faq, wasn't overly helpful). by opengl 3.x features, i'm meaning whole 'gltranslate' model unaccessible, , rendering or translation, etc, used through shaders , passing around model/view/projection matrices. glcontrol default creates compatibility context maximum version supported drivers. example, if have recent nvidia card up-to-date drivers, glcontrol give opengl 4.5 compatibility context. note on linux , mac os x, compatibility contexts limited opengl 2.1. access higher versions need create core context instead: var glcontrol = new glcontrol(graphicsmode.default, 4, 0, graphicscontextflags.forwardcompatible); deprecated functions, such gltranslate, not available on core contexts. if using winforms ui

c# - Compiler error reads "end of file expected" -

c# - Compiler error reads "end of file expected" - the lastly 2 curly brackets on code underlined error reads: type or namespace definition, or end-of-file expected. i think curly brackets somehow uneven or mismatched somewhere. have looked through them , cannot seem find off. public partial class add_customer : form { public client newcustomer { get; set; } public add_customer() { initializecomponent(); } private void btn_submit_click(object sender, eventargs e) { validateform(); } private bool validateform(); { if (string.isnullorwhitespace(txtfirstname.text)) { messagebox.show("first name required"); homecoming false; } } } } this error means have mismatched parenthesis or brackets. in case have } in method: private bool validateform(); { // 1 if (string.isnullorwhitespace(txtfirstname.t

javascript - Performing calculations on an html form -

javascript - Performing calculations on an html form - i new html & javascript , have been assigned task create html form restaurant allows user input info booking. far have created form website , validated each input field in order ensure right info entered necessary fields. however, need enable form calculate total cost booking based on 2 details (number of people in party & if client wishes dine in vip area). here related html code far: ... <strong>select party size:</strong> <br> <select name="party" id="party" onblur="validateselect(name)"> <option value="">please select</option> <option value="1">1 person (£5)</option> <option value="2">2 people (£10)</option> <option value="3">3 people (£15)</option> <option value="4">4 people (£20)</option> <option value="5">5 people (£25)&

regex - I'm matching a string and want to return the next three lines after the match -

regex - I'm matching a string and want to return the next three lines after the match - i'm matching string , want homecoming next 3 lines after match. know $_ homecoming line i'm not sure look utilize homecoming next 2 lines in file have. here code have: open $fh, '>', "${file}result.txt" or die $!; $fh->print("$file\t$_\n"); print "$_\n"; thanks in advance help , not making much fun. keeping simple: while (<$infile>) { if (/regex/) { $outfile->print($_); $outfile->print($infile->getline) 0 .. 1; } } the io::handle methods nice couple of reasons. $infile->getline <> , ever grabs 1 line (whereas <> homecoming lines in list context). doesn't clobber $_ or warn @ end of file (although latter behavior desirable). regex string perl line match

How to install imagemagick on OSX Yosemite -

How to install imagemagick on OSX Yosemite - i want install imagemagick using homebrew have problem, please have thought on how resolve it? thanks. ==> downloading https://downloads.sf.net/project/machomebrew/mirror/imagemagick- downloaded: /library/caches/homebrew/imagemagick-6.8.9-7.tar.xz ==> ./configure --disable-osx-universal-binary --prefix=/usr/local/cellar/imagem ==> create install 1 error generated. make[1]: *** [magick/magick_libmagickcore_6_q16_la-annotate.lo] error 1 make[1]: *** waiting unfinished jobs.... cc magick/magick_libmagickcore_6_q16_la-artifact.lo make: *** [install] error 2 osx imagemagick

c++ - Temporary lifetime and perfect forwarding constructor -

c++ - Temporary lifetime and perfect forwarding constructor - i having problem understanding why lifetime of temporaries bound const reference parameters cutting short when there perfect forwarding constructor around. first of, know temporaries bound reference parameters: lastly total expression: a temporary bound reference parameter in function phone call (5.2.2) persists until completion of total look containing call however found cases not true (or might misunderstand total look is). let's take simple example, first define object verbose constructors , destructors: struct { a(int &&) { cout << "create a" << endl; } a(a&&) { cout << "move a" << endl; } ~a(){ cout << "kill a" << endl; } }; and object wrapper b, used reference collapsing: template <class t> struct b { t value; b() : value() { cout << "new b" << endl; } b(const t &a

Python Copying part of string -

Python Copying part of string - i have line server:x.x.x.x # u:100 # p:100 # pre:0810 # tel:xxxxxxxxxx and want re-create value 0810 after pre: value how can ? you utilize re module ('re' stands regular expressions) solution assumes pre: field have 4 numbers. if length of number varies, replace {4} (expect 4) + (expect 'one or more') >>> import re >>> x = "server:x.x.x.x # u:100 # p:100 # pre:0810 # tel:xxxxxxxxxx" >>> num = re.findall(r'pre:(\d{4})', x)[0] # re.findall returns list >>> print num '0810' you can read here: https://docs.python.org/2/howto/regex.html python string copy

python - Use spines and tick_params in Matplotlib style sheet -

python - Use spines and tick_params in Matplotlib style sheet - i have next python 3 code generating plot matplotlib : import numpy np import matplotlib.pyplot py x = np.arange(0, 10, 0.1) y = np.sin(x) py.figure(1) py.plot(x, y, c='g', lw=2) py.ylim(-1.1, 1.1) py.title('plot title') py.ylabel('y label') py.xlabel('x label') py.gca().spines['top'].set_visible(false) py.gca().spines['right'].set_visible(false) py.gca().spines['bottom'].set_visible(false) py.gca().spines['left'].set_visible(false) py.tick_params(top='off', right='off', bottom='off', left='off') py.grid() py.show() this preferred configuration creating plots no axis borders or tick marks. axis labels, title, , grid remain. instead of writing spines , tick_params every plot figure, tried add together parameters mplstyle file. however, style file doesn't back upwards these features. there way create defau

hadoop - MongoDB into AWS Redshift -

hadoop - MongoDB into AWS Redshift - we've got pretty big mongodb instance sharded collections. it's reached point it's becoming expensive rely on mongodb query capabilities (including aggregation framework) insight data. i've looked around options create info available , easier consume, , have settled on 2 promising options: aws redshift hadoop + hive we want able utilize sql syntax analyze our data, , want close real time access info (a few minutes latency fine, don't want wait whole mongodb sync overnight). as far can gather, alternative 2, 1 can utilize https://github.com/mongodb/mongo-hadoop move info on mongodb hadoop cluster. i've looked high , low, i'm struggling find similar solution getting mongodb aws redshift. looking @ amazon articles, seems right way go utilize aws kinesis info redshift. said, can't find illustration of did similar, , can't find libraries or connectors move info mongodb kinesis stream.

Android Facebook Like Button not appearing properly -

Android Facebook Like Button not appearing properly - this may sound trivial having difficulty in display of likebutton. not intended. it supposed this. https://s3.amazonaws.com/uploads.hipchat.com/20645/978150/pm1gbfbvvhpmjvu/screen%20shot%202014-10-24%20at%2010.25.15%20am.png instead looks following: https://s3.amazonaws.com/uploads.hipchat.com/20645/978150/jeuu1ceq3dvmzjj/screen%20shot%202014-10-24%20at%2010.27.56%20am.png notice long bluish space beingness stretched , "like" text beingness extremely little in sec pic. here code layout file: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layoutfacebooklike" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:screenorientation="sensorlandscape" > &

android - How to position two TextViews in a ListView next to each other, but having at least a certain gap -

android - How to position two TextViews in a ListView next to each other, but having at least a certain gap - i want have 2 of textviews position next each other, having @ to the lowest degree space between them. because textviews part of listview, receiving info differs sometimes. want achive first textview, if contains shorter text preceding one, same padding next textview. here ma layout file: layoutfile.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/balken_clear" > <textview android:id="@+id/line_color" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignparentleft="true" android:padd

How to access images stored in Documents Directory in ios8 -

How to access images stored in Documents Directory in ios8 - in ios7 can write images documents directory , access without problem. in ios8 able write imagesdata documents directory , access it. location of images folder changes every time run app on simulator.i went through many stack overflow questions , apple's technical note (link:https://developer.apple.com/library/ios/technotes/tn2406/_index.html) didn't solution.actually storing path of images file in sqlite database. any help appreciated. seems storing finish path. in ios 8 apple changed directory structure.apple extended folders in documents directory internally(i.e /developer/data/some random number sequence).directory folders keeps on changing on every build,if u store finish path in sqlite not find file @ location because documents directory location has changed. the solution not store finish path store path documents directory database,while accessing images prefix current application documents

How do I convert a List in Java 8? -

How do I convert a List in Java 8? - in java 8, can write list<string> strlist = arrays.aslist("1", "2", "3"); list<integer> intlist = strlist.stream().map(s -> integer.valueof(s)).collect(collectors.tolist()); and pretty short already, have lots of these conversions , wonder why next not possible, i.e. why there no convert/transform method? // won't work, list has no convert() or transform() method: list<integer> intlist = strlist.convert(s -> integer.valueof(s)); if implementation of convert clever, maybe lazy, conversion done when elements requested. alternatively, of course of study write myself, maybe know library provides method? // thought library provides util? list<integer> intlist = somelibraryutil.convert(strlist, s -> integer.valueof(s)); java

ruby on rails - Capybara emails: setting correct port in URLs -

ruby on rails - Capybara emails: setting correct port in URLs - i'm using capybara (2.4.4) capybara-email (2.4.0) gem in rspec (2.14.1) integration tests rails (4.1.6) app. have test ensures functionality of link in email. while capybara spawns server on different, random ports each test run, rails's path helpers in email views generate localhost:3000 domain specified in config/environments/test.rb . how can specify rails path helpers utilize current capybara test server's host , port domains? i solved specifying host (but not port) in test.rb : config.action_mailer.default_url_options = { host: 'localhost' } and including capybara.always_include_port = true in env.rb. ruby-on-rails ruby-on-rails-4 rspec capybara integration-testing

javascript - Print a variable in Html -

javascript - Print a variable in Html - iam beginner jquery , javascript..please help me out.. want value of "x" variable stored in html div's... <script> var x=''; $('#calendar').datepicker({ //altfield: '#datepicker_send', inline: true, firstday: 1, showothermonths: true, daynamesmin: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'], onselect: function(datetext) { x = datetext; //alert(x); } }); <div class="evnt-p">no events on : <script>document.write (x); </script> </div> what need update date when datepicker value changed so <div class="evnt-p">no events on : <span id="event-date"></span></div> then $('#calendar').datepicker({ //altfield: '#datepicker_send', inline: true, firstday: 1, showothermonths:

java - how to implement an url seen test / cache across multiple crawlers and maintain a good performance? -

java - how to implement an url seen test / cache across multiple crawlers and maintain a good performance? - currently developing little webcrawler private testing purpose. my basic setup this: -2 computers crawling (small ram) -1 computer main "database" (big ram). my primary question how implement url seen test across multiple crawlers? if had 1 crawler implement bloom filter in java, got stuck on how when have "infinite" crawlers - since needed "synchronized"? there needs central cache or something, , how remain fast? querying mysql millions of rows after time may slow... java mysql database caching web-crawler