Friday, 15 March 2013

develop custom extension in magento, which processes image of product and tags with prominent color codes -



develop custom extension in magento, which processes image of product and tags with prominent color codes -

i have been struggling in figuring out how can tag product color , when user selects color color picker, user should products tagged particular color or near hex codes.

a simple solution create 2 product attribute main_color , related_colors, main_color should single selection input type , should searchable while related_color should multi-selectbut not searchable. can assign 1 main color product , multiple related color shades. on frontend have custom code, related_color attribute value,extract related color codes , fetch products having main_color value.

hope makes sense.

magento

html - Mystery spacing on svg web graphic -



html - Mystery spacing on svg web graphic -

this code: http://jsfiddle.net/c8d34/17/

this code svg:

<svg viewbox="0 0 100 100"> /* here */ <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /> </svg>

i've tried few different things, seems although in theory circle should nail top , bottom of bluish box, instead leaves space. i've tried this:

* { padding:0px; margin:0px; }

all no avail. can please tell me why circle doesn't fill area completely.

basic geometry.

your numbers must such (r * 2) + strokewidth = height

in case, if want maintain stroke-width="4", want r = (height - strokewidth) / 2 = 96 / 2 = 48

so:

<circle cx="50" cy="50" r="48" stroke="green" stroke-width="4" fill="yellow" />

html css svg

tfs - Visual Studio restoring solution to previous point -



tfs - Visual Studio restoring solution to previous point -

i have vs2012 solution have been developing quite time now. regularly (at to the lowest degree 1 time week) check-in of changes tfs. solution made of 6 or 7 projects.

right having bit of problem. need entire solution as-it-was in previous point in time. know changeset need get, don't know how accomplish that. tried doing rollback had heart attack because lost several projects. seems doing gets files commited on changeset.

i tried going through browser , download project on changeset want when opened solution projects missing it's same doing rollback. sure not how solution when did check-in.

i must doing wrong.

i'm sorry if i'm not clear enough, i'll glad provide more info if necessary.

thanks in advance.

first, check-ins much more 1 time week. little commits encompass single new feature or change. it's practice commit several times day.

that said, feature you're looking "get specific version". can right-click on folder, mouse on "advanced", , it's right there.

you can specify changeset, , it'll pull downwards version of source code point in time.

if have work in progress, you'll want create shelveset containing work in progress prior getting specific version -- overwrite haven't checked in yet.

visual-studio-2012 tfs

ruby - PG Error could not connect to server: Connection refused Is the server running on port 5432? -



ruby - PG Error could not connect to server: Connection refused Is the server running on port 5432? -

i updated machine (macbook pro running mount lion) , ever since then, whenever set rails project, machine craps out , cannot connect pg. currently, error getting when seek go localhost;

pg::error not connect server: connection refused server running on host "localhost" (::1) , accepting tcp/ip connections on port 5432? not connect server: connection refused server running on host "localhost" (127.0.0.1) , accepting tcp/ip connections on port 5432? not connect server: connection refused server running on host "localhost" (fe80::1) , accepting tcp/ip connections on port 5432?

here checklist, , list of things have tried;

postgresql version 9.3.4 i have installed through homebrew i have host: localhost in database.yml file rails version 4.1.1, ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.5.0] ran brew uninstall postgresql brew install postgresql tried access postgres.conf file wasn't allowed through pgadmin , command line

ran locate pg_hba.conf , terminal shot out;

warning: locate database (/var/db/locate.database) not exist.

i have tried using rails 4.0 still problem

i can still work on other projects on machine started/finished before updated computer.

when run psql terminal psql: not connect server: no such file or directory server running locally , accepting connections on unix domain socket "/tmp/.s.pgsql.5432"?

i lost here, , not sure else do. help much appreciated.

update:

thanks this question, resolved downloading postgres.app mac. works great now.

this quite easy think because if update mac process running postmaster.pid file missing /usr/local/var/postgres/ here. need start process postgres create postmaster.pid.

if progress running -

stop manually:

pg_ctl -d /usr/local/var/postgres stop -s -m fast

start manually:

pg_ctl -d /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

now working...

ruby osx postgresql ruby-on-rails-4

android - update a fragment on ViewPager based on the fragment before -



android - update a fragment on ViewPager based on the fragment before -

i using viewpager fragments , fragmentstatepageradapter, need update sec fragment based on user checked in first one, happens both fragments loaded when fragment activity started, doesn't matter user checks on first fragment, sec not updated. i've tried override de getitemposition notifydatasetchanged phone call method update fragment, appears called when it's created, need update sec fragment when user check options want in first fragment. thanks

public class screenslidepageradapter extends fragmentstatepageradapter { public screenslidepageradapter(fragmentmanager fm, list<fragment> fragments) { super(fm); } @override public fragment getitem(int position) { if(mfragments.get(position) instanceof updateablefragment){ notifydatasetchanged(); } homecoming mfragments.get(position); } @override public int getcount() { homecoming mfragments.size(); } @override public int getitemposition(object object) { if (object instanceof updateablefragment) { ((updateablefragment) object).customize(); } homecoming super.getitemposition(object); } }

android android-fragments android-viewpager

Basic Ruby - Need simple explanation of what an if/else statement is doing -



Basic Ruby - Need simple explanation of what an if/else statement is doing -

for basic auto class exercise, asked create drive method should take input number of miles driven, alter position accordingly , cut down fuel @ rate of 20 miles per gallon.

i understand basic concept of need , how if/else statement works, need help breaking downwards if/else statement more 'layman terms' happening content.

def initialize @fuel = 10 @distance = 0 end def drive(miles) if (@fuel - miles/20.0) >= 0 @distance += miles @fuel -= miles/20.0 else @distance += @fuel * 20.0 @fuel = 0 puts "you're out of gas!" end

you set fuel value of 10 , distance 0.

when drive x amount of miles (hence why miles input), have see if you're out of gas.

if amount of fuel minus number of miles traveled, divided 20, greater or equal 0, set distance traveled distance + amount of miles traveled (+= shorthand @distance = @distance + miles). think if may need clarification though: "fuel - miles, divided twenty"? or "fuel - miles/20", order of operations comes play?

anywho, shorthand +=:

@distance = @distance + miles

then set fuel amount of fuel minus amount of miles traveled, divided 20 (-= shorthand, similar before.)

@fuel = @fuel - miles/20.0

however, otherwise (the else), set distance

@distance = @distance + fuel *20

then set fuel 0, , print out string "you're out of gas!".

ruby

Supported (and recommended) scaling methods with Azure SQL Database "Premium" (replacement for web & business) -



Supported (and recommended) scaling methods with Azure SQL Database "Premium" (replacement for web & business) -

microsoft azure provides auto-scale feature of services, including web sites. feature enables set target cpu value, , azure automatically spin or downwards additional "instances" of web site in effort meet target cpu utilization. allows meet demand spikes.

most websites backed datastore of kind, whether it's mongodb, oracle database, oracle mysql, or azure's sql database. thus, went @ scaling features of azure sql database. best can tell, there no "auto-scale" feature. instead, take tier , that's you're going get.

i've done bit of searching , while i've found recommendations one1, , talk sharding , partitioning, nil i'm finding discusses way "auto-scale" azure sql database in response load. manual scaling method supported?

azure sql-azure