Wednesday, 15 July 2015

json - slc loopback:model does not allow selection of datasource -



json - slc loopback:model does not allow selection of datasource -

following through tutorial , couldn't model creation allow me manually take datasource. automatically chooses "db (memory)"

numerous datasources created via "slc loopback:datasource"... datasource.json follow:

{ "db": { "name": "db", "connector": "memory" }, "accountdb": { "name": "accountdb", "connector": "memory" }, "anotherdb": { "name": "anotherdb", "connector": "mysql" }, "yetanotherdb": { "name": "yetanotherdb", "connector": "mongodb" }, "blah2db": { "name": "blah2db", "connector": "mysql" } }

when creating model:

[?] come in model name: account

[?] come in model name: account

[?] select data-source attach business relationship to: db (memory)

[?] expose business relationship via rest api? (y/n)

versions info:

node --version v0.10.31

slc --version strongloop v2.9.1 (node v0.10.31) ├── strong-build@0.2.1 ├─┬ strong-supervisor@1.0.1 │ └── strong-agent@0.4.14 ├── node-inspector@0.7.4 ├── strong-deploy@0.1.4 ├── strong-pm@1.2.0 ├── strong-registry@1.1.1 ├── nodefly-register@0.3.3 └── generator-loopback@1.3.1

i not able reproduce virtually same installation. os using?

also, sure, see next prompt (what pasted different):

[?] select data-source attach business relationship to: (use arrow keys) ❯ db (memory)

if/when see that, can please seek hitting down-arrow key: happens?

thanks, rand

json strongloop

PHP check if value exists in MySQL -



PHP check if value exists in MySQL -

i tried re-create check if value exists in mysql , create own, reason wont work...

this got:

<?php $host = '127.0.0.1'; $username = 'root'; $password = ''; $dbname = 'multiplayer'; $con=mysqli_connect($host, $username, $password, $dbname); $check_player_ip=mysqli_query($con, 'select `player_ip` `playerdata` username = "remco" , active = 0'); if (mysqli_num_rows($check_player_ip) == 0) { //didnt find } else{ //found } ?>

i error: parse error: syntax error, unexpected '$check_player_ip' (t_variable) in c:\xampp\htdocs\test.php on line 1

solution

if t_variable error, check varriable before rule. may forgot place ';' xd

thanks support!

try this:

<?php $host = '127.0.0.1'; $username = 'root'; $password = ''; $dbname = 'multiplayer'; $con = new mysqli( $host, $username, $password, $dbname ); /* check connection */ if ( $con->connect_error ) { printf( "connect failed: %s\n", $con->connect_error ); exit(); } /* query - returns resultset */ if ( $result = $con->query('select `player_ip` `playerdata` username = "remco" , active = 0 ') ) { if ( $result->num_rows <= 0 ) { //didnt find printf("no player"); } else { //found printf("select returned %d rows.\n", $result->num_rows); } /* free result set */ $result->close(); } /* close connection */ $con->close(); ?>

php mysql

javascript - Can't set breakpoint in source mapped file (example with jquery) -



javascript - Can't set breakpoint in source mapped file (example with jquery) -

i have problem set breakpoint on javascript source file minified mapped on real sources source map file.

the problem can demonstrated jquery.com website.

on site, imported script jquery.min.js contains //# sourcemappingurl=jquery.js directive.

this can observed on chromium 37 debugger :

on "real source file", i'm trying setup breakpoint on line 500, bug breakpoint appears on line 6955.

what is wrong utilize case ? possible ?

this happen when line set breakpoint not have proper mapping compiled source code. have checked , indeed line mapped weird (unexisiting) position in jqeury.min.js file.

consider filing jquery issue. please note, however, while in recent versions of jquery source map url not included in minified version default, can still download site , check if fixed.

javascript jquery google-chrome debugging source-maps

scala - How to set up prod mode to have configuration file in conf directory (not inside jar)? -



scala - How to set up prod mode to have configuration file in conf directory (not inside jar)? -

i'm using activator create project , utilize command universal:packagebin generate .zip file.

i wondering if it's possible set application read configuration file conf folder instead of configuration classpath ( .conf file within jar).

is possible? if it's, how can it?

see https://www.playframework.com/documentation/2.3.x/productionconfiguration mechanism of telling play application pickup config from.

to tie in universal:packagebin, pass -dconfig.file script within bin directory. e.g. if application called foo:

unzip foo-1.0-snapshot.zip foo-1.0-snapshot/bin/foo -dconfig-file=/path/to/app.conf

scala playframework-2.0 typesafe-activator

Combining two lists into a dictionary in python -



Combining two lists into a dictionary in python -

this question has reply here:

map 2 lists dictionary in python 9 answers

for example, if had 2 lists:

lista = [1, 2, 3, 4, 5] listb = [red, blue, orange, black, grey]

i'm trying figure out how display elements in 2 argument lists in 2 columns, assigning 1: red, 2: blue... , on.

this has done without using built-in zipfunction.

>>> lista = [1, 2, 3, 4, 5] >>> listb = ["red", "blue", "orange", "black", "grey"] >>> dict(zip(lista, listb)) {1: 'red', 2: 'blue', 3: 'orange', 4: 'black', 5: 'grey'}

python list dictionary

diskspace - Linux du directory size, how is this possible? -



diskspace - Linux du directory size, how is this possible? -

i have folder called joblibscratch. , see this

ubuntu@memo:~$ du -s joblibscratch 2831128 joblibscratch

this 2831128 kilobytes, 2.836024gb. , see this

ubuntu@memo:~$ du -hs joblibscratch 2.7g joblibscratch

so du saying folder both 2.7gb , 2.83 gb. how can be? if makes difference i'm using virtual hard drive on cloud server.

2831128 / 1024 = 2764.7734375 2764.7734375 / 1024 = 2.69997406005859375

linux diskspace

commonsware cwac - Load HTML Content to android RichEditText -



commonsware cwac - Load HTML Content to android RichEditText -

i'm using cwac-richedit librar in project user write text in , app save user input html content

problem when want show saved content user, displays html content. tried :

spanned description = html.fromhtml(stepcontent); rtxtstepdescription.settext(description);

and looks this

edited: user writes in edittext: app saves content html.tohtml(rtxtstepdescription.geteditabletext())

after that, next time open app app loads: <p dir="rtl"><u>&#1587;&#1604;&#1575;&#1605;</u><br> &#1605;&#1578;&#1606; <i>&#1570;&#1586;&#1605;&#1575;&#1740;&#1588;&#1740;</i> &#1576;&#1585;&#1575;&#1740; <b>&#1587;&#1608;&#1575;&#1604;</b></p>

figured out. these html entities, see 1 convertor online here.

use apache stringescapeutils apache commons lang:

import org.apache.commons.lang.stringescapeutils; ... string withcharacters = stringescapeutils.unescapehtml(yourstring);

javadoc says:

unescapes string containing entity escapes string containing actual unicode characters corresponding escapes. supports html 4.0 entities.

for example, string "&lt;fran&ccedil;ais&gt;" become "<français>"

if entity unrecognized, left alone, , inserted verbatim result string. e.g. "&gt;&zzzz;x" become ">&zzzz;x".

as described in answer here

android commonsware-cwac