Posts

Showing posts from February, 2015

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

oracle - Can I execute a procedure with default null parameters? -

i created procedure defined this: create or replace package pkg_dml_legal_transactions procedure spm_update_court_cost( p_court_state in legal_court_cost.state%type, p_tran_code in legal_court_cost.transaction_code%type, p_legal_court in legal_court_cost.court%type default null, p_end_date in legal_court_cost.end_date%type, p_cost_min in legal_court_cost.cost_range_min%type, p_cost_max in legal_court_cost.cost_range_max%type, p_bal_min in legal_court_cost.bal_range_min%type default null, p_bal_max in legal_court_cost.bal_range_max%type default null); end pkg_dml_legal_transactions; when attempt execute procedure, error stating that: pls-00306: wrong number or types of arguments in call 'spm_update_court_cost' here execute statement looks like: execute pkg_dml_legal_transactions.spm_update_court_cost('nj',1,sysdate,1000,40000); now understand error means, figured if par

javascript - Django select foreign key with bootstrap modal -

i'm having problem this: want create modal pick related object foreign key. modal shows up, render form , list results. search button close modal , don't know how pick object radiobox. code below: pay_form.html <div class="form-inline"> <label for="idticket" style="margin-right: 5px">ticket:</label> {{ payform.idticket }} <a data-toggle="modal" href="searchticket" type="button" class="btn btn-default btn-xs"> <i class="icon-search"></i> </a> </div> <a href="/payments/cash" class="btn btn-default">cancel</a><input type="submit" class="btn btn-primary" value="save"/> </form> <div id="searchticket" class="modal fade" style="display: none"> {% include "payments/ticket_search.html" %} </div><!

r - Load image from website -

Image
i trying add chemical structure images plots have created. using actor database access chemical structures. example: ( http://actor.epa.gov/actor/image?format=png%3aw250%2ch250&casrn=80-05-7 ) the nice thing site can change size , chemical within url, can automate grabbing images. hope store object containing cas numbers, iterate through cas numbers make plots. for example: library(png) casnums <- ("80-05-7","77-40-7","1478-61-1") image.list <- list() for(cas in casnums){ image.list[[cas]] <- readpng(paste0("http://actor.epa.gov/actor/image?format=png%3aw1000%2ch1000&casrn=",cas)) } i have tried using readpng png package, , tried use rgdal package well. unfortunately, far can tell, actor generate images in png or jpeg format - cannot use grimport package reading vector images. i hoping find solution not have manually download each image - there lot of them. open solution r goes , dowloads images folder, use

c# - Handle application error problems -

i using mvc project , hase been logging application errors in global.ascx . this code protected void application_error(object sender, system.eventargs e) { system.web.httpcontext context = httpcontext.current; system.exception exception = context.server.getlasterror(); var stacktraceexcep = new stacktrace(exception, true); // create stack trace var stacktrace = stacktraceexcep.getframes() // frames .select(frame => new { // info filename = frame.getfilename(), linenumber = frame.getfilelinenumber(), columnnumber = frame.getfilecolumnnumber(), method = frame.getmethod(), class = frame.getmethod().declaringtype, }).firstordefault(); string filename = stacktra

android - Set Date Format Of TextClock In A Widget Programatically -

i have set textclock show time date in textclock . want able enable user change format of date. eg. instead of dd mmmm yyyy want: mmmm dd yyyy show january 01 2013. i have set spinner , array choose in config activity want know how change textclock format i've mentioned. have tried views.set. ... have found nothing. surely there must way change format have in xml file android:format12hour="dd mmmm yyyy" android:format24hour="dd mmmm yyyy" in java file.. yes there setformat12hour(charsequence) method , 24hour textclock instance. char sequence 1 mention.

Retrieving list of video information for an auto-generated YouTube playlist using v3 API -

// first attempt @ using youtube's v3 api. doesn't require authentication. getautogeneratedplaylistdata: function() { gapi.client.setapikey('{api_key}'); gapi.client.load('youtube', 'v3', function () { var request = gapi.client.youtube.playlistitems.list({ part: 'contentdetails', maxresults: 50, playlistid: 'alyl4ky05133rtmhtulsaxkj_y6el9q0jh', fields: 'items/contentdetails' }); request.execute(function (response) { console.log("response:", response); }); }); } this code takes playlistid of auto-generated youtube playlist , retrieves first 50 items it. the provided response's contentdetails contains each video's id. it seems if want retrieve of video information auto-generated playlist need issue 2n requests youtube? n requests retrieve of video ids playlist in sets of no more 50. once have of v

is java hashcode and equals example of strategy pattern -

if hashmap point of view variable step calculation of hashcode , equals. using hashcode , equals methods hashmap can vary algorithm implement hashing. can't vary strategy calculate hashcode , euals objects of given type t. based on above argument think doesn't fit definition of strategy pattern. am correct? the way it's implemented not strategy pattern. if looked more like: class hashmap { private final hashingstrategy strategy; private int computehash(object) { return strategy.hash(object); } } then strategy pattern. instead, it's more like: class hashmap { private int computehash(object) { return object.hashcode(); } } to hashcode of object, hashmap asks object hashcode, doesn't decide how compute it. strategy pattern when can plug in various algorithms particular step, more delegating responsibility object.

c++ - Passing a template to deque -

i'm trying write container class deque make circular buffer (using deque important here since class replacing vector , need used 1 here). don't want have make container class specific specific deque; is, want class template class , deque templated type. however, code gives me use of undefined type errors when compiles (c:\program files (x86)\microsoft visual studio 10.0\vc\include\deque(795): error c2027: use of undefined type 'dequeclass'). the code: #pragma once #include <deque> template<typename dequeclass> class circulardeque { public: circulardeque(int newmax); ~circulardeque(); void push_front(dequeclass&& val); void push_front(const dequeclass& val); void push_back(dequeclass&& val); void push_back(const dequeclass& val); std::deque<dequeclass> que; int getmax(); void setmax(int newmax); private: unsigned int max; }; circulardeque<class dequeclass>::circulardeque(in

Java Swing/AWT GUI Locations Wrong -

Image
so have application developed in c# creates bunch of controls on command button click. lot of control creation i've scaled down first 2 of set creates, simplicity. in picture below you'll see have pressed create button (which goes invisible upon clicking) , made 16 (ability scroll see more) text boxes , combo boxes each respectively aligned each other. now, know should have thought of developing in cross platform environment before production, disregarding that, main problem emulating application in java using swing , awt gui objects. i have ability create text boxes in line shown. in addition have ability create combo boxes i'd want them be, in line shown. however, once try dynamic create both, location/positioning gets messed up. is there attribute or property i'm missing? code location positioning below... don't have other attributes turned on or off different defaults. panelcontainer.add(newcombobox); newcombobox.setsize(95, 20)

google apps script - POST command to WebCeo API -

trying connect webceo api . function getprojects() { var payload = { "key": "customer_key", "method": "get_projects" }; payload = json.stringify(payload); var url = "https://online.webceo.com/api/"; var options = { "method": 'post', "contenttype" : "application/json", "payload": payload }; var response = urlfetchapp.fetch(url, options); } receiving "request failed https://online.webceo.com/api/ returned code 404". any hint on else need include / change? body must contain following: json={"key": "your_api_key", "method": "get_projects"}

php - Is there a way to automate authentication on Google Drive? -

i wrote php application upload text file, encrypts file , stores on our server. need use google drive api upload these encrypted files pressing 1 button, upload button in application without user going thru authentication process. possible automate authentication process in backend php in application? if how do this? there no way leave out auth. may prefer use save drive button, handles auth itself: https://developers.google.com/drive/savetodrive

jquery - Bootstrap button disabled by default, how can I enable it? -

i adding content bootstrap page using $.get() url , working except close button displays if disabled. i've tried btn-primary , btn-info same result. bootstrap offers disabled keyword not enabled one. here html button: <a class="btn btn-small close"><i class="icon-remove"></i> close</a> my 2 questions -- why default being disabled , suggestions how make normal button? thanks! you remove property: $('#whatever').removeattr('disabled'); and disabled property comes html.

hadoop - Pig Multi-Query Optimization issue -

we running issues on pig's multiquery optimizer not work expected. as understood, below script should run 1 mr job, runs 2 jobs on our cluster. think multiquery optimization should on default, missing here? if replace group by "filter" statement works 1 single mr job. data = load 'input' (a:chararray, b:int, c:int); = group data b; b = group data c; store 'output1'; store b 'output2'; i'm using cdh packed pig 0.1.0 , hadoop 2.0.0. if 0.1.0 real version of pig installation - it's old. latest version 0.11.1. page performance 0.11.1 docs: http://pig.apache.org/docs/r0.11.1/perf.html

php - Using count(*) vs num_rows -

to number of rows in result set there 2 ways: is use query count $query="select count(*) count some_table type='t1'"; and retrieving value of count. is getting count via num_rows(), in php. so 1 better performance wise? if goal count rows, use count(*) . num_rows ordinarily (in experience) used confirm more 0 rows returned , continue on in case. take mysql longer read out many selected rows compared aggregation on count if query takes same amount of time.

sql - Getting parameters and their values of a stored procedure via DMVs -

i have stored procedure using dmvs returns performance statistics on stored procedures. in using tool @ sp performance, found of complex stored procedures have multiple cached plans. stored procedures in question have lot of parameters , performance varies dramatically across cached plans, therefore, want examine how these stored procedures being called. parameters have values (other default). is there way stored procedure command being called in result set via dmv? for example, hope able see like: "exec myprocname @param1=value1, @param2=value2, @paramn=valuen" the second question have on subject multiple instances of cached plans per stored procedure. thought there multiple plans if procedure called varying parameter values (enough variation change or generate new plan). on track here or way off base? here definition of current stored proc uses sys.dm_exec_procedure_stats dmv: alter procedure [dbo].[bss_stored_procedure_performance] @dt_start datetime = nu

multithreading - How to reset a textbox in WPF in a button handler before doing something else? -

i have simple wpf button , textbox in wpf application(not using mvc or binding @ all). able following upon clicking button: 1) clear textbox 2) create result 3) assign result textbox i used textbox.clear, textbox.text= string.empty, delegates , dispatcher approach like private void button_click(object sender, routedeventargs e) { application.current.dispatcher.begininvoke(new action (clearreporttxtbox), dispatcherpriority.send); system.threading.thread.sleep(5000); runtest(); } private void clearreporttxtbox() { report_textbox.text = string.empty; } none of them working correctly me. dispatcher method somehow working not wish. seems clear task queued , when actions in button click handler finished, come play , delete textbox, causes generated report , assigned textbox (created runtest in code above) deleted well. hence late delete action , eliminate whole result. currently seems me clicking on button uithread blocks ,

Setting up artifactory on Ubuntu: ERROR: cannot find a JRE or JDK -

when attempting install artifactory, run following command: sudo service artifactory check i following output: created output file /root/artifactory-2.3.2/logs/consoleout.log cannot find jre or jdk. please set java_home >=1.5 jre i used following java home: # java /usr/bin/java i have added java home etc/artifactory/default follows: export java_home=/usr/bin/java my /etc/environment looks like: java_home="/usr/bin/java" what doing wrong? java_home should set directory 1 level above "bin" subdirectory containing java executable file, not file itself. /usr/bin/java on ubuntu symlink actual java installation. find actual directory (i pasted commands system): $ ls -l /usr/bin/java lrwxrwxrwx 1 root root 22 2012-06-14 17:33 /usr/bin/java -> /etc/alternatives/java* $ ls -l /etc/alternative/java lrwxrwxrwx 1 root root 35 2012-06-14 17:33 /etc/alternatives/java -> /usr/lib/jvm/java-7-oracle/bin/java* so in case java_home shou

mercury-rails no editable area js error 'Uncaught TypeError: Cannot read property 'konqueror' of undefined ' -

i cannot life of me figure out why isn't working! i'm working through railscast mercury , can't editable area show up. gemfile source 'https://rubygems.org' gem 'rails', '3.2.13' gem 'mercury-rails', git: 'https://github.com/jejacks0n/mercury.git' gem 'sqlite3' group :assets gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem 'uglifier', '>= 1.0.3' end gem 'jquery-rails' routes mercuryrelational::application.routes.draw mount mercury::engine => '/' root to: "pages#show" show page <h1>show page</h1> <div id="page_content" class="mercury-region" data-type="editable"><%= raw(@page.content) %></div> url show page http://localhost:4002/editor still there no editable blue box around text. however! error in javascript terminal though &

javascript - URL tag for angular -

coming django world, i'm in love it's cool feature url prevent hardcode urls in templates & views: in urls.py: url(r'/url/param1/param2/$', 'view_name', name="url_name"), in template: <a href="{% url "url_name" @param1 &param2 ... %}">my link</a> this way, if want change url don't have change in multiple files. i'm wondering if angular allow this. have write things that: in app: when('/home', { templateurl: 'app/home/home.tpl.html' }). in view: <a href='#/home'>my link</a> thanks help. here simple solution. first, added name of view in $routeprovider configuration. example defined name of route '/login/:arg1/with/:arg2' 'view_name': myapp.config(['$routeprovider', function($routeprovider) { $routeprovider.when('/login/:arg1/with/:arg2', { templateurl: 'app/common/login/login.tpl.

c# - Why NServiceBus OutgoingHeaders is static and not ThreadStatic? -

how nservicebus maintaining consistency when outgoing headers static? does mean if set outgoing headers particular message, affect other outgoing messages since it's singleton? namespace nservicebus.messageheaders { [comvisible(false)] public class messageheadermanager : imutateoutgoingtransportmessages { private static idictionary<string, string> staticoutgoingheaders = (idictionary<string, string>) new dictionary<string, string>(); private iunicastbus bus; [threadstatic] private static idictionary<object, idictionary<string, string>> messageheaders; . . . } the incoming header seems correctly marked [threadstatic] however. explain. ========================edit============================== i guess i'm trying understand because many examples show code below: bus.outgoingheaders["test"] = g.tostring("n"); which's traced to: idictionary<string, string> ibus.outgoing

javascript - How organize and ensure that all script and css are loaded without putting them on each page -

i new web development , building c# web mvc application in visual studios. using jquery,angularjs,twitter bootsrap css , bunch of other 3rd party javascripts. have included reference these files on every page looks nasty. using master layout page other pages thought referencing required resolve problem didnt work out. how can store required scripts , css in 1 place , have web pages there? make sure have layout used every page, , make sure layout calling header. throw script files in there. although suggest against loading javascript files of pages, might take performance hit once scale upward. can put checks in header filter ones need.

In Chef how do I detect if chef is running on a Mac? -

in cookbooks, how should check if chef recipe being provisioned onto macintosh machine? a better solution use platform_family check. work both os x , os x server (source ohai-345 ). cookbook_file "/etc/nginx/nginx.conf" source "nginx.conf" not_if platform_family?("mac_os_x") end an better solution let chef work. use single cookbook_file declaration: cookbook_file "/etc/nginx/nginx.conf" source "nginx.conf" end and ship platform specific files cookbook: mycookbook/files/default/nginx.conf mycookbook/files/mac_os_x/nginx.conf mycookbook/files/ubuntu/nginx.conf ..

class - Java, differing object fields in child classes and how to work with them in the least painful way -

(edited down big wall o' text better sum up) problem thus: i have collection of abstractmyclass. there number of concrete child classes in collection. each child class contain field particular type of object. there dozen different children of abstractmyclass, each own object field. each of these objects has no shared parent class outside of object. for example, myclassa may have string, myclassb may have integer, myclassc may have mycustomclass, etc. different objects unfortunate necessity in way done. the thing is, collection needs evaluated and, given right set of conditions, object(s) within abstractmyclass must extracted, examined, manipulated, stored, set aside, etc later operations. there variety of potential operations based on conditions myclass/object type within, operations such handling data within myclass may not viable other, more centralized classes (ie, class managing thread pool) may need deal them. leaves me need handle disparate object types. can done, c

asp.net - IIS not returning HTTP/304 on conditional request made with If-None-Match -

i have made request video returns video etag. when make request same video again, can see if-non-match header passed browser etag instead of 304 returned, video downloaded again 200 ok response. in fiddler first request video, response is: http/1.1 200 ok cache-control: max-age=10 content-length: 76278442 content-type: video/mp4 last-modified: wed, 21 aug 2013 08:47:29 gmt etag: "2117329216" server: microsoft-iis/7.5 x-mod-h264-streaming: version=2.2.7 x-powered-by: asp.net date: fri, 23 aug 2013 21:20:34 gmt on second request, headers are: get http://test/video.mp4 http/1.1 accept: */* accept-language: en-gb x-flash-version: 11,8,800,94 accept-encoding: gzip, deflate if-modified-since: wed, 21 aug 2013 08:47:29 gmt if-none-match: "2117329216" connection: keep-alive but in case, whole video downloaded rather 304 non modified response. i noticed x-mod-h264-streaming used, not sure if may have it. edit i used url video in ie 10 directly (not usin

java - By analyzing the bytecode, how can I detect explicit throw statement invocations from within a catch block? -

i want detect throw statements occur within catch block. instance: try { def(); } catch (ioexception e) { throw e; } catch (exception e) { throw new runtimeexception(e); } first, using eclipse-jdt detect these cases , quite simple, since traverse abstract syntax tree. now have use framework (bat - bytecode analysis toolkit) deals directly bytecode. first of all, how catch block represented in bytecode? , how can detect throw statement within it? each method has exception table maps range of instructions plus , exception type exception handler (it's entry point). not easy translate java code. in general, need examine table , analyse reachable code entry points. of code belongs catch clause. it's matter of identifying athrow instructions. use javap or other bytecode visualizer play around , understand better. completing code, compiling it, , subjecting javap produces: public class test extends java.lang.object{ public test(); code:

amazon web services - Ruby AWS SDK breaks when caching classes -

i'm having headache trying figure out. everytime try deploy app productio error: /users/rafael/.rvm/gems/ruby-1.9.3-p429/gems/aws-sdk-1.3.9/lib/aws/core/service_interface.rb:24:in `module_eval': undefined method `each' nil:nilclass (nomethoderror) /users/rafael/.rvm/gems/ruby-1.9.3-p429/gems/aws-sdk-1.3.9/lib/aws/simple_email_service/client/xml.rb:29:in `<module:xml>' /users/rafael/.rvm/gems/ruby-1.9.3-p429/gems/aws-sdk-1.3.9/lib/aws/simple_email_service/client/xml.rb:19:in `<class:client>' /users/rafael/.rvm/gems/ruby-1.9.3-p429/gems/aws-sdk-1.3.9/lib/aws/simple_email_service/client/xml.rb:16:in `<class:simpleemailservice>' /users/rafael/.rvm/gems/ruby-1.9.3-p429/gems/aws-sdk-1.3.9/lib/aws/simple_email_service/client/xml.rb:15:in `<module:aws>' /users/rafael/.rvm/gems/ruby-1.9.3-p429/gems/aws-sdk-1.3.9/lib/aws/simple_email_service/client/xml.rb:14:in `<top (required)>' (eval):1:in `configure_client' /users/rafael/

php - Append data to GET parameter -

i need send data parameter on different host fail find suitable function within php occasion. that's question. for example send value information parameter: http://example.com/obtainer.php?information= thanks :) query strings (_get) parameter constructed like; www.example.com/index.php?param1=value&param2=value if you're sending value information parameter via form, following; <form action="" method="get"> <input type="text" name="information" value="" /> <input type="submit" value="send" /> </form> however, if you're sending data via link, write manually, so; <a href="index.php?information=hello">link</a> remember, when putting string query string, ensure use urlencode

windows - How to include MFC and Visual Studio CRT libraries into MSI installer? -

i'm trying learn how write msi installer. i'm using wix, , i'm curious. application comes dependencies followign mfc , crt libraries: mfc90u.dll msvcr90.dll how install those? there choices listed here . recommend using appropriate redistributables instead of installing individual dlls. with wix 3.6 , later, can create chainer runs multiple installers. can create vs project wix bootstrapper template.

html - background pattern image on videos having issues while scrolling -

my code <div id="homepage"></div> #homepage { background:url('../../images/pattern.png'); position: fixed; width: 100%; min-height: 100%; } i used video background , while scrolling, creates unwanted horizontal lines across screen shown in screens: here's video link. scroll , down see pattern isn't uniform: http://testingprth.hostingsiteforfree.com/demo/ thanks can provide jsfiddle please? ^ dont have 50 rep have post in answer section ill update after take

c# - Write text on an image -

i developing image editor in have implemented rectangle, lines , ellipse drawing functionality using mouse event , using graphics.drawline() , graphics.drawrectangle() , graphics.drawellipse() . i searching writing text on image not find solution, mean whenever click on image @ location cursor change (like writing text in textbox) , can start typing on location. the graphics.drawstring method similar looking not support dynamic typing alex fr provided excellent set of drawing tools in drawtools article , these tools serve basis draw tool redux . i use transparent textbox from: http://www.codeproject.com/articles/4390/alphablendtextbox-a-transparent-translucent-textbo to add textbox control drawing tools need make class tooltext , drawtext. in tooltext class, show form "textdialog" without border has textbox: internal class tooltext : toolobject { public tooltext() { cursor = new cursor(gettype(), "rectangle.cur"); } public override vo

How to use a for loop to loop through all the numbers between two integers in java -

so stumped on how this, appreciated, want numbers between 2 integers. so had numbers: 254 , 259 want output following numbers: 255, 256, 257, 258 also want add these numbers list , able output how many numbers in list, in case there 4 numbers in list. i using cycle through area of land. public static list<integer> getopenrange(int start, int end) { list<integer> result = new arraylist<>(); (int = start + 1; < end; ++i) result.add(i); return result; }

mysql - PHP and Ajax Uploading -

this script inserts data table, uploads image want url image upload inserted column image another problem i'm having when put upload portion of form inside other form, refreshes page , says file not selected anymore. ideally have 1 submit button, , load bar still work same way, giving dialog box saying file uploaded , after closing submit form database. index.php <?php session_start(); if(isset($_session['username'])) { mysql_connect ('localhost', 'root', '') ; mysql_select_db ('admin'); } else { header("location: index.php"); } if (isset($_post['submit'])) { $month = htmlspecialchars(strip_tags($_post['month'])); $date = htmlspecialchars(strip_tags($_post['date'])); $year = htmlspecialchars(strip_tags($_post['year'])); $time = htmlspecialchars(strip_tags($_post

mysql - right outer join calling null on left side (id) when the pair exists -

the following results in left hand (table l) "identifier" null if there pair (ex, there f.url = l.url , both not null) there. identifier should considered auto increment , "url"s unique is there obvious should doing not? select * `l` right join f on f.url = l.url , f.url <> '' , f.id = l.id , l.url null , l.id null this because have condition and l.id null . thus, rows have l.id = null . (or, in own words, "lefthand identifier null".)

c - OSX FSEventStreamEventFlags not working correctly -

i watching directory file system events. seems work fine 1 exception. when create file first time, spits out created. can remove , says removed. when go create same file again, both created , removed flag @ same time. misunderstanding how flags being set when callback being called. happening here? // // main.c // gofsevents // // created kyle cook on 8/22/13. // copyright (c) 2013 kyle cook. rights reserved. // #include <coreservices/coreservices.h> #include <stdio.h> #include <string.h> void eventcallback(fseventstreamref stream, void* callbackinfo, size_t numevents, void* paths, const fseventstreameventflags eventflags[], const fseventstreameventid eventids[]) { char **pathslist = paths; for(int = 0; i<numevents; i++) { uint32 flag = eventflags[i]; uint32 created = kfseventstreameventflagitemcreated; uint32 removed = kfseventstreameventflagitemremoved; if(flag & removed) { printf("item re

html - Tilt Shaped Bordered Div in css3 -

i trying design bordered shape div css3 bordered square tilted right hand side extend... here's trying design:- http://i.imgur.com/6gvzltp.png i tried skew div css3 transformation skews map , content inside div , skews both side of div my demo:- http://jsfiddle.net/znsmg/ html code:- <div class="map_canvas"> <div class="map_area" data-showcontrols="true" data-lat="-34.397" data-lng="150.644" data-zoom="7"></div> </div> css:- .map_canvas { border: 10px solid #d2d828; position:relative; } .map_area { height: 400px; width:100%; } any method or achieve this? just created beauty css3 transformation ... the trick, implemented skew root container 10deg , parent container -10deg , , overflow hidden outer container , vice versa... working demo :- http://jsfiddle.net/znsmg/3/ css:- .map_contain { border-left: 10px solid #d2d828; overflow: hidd

angularjs - Configure Restangular.baseUrl using Gruntjs -

i'm using restangular in project built using gruntjs. here snippet: // scripts/app.js angular.module('myapp', ['restangular'])]) .config(['restangularprovider', function(restangularprovider) { /* different on dev, test, prod environments */ var baseurl = 'http://localhost:8080/sms-api/rest/management/'; restangularprovider.setbaseurl(baseurl); }]) i have different value baseurl if specified @ cli or default if not specified: $ grunt server using default value 'baseurl' $ grunt build --rest.baseurl='http://my.domain.com/rest/management/' using 'http://my.domain.com/rest/management/' 'baseurl' how can that? it's possible aid of grunt preprocess useful replacing (and other things) templates inside files. first add .js code: /* begin insertion of baseurl gruntjs */ /* @ifdef baseurl var baseurl = /* @echo baseurl */ // @echo ";" // @endif */ /* @ifndef baseurl

sql - How to select rows after last 10 records in php mysql? -

i want know how call after 10 rows in flash column. want call category = today . possible? for example select * news category='today' , flash='true' limit 60 is you're looking (it's official solution shown in mysql select syntax )? select * news flash='true' limit 10, 18446744073709551615; update: after reading comments, maybe you're looking for: select * (select * `news` (`flash` = 'true') limit 10, 18446744073709551615) `after_flash` `after_flash`.`category` = 'today';

Unit testing a PHP Framework -

i have custom lightweight php framework our company uses. start, don't want suggestion use third-party framework. trying write unit tests have stumbled upon problem. relatively new unit testing, of code covered. i have loader class require files can't loaded class auto loader (e.g. configuration files). has kind of fallback system if don't specify module load particular resource from, try guess based on current module, default module. has required me (so far can see) check existence of particular file before falling default. the problem i'm running writing test class doesn't depend on files existing (which desirable). i've read virtual file systems , testing, i'm having trouble seeing how can utilize solve problem. i can write abstraction of filesystem inject class, class have similar problem. in pseudo code: if file exists in module, load it; if not, load default. any suggestions appreciated. edit: here's excerpt of code: class base