Posts

security - SVG source code via PHP form -

i use online photo editor on web store. user can edit photo using svg-edit , save changes. user results stored svg source code (...). have send svg source code through php form, save in database , show in administration panel. i'm afraid of injections or attacks on web store. there possibility make secure? i can't generate private hash svg source code, because it's client side , request can make via ajax. @edit example: user saves ... code , code being sent through post. in php script can access $svg = $_post['svg_source']; worring injection in post value. attacker may inject html, js, other, source code. @edit: and in db can store $_post value ... , view in pa. attacker can write ... code , executed in pa view svg image (based on svg code) @edit: i need solution check svg code valid , don't contain js, html code. or - need solution secure viewing svg code on website. consider wrapping user input mysql_escape_string() before storing...

mysql - Will rewriting the Joomla system files, remove my articles and data? -

as cannot access admin area, told joomla system files might have problems , best download latest version , rewrite on host. website running , up. if replace joomla package on host, remove or change on website? have on website, such plugins, template, articles, music, mysql, , on. change? based on joomla 1.5. if yes, suggestion? it's not idea on live server because may broke site. instead of prepare local server , download site it. download dump of server database , restore locally. on local copy need change configuration.php file local database settings (username, password , database) , paths tmp , cache directories. when local site , running can try replace old files new ones, don't overwrite configuration.php file. before replacing files not bad idea keep copy of site files. way, don't try overwrite files higher versions 1.5 : won't work. last stable package (discontinued) 1.5 1.5.26, available through joomlacode : http://joomlacode.org/gf/project/...

ios - loop doesnt change label as i want it to in objective c -

this question has answer here: trouble setting label text in ios 4 answers i playing around objective c on xcode, may seem dumb question here block of code, works doesnt work how want to. int = 10; int x = 0; { printf("count is: %i\n", x); nsstring *result = [[nsstring alloc] initwithformat: @"%i", x]; counting.text = result; x++; usleep(1000000); } while (x < i); it changes label 9 @ end of loop, prints console fine, supposed count 0 9 , show on app. think need todo multi threading examples in java, cant apply them language as people mentioned in comments, problem because usleep(1000000) freezing main thread, responsible interations ui, including updating it. if change sleep line [[nsrunloop currentrunloop] rununtildate:[nsdate datewithtimeintervalsincenow:1]]; , code...

html - Programming Languages required to develop a website like Imgur? -

i'm new web development. far, have idea of html , css. 1) know programming languages required develop website imgur , what's role of each language used. 2) assuming user has uploaded image imgur, required steps generate unique hmtl file particular image. you need: html css a server-side framework (e.g., php, ruby on rails, etc.) most javascript (but might able without it) a database backend, such postgresql or mongodb you wouldn't need individual html sites. when goes http://www.yoursite.com/image/1 , backend (usually .htaccess in apache) process , turn /image.php?id=1, php (or framework) uses create image-specific html page. good luck! -totallyuneekname

excel - Get maximum value based on unique values -

Image
i have 2 columns in excel follows: col1 col2 1 10 1 22 1 11 1 23 1 14 2 16 2 12 2 10 2 9 how write command returns maximum value col2 corresponding each unique value in col1 ? so here need write command 23 , 16 . the data have shown here dummies; have 600 unique values in col1 in actual data set. pivot tables: single underutilized , powerful feature of excel. file menu: insert pivot table select range fill in indicated in image below step step: place cursor in cell right of data on sheet. select insert menu select pivot table icon select pivot table pop-up of icon use button select range of cells included (all 600+ rows in 2 columns) (or enter $a:$b) select ok a pivot table field list appears on right: drag , drop row 1 row labels. drag , drop row 2 values area. left click on "... of row 2" select value field settings select "max" instead of count or sum select ok , should have...

ruby - Combining polymorphic Mongoid model scopes in the base class? -

i have simple bit of polymorphism each subclass has dead scope, each implemented differently. able gather them dead class method base class: class animal include mongoid::document field :birthday, type: datetime def self.dead descendants.map(&:dead) end end class dog < animal scope :dead, ->{ where(birthday: { :$lt => time.now - 13.years }) } end class guineapig < animal scope :dead, ->{ where(birthday: { :$lt => time.now - 4.years }) } end class turtle < animal scope :dead, ->{ where(birthday: { :$lt => time.now - 50.years }) } end as defined, animal::dead method returns array each descendant model's scope criteria: >> animal.dead => [#<mongoid::criteria selector: {"birthday"=>{:$lt=>2000-08-23 14:39:24 utc}} options: {} class: dog embedded: false> , #<mongoid::criteria selector: {"birthday"=>{:$lt=>2009-08-23 14:39:24 utc}} options: {} class: ...

javascript - Flot Area Chart -

Image
is possible make area chart in flot? i've noticed there "stack" plugin. image below effect want create. there 1 problem, stack plugin automatically adds component data. don't want that. want fill in effect. i tried fill between property, makes annoying color blending (see below): in stack example, colors don't blend @ all. that's visual effect i'm going for. update code used make work was: var dataset = [ {id: "a", label: "demand (kw)", color: "#2980b9", data: d, lines: { show: true, linewidth: 1, fill: .5}}, {id: "b", label: "demand (kw)", color: "#d35400", data: d2, lines: { show: true, linewidth: 1, fill: .5 }, fillbetween: "a"}, {id: "c", label: "demand (kw)", color: "#c0392b", data: d3, lines: { show: true, linewidth: 1, fill: .5 }, fillbetween: "b"} ] yes, can set fill color line chart p...