Posts

php - Symfony using external parameters in assert and routing -

we working on big symfony2 project should portable , configurable possible. security super important in our project use many validation , on. example use assert in entity , check requirements in routing. example in entity: @assert\range( min = 1, max = 3, minmessage = "common.moderation.status.range_min", maxmessage = "common.moderation.status.range_max" ) and in routing: requirements: status: "[1-3]" we find way store these range values separately , use them in entities , routes. @ moment these (and other consts) statuses stored in entity constants project grows need more , more constants , fields , routes validation these values cause many duplications this. if 1 of our customers want change range can cause headaches. possible not manually rewrite necessary asserts , route requirements external parameter? thx in advance. i think should create custom validation constraint .

How can I test Eddystone beacons using the Proximity Beacon API on Android or iOS and are there any dependencies? -

i saw announcement google made regarding eddystone , want start testing on smartphone devices. can please provide links can started , need download particular dependencies? help! here's tutorial wrote on how build basic eddystone-capable app: http://developer.radiusnetworks.com/2015/07/14/building-apps-with-eddystone.html this app run on android phone version 4.3+. dependency need free , open source android beacon library . library documentation includes lots of details on how use all of different eddystone frames , , how program detection of each one . a few other things might find useful: developer kits hardware eddystone beacons can purchased radius networks (my company) here . you can use free android locate app detect , decode of frames transmitted eddystone. you can use same locate app above act free eddystone transmitter

java - jdbc connection string with c3p0 -

i have jdbc configured c3p0. however, worried possible conflicts, since of parameters in jdbc string , c3p0 similar. here jdbc string: jdbc:mysql://1.1.1.1:3306/db?usessl=true&requiressl=true&connecttimeout=15000&sockettimeout=30000&autoreconnect=true we decided include connecttimeout, sockettimeout, autoreconnect because otherwise took long switch replica if master crashes. ( using mysql rds multi-az ). here c3p0 properties: <property name="acquireincrement" value="3"/> <property name="minpoolsize" value="5"/> <property name="maxpoolsize" value="10"/> <property name="maxidletime" value="3600"/> <!-- 1 hour --> <property name="maxconnectionage" value="7200"/> <property name="maxidletimeexcessconnections" value="600"/> <property name="idleconnectiontestperiod" value="180"/...

javascript - Starting Out In LiveWeave -

i have been trying make cute little games in javascript, using liveweave html/css/javascript playground. however, can't seem figure out how insert javascript. blocks use? put script in html? reason i'm asking tested out making few rects around screen, yet none showed up. help, please go http://liveweave.com . best regards, dominic

performance - Java: Find similar strings -

i have java list (it map if necessary) lot of strings. list(hello,hell,car,cartoon,...) i want find similar strings given string in efficient way. i think should use levenshtein distance, don't want iterate through list. do think idea divide main list in pieces common prefix? then have map prefixes key , list value: hel -> list(hello,hell,...) car -> list(car,cartoon,...) in way search strings same prefix searched one. apply levenshtein distance strings , not main-list. is idea? thanks you once calculate soundex code of every entry, , map soundex list of original word. soundex reducing code 1 single key similar sounding words. map<string, set<string>> soundextowords = ... (string word : words) { string sdex = soundex(word); set<string> similarwords = soundextowords.get(sdex)); if (similarwords == null) { similarwords = new hashset<>(); soundextowords.put(sdex, similarwords); } sim...

css - change image existing color from one to another one -

Image
i have calendar image want change color. dont have photoshop edit color. possible change color css? i want apply color color: #26416c; if it's image, you're limited editing image editor, or using experimental css technology using filter property : img { -webkit-filter: hue-rotate(90deg); filter: hue-rotate(90deg); } <img src="http://i.stack.imgur.com/v96i5.png" />

rotation - Rotate individual shape -

i'm working on replicating piece of art in processing. i'm having issue rotate functionality. so image can found here . below can see code processing. can see differing part rotating of ellipses. i've tried changing origin e.g: translate(midpoint - (position*tenth + layer*tenth/2.0), i*tenth + layer*tenth/2.0,) then rotating , creating shape @ (0,0), doesn't i'd to! any ideas appreciated this changes origin x, y position want ellipse drawn at. void setup(){ size(550,550); background(187,182,179); midpoint = height/2.0; tenth = height/10.0; circle_radius = 20.0; } float circle_radius = 15.0; float midpoint; float tenth; float base_colour = 0; float getcolour(float x_value){ float colour_val = ((x_value - 50.0)*255.0)/(450.0-50.0); if(floor(colour_val/255.0)%2 == 0){ return colour_val%255.0; } return 225.0 - (colour_val%255.0); } void draw(){ nostroke(); background(187,182,179); base_colour += 5.0; for(int layer = ...