Posts

Showing posts from July, 2014

build - Android studio building signed APK error on "Type of anim" -

i trying build singed apk android studio. when press button create signed apk error : error: expected resource of type anim [resourcetype] and line of java code show's up layoutanimationcontroller lac = new layoutanimationcontroller(animationutils.loadanimation(employment.this, r.animator.grow_from_bottom), 0.8f); lview.setlayoutanimation(lac); i do'nt have problem create unsigned apk. in singed apk. please me. thank you. there 2 different types of animations in android: animation , animator . likewise, there 2 resource folders each: res/anim , res/animator . animationutils works animation , you're passing animator , why it's getting upset. need give animation resource (i.e. r.anim ). since it'll important learn difference between 2 types of animation, here resources: more on property animation (aka animator ) more on view animation (aka animation ) animation resources definition

Django+django-filebrowser+TinyMCE -

i added tinymce (directly, not django-tinymce) , django-filebrowser django admin. works, except 1 thing: click file browse button on tiny "add picture" menu, page not found (404), because don't understand means string in tiny options: var managerurl = window.location.tostring() + 'media/upload/?type=' + type; full code: <script type="text/javascript"> function tinydjangobrowser(field_name, url, type, win) { var managerurl = window.location.tostring() + 'media/upload/?type=' + type; tinymce.activeeditor.windowmanager.open({ file: managerurl, title: 'pic', width: 800, height: 450, resizable: 'yes', inline: 'yes', close_previous: 'no', popup_css : false }, { window: win, input: field_name }); return false; } tinymce.init({ mode : "specific_textareas", theme : "advanced", skin : "bootstrap"

Is there a way to optionally not have filepicker.io store your uploads in their servers/database? -

maybe haven't read documentation thoroughly enough, seems if want use s3 option, it's typically because want serve uploads s3 location. once stuff in s3, doesn't need saved @ filepicker url anymore. there way specify want upload stored in s3, , not filepicker, making filepicker middle man? one expect if possible, entail type of reduced cost due fact filepicker isn't storing data us. if possible, uploads stored in s3 , not filepicker still count towards our file limit account type have? if specify s3 location, filepicker.io not store contents of file on our servers, why pricing plans done on # of files rather size, etc. on both filepicker.store() , filepicker.pickandstore() calls, fpfile returned have key parameter indicates in s3 bucket file stored. from this, can construct s3 url necessary, default provide filepicker.io url serves both unique identifier file, providing options /convert , /stat , etc.

angularjs - Angular Service - Passing 'this' -

i attempting use external function reduce repeating standard $http call code within angular service , having think scope/this issues. question is, how amend service can make use of 'this' myservice in calls apiget function example service code: angular .module('myapp') .factory('myservice', ['$http', function($http) { function myservice() { this.uid; this.stuff; this.things; } myservice.build = function() { return new myservice(); }; myservice.prototype.setuid = function(uid) { this.uid = uid; }; // key part of problem code - have tried this: myservice.prototype.getstuff = apiget.apply(this,[$http,'stuff',this.uid]); // , this: myservice.prototype.getthings = apiget($http,'things',this.uid); }]); example external function code: function apiget($http,collection,uid) { return function() { return $http({ method: 'get',

memory - dashDB service not repsonding? -

last night, receiving memory issues of queries (inner joins on multiple tables) against dashdb service on bluemix. today, cannot access dashdb service. when access project instance on bluemix, using web browser, , choose dashdb service, presented grey page , white spinning wheel. never past that. is there issue dashdb in general? instance of it? way fix it? thanks in advance! dan it doesn't appear general problem shown @ https://developer.ibm.com/bluemix/support/#status i advice open ticket bluemix support. you can using 1 of following methods: use support widget. available user avatar in upper right corner of main bluemix ui. after opening support widget panel, select > in touch, select type of assistance need, , fill out support form. use support site 'get help' form. form available on separate site made available ticket submission when cannot log bluemix , access support widget. go http://ibm.biz/bluemixsupport , fill in support reque

iphone - same View different size at cell,how to reuse the cell -

- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { // return number of rows in section. nslog(@"[listarr count]=%d",[listarr count]); return [listarr count]; } // customize appearance of table view cells. - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { postcount *post=[listarr objectatindex:indexpath.row]; // nsstring *cellidentifier = [nsstring stringwithformat: @"cell_%d_%@",indexpath.row,post.foreignid]; // // uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; // if (cell == nil) { // cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; // // nslog(@"indexpath.row++++++++=%d",indexpath.row); // // // // }else{ //// [[cell.contentview viewwithtag:indexpath.row+1000] removefromsu

javascript - jQuery combine 2 scripts to achieve smooth scrolling to anchor -

i have following jquery function shows / hides content depending on div selected... jquery(document).ready(function() { jquery('.showsingle').on('click', function () { jquery(this).addclass('selected').siblings().removeclass('selected'); jquery('.targetdiv').hide(); var selector = '#div' + jquery(this).data('target'); jquery(selector).show(); location.hash = selector; }); }); http://jsfiddle.net/w4km8/7944/ i have following script taken http://1stwebmagazine.com/jquery-scroll-to-anchor-point $(document).ready(function(){ $('a[href^="#"]').bind('click.smoothscroll',function (e) { e.preventdefault(); var target = this.hash, $target = $(target); $('html, body').stop().animate({ 'scrolltop': $target.offset().top-40 }, 900, 'swing', function () { window.location.hash = target;

sqlite - SQL missing 0 values -

i have problem 1 query: select first_name, last_name, count(scheduleevents.id) workers join scheduleevents on scheduleevents.worker_id = workers.id this query result is: workers have events ( more 0) in scheduleevents table want workers 0 events too. left join don`t work , ifnull option how can resolve problem? you can use left join, you're missing group result per worker; select first_name, last_name, count(scheduleevents.worker_id) workers left join scheduleevents on scheduleevents.worker_id = workers.id group workers.id; an sqlfiddle test with .

sql server - T-SQL - how to compare a SELECT resultset and IN list -

this question has answer here: t-sql - using , condition if value list present 2 answers i have query , in clause want add , condition if resultset of 1 select statement in list of predefined values, otherwise condition should not added select field1, field2, field3 .... table1 join table2 on somekeymappings condition1 , condition2 , if (select ids table2) in (1001, 1002, 1003, 1004, 1005, 1006) condition3 group blah, blah, blah having blah, blah select field1, field2, field3 .... table1 join table2 on somekeymappings condition1 , condition2 , (table2.id in (1001, 1002, 1003, 1004, 1005,1006) , condition3 or table2.id not in (1001, 1002, 1003, 1004, 1005,1006)) group blah, blah, blah having blah, blah

sql - Retrieve the latest guid value that is testID -

this question has answer here: scope_identity() guids? 5 answers goal: retrieve latest guid value in real time after have inserted the value in table problem: don't know how it info: *you can add new vale address , zip code *please take account can lots of data! create table [addressbook] ( [testid] [uniqueidentifier] not null default newid(), [address] [nvarchar](50) null, [zipcode] [nvarchar](50) null ) you can retrieve inserted guid through insert stored procedure sample: create procedure [dbo].[spupdatebookmark] @bookmarkguid [uniqueidentifier] = null, @otherfield nvarchar(256), @newbookmarkguid [uniqueidentifier] output execute caller begin set @bookmarkguid = newid() insert bookmarks (bookmarkguid, otherfield) values (@bookmarkguid, @ot

Android: HTTP POST response - 401 -

i have faced 1 problem - returning 401 error msg when signed in , trying access secured pages. mystic of problem me can access secured pages after signed in if check via firefox restclient or via ios app cannot access via chrome advanced rest client , android app. however, content-type , other necessary params set same in both web tools , apps. have tried set different auth headers encoded login:pass doesn t , doesn t need because should work without it, think(at least ff , ios app work without header). what`s gonna wrong? response headers of chrome: 401 unauthorized loading time: 29 request headers content-type: application/x-www-form-urlencoded response headers date: mon, 04 mar 2013 10:01:02 gmt server: apache/2.2.20 (ubuntu) x-powered-by: php/5.3.6-13ubuntu3.9 set-cookie: peachy=qg3mjvchjh1oionqlhhv0jrn71; path=/ expires: thu, 19 nov 1981 08:52:00 gmt cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 pragma: no-cache vary: accept-encodin

Html5 video blob on iOS 9 -

loading video (mp4/h264) blob through xhr, using such blob source html5 video element. var vsource = window.url.createobjecturl(blob); var player = document.getelementbyid("player"); player.src = vsource; player.play(); the above has been working on pretty every major desktop , mobile browser, exception of ios safari. it broken on ios 7, worked on ios 8, , stopped working again on ios 9. wonder if aware of this, , if there workaround. thanks edit: safari: unable dynamically load video blob url the last line, says "update, 2015: works now, updated code." seems imply has been fixed. me, doesn't seem so.. fixed (again) apple of ios 9.2.

debugging - How to debug erlang code during rebar3 eunit? -

i have created release app rebar3 (beta-4). added eunit tests , wrote code. for have debug 1 test case see have add make implementation work properly. i found articles using dbg erlang console , found how write debug info eunit. need info code have test (the actual implementation(logic)). is there way debug erlang code (actual source code, not test one) when rebar3 used eunit argument? thanks currently i'm using tracing in terminal there: https://aloiroberto.wordpress.com/2009/02/23/tracing-erlang-functions/ one way use rebar3 run shell under test profile, start debugger , set breakpoints , such: $ rebar3 test shell ... 1> debugger:start(). {ok, <0.67.0>} this pop debugger gui . once debugger set , ready, run test under eunit : 2> eunit:test(your_test_module,[verbose]). ======================== eunit ======================== your_test_module: xyz_test_ (module 'your_test_module')... assuming set suitable breakpoint in debugge

php - How to test deployed web applications -

we've build web application update tool pulls our versioncontrol server , applies .sql script database. per client account have separate set of php files + new database. client accounts separated each other. at moment because have 7-8 client accounts after update manually click through few of pages see went alright, because whole application behind login use dummy account login. my question how can automate task in propper way. i set scripts curl each client account login details of dummy account seems bad create dummy account purpose + script need know username/pw each dummy account. what's way test web-applications behind log in? i jenkins . provides bunch of tools can integrated monitor , test server when deploy.

php - Hello Expected argument of type "string", "bundle\FrontBundle\Form\Type\PrestationType" given -

i test application , i'm error please my formtype namespace bundle\frontbundle\form\type; use doctrine\orm\entityrepository; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; use symfony\component\optionsresolver\optionsresolver; class prestationtype extends abstracttype { public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('path') ->add('alt') ->add('save', 'submit'); } public function configureoptions(optionsresolver $resolver) { $resolver->setdefaults(array( 'data_class' => 'bundle\frontbundle\entity\image', )); } public function getname() { return 'prestation'; } } my entity <?php namespace bundle\frontbundle\entity; use doctrine\orm\mapping orm; /** * image * * @orm\table

Visual Studio Starter Kit for development of dnn skin and dnn module? -

i want develop dnn modules , skins vs starter-kit. can download dnn7 starter kit development of dnn skin , dnn module ? now can download dnn starterkit visual studio

c# - string[,] array of string arrays equivalent in C -

in c#, if create array of string arrays easy doing: string[,] array = new string[50,7]; how go doing in c? understand should make use of pointers have come doesn't seem work properly. char *array[50][7]; please note i'm not looking set elements constant values, need able access them/set them in program again either means of using scanf() function or = if possible. simplest way of achieving this? edit: doing wrong here? following simple example crashes program: char *username; printf("username: "); scanf("%s", &username); array[0][0] = malloc(strlen(username) + 1); strcpy(array[0][0], username); i have, in fact, added reference stdlib.h the following code crashes code attempting save scanf() input place pointed username , yet username not initialized. char *username; scanf("%s", &username); // bad instead, use char username[100]; scanf("%99s", username); or better char username[100]; fget

c++ - Iterator prints two values, one is text and other is unfortunately a pointer -

the following code shows 4 messages, first 2 normal, other 2 passes through iterator, second 1 doesn't show right value, prints pointer instead of value, code same 2 variables. the code big, important part inside main , show_message, problem anm->getname() works , anm->getparent()->getname() doesn't #define win32_lean_and_mean #include <windows.h> #include <stdlib.h> #include <malloc.h> #include <memory.h> #include <tchar.h> #include <string> #include <vector> class node; class customobject; class customobject { public: std::string name; node* parent; customobject(std::string n_name); std::string getname(); void setparent(node* pparent); node* getparent(); }; customobject::customobject(std::string n_name) { name = n_name; } std::string customobject::getname() { return name; } void customobject::setparent(node* pparent) { parent = pparent; } node* customobject::getparent()

php - why doesn't Telegram trigger my registered webhook? -

i develop simple telegram bot php , host on koding telegram doesn't trigger webhook; why ?! how debug webhook? below code bot. require_once "vendor/autoload.php"; use telegram\bot\api; $telegram=new api('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); if (isset($_get['hook'])){ $msg=$telegram->setwebhook([ "url" => "https://umkk50a5b157.mohsenti.koding.io/phpbot/index.php", "certificate" => "/etc/apache2/ssl/apache.crt" ]); echo json_encode($msg)."<br>"; echo "setup webhook ok"; exit; } if(isset($_get['uhook'])){ $telegram->removewebhook(); echo "remove webhook ok"; exit; } if(isset($_get['debug'])){ $fp=fopen('debug.txt','r'); while($read=fread($fp,4096)) echo $read; fclose($fp); echo "debug end"; exit; } $updates=$telegram->getwebh

php - Outlook API - We received a bad request -

i'm following this tutorial , getting following message: sorry, we’re having trouble signing in. received bad request. miserably, microsoft isn't giving me other message. edit: here code i'm using id's , passwords masked home.php <?php session_start(); require('oauth.php'); $loggedin = false; $redirecturi = 'http://localhost:9999/outlook_cal03/authorize.php'; ?> <html> <head> <title>php mail api tutorial</title> </head> <body> <?php if (!$loggedin) { ?> <!-- user not logged in, prompt login --> <p>please <a href="<?php echo oauthservice::getloginurl($redirecturi)?>">sign in</a> office 365 or outlook.com account.</p> <?php } else { ?> <!-- user logged in, here --> <p>hello user!</p> <?php } ?

c# - Winforms Null Reference Exception -

at moment trying open first video file in winform application using this vlc library as far can tell, have set properly. have followed of source code sample projects give , created winform in style of sample project. when run project , open file, null reference exception on following code, namely line vlccontrol.media = media; : if (openfiledialog.showdialog(this) == dialogresult.ok) { var media = new pathmedia(openfiledialog.filename); vlccontrol.media = media; } i know null reference errors happen because haven't initialized something, eyes, media has been set new object. why compiler throwing fit? update i've fixed issue. had rebuild , re-add dll had fix issue. thank help. there 2 options cause this. vlccontrol null (hasn't been constructed or initialized) @ point. cause exception occur since you're trying access media property. vlccontrol raising exception because it's internal state not setup properly. if setting

mysql - Cloud webservice for and Android app -

hello i'm looking freeware or cheap server can set restful webservice database , php. does suggest me one? thanks! https://www.firebase.com/features.html firebase great option ( i recommend one ). can authentication (g+, twitter,facebook, password based , anonymous), realtime database , hosting. free teir pretty good, can expensive. http://www.couchbase.com/nosql-databases/couchbase-server you can use couchbase server need lot of set ups it. free!

Script to delete duplicate files with same names but different extensions -

i using audacity's chains scripting function batch-convert , edit many large, uncompressed .wav files @ once smaller .ogg format. end folder structure following: f:/sound-recordings: -- rec1.wav -- rec2.wav -- rec3.wav -- rec4.wav -- rec5.wav f:/sound-recordings/cleaned: -- rec1.ogg -- rec2.ogg -- rec3.ogg some of source .wav files corrupted (note rec4.wav , rec5.wav in above example), , audacity not convert them (at least through chains function). creates problem, can become tedious compare 2 folders, , delete .wav files converted .ogg. in example above, "rec1.wav", "rec2.wav", , "rec3.wav" should deleted, while "rec4.wav" , "rec5.wav" untouched, since weren't converted. i need script (batch or python preferred) delete .wav files main folder, have identically named .ogg files located in "cleaned" folder, leaving other .wav files untouched. @echo off %%i in (f:\sound-recordings\*.wav) ( if exi

Exception in thread, bound must be positive at java.util.random.nextInt and at main -

as new beginner in java, having trouble text adventure game, , work on it, realized unable run it. have searched google, looked here, , found no answer how fix problem. here's error: exception in thread "main" java.lang.illegalargumentexception: bound must positive @ java.util.random.nextint(random.java:388) @ iproject.iproject.main(iproject.java:47) and here code: package iproject; import java.util.random; import java.util.scanner; /** * * @author twinbranch*/ public class iproject { /** * * @param args */ public static void main (string[] args) { scanner in = new scanner(system.in); random rand = new random(); string[] enemies = { }; int maxenemyhealth = 75; int enemyattackdamage = 25; int health = 100; int attackdamage = 50; int numhealthpots = 3; int healthpotionhealamount = 30; int healthpotiondropchance = 33; //percentage boolean running = true; { game: while (running) { system.out.println(); int enemyhealth = rand.nextint(maxenemyheal

c# - Minecraft not starting -

i in project of launcher minecraft, without using java! c#. i have code not know what's going wrong, java open closes. public void runminecraft() { list<string> j_args = new list<string>(); list<string> libraries = new list<string>(); args = ""; int x = convert.toint32(numericupdown1.value); j_args.add("-xx:heapdumppath=mojangtricksinteldriversforperformance_javaw.exe_minecraft.exe.heapdump"); j_args.add("-xmx" + x + "g"); j_args.add("-djava.library.path=" + application.startuppath + "\\data\\natives"); j_args.add("net.minecraft.client.main.main"); string lib = application.startuppath + "\\data\\libraries\\{0}"; string app = application.startuppath; string game = application.startuppath + "\\data\\game"; string assets = application.startuppath + "\\data\\as

c# - Regex find at least one of two characters -

bear me, new regular expressions, syntax may out. here expression: "(?:\\s*[\"]?[']?\\s*)" which equates to: amount of white space, possibility of double quote, possibility of single quote, amount of white space. the problem have still matches if there no double quote or single quote. how make expression there must @ least 1 double quote or @ least 1 single quote? this should work: @"(?:\s*('|\")+\s*)"

c# - WPF ListView not rendering properly -

i have created listview control display users connected application. working before added celltemplates gridviewcolumns. when add item list, not show up. however, if close , reopen list item appear. seems item being added properly, control not rendering after item added. code below. in advance assistance. public class ncwindow { public grid _grid; public listview lstconnectedusers; private gridview connectedusersgrid; public list<connecteduseritem> roomusers = new list<connecteduseritem>(); public ncwindow(grid grid) { _grid=grid; setter setter = new setter(); setter.property = gridviewcolumnheader.visibilityproperty; setter.value = visibility.collapsed; style style = new style(); style.targettype = typeof(gridviewcolumnheader); style.setters.add(setter); style lcustyle = new style(typeof(listviewitem));

Google Map distance calculation between multiple points -

i calculating distance , duration between origin (say a) , destination (say b) in java using google map api follows:- distancematrixapirequest request = distancematrixapi.newrequest(context).origins(origin).destinations(destination); distancematrix result = request.await(); system.out.println("distance : "+result.rows[0].elements[0].distance.inmeters); system.out.println("duration : "+result.rows[0].elements[0].duration.humanreadable); however if want calculate duration , distance between multiple points (say --> b --> c --> d), how do this? should repeat above code between each of points or there better way this? you can in single request: origins: [a,b,c] destinations: [b,c,d] then ignore results don't need (you need a->b, b->c, c->d; not other combinations).

javascript - Adding elements to array in a for loop, empty array after loop -

so encountered following problem: have array keys used encrypt string. loop goes through array, encrypts string current key , pushes encrypted string new array. here code: var enc_gmessages = ['start']; for(i = 0; < pubkeys.length; i++) { var pubkey = pubkeys[i]; if(pubkey != 'no' && pubkey != null) { var publickey = openpgp.key.readarmored(pubkey); openpgp.encryptmessage(publickey.keys, content).then(function(pgp_gmessage) { //string encrypted console.log(pgp_gmessage); enc_gmessages.push(pgp_gmessage); }).catch(function(error) { console.log('error'); }); } } alert(enc_gmessages); while string gets encrypted (and logged in console) if there's valid public key, array contains 'start' element after loop. can please point out i'm doing wrong? you're trying obtain value asynchronous operation before has completed. that'

MD5 Hash function in excel without using VBA -

i need function take entire cell value in excel , convert value md5 hash equivalent in new cell. there formula in excel that? need solution without using vba. possible? i did this. here can download md5 in pure excel without vba. office 2013 only. http://rghost.ru/download/52431889/443023f8bef59a9a409e3e93fdffa4c35cdfb7d3/443023f8bef59a9a409e3e93fdffa4c35cdfb7d3/md5.xlsx office 2013 comes handy functions bitwise operations bitand() , bitor() , bitxor() , bitr[l]shift() . think it's technically possible implement md5 in previous versions of office, utter hell because have convert values binary, convert strings, character replacement mixed arithmetical addition/subtraction etc. etc. add 15-digit maximum number precision (which means have hard time processing 16-bit binary values). my workbook can process strings 1024 ascii characters long. reduce file size (which 185 kb). if need process longer messages can add calculation blocks bottom of table (a single calcula

ios - Can't push a view onto searchResultsController -

i have tableviewcontroller, searchresultscontroller , webviewcontroller. when click on cell in tableviewcontroller pushes webviewcontroller opening url related cell. the tableviewcontroller has uisearchcontroller filters results searchresultscontroller when cell clicked in searchresultscontroller webviewcontroller doesn't pushed. here code didselectrowatindexpath searchresultscontroller: - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { webviewcontroller *webviewcontroller = [[webviewcontroller alloc] init]; nsstring *extensionurl = (self.searchresults[indexpath.row])[@"url"]; nsurl *baseurl = [nsurl urlwithstring:@"http://www.baseurl.com"]; nsurl *url = [nsurl urlwithstring:extensionurl relativetourl:baseurl]; webviewcontroller.title = (self.searchresults[indexpath.row])[@"title"]; nslog(@"%@", url); webviewcontroller.url = url; [self.navigationcontroller

javascript - How to pass values between service and controllers -

how can 1 pass values services controllers? have been reading stackoverflow questions regarding , none of solutions seem solve problem. trying access google spreadsheets using tabletop.js when console.log services can see values when try access spreadsheet values controller following error: chartservice.getproperty not function the code getting url of spreadsheet works fine. method. not sure doing wrong here. controller angular.module('myapp') .controller('piechartctrl', function (chartservice, $scope, config) { $scope.values = chartservice.getproperty(); }); service.js angular.module('myapp') .service('chartservice', function(){ return { geturl: function init(path) { tabletop.init( { key: path, callback: showinfo, simplesheet: true } ) } } function showinfo(data, tabletop) { return{ getproperty: function(){ return data }, setpro

Rebalancing Cassandra 1.2 cluster when a seed node (from total of 2) is died using virtual nodes -

i have cassandra 1.2 cluster in local machine modified hosts: #cassandra nodes m.y.i.p m.y.i.p (node 1)<---- seed 1 m.y.i.p 127.0.0.3 (node 2) m.y.i.p 127.0.0.4 (node 3)<---- seed 2 m.y.i.p 127.0.0.5 (node 4) m.y.i.p 127.0.0.6 (node 5) ... cluster has total of 5 nodes. i'm using virtual nodes, don't havo set initial_token anywhere. the steps i've followed: start seed nodes (1 , 3) start nodes 2 , 4. turn off node 3. try join node 5. the problem in 4th step, when try join node 5 cassandra throws exception: java.lang.illegalstateexception: unable find sufficient sources streaming range (-7204018021044318047,-6965052533844316617] @ org.apache.cassandra.dht.rangestreamer.getrangefetchmap(rangestreamer.java:205) @ org.apache.cassandra.dht.rangestreamer.addranges(rangestreamer.java:129) @ org.apache.cassandra.dht.bootstrapper.bootstrap(bootstrapper.java:81

java - Regex for JSON validation -

i'm trying regex validate json below. need validate if structure of json correct , nodes available regex validation in java code. {"vehicles":[ { "id" : "10001", "storeid" : "101", "purchasedate" : "2014-08-12", "merchantname": "friends", "category" : "sale", "type" : "sedan", "amount" : "15000.33" }, { "id" : "10002", "storeid" : "101", "purchasedate" : "2014-08-12", "merchantname": "friends", "category" : "lease", "type" : "sedan", "amount" : "25000.33" }, { "id" : "1

node.js - How can I pass variable to ejs.compile -

my bottom_index.ejs looks that: <div>the bottom section</div> in code declare ejs: ejs = require('ejs'); then compile function: var botom_index_ejs = ejs.compile(fs.readfilesync(__dirname + "/../views/bottom_index.ejs", 'utf8')); and call rendered html: botom_index_ejs() it works fine! now change template to: <div><%= bottom_text %></div> and able pass parameter (bottom_text) bottom_index.ejs how should pass parameters? thanks! parameters passed ejs template js plain object. example sholud be: botom_index_ejs({ bottom_text : 'the bottom section' }); update: test.js var fs = require('fs'); var ejs = require('ejs'); var compiled = ejs.compile(fs.readfilesync(__dirname + '/test.ejs', 'utf8')); var html = compiled({ title : 'ejs', text : 'hello, world!' }); console.log(html); test.ejs <html> <head> <tit

javascript - jquery addClass to element if css has style -

please have @ following question , answer, seccond answer (with many upvotes) jquery: how check if element has css class/style looks this: if ($('#yourelement').css('position') == 'absolute') { // true } so awesome like if ($('#yourelement').css('position') == 'absolute') { $(this).addclass('xxx'); } so element id "yourelement" gets class added what easyest way that you way: $('#yourelement').addclass(function(index, currentclass) { return $(this).css('position') == 'absolute' ? 'xxx' : ''; }); for more information on syntax take @ api .addclass() .

java - How to create a ParamConverter<Integer> that handles primitive int as well? -

so want create custom paramconverter<integer> in jax-rs: public class intparamconverter implements paramconverter<integer>{ @override public integer fromstring(string value) { try{ return integer.valueof(value); }catch (exception e){ //do stuff throw new badrequestex("convert exception"); } } @override public string tostring(integer value) { return string.valueof(value); } } and register via paramconverterprovider: @provider public class customparamconverterhandler implements paramconverterprovider { @override public <t> paramconverter<t> getconverter(final class<t> rawtype, type generictype, annotation[] annotations) { if (rawtype.equals(integer.class)){ return (paramconverter<t>) new intparamconverter(); } return null; } } and use in resource pojo follows

c++ - How to use z3 with Visual Studio? -

i want use z3 visual studio 2015. downloaded binaries current version (4.4.1) windows. set new project, add include-folder include directories , bin folder librariy directories. current main file (and file) is: #include <z3++.h> void main() { z3::context ctx; z3::expr expr = ctx.bool_val(4); } however, when try run local windows debugger, number of linker errors shown, e.g., unresolved external symbol _z3_mk_config referenced in ... . so, apparently, i'm missing something, don't know what. thanks help! all right, comments solve problem: i needed add libz3.dll additional dependencies in linker->inputs , lib folder additional library dependencies in linker->general. thank help!

angularjs - http POST data access -

i'm new anuglarjs , trying send http post request. request sent successfully. however, cannot access post data on server side. i've tried modify headers , request data (per different articles). none seem work. here's using, client: var user = { name: $scope.username }; $http({ method: "post", url: "../validation", data: user, }).then(function(response) { console.log(response); }); server: $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $name = $request->name; echo $name; any appreciated. thanks!

php - Symfony internationalization -

i having strange problem translation in symfony 2. this config.yml imports: - { resource: parameters.yml } - { resource: security.yml } - { resource: services.yml } # put parameters here don't need change on each machine app deployed # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration framework: #esi: ~ translator: { fallbacks: ['%locale%'] } secret: "%secret%" router: resource: "%kernel.root_dir%/config/routing.yml" strict_requirements: ~ form: ~ csrf_protection: ~ validation: { enable_annotations: true } #serializer: { enable_annotations: true } templating: engines: ['twig'] #assets_version: someversionscheme trusted_hosts: ~ trusted_proxies: ~ session: # handler_id set null use default session handler php.ini handler_id: ~ fragment

Access Report Showing Each Records Color Value -

i've asked similar question here , want create report showing color values entered each record. i've been able use portion of code used enter values, when report loaded, rectangles in report showed color value record 1, not per each. this used enter values, works: dim variant = split(textbox1.text,",") box1.backcolor = rgb(int(a(0)),int(a(1)), int(a(2))) i added code report, on current, on load events , neither worked. maybe code needs go event? how can report show color each record? your code must go on format event of details section. note event fires when open report in print or print preview view, not in report view.

save - MATLAB: How to store clicked coordinates using ButtonDownFcn -

goal: perform several clicks in 1 figure, containing image displayed imshow , save coordinates of "clicked" point(s), used in further operations. notes: know functions getpts / ginput perform without using them. possible using buttondownfcn ? (see following code) function testclicks img = ones(300); % image display h = imshow(img,'parent',gca); set(h,'buttondownfcn',{@ax_bdfcn}); function ax_bdfcn(varargin) = get(gca,'currentpoint'); x = a(1,1); y = a(1,2); at stage variables x , y "live" inside ax_bdfcn . how can make them available in testclicks function? possible using buttondownfcn ? approach? thanks lot. edit1: answer shai. still cannot accomplish intended. function [xarray, yarray] = testclicks() img = ones(300); % image display h = imshow(img,'parent',gca); x = []; y = []; xarray = []; yarray = []; stop = 0; while stop == 0; set(h,'buttondownfcn',{@ax_bdfcn}); xarray = [xarray x];