Posts

css - how to place image tags in a select imput bar -

i have select box below works perfectly; want place little colour box in each of option groups. tried using span tag within not seem work. i don't want use anchor tags or images. prefer if possible have kind of container tag. i have enclosed code below. <select name="search-legend"> <option value=""></option> <option value="1"<?= $this->returnsearchvalue == "1" ? 'selected' : '' ?>> <span id="redbox"> </span> value1 </option> <option value="2"<?= $this->returnsearchvalue == "2" ? 'selected' : '' ?>> <span id="bluebox"></span> value2 </option> <option value="3"<?= $this->returnsearchvalue == "3" ? 'selected' : '' ?>> <span id="greenbox"></span> value3 </option> </se...

linux - Scrubbing files from the shell -

my shell skills bit rusty, trying take 2 files , 'scrub' 1 other based on matching field. that's important part rest of line can different, if key field matches removed. example files pipe delimited , second field key field. file 1 ------ acme|widg001|green|plant a|<timestamp> acme|widg102|blue|plant b|<timestamp> acme|widg002|yellow|plant a|<timestamp file 2 ------ acme|widg001|blue|plant a|<timestamp> acme|widg701|blue|plant a|<timestamp> when scrub file 2 file 1 want resulting file contain is new file ------ acme|widg102|blue|plant b|<timestamp> acme|widg002|yellow|plant a|<timestamp> ideally solution allow me specify more 2 files ie scrub files 2, 3 & 4 file 1. any assistance great! since asked bash decided give go using bash. no external programs @ all. ifs='|' declare -a scrub while read f1 f2 rest; scrub[$f2]=0 done < file2.txt while read f1 f2 rest; if [ ! ${scrub[$f2]} ]; ...

database - How to "explore" group of servers? -

i need check group of servers (unix, linux) know kind of services, software (also version) running there (check once while , store in database). idea have fresh info whole environment - changing. perhaps can suggest solution there? thinking using nagios or cacti + plugins not sure if solution optimal. nagios powerful monitoring solution (the best me) : open source, compatible both linux & windows, reporting & notifications via emails/sms, nice interface, many many plugins...etc i've worked & satisfied. check nico largo's forum install. if not familiar linux command search fan : automated nagios .iso nagios in. if have trouble during install or configuration post questions there : https://serverfault.com/

java - Eclipse plugin: Copy/Export dependencies -

i have plugin in need of .dll-files. debug eclipse-applicatoin , try load these .dll files receive filenotfoundexception since application not inside project folder in actual eclipse folder running in. so not c:\eclipseworkspace\myproject\fileineed.dll c:\eclipse\fileineed.dll instead. of cource copy .dll there , that's sure can tell eclipse export these files debugging eclipse. does know how? please read paragraph "native code , class loaders" @ http://www.eclipsezone.com/articles/eclipse-vms/ . tell important steps: put dll @ root of plugin project. include in build.properties. use either system.loadlibrary() or osgi headers dll loaded @ runtime.

Sample arbitrary amount of numbers from Haskell list -

i'm starting learn haskell ruby background. i'm looking able arbitrary number of items list: sample [1,2,3,4,5,6,7,8,9,10] => 7 sample 3 [1,2,3,4,5,6,7,8,9,10] => [4,2,9] this available in ruby , i'm hoping same functionality. haven't been able find after googling, figured ask here. available or function have implement myself? thanks! based on code @ http://ruby-doc.org/core-2.0/array.html sample, chooses n random indices array, came following: import system.random import data.list import control.applicative sample1 xs = let l = length xs - 1 idx <- randomrio (0, l) return $ xs !! idx sample 0 xs = return [] sample n xs = let l = min n (length xs) val <- sample1 xs (:) <$> (pure val) <*> (sample (l-1) (delete val xs)) alternatively, use control.monad instead of control.applicative , liftm2 (:) (return val) (sample (ct-1) (delete val xs)) using delete incur eq constraint on type of list elements, though, h...

haskell - C Header Files and ABI -

i'd know how c header files , abis relate. sizes of various types architecture , compiler-dependent. how can 1 reliably link c library? for more specific problem: when using haskell's ffi, 1 uses haskell types cdouble define (duplicate definition of) c library interface. don't know binary type size information coming from. trick making linking work? please see link https://code.google.com/p/tabi it may avoid difficulties possible abi differences between haskell , c.

ios - trouble with UIAppearance and UIButton subclassing -

i have custom button, standard uibutton, cagradientlayer added in. in custom button, have defined 2 properties: @property (nonatomic, strong) uicolor* topcolor ui_appearance_selector; @property (nonatomic, strong) uicolor* bottomcolor ui_appearance_selector; if 2 values set, button draws nice linear gradient. works great. i put interfacebuilder possible. so, on of these buttons, in ib's "identity inpsector" add in "user defined runtime attributes" these properties. again, works great. next, thought i'd try using uiappearance proxies. of custom gradient buttons have same colors. there few different. so, figured use appearance-proxy stuff set default colors class, , buttons different, set values in intefacebuilder. fails. apparently, what's happening it's reading runtime attributes storyboard file first, afterwards values overwritten appearance proxy. wouldn't expect work way, does. any tips on how accomplish this? or should give ...