Posts

Showing posts from April, 2010

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

html - jquery scrollTop offset issue -

i trying build anchor link allows panel 2 slide cover panel 1, leave black header visible: http://jsfiddle.net/xmpu4/19/ i'm setting offset with: 'scrolltop': $target.offset().top - 140 it milisecond , jump top of page. how can set stops in right place? it works have written: $('html, body').stop().animate({ 'scrolltop': $target.offset().top - 140 }, 600, 'swing', function () { window.location.hash = target; }); the first part animates scrolling, , when finished, tell window jump specific hash. notice happens when click function has this: window.location.hash = target; remove callback function , prevent page jumping hash. on unrelated note, suggest don't use hard-coded values in animation function. try instead: 'scrolltop': $target.offset().top - $("#a").offset().top;

c# - How to catch new processes starting and stopping? -

this question has answer here: how detect process start & end using c# in windows? 1 answer .net process monitor 2 answers i wanted know if knows of way catch new applications starting or stopping on computer. instance, user logs in , opens word, outlook, or ie. want catch instance opening. have been working process. i building service runs in background , writes event log. public string applicationid() { process p = new process(); string application = p.processname.tostring(); return application; } i know foreach process list. pointers or samples great. once have process object, can add handler "exited" event detect when stops. note "enableraisingevents" property must set "true" work, can s

iphone - Show UIAlertView during UIActivity:activityViewController -

i have set of uiactivities prepare data given format , attach email user can send. i'm using subclass of uiactivity , i'm doing work in -(void)activityviewcontroller : - (uiviewcontroller *)activityviewcontroller { [self.alert show]; nsstring *filename = [nsstring stringwithformat:@"%@.gpx", self.activity.title]; __block mfmailcomposeviewcontroller *mailcomposevc = [[mfmailcomposeviewcontroller alloc] init]; mailcomposevc.mailcomposedelegate = self; [mailcomposevc setsubject:[nsstring stringwithformat:@"gpx export %@ activity", self.activity.title]]; [mailcomposevc setmessagebody:@"generated slopes" ishtml:no]; dispatch_sync(dispatch_get_global_queue(dispatch_queue_priority_low, 0), ^{ cbcfileexporter *exporter = [[cbcfileexporter alloc] init]; nsdata *exportcontents = [exporter exportactivity:self.activity infileformat:cbcfileexporttypegpx error:nil]; [mailcomposevc addattachmentdata:expo

javascript : send file to php script for user to download -

in website i'm building, i'm trying provide users ability export , download data in kml format. i've built php script generate kml file string. works reasonably well, until requests long , 414 errors. the thing is, i'm pretty sure i'm going @ wrong way (i'm new php). rather sending data string, can multiple tens of thousands of characters long, should sending file generated javascript php script send user or this. possible? if not, other options have? here's php script : if($_server['request_method']=='post') { $text = $_post['text']; $text = str_replace('\r\n', php_eol, $text); $text = str_replace('\n', php_eol, $text); $text = str_replace('\t', "\t", $text); $text = str_replace('_hash_', "#", $text); $filename = $_post['filename']; $tmpname = tempnam(sys_get_temp_dir(), $filename); $file = fopen($tmpname, 'w'); fwrite($file, $text); fclose($file)

python - Trouble downloading most recent version of my package from pip -

i started out using pypi packaging of few tools useful in everyday life, i'm having trouble making sure can download recent version of package. the package in question pyfuzz , upgraded version 0.1.1 , reason when pip install it, --upgrade flag can pull down 0.1.0 . the file recognized on pypi site (see: https://pypi.python.org/pypi/pyfuzz/0.1.1 ) , if try upload again error saying i've uploaded 0.1.1. this setup file: try: setuptools import setup except importerror: distutils.core import setup setup( name="pyfuzz", version="0.1.1", author="slater victoroff", author_email="slater.r.victoroff@gmail.com", packages=["pyfuzz"], url="http://pypi.python.org/pypi/pyfuzz/", license="license.txt", description="simple fuzz testing unit tests, i18n, , security", long_description=open("readme.txt").read(), install_requires=[ "l

excel vba - VBA: Selecting array which depends on variables for use in lookup formula -

i trying write vba code writes formula cell. formula hlookup array being fixed, on worksheet, , size depending on variables defined. here relevant part of code (the variables have been defined , integers): range("c2").select activecell.formula = "=hlookup(a2,visits!range("c2",cells(" & rowsforlook & ", " & rowsforauto & " + 1))," & rowsforlook & " - 1)" i have checked there no problems variables. have realised haven't $fixed array because not sure how this. think page reference "visits!" not correct, code did not select array without this. array trying use selected region appear if typed range("c2",cells(" & rowsforlook & ", " & rowsforauto & " + 1)).select thanks. to fix range suggest - instead of using range() method - build range in string. imagine want produce result looking like: "=hlookup(a2,visits!c2:d10

haskell - What are Alternative's "some" and "many" useful for? -

alternative , extension of applicative , declares empty , <|> , these 2 functions: one or more: some :: f -> f [a] zero or more: many :: f -> f [a] if defined, some , many should least solutions of equations: some v = (:) <$> v <*> many v many v = v <|> pure [] i couldn't find instance some , many defined. what meaning , practical use? used @ all? i've been unable grasp purpose definition. update: i'm not asking alternative , some , many i tend see them in applicative parser combinator libraries. a :: parser [string] = (string "hello") and see many used purpose in default definitions of parsing in parsers . i think parsec being primary example of parser combinator library hides use of some / many since redefines things (<|>) .

Using an implemented ontology(Protege) in Netbeans through Java -

step 1 : have created ontology using protege. store rdf/xml file. step 2: have created user interface using netbeans & java. i want import ontology in netbeans project , interact it. how can that? suggested me should use jena. have installed latest jena version in netbeans project. im not sure if have done correctly. after adding jena libraries tried that: ont m = modelfactory.createontologymodel(ontmodelspec.owl_mem, null); and when try run program: log4j:warn no appenders found logger (com.hp.hpl.jena.util.filemanager). log4j:warn please initialize log4j system properly. log4j:warn see http://logging.apache.org/log4j/1.2/faq.html#noconfig more info. i have knowledge of java have im new ontologies , have never done before. please me understand im doing wrong or should make things right. thank you! that warning get, might missing log4j library in netbeans project. can download in link http://logging.apache.org/log4j/1.2/download.html , try add

semantic web - RDF - Distributing rdf:type to all items in the list -

consider following rdf: semapi:baseclass rdfs:class; rdfs:subclassof rdfs:class . semapi:haschainto rdf:property; rdfs:domain semapi:baseclass; rdfs:range semapi:baseclass . semapi:derivedclass rdfs:class; rdfs:subclassof semapi:baseclass . instances:instance1 semapi:derivedclass; semapi:haschainto ( [ semapi:derivedclass; semapi:haschainto ( [c1] [c2] ) ] ) if semapi:haschainto rdfs:range semapi:baseclass implies the list rdf:type semapi:baseclass . what mean each item in list rdf:type (ei. [c1] rdf:type semapi:baseclass , [c2] rdf:type semapi:baseclass , ...) how can this? need owl (prefer

c - override mkdir with LD_PRELOAD -

i'm trying modify syscall mkdir(), filter users don't want them create directories, maybe not elegant way it, want know why it's not working. the mkdir() replacement code is: #define _gnu_source #define maxgrupos 30 #define dim(x) (sizeof(x)/sizeof(x[0])) #define true 1 #define false 0 #include <stdio.h> #include <stdint.h> #include <stdlib.h> // //me permite llamar al metodo original #include <dlfcn.h> //codigos de error #include <errno.h> //mkdir() #include <sys/stat.h> #include <sys/types.h> //para obtener los usuarios #include <unistd.h> //parser de la config #include <libconfig.h> //##################################################### #define ruta_config "/etc/samba/gruposhabilitados.txt" //##################################################### int *obtenergruposvalidos(){ int indice = 1; int (*gruposvalidos) = malloc(sizeof (int) * maxgrupos); config_t cfg, *cf;

mysql - Avoid default activerecord primary index creation -

i trying workout how advise/tell activerecord not create it's primary index default. anyone know how can achieve ? class createhouse < activerecord::migration def change create_table :houses |table| table.string :name, :null => false, :unique => true table.integer :number, :null => false, :unique => true table.string :category, :null => false table.timestamps(:null => false) end add_index :houses, [:category, :number], :unique => true end end thanks you can add id: false create_table definition. try following: class createhouse < activerecord::migration def change create_table :houses, id: false |table| table.string :name, :null => false, :unique => true table.integer :number, :null => false, :unique => true table.string :category, :null => false table.timestamps(:null => false) end add_index :houses, [:category, :number], :unique => tr

javascript - jQuery .html() anonymous function return oldHtml -

fiddle: http://jsfiddle.net/bplumb/znmf5/1/ this lack of understanding on part, trying run anonymous function .html() custom code , return old html string value variable. isn't returning html expect returning jquery object based on selector used. var oldhtml = $('#test').html(function(index, oldhtml){ //some custom code here return oldhtml; }); console.log(oldhtml); i thought return html way works in normal function call. var someotherhtml = getoldhtml(); console.log(someotherhtml); function getoldhtml(){ return $('#test').html(); } what not understanding jquery when comes this? $(...).html(function) returns original jquery object, not html in selected element. what return in function set new html of selected element. $(collection).html(function(){ return "i'm new html!"; }); // results in elements in collection receiving html ("i'm new html!") // equivalent to: // $(collection).html("i

php - Efficiently change website body depending on day? -

so have website, , have txt file multiple lines date, text. can find how parse txt file text goes date, there way make instead of every person tries load page having server logic , find out text display, make first person per day make server find out text display server automatically displays rest of day? you can write results file, sort of cache system. $today = date('y-m-d'); $path = '/path/to/cache/'; $file = $path.$today; // cache file exist? if not, make if ( ! is_file($file)) { // parse text file, content, write file file_put_contents($file, $txt_content); } $content = file_get_contents($file);

Delete a mailitem permanently in outlook -

i'm trying delete mailitem using outlook api. following, dim objmail each objmail in objfolder.items objmail.delete next obviously, deleting item straight away simple. outlook move "deleted items" folder instead of deleting it. tried "deleted items" folder using outlooknamespace.getdefaultfolder(oldeleteditems) and delete mail again, pst code working on not default mailbox , folder returned wrong deleted items folder. how can permanently delete mailitem? i tried loop through folders in current store, there's no way of telling folder deleted items folder except comparing names, can't since programs used in multiple languages , name different each version. ps: cannot use third party dll :( help! first problem of code not appropriate loop use. if want delete (almost in vba) need loop collection last element first. if not, change order of collection- after delete 1st element >> 2nd 1 moved 1st position , not deleted. theref

post - An error occured submitting the edit - SQL -

i getting errors trying answer question , posting sql query. the unhelpful error message is: error occured submitting edit here tried submit: select empname, phone, email employee emptype = 'pt' , salary between 30000 , 50000 order city, faculty, empid; why post here? did mark code {} (the 4 space indent). it seems error caused in text used describe query. had phrase 'select list' when reworded work. phrase works here - strange.

xml - selecting nodes based on the attribute value -

i have been struggling days determine how take xml file of game results (teams , final scores) , generate team standings list shows each team along how many times won, lost or tied based on game status(played). able display team standings on both game status(played , pending). want display team standings played only.any appreciated. here xml code: <schedule> <game status="played"> <home_team>a</home_team> <away_team>b</away_team> <date>2013-06-15</date> <home_team_score>3</home_team_score> <away_team_score>3</away_team_score> </game> <game status="played"> <home_team>a</home_team> <away_team>c</away_team> <date>2013-06-17</date> <home_team_score>7</home_team_score> <away_team_score>4</away_team_score> </game> <game status="pl

php - Prepared statement & binding the results to array -

i'm trying fetch rows database , put them array can't work out! so fetch data so: if ($archiveinfo = $mysqli->prepare('select date,title blog')) { $archiveinfo->execute(); $archiveinfo->close(); } but not sure best code bind results array. i'm guessing 2 dimensional array i.e. $archiveinfo[0]['date'] how bind array , start echoing selected sections of array? if ($archiveinfo = $mysqli->prepare('select date,title blog')) { $archiveinfo->execute(); $archiveinfo->bind_result($date, $title); /* fetch values */ while ($archiveinfo->fetch()) { echo $date." ".$title; } $archiveinfo->close(); } you use http://php.net/manual/en/mysqli-result.fetch-array.php instead , loop through array..

c# - Is there a way to pass Smartscreen filter when creating an application with installshield limited? -

i have created application want run desktop version on windows 8. created installer installshield limited in visual studio. when try run exe on windows 8, smartscreen filter error. did research on it, , went through following links: digitally signing install shield installer microsoft smartscreen & extended validation (ev) code signing certificates now not sure whether buy standard code signing certificate or 1 extended validation. comparison can found here . buying standard certificate ensure pass smartscreen filter first time installer run on windows 8? if can tell me cheaper options pass filter, great help. tia. the ev certificate make sure users won't shown screen if have couple download/installs. if more people install application standard cert not shown users aswell.

database - Trying to verify person specific url then bring up login screen in Android -

i'm trying make application person connects specific website , can access data it. first page asks them put in url. parse , need verify url's existence can move them login screen. how go doing this? i'm trying httpurlconnections i'm not having luck. thoughts? try below code : try { int status = 0; try { httpurlconnection httpconnection = (httpurlconnection) new url( "http://www.google.com").openconnection(); httpconnection.setrequestmethod("head"); log.e("statuscode",httpconnection.getresponsecode()); if ((httpconnection.getresponsecode() == 200)||(httpconnection.getresponsecode() == 302)) { status = 1; } } catch (exception ex) {} if (status == 1) { log.e("website","found"); } else { log.e("website","notfound"); } } catch (exception ex1) { log.e("error

python - Starpy connection randomly closing itself -

i have application uses newest version of starpy , works of time on machines being used, randomly stops on of them. what happens: factory stops ( stopping factory ) , error thrown. error given is: " sequence index must integer, not 'str' ", doens't seem code. error preceded following error: file "/usr/lib64/python2.6/logging/__init__.py", line 797, in emit [amiprotocol,client] stream.write(fs % msg) [amiprotocol,client] ioerror: [errno 5] input/output error the code randomly throws error in 1 of 2 following partial codes: notes: i'm using " @defer.inlinecallbacks " decorator , variable client contains connection. try: dndextensions = [] dnd = yield client.command ( 'database show dnd' ) extension in dnd: if 'dnd' in extension: dndextensions.append ( extension.split ( '/dnd/' )[1].split (' ')[0] ) except exception, e: # error ... try: lunchextensions

SQL server, linked server error with open query -

i can't figure out why getting error on open query line: "could not find server 'server_name' in sys.servers. verify correct server name specified. if necessary, execute stored procedure sp_addlinkedserver add server sys.servers." when run code in parts works... if not exists(select * sys.servers name = server_name) begin exec sys.sp_addlinkedserver @server = server_name, @srvproduct = 'sql server' exec sys.sp_addlinkedsrvlogin server_name, 'false', null, 'username', 'password' end select * openquery(server_name, 'select * table') if exists(select * sys.servers name = server_name) exec sys.sp_dropserver @server = server_name, @droplogins = 'droplogins'

java - Jersey Client post binary data application-octet/stream -

i perform post binary data using jersey client. the equivalent curl be: curl -v --header "content-type:application/octet-stream" --data-binary "abc" http://example.com i not find how in official docs: http://jersey.java.net/documentation/latest/user-guide.html#client thanks. i think can invoke post request entity encapsulates binary data this: client client = clientbuilder.newclient(); webtarget webtarget = client.target("http://example.com/rest"); response response = webtarget.request(mediatype.text_plain_type) .post(entity.entity("abc", mediatype.application_octet_stream));

filepicker.io - Ink file picker callback called too early. How to detect when the file is available? -

when uploading file using filepicker.io, filepicker.pick success callback getting called before file available. here's code: filepicker.pick({ mimetypes: ['image/*'], container: 'modal', services:['computer', 'facebook', 'instagram', 'webcam'] }, function(inkblob){ $('img.foo').attr('src', inkblob.url); }, function(fperror){ console.log(fperror.tostring()); }); i url in inkblob comes in callback, if insert url dom (as above), 404. other times works. i'm looking reliable way know when can use file returned filepicker. figured success callback it, there seems race condition. i realize wrap success callback in settimeout, seems messy, , i'd not keep user waiting if file available. you can use event listener. i have ajax call downloads image after it's cropped ink. call failing sp

activepivot - How to use Relational Stores with a position based data file? -

i have different data files mapped on relational stores. have formatter contains separators used different data files (most of them csv). here example of how looks like: dqki 435741198746445 45879645422727jhufhglobal collateral services aggregator v9 the rule read file following: index 0 3, it's code name, index 8 11, it's pid, index 11 20, it's account number, , on... how specify such rule in activepivot relational stores? the relational-store of activepivot ships high performance, multithreaded csv-source parse files , load them data stores. suppose that's hope use fixed-length field file. but not supported in current version of relational store (1.5.x). you pre-process file small script add separator character @ end of each of fields. entire csv source can reused immediately. you write own data source defines fields offset in text line. if can reuse of fast field parsers available in csv source project (they work on char sequences): com.

rcpp - Getting g++ error when installing R code from source -

i've downloaded rcpp cran , unzipeed , attempted build it. when try use r cmd install . in directory get: cp: unknown option -- ) if try open session , use install.packages("rcpp", type = "source"), following error g++ : *** arch - x64 g++ -m64 -i"c:/r/r-30~1.1/include" -dndebug -i../inst/include/ -i"d:/rcompile/cranpkg/extralibs64/local/include" -o2 -wall -mtune=core2 -c date.cpp -o date.o date.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in make: *** [date.o] error 1 i have rtools installed, , directories in front of path. on 64-bit windows 7. there install options missing? have been reading appendix d of r's installation , administration manual , can't find might have violated, installed through rtools. feel there flag not including can't figure out what. this problem started working once did following (i'm not sure 1 fixed it) listed in consecutive order: -threw coffee cup against

database - How to extract a table from a *.dump file into a CSV -

i have *.dump file (postgresql dump) , output my_table my_table.csv . there better way pg_restore -t my_table db.dump > my_table.txt , writing script create csv output? the output pg_restore --data-only -t my_table db.dump is tab-separated headerless tabulated text comments , few commands. script mangle csv tool perl or awk pretty simple. that said, would: restore table temporary database created purpose. if table depends on custom types, functions, sequences, etc need restore them too. in psql , \copy the_table 'some_file.csv' (format csv, header on) this way can control representation of nulls , lots more .

ios - NSDictionary<FBGraphUser> *user syntax explanation -

in facebook ios sdk requests returned following handler: ^(fbrequestconnection *connection, nsdictionary<fbgraphuser> *user, nserror *error) { } the user variable can accessed calls these... self.usernamelabel.text = user.name; self.userprofileimage.profileid = user.id; this syntax similar syntax id <protocoldelegate> object syntax common property declaration, except nsdictionary id object explicitely, , dictionary conforms protocol? dot syntax come , how 1 state arbitrary nsfoundation object corresponds protocol without subclassing object , making conform? i did additional research dot notation , nsdictionary , appears not possible use dot notation on dictionary without adding category nsdictionary. however, did not see reference of <> syntax in apple documentation indicate particular instance of nsdictionary conformed notation. and facebook documentation little sparse on how wrapping works: the fbgraphuser protocol re

iphone - which option gives me better performance: a variable declaration or an implicit function in iOS -

not less code better, last lesson learned so came me question in terms of memory management, speed , that, what's better?? uialertview *message = [[uialertview alloc]initwithtitle:@"notification" message:@"my message" delegate:self cancelbuttontitle:@"ok" otherbuttontitles:@"cancelar",nil]; [message show]; or [[[uialertview alloc]initwithtitle:@"notification" message:@"my message" delegate:self cancelbuttontitle:@"ok" otherbuttontitles:@"cancelar",nil]show]; this short difference (2 lines against one) can more complex when you're reducing more code more complex code , functions thanks in advance answer there

ios - How do I have padding at the bottom of my UITextView like in Mail.app so the text isn't scrunched? -

in mail.app, if go create new message , type way text @ last line of uitextview there still decent amount of space between last line of text , keyboard if scroll down. can't type here. it's nice padding can read without being scrunched against keyboard, , if select text, selection handles don't extend under keyboard. my question is, how mimic traditional uitextview? i think can setting contentinset property of uitextview: mytextview.contentinset = uiedgeinsetsmake(-4,-8,0,0); btw... values above not specific situation. want adjust these inset looking for.

git - Makefile for pulling and building projects -

i building project requires ecosystem of projects (linux, qemu, uboot etc) of in git repositories. used manage them script find myself implementing stuff better done make. decided migrate script makefile. the problem want projects cloned if not present , pulled if present. there way without repeaing myself much? something work think. doesn't have make work because without depending on inside project directories i'm not sure conditionally run clone. force: ; proj%: force @echo [ -d $@ ] || git clone srv:$@ @cd $@ && git pull if wanted list proj1/.git/config entry-point prereq split clone order-only prereq on clone project directory. though still need force on config prereq force pull happen. something perhaps: proj%: git clone srv:$@ proj%/.git/config: force | proj% git pull

odata - When will Breeze support ANY filtering (where predicate on children relationship)? -

we have need select records based on value of related child table's properties. discovered today feature supported in odata keyword called 'any'. further it's supported in default breeze server implemention (using entity framework). using same server breeze client does, can enter odata query in browser using 'any' keyword , select records on related child's field value. example: .../issue?$filter=oissueimages/any(ii: ii/issueimageref eq 4) and works! but, there no support in breezejs client code. fwiw: found breeze feature request: https://breezejs.uservoice.com/forums/173093-breeze-feature-suggestions/suggestions/3988038-adding-any-and-all-filter-operators anyone know when breeze implement feature? updated post: 11/25/13 as of breeze 1.4.6, 'any' , 'all' operators supported. so client side breeze query like: var query = entityquery.from("issue") .where("oissueimages", "any", &qu

xml - Android cannot re-size LinearLayout -

i've been working on android application recently, , in last day or i've been working on gui using eclipse layout editor. unfortunately, can't resize linearlayout in way other x-dimension. can resize resizing textview contained within it. sushil stated, can't control height of linearlayout. code: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <scrollview android:id="@+id/scrollview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" > <linearlayout android:id="@+id/helplinearlayout" android:layout_width="match_parent"

django - Indenting a nested form in an HTML template -

this may more of html question there django code in html template. have list of teachers , nested form contain students associated each teacher. there way indent student list when it's being rendered underneath teacher? don't know put html code. i've tried few things in various places nothing indents. <div class="form-block"> {{ teachers.management_form }} {% teacher in teachers.forms %} {{ teacher }} {% if teacher.nested %} {% studentformset in teacher.nested %} {{ studentformset.as_table }} {% endfor %} {% endif %} {% endfor %} </div> browser source snippet <option value="50">dd</option> </select></td></tr> <tr><th><label for="id_value_35-0-student">student names:</label></th><td> <input id="id_value_35-0-student" type="text" name="value_35-0-s

Separate words with commas in Excel 2010 -

Image
i'm trying use formula in excel separate bunch of words in cell comma. if there more 5 words in cell, want first 5 words. first 5 words in cell , separate them comma use this: =substitute(left(a1,find("^",substitute(a1," ","^",5))-1), " ", ", ") this works fine. problem this, because of number 5 here, if cell contains less 5 words, error. tried substitute 5 this: len(trim(a1))-len(substitute(a1," ",""))+1 so function becomes this: =substitute(left(a1,find("^",substitute(a1," ","^",len(trim(a1))-len(substitute(a1," ",""))+1))-1), " ", ", ") but doesn't work, gives me error. idea how can please? also ignore first word if first character "-" (without quotes) , start second word. in other words, want this: i love life should return i, love, my, life, very - love life should return i, love, my, life, (the "-

.net - Web Service in a Windows Service: Multithreading -

summary : how parallel requests web service managed when host windows service? i know soap web service can hosted within iis, console application or winforms application. 1 reason or another, these hosts not available me , must host web service within windows service. in case of iis, have read web server manages multiple parallel requests , assigns them different threads. need understand how multithreading works in case of windows service. component responsible it? pool-based or something? how , can configrue pool-size etc? the term 'web service' broad. please review web service vs wcf service clarification. in case question wcf-based services, there article on concurrency here: http://www.codeproject.com/articles/89858/wcf-concurrency-single-multiple-and-reentrant-and . to answer questions: the system.servicemodel.servicehost responsible hosting service. servicebehavior attribute in app config or in code can used set desired behavior, so: [servicebeha

if statement - onsubmit: jQuery alert if field is empty -

on website, have button says "get free consultation" , next button email field. when user types in email , presses button, email submitted google spreadsheet, , popup appears more information. how can add jquery code "onsubmit" part of tag says: if email field contains email address, submit form , show popup. otherwise ("else"), display alert box says "please enter email address." here's code looks now: <form action="https://docs.google.com/forms/d/xxxxx/formresponse" method="post" id="ss-form-landing" onsubmit="$('.landing-button').click();return true;" target="hidden_iframe"> <input type="text" name="entry.xxx" value="" id="entry_2005747986" class="landing-pg-email-field" placeholder="enter email address"><input type="submit" name="submit" value="get free &#x00a; consul

asp.net - Sending Thousands of Email per day without being spam -

i'm having website developed asp.net online art competition people can register , enroll competition. in system there lot of emails sends on various stages of process user. as example, 1 user gets: account confirmation email welcome email competition instruction email password reset email payment confirmation email thank email completing enrollment process. likewise need send various emails, number of users registering per day getting higher , higher. so lets there more 2000 - 5000. there more 10000 email sending noreply@mydomain.com email im using send emails. anyway 1 email message send 1 user. meaning there 1 user email address in 'to:' field , no 'cc:','bcc:' fields. my question is considered spamming ? have doubt email can marked spam. how can avoid this? there way properly? at least separate emails registered users registration/verification emails. send them different ip addresses. make sure recipients want receive

python - Dpedia spotlight on my own instance -

i have set own instance of dbpedia on amazon ec2 instance: http://xxxx.compute-1.amazonaws.com i had written code access dbpedia so: annotations = spotlight.annotate('http://spotlight.dbpedia.org/rest/annotate', document, confidence=0.4, support=20) where "document" string. how take have down , use on own instance?? have tried replace http://spotlight/dbpedia.org/rest/annotate with http://xxxx.compute-1.amazonaws.com/rest/annotate , incorrect. assistance appreciated! thanks! thank you! if using command line java -jar dbpedia-spotlight.jar /data/spotlight/en/model_en http://[your_amazon_server]:2222/rest the service available @ http://[your_amazon_server]:2222/rest/annotate. (notice port number 2222) also, make sure there no firewall blocking port (aws: securitygroups -> inbound). we have more information @ https://github.com/dbpedia-spotlight/dbpedia-spotlight/wiki/installation . all best,

vhdl - How to take samples using fpga? -

i want take samples of digital data coming externaly fpga spartan 3. want take 1000 samples/sec initially. how select clock frequency in vhdl coding? thanks. do not use counter generate lower frequency clock signal. multiple clock frequencies in fpga cause variety of design problems, of come under heading of "advanced topics" and, while can (if necessary) dealt , solved, learning how use single fast clock both simpler , better practice (synchronous design). instead, use whatever fast clock fpga board provides, , generate lower frequency timing signals it, , - crucially - use them clock enables, not clock signals. dlls, dcms, plls , other clock managers have uses, generating 1 khz clock signals not use, if limitations permit it. application crying out clock enable... also, don't mess around magic numbers, let vhdl compiler work! have put timing requirements in package, can share them testbench , else needs use them. package timing -- change fi

How Do You Pass a Variable from One Class to Another in Java? -

i have 2 java classes named x.java , y.java . in x.java have protected method: protected resultset populatespecieslist(resultset results) and inside of protected method, have if statement: if (fstitle != null) { sp.setfirestudytitle("available"); string sppacronym = results.getstring("acronym"); firestudyquerybuilder qb = new firestudyquerybuilder(); this.magicstring = qb.buildmagicstring(); } now in y.java have method goes this: string buildmagicstring() { string sppacronym = getacronym(); string newquerystring = bunch of sql; return newquerystring; } the problem is, can't use sppacronym in other class because it's not recognized. so question is, how pass variable class another? thanks. can not rewrite method buildmagicstring() following? string buildmagicstring(string sppacronym) //this allows caller pass argument method. { system.out.println(sppacron

jsp - Why is my array list size zero when i initialised it to 30? -

why array list size 0 when initialised 30? i java.lang.indexoutofboundsexception: index: 1, size: 0 when addrecord() called (note: calling setinitialvalues jsp doesnt help.) (note: shootrecord implements serializable) servlet procesrequest method protected void processrequest(httpservletrequest req, httpservletresponse resp) throws servletexception, ioexception { printwriter pw = resp.getwriter(); string address = null; httpsession session = req.getsession(); shootmeet meetbean = (shootmeet)session.getattribute("shootmeetbean"); if(meetbean == null){ pw.print("initialising meet \n"); meetbean = new shootmeet(); meetbean.setinitialvalues(30); } shootrecord recordsent = (shootrecord)session.getattribute("shootrecordbean"); if(recordsent == null){ recordsent = new shootrecord(); } // **record sent created here** try{ meetbean.addrecord(

alignment - Aligning div elements side-by-side -

i have page on project i'm creating class wanted align image in left side, text right aligned in middle of image. instead of using html elements, decided try internal css div elements within external css. problem can't them align correctly vertically. have horizontal alignment, text either appears 1 line above or 1 line below image. tried techniques included in posting, didn't fix problem. align <div> elements side side here internal css. <style type="text/css"> /* left div holding image */ #left { width:170px; align:left; } /* right div hold text */ #right { margin-left: 200px; text-align:left; } </style> here's html <div id="content"> <br/> <br/> <br/> <blockquote> <div id="right">check soon. <a href="mailto:twowiredchicksjewelry@gmail.com?subject=alertwhenpagecomplete">click here</a> receive email when site becomes available.</div><

java - How can I add to or change a label on a JMenuItem? -

Image
i need add label on right hand side of jmenuitem , labels shown below: i have application uses ctrl + + , ctrl + - zoom image. however, + key default (without shift ) = key. when try adding accelerators these menu items, ctrl + - shortcut label displays "ctrl+minus" (i prefer "ctrl -") , ctrl + + shortcut label displays "ctrl+equals" (even worse - in interest of user experience, prefer "ctrl +"): menubar_view_zoomin.setaccelerator(keystroke.getkeystroke(keyevent.vk_equals, actionevent.ctrl_mask)); i want ctrl + + display "ctrl +" , ctrl + - display "ctrl -". how can done? not answer, need search paint() heavy, paintcomponent() lightweight jpopup, jmenu (for custom painting can switch isheavyweight...) overlay jlabel container (few question jtable @guillaume polet , @robin) create own jmenu/jpopup (see comment question) import java.awt.color; import java.awt.component; import java.awt.