Posts

Showing posts from February, 2011

ember.js - Torii Configuration is not being loaded in ember cli -

i'm having lot of trouble getting ember simple auth torii working @ @ moment using ember cli. after creating new ember cli app , installing torii, ember-cli-simple-auth , ember-cli-simple-auth-torii, have couple of buttons on login page here contents of routes/login.js: import ember 'ember'; export default ember.route.extend({ actions: { googlelogin: function() { this.get('session').authenticate('simple-auth-authenticator:torii', 'google-oauth2'); return; }, facebooklogin: function() { this.get('session').authenticate('simple-auth-authenticator:torii', 'facebook-oauth2'); return; } } }); the relevant part of environment.js file is: var env = { ... torii: { providers: { 'google-oauth2': { apikey: 'api-key-here', scope: 'profile', redirecturi: 'http://localhost:4200' }, 'facebook-oauth2': { ap

javascript - How can I separate the HTML Elements and the CSS elements and return them? -

this js fiddle of 1 part want achieve. js fiddle alert($("#content")[0].outerhtml); this returns dom structure like: <div id="content"> <div id="example1" style="width:100px height:100px background-color:red"></div> <div id="example2" style="width:50px height:50px background-color:blue"></div> <div id="example3" style="width:25px height:25px background-color:yellow"></div> </div> i adding div s dynamically , css inline . ideally, want able take css out can return both div elements , css attributes separately text elements. you can remove style attributes , store them in id-style map, can use them later if need. this: var styles = {}; $("#content").children().each(function() { styles[this.id] = $(this).attr('style'); $(this).removeattr('style'); }); // check alert( &

php - cakephp upload plugin no input parameters can be change -

i attached plugin cakephp project: https://github.com/josegonzalez/cakephp-upload . it took me lot of time realise upload files webroot\files\model_name\filename folder, @ first thought no file uploaded. database like: id|descr|filename|filepath i try modify input parameters,but nothing happened copy file : webroot\files\model_name\filename on , on again.i tried empty cache not worked. public $actsas = array( 'upload.upload' => array( 'path' => '{root}{ds}webroot{ds}img{ds}{model}{ds}{field}{ds}', 'filename'=> array( ) ); also: public $actsas = array( 'upload.upload' => array( 'filename'=> array( 'path' => '{root}{ds}webroot{ds}img{ds}{model}{ds}{field}{ds}', ) ) ); also: class user extends appmodel { public $actsas = array( 'upload.upload' => array( 'fi

assembly - ASM8086: mul, imul, carry flag and overflow flag -

i understood logic of carry flag , overflow flag. but, when read program (wrote in masm 8086) , got perplexed bit. the program intent tell if quadratic equation has 2 distincts solutions, 2 equals solutions or no solutions @ all. .model small .stack .data aa dw 2 bb dw 4 cc dw 2 sol_msg db "there exist 2 real solutions", cr, nl no_sol_msg db "no real solutions! ", cr, nl sol_coinc db "the 2 solutions coincide! ", cr, nl .code .startup mov ax, bb imul bb jc overflow ; decided work @ 16-bit numbers push ax mov ax, aa imul cc jc overflow mov bx, 4 imul bx jc overflow pop bx sub bx, ax jo overflow js mess2 jz mess3 lea si, sol_msg jmp next mess2: lea si, no_sol_msg jmp next mess3: lea si, sol_coinc next: mov bx, lung_msg mov ah, 2 loop1: mov dl, [si] int 21h inc si dec bx jnz loop1 jmp end1 overflow: nop end1: .exit end now, doubt is: why first 3 checks has been tested carry flag , last 1 overflow flag? since in last one, subtract

php - How can I run my docker container with installed Nginx? -

Image
i have docker image dockerfile , build docker build . command. dockerfile content is: from ubuntu run apt-get update && apt-get install -y nginx php5 php5-fpm add . /code how can run docker container see nginx work? update: when try use next dockerfile: from ubuntu run apt-get update && apt-get install -y nginx php5 php5-fpm run sudo echo "daemon off;" >> /etc/nginx/nginx.conf cmd service php5-fpm start && nginx it build docker build -t my/nginx . , when enter docker run --rm -ti my/nginx command, terminal not response: when build image want specify image name -t option. docker build -t my/nginx . to run container use run command docker run --rm -ti my/nginx you should add following command dockerfile cmd ["nginx"] or php5-fpm cmd service php5-fpm start && nginx update. should run nginx daemon off. add following dockerfile after installing nginx. run echo "daemon off;" &

vb6 - How to hide the object of the OLE controler? -

i'm working ole object using vb6. use play sound when condition true. ole class mplayer . problem don't want player visible. know can set visible property of ole control false, thats hides conrtrol itself, not mplayer itself. i've tried following: if ' starts music. oleplayer.action = 7 ' here, line should use hide mplayer itself? ' oleplayer.visible = false - hides controler, , not class. ' there no visible property class. else ' stops music. olealarmsound.action = 9 end if i've looked everywhere, since there minor support vb6 in general, , vb6 ole in particular, i've found nothing. use screen.width screen.height object.top object.left to move object out of screen area

android - Does Picasso library save image to the cache? -

i work on android application, , clarify, picasso library save processing image cache? if not, how can force picasso save image cache? picasso automatically caches images. can check picasso loaded image calling setindicatorsenabled(true) on builder.

mysql - How to pass variables from one PHP file to another using HTML links? -

Image
//db connection $sql = "select `city`,`country` infotab"; $result = $conn->query($sql); while ($row = $result->fetch_assoc()) { echo $row["city"].$row["country"]"<a href='order.php'>order</a>"; } table output: this code select data. additionally, there reference order.php on every line. when user clicks on reference( <a href> clause), opens order.php , there need know row user selected work these data. change code to: while ($row = $result->fetch_assoc()) { echo $row["city"] . $row["country"] . "<a href='order.php?city=" . $row["city"] . "&country=" . $row["country"] . "'>order</a>"; } in order.php can access these values using $_get["city"] , $_get["country"] variables contain values <a href> link on previous page. example, runnin

javascript - Angular js dynamic grid headers after importing JSON data -

from following code, the grid having columns name, gender , company . now how dynamically change grid column names : want firstname instead of name <!doctype html> <html ng-app="app"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular-touch.js"> </script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular-animate.js"> </script> <script src="http://ui-grid.info/docs/grunt-scripts/csv.js"></script> <script src="http://ui-grid.info/docs/grunt-scripts/pdfmake.js"></script> <script src="http://ui-grid.info/docs/grunt-scripts/vfs_fonts.js"> </script> <script src="/release/ui-grid-unstable.js"></script> <script src="/release/ui-gr

c# - getting the CultureInfo from the existing ResourceSet -

i have resourceset use in code. works ok, because of users use rtl need know resourceset active one. sure happy if after code: cultureinfo ci = cultureinfo.getcultureinfo(language); assembly localisationassembly = assembly.load("resources"); resourcemanager rm = new resourcemanager("resources.myresource", localisationassembly); resourceset rs = rm.getresourceset(ci, true, true); i do: cultureinfo ci2 = rs.getcultureinfo(); as @hans mentioned in comment, cannot done because resourceset not store information.

objective c - Calling SKSpriteNodes based on of their name -

in spritekit game have several sprites different name properties . for (int = 0; < 10; i++) { skspritenode *sprite = [skspritenode spritenodewithimagenamed:@"png"]; sprite.name = [nsstring stringwithformat:@"name%i",i]; sprite.position = cgpointmake(100, 100); [self addchild:sprite]; } is possible call 1 of these sprites based on name? i found looking for.. use [self childnodewithname:@"name"]; to search specific node.

google app engine - Sharing vm machine between applications -

i have production gae application - myapp . i've created second app - myapp-staging have separate, staging environment. in myapp i've created jenkins machine build pipeline. it's easy run test , deploy jobs on same app. there problem deploy version jenkins vm on myapp myapp-staging . got unknown application (or similar) error while gcloud preview deploy . is possible give access vm on 1 application one? gcloud command? the problem jenkins instance using service account enabled myapp admin has no access myapp-staging . you'll have either: 1) setup original jenkins second service account admin rights myapp-staging 2) setup second jenkins instance , trigger build of staging version when first 1 complete.

jquery - using 2 jassor slider together in same html -

i trying use full-width-slider.source first slider , below trying use slider-cluster.source in same html page.but in slider-cluster .source slider1options not working neither arrows working nor slider view slider2options , slider3options working same set of codes first =============== var options = { $fillmode: 2, //[optional] way fill image in slide, 0 stretch, 1 contain (keep aspect ratio , put inside slide), 2 cover (keep aspect ratio , cover whole slide), 4 actual size, 5 contain large image, actual size small image, default value 0 $autoplay: true, //[optional] whether auto play, enable slideshow, option must set true, default value false $autoplayinterval: 4000, //[optional] interval (in milliseconds) go next slide since previous stopped if slider auto playing, default value 3000 $pauseonhover:

python - DjangoCMS failed to create a project -

i'm on windows system , following install django cms tutorial . according set fresh virtual environment python 3.4.3, installed djangocms-installer pip , run command (env) ps d:\skyro\documents\djangocms-project\sites> djangocms -p . mysite when answered installer's questions, got output error message: creating project please wait while install dependencies command "python setup.py egg_info" failed error code 1 in c:\users\roman\appdata\local\temp\pip-build-0v8y2934\django-select2-py3 i don't understand wrong , happy if explain me mean , how fix it. my installing process beginning: install python 3.4.3 default path , options enabled. pip install --upgrade pip (6.0.8 -> 6.1.1) pip install --upgrade setuptools (12.0.5 -> 15.1) pip install virtualenv move work folder , run virtualenv env activate virtual environment .\env\scripts\activate pip install djangocms-installer create , move empty folder 'sites' django

php form post is empty -

i started basics of html , php , hosted tiny website on server of friend , erverything worked fine. got own server , transfered website-data new server , changed mysql_connect() , mysql_select_db() parts. simple test mysql_query() works, connection new database alive (and yes, there data in it). however, form post sends empty forms: login.php: <form method="post"> <input name="user" type="text"> <button class="mybutton" type="submit" value="submit" name="submit">login</button> </form> <?php $user=mysql_real_escape_string($_post['user']); echo "user: ".$user; ?> here username empty. tried changing first line this: <form action="login.php" method="post"> suggested here , doesn't work. url of loginpage looks this: subdomain.domain.de/login.php , that's same location-syntax used on server of friend. i read problematic

How do i cache bust with Django's staticfiles? -

i have webpage includes image. wish cache bust image using ? technique. however, staticfiles encodes questionmarks '%3f', path no longer correct. {% load staticfiles %} <img src="{% static 'poll/img/test.jpg?v2' %}"> gets compiled as. <img src="/static/poll/img/test.jpg%3fv2"> there no test.jpg%3fv2 file. doesn't show. using static works fine. {% load static %} <img src="{% static 'poll/img/test.jpg?v2' %}"> get's compiled expected. want use staticfiles rather static serve static files cloud service. there way prevent encoding of string path or workaround of problem? to solve encoding either write own version of static tag or move parameters beyond tag. {% load staticfiles %} <img src="{% static 'poll/img/test.jpg' %}?v2">

c++ - How can I use a function as argument to a member function? -

i trying use member function sover::tov argument function using std::bind. compile error @ calling std::bind. briefly, essence of code following. wrong syntax or there better way want? class solver { private: .... public: .... double solve(vector< vector<double> > & sol, const double &z, const double &n) {... method(std::bind(&solver::tov, *this, pl::_1 , pl::_2 , pl::_3 ),y,x,dx) ...} void tov ( const vector<double> &y, vector<double> &dy, const double &x ) {...} }; void method(void (*i_function)(const vector< double > &, vector<double> &, const double &), vector< double > &y, const double &x, const double &h) {...} let me give concrete example reproduces main problem: void method(void (*i_function)(double &), double &y) { i_function(y); } class solver { public: solver() {} void so

angularjs - Angular ngCordova Datepicker doesnt display -

i installed ngcordova datepicker , can't find why datepicker isnt working : 1) view integrated ng-click="datepicker()": <a ng-click="datepicker()" class="item item-icon-left item-icon-right" href="#"> <img id= "icon_calendar" src="../img/icon_calendrier.svg"/> <p class="time_date"> </p> <img class= "flechedate" src="../img/fleche_bleuclaire.svg"/> </a> 2) controller (following doc in ngcordova website): angular.module('foot',[]).controller('footcontroller', function ($scope, $cordovadatepicker) { $scope.foot; $scope.datepicker = function(){ var options = { date: new date(), mode: 'date', // or 'time' mindate: new date() - 10000, allowolddates: false, allowfuturedates: true, donebuttonlabel: 'done', donebuttoncolor: '#f2f3f4', cancelbuttonlabel: 'cancel&#

javascript - D3.js JSON parse error -

while parsing inline json object d3.json(obj, function(error, root) , working when i'm running locally, when run on tomcat server i'm getting xmlhttpparse error. searched on internet. answer found cors. there no clarity how achieve this. please me? var obj = { "name": "vis", "children": [ { "name": "votes", "children": [ {"name": "200", "size": 200,"url":"1"}, {"name": "500", "size": 500,"url":"2"}, {"name": "300", "size": 300,"url":"3"}, {"name": "400", "size": 400,"url":"4"} ] }, { "name": "reputation", "children": [ {"name": "200", "size": 200}, {"name": "500", "size": 500},

c# - List<T> overwrites all the items inside a foreach loop to the last value -

i'm trying build windows application in there combo box , during load(), i'm population combo box connection strings availabe in app.config file. here app.config snippet: <!-- adding multiple servers in connection string--> <connectionstrings> <add name="sqlconnect-1" connectionstring="data source=sahil; initial catalog=recordcomparisontool; integrated security=sspi" providername="system.data.sqlclient"/> <add name="sqlconnect-2" connectionstring="data source=sahil; initial catalog=recordcomparisontool; user id=test; password=12123; integrated security=sspi" providername="system.data.sqlclient"/> <add name="sqlconnect-3" connectionstring="data source=sahil; initial catalog=recordcomparisontool; user id=test; password=32315; integrated security=true" providername="system.data.sqlclient"/> </connectio

spring boot RestController not seen from Grails -

i have made grails 3 application $ grails create-app helloworld into 1 have created spring controller democontroller.groovy package helloworld import org.springframework.web.bind.annotation.requestmapping import org.springframework.web.bind.annotation.restcontroller /** * controller responding * curl http://localhost:8080/demo * source location: src/main/groovy/helloworld/democontroller.groovy * */ @restcontroller class democontroller { @requestmapping("/demo") string demo() { "hello demo!" } } using $spring run src/main/groovy/helloworld/democontroller.groovy & $curl http://localhost:8080/demo works fine using $gradle bootrun & $curl http://localhost:8080/demo fails! grails reports /demo cannot found when same thing clean spring boot application (made http://start.spring.io/ ) works fine i cannot see wrong i have found solution in ( grails 3 , spring @requestmapping ) the grails applicat

xcode - ios plugin com.apple.share.Facebook.post do not show provided text -

in app i'm using following code allows share image text: - (ibaction)sharepressed:(id)sender { uiimage *postingimage = [uiimage imagewithcontentsoffile:self.filepath]; uiactivityviewcontroller *activityviewcontroller = [[uiactivityviewcontroller alloc] initwithactivityitems:@[@"lorem ipsum", postingimage] applicationactivities:nil; [self presentviewcontroller:activityviewcontroller animated:yes completion:nil]; } and when posting can see image, can't see text. text doesn't appear in fb. i'm afraid tell you, cannot post text facebook programatically. it's new facebook prohibition forbids "pre-filled" facebook sharing. why newer versions of ios not show text, tough it's correctly provided (and works on twitter , in other sharing options). for more info please refer https://developers.facebook.com/docs/apps/review/prefill )

php - Get radio button name attributes value -

Image
sorry if stupid question im not sure how tackle this, perhaps im overthinking. need retrieve both name attributes value , value attributes value. have @ img below: echo'<input type="radio" name="'.$eventid[].'" value="'.$team1.'">'; the name contains event_id , value contains user selection. need name ids value insert event id db along user selection. i know how retrieve rad value attribute not sure name, maybe im overthinking or need change logic. ideas? if user select australia radio button in php value 'australia' want value 'australia_80' store in db. change radio button values , names like <input type="radio" value="australia_80" name="getradio"> <input type="radio" value="canada_81" name="getradio">

Spring MVC app forwarding POST request to Webflow app -

we have 2 web apps; spring mvc app fronts spring webflow app. mvc app forward browser post request webflow app , send response browser, subsequent browser interaction directly webflow app. mvc app modifies response new webflow app's context. the problem i'm getting webflow app doing post-redirect-get. results in exception in mvc app when come handle response before responding browser. i'm thinking either need prevent prg flow request or steer clear of webflow in webflow app initial request possibly using mvc controller , starting webflow after initial request.

java - How to validate a specific json structure in Jackson? -

i need way validate specific formatted json can represent class (in case book class) strings using jackson. there way of doing using jsonschema? or have in different way objectmapper mapper = new objectmapper(); jsonschema jsonschema = mapper.generatejsonschema(book.class); edit you need use third party library this. i.e. https://github.com/fge/json-schema-validator objectmapper objectmapper = new objectmapper(); // line generate json schema class jsonnode schemanode = objectmapper.generatejsonschema(stagedetail.class).getschemanode(); // make json jsonnode jsonnode jsontovalidate = jsonloader.fromstring(json_to_validate); // validate against schema processingreport validate = jsonschemafactory.bydefault().getjsonschema(schemanode).validate(jsontovalidate); // validate.messages contains error massages system.out.println("valid? " + validate.issuccess());

python - Setting up MongoDB + Django -

i new mongo db , django. i've been trying use mongo db primary database django. i've installed mongodb , django-nonrel per following link: django - mongodb setup the version of django-nonrel, using 1.7. clone link it: pip install git+https://github.com/django-nonrel/django@nonrel-1.7 after following steps, settings.py in django project file looks this: databases = { 'default': { 'engine': 'django_mongodb_engine', 'name': 'blink', 'user': '', 'password': '', 'host': '127.0.0.1', 'port': 1234, } } installed_apps = ( 'djangotoolbox', ) but while running manage.py using following command: python manage.py runserver i getting error this, system check identified no issues (0 silenced). unhandled exception in thread started <function check_errors.<locals>.wrapper @ 0x104a95f80> traceba

ionic build android error when download gradle -

i'm new ionic framework :) >npm install -g cordova >npm install -g ionic >ionic start test blank >cd test >ionic platform add android when use ' >ionic build android ' start download gradle, can't download , error what caused error , how can fix it?! i download gradle , install in pc wants download again. can add gradle project offline? c:\users\lenovo2014\test>ionic build android running cordova build android running command: "c:\program files\nodejs\node.exe" c:\users\lenovo2014\myapp\ho oks\after_prepare\010_add_platform_class.js c:\users\lenovo2014\myapp add body class: platform-android running command: c:\users\lenovo2014\myapp\platforms\android\cordova\build.bat android_home=d:\program\programing\android\sdk java_home=c:\program files\java\jdk1.8.0_31 running: c:\users\lenovo2014\myapp\platforms\android\gradlew cdvbuilddebug -b c: \users\lenovo2014\myapp\platforms\android\build.gradle -dorg.gradle.daemon=true downloadin

c# - How much record can linq load when result stored in array? -

i have 600 milion record database,and want load query: var query=(from p in behzad.test select p).toarray(); can load that? highly improbable... there multiple "walls" you'll encounter. first... let's each record id... store in best way 600 million of ids, 600 million * 4 bytes = 2.4gb. don't think objects small. there reference objects... each referece 8 bytes @ 64 bits... http://codeblog.jonskeet.uk/2011/04/05/of-memory-and-strings/ here skeet calculated minimum memory used object @ 64 bits 24 bytes... 14.4gb (it doesn't includes reference object, new object[size] before gc.gettotalmemory(true) ). in space can put 2 int without making object bigger (the id , int field, example) (in same page, search table twoint32s ). then there problem linq-to-sql duplicates records when loaded (one copy goes object tracker). can disable https://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.objecttrackingenabled.aspx

ruby on rails - ArgumentError in Users::Registrations#create -

i making user-sign_up interface using devise gem missing host link to! please provide :host parameter, set default_url_options[:host] , or set :only_path true <p>you can confirm account email through link below:</p> <p><%= link_to 'confirm account', confirmation_url(@resource, confirmation_token: @token) %></p> you need set host variable application url. in environment.rb file config.action_controller.default_url_options = { host: application url' }

ios - How do you access NSManagedObjects between blocks? -

like title says how 1 go accessing nsmanagedobject has been created in 1 block , needs accessed in other. have following implementation , wondering if it's correct. __block person *newperson; @weakify(self); [magicalrecord savewithblock:^(nsmanagedobjectcontext *localcontext) { newperson = [person mr_createincontext:localcontext]; newperson.name = @"bob"; } completion:^(bool success, nserror *error) { @strongify(self); // called on main thread personviewcontroller *personvc = [[personviewcontroller alloc] initwithperson:newperson]; [self.navigationcontroller pushviewcontroller:personvc animated:yes]; }]; am correct in not needing access newperson localcontext in completion handler because it'll executed on main thread? edit it looks following proposed way: __block nsmanagedobjectid *newpersonobjectid; @weakify(self); [magicalrecord savewithblock:^(nsmanagedobjectcontext *localcontext) { person *newperson = [person mr_cr

unity3d - An Object reference is required to access non-static member C# Unity - How do I fix? -

this question has answer here: an object reference required access non-static member 2 answers i keep getting following error assets/zoning.cs(12,30): error cs0120: object reference required access non-static member `playercontroller.addfuel(float)' void ontriggerenter2d(collider2d collider) { if (collider.tag == "player") { debug.log("player re-fueling"); playercontroller.addfuel(1); } you must create instance of class in order access functions inside it. playercontroller obj = new playercontroller(); void ontriggerenter2d(collider2d collider) { if (collider.tag == "player") { debug.log("player re-fueling"); obj.addfuel(1); }

php - Can't get query to show on web page -

working on first mysqli data query. have done ton of reading, not understanding something... or apparently many things i no errors, blank page. can positive return if use straight php page such example.php, believe connection , basic query can work. in wordpress site. the results should river fish alsea steelhead applegate fall chinook etc. etc. i add more columns once basic functionality <?php $con=mysqli_connect("localhost","database","password","username"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $sql="select river, fish coastal1 order river"; if ($result=mysqli_query($con,$sql)){ // fetch 1 , 1 row while ($row=mysqli_fetch_row($result)){ echo $row[0].' '.$row[1]; } // free result set mysqli_free_result($result); } ?> this line: $con=mysqli_connect("localhost","

winforms - How to suppress launching beyond compare 3 while doing a comparison from windows forms application -

i using beyond compare 3 in win forms application comparison in 2 output folders (prodoutput , sitoutput). using below lines of code doing comparison public static void launchviewer(string filepath1, string filepath2) { string arguments = string.format("\"{0}\" \"{1}\"", filepath1, filepath2); processstartinfo psi = new processstartinfo(applicationpath, arguments); using (process p = process.start(psi)) { comparsionresult = comparefiles(filepath1, filepath2, beyondcomparerules.everythingelse); } } public static comparisonresult comparefiles(string filepath1, string filepath2, string rulename) { comparisonresult result = comparisonresult.none; string arguments = string.format("/quickcompare /rules=\"{0}\" \"{1}\" \"{2}\"", rulename, filepath1, filepath2); processstartinfo psi = new processstartinfo(appli

logic - Unexpected behavior in subsetting aggregate function in R -

i have data frame contains following format: manufacturers pricegroup leads harley <2500 # honda <5000 # ... ... .. i using aggregate function pull out data in following way: aggregate( leads ~ manufacturer + pricegroup, data=leaddata, fun=sum, subset=(manufacturer==c("honda","harley"))) i noticed not returning correct totals. numbers each manufacturer smaller , smaller more manufacturers add subset group. however, if use: aggregate( leads ~ manufacturer + pricegroup, data=leaddata, fun=sum, subset=(manufacturer=="honda" | manufacturer=="harley")) it returns correct numbers. life of me, can't figure out why. use or operator, except passing list of manufacturers in dynamically. thoughts why first construct not working? better, thoughts on how make work? thanks! the problem == alternating between values of "honda" , "harley" , comparin

angularjs - How to call the same directive in different views through one controller -

i have 1 directive looks this .directive('audioplay', function() { return { restrict: 'e', link: function(scope, element, attr) { var player = element.children('.player')[0]; scope.playorpause = true; scope.playmusic = function() { scope.playorpause = false; player.play(); } scope.stopmusic = function() { scope.playorpause = true; player.pause(); } } }; }) i using directive play , pause audio <audio-play> <audio class="player"> <source src="http://fire.wavestreamer.com:9711/urbanetradio"/> </audio> <button ng-click="playmusic()" ng-hide="!playorpause"> </button> <button ng-click="stopmusic()" ng-show="!playorpause"> </button> </audio-play> this app need have audio in every view, doesn't matter user goes, live str

overcome 32k limit when inserting oracle clob IN parameter using spring StoredProcedure -

environment: oracle 11g, spring-jdbc-3.2.2-release.jar, jdk 1.7, oracle ucp driver. i have stored procedure insert record table clob column. sp has clob input argument among other in , out arguments. java code uses spring storedprocedure call stored procedure: public class myclass extends storedprocedure { public myclass(){ ..... declareparameter(new sqlparameter("content", types.clob)); ..... } public void insert(){ hashmap<string,object> params = new hashmap<string, object>(37); string bigcontent = ....; // contains ascii chars in test .... params.put("content", new sqllobvalue(bigcontent)); .... execute(params); } } the code works fine if bigcontent has < 32k chars. if bigcontent has, 50k, chars, didn't work. tested using jdbctemplate , sqllobvalue insert table directly, works fine bigcontent has 50k chars. i want use sp whole bunch of other stuff , more

c# - How to use ShowWindow to show already hidden windows? -

i writing c# program use showwindow show or hide windows of other processes . problem not able use program show or hide windows of processes if window hidden before program run. for example, if run program, hide window of other process, show it, work normal. however, if run program, hide window of other process, terminate program, run program again, not able show window of process anymore. i able show windows of hidden processes if hidden before program ran. how may achieve this? program.cs using system; using system.collections.generic; using system.diagnostics; using system.linq; using system.text; using system.threading.tasks; namespace consoleapplication1 { class program { static void main(string[] args) { if (args.length == 2) { if (args[0] == "showh") { int handle; int.tryparse(args[1], out handle); app.showhandle(han

c++ - array pass by value vs an int? -

this question has answer here: what array decaying? 7 answers simple c++ swap function 3 answers how come pass value doesnt reset array global while int pass value resets if change in function? example, items_ordered becomes 0 when return though added 1 array doesn't become how started before function called. know if pass items_ordered reference change #include <iostream> using namespace std; void meal(char menu_1[], int order); int main() { char menu_order[50]; int items_ordered = 0; meal(menu_order, items_ordered); cout<<items_ordered<< menu_order; return 0; } void meal(char menu_order[50],int items_ordered) { cout<< "please enter item order\n"; cin.get(menu_order, 5

xcode - Why the UIButton is so big in a simulator? -

Image
i have uipageviewcontroller , uibutton under it. here screenshot of storyboard. when build app, button huge: all of constraints set automatically. tried specify height, doesn't help. ideas? p.s. i'm using xcode 6.3. edit: viewcontroller.swift : import uikit class viewcontroller: uiviewcontroller, uipageviewcontrollerdatasource { @iboutlet weak var restartbutton: uibutton! var pageviewcontroller: uipageviewcontroller! var pagetitles: nsarray! var pageimages: nsarray! override func viewdidload() { super.viewdidload() self.pagetitles = nsarray(objects: "page 1", "page 2") self.pageimages = nsarray(objects: "algorithm", "apoint") self.pageviewcontroller = self.storyboard?.instantiateviewcontrollerwithidentifier("pageviewcontroller") as! uipageviewcontroller self.pageviewcontroller.datasource = self var startvc = self.viewcontrolleratindex(