Posts

Showing posts from June, 2014

php - How to put a variable in quotes? -

i have variable $teste = hiiiii i need put variable inside quote , double quote. this: "'$teste'" value "'hiiiii'" i'm trying concatenation not working. how that??? you can escape quotes: echo "\"'$teste'\""; will print out: "'hiiiii'"

multithreading - Parallel computing in Java for big data -

there 2 sets of matrices i.e. a(1 500 matrices) , b(150 000 matrices). for each matrix set a, iterate through elements b b checking criteria on , b (if it's true matrix b, stop iterating , return true. if no match found after iterating entire set b, return false). my question how make program parallel using java? i understand matrices sets quite big (the numbers of elements posted above instance, in real-life case bigger). how correctly computations? create 1 5000 threads , computation not idea. optimal amount of threads, take computational work? as said, may need check pair , there no heuristic order of checking if checking not need i/o or sth cause wast of cpu, if have 4 example 4 core, create 4 thread(0-3) , thread responsible checking a(4k+i) , every b . , before each checking in each thread, must check whether find true pair or not, can accomplished static variable in classes extends thread public class worker extends thread{ static int found=0; ...

mongodb - mongoengine NotUniqueError on empty collection -

i trying save first object collection (i did db.connection.drop_database() ensure first object), keep getting *** notuniqueerror: tried save duplicate unique keys error. here's quick example of get: ipdb> card.objects.all() [] ipdb> card `<card: <card url/pk: c569e1c9-7311-441e-ba03-0e86d4bc2932>>` ipdb> card.save() *** notuniqueerror: tried save duplicate unique keys (e11000 duplicate key error index: contacts.dav_object.$username_1 dup key: { : null }) ipdb> card.drop_collection() ipdb> card.save() `<card: <card url/pk: c569e1c9-7311-441e-ba03-0e86d4bc2932>>` ipdb> i'm using unittest, , setup method has card.ensure_indexes() . suspect has it, without line mongo accept duplicated entries, if model definition says unique=true . if add card._collection.drop_indexes() after card.ensure_indexes() problem goes away, duplicated entries, said above. here's card model: class card(davobject): add...

How to receive a notification message from LOCAL SERVER such as WAMP to android devices? -

how receive notification message local server such wamp android devices? i dont wanna use c2dm or gcm because there no internet connection. have use local server. how push notification local server such wamp server android device? devices in lan network... heard mqtt m not sure work local server or not i want send notification device1 , receive server(local) , server(local) push notification android device2

Python cx_Oracle merge mystery - working in SQL Dev not working in python33 -

i using python33 , cx_oracle (with oracle 11g) analyze database, have run problem. problem sql: merge ftab01 using (select username , count (case when action ='friend' 1 end) friendcount pool_1 group username) b on (a.username=b.username) when matched update set a.friendcount=b.friendcount if run command in sql developer, works perfectly, if this: cursor.execute("merge ftab01 using (select username , count (case when action ='friend' 1 end) friendcount pool_1 group username) b on (a.username=b.username) when matched update set a.friendcount=b.friendcount") , fail (without error! - not change table). other commands working (for example: cursor.execute('alter table '+self.tabname + ' add ('+column_name+' number)') - code 2 lines above problematic code. have no idea might wrong, tried googling longer time haven't found (maybe because don't know how name problem) code used it: def action_counts(self,action_list): s...

Need a second pair of eyes for a CSS3 animation -

i have been trying make simple drop down animation. want push other buttons down , display simple text. got work, wanted webkit tween jazz bit , can't seem work. don't want use absolute positioning because laying out outline. here's sample of html <div id="ngss-main" class="post"> <div class="infoblock"> <a class="topic">forces , interactions <div class="inform"> <h5>what happens if push or pull object harder?</h5> <ul> <li>pushes , pulls have different strengths , directions</li> <li>pushes , pulls start, stop, change speed or direction of object*</li> <ul> </div> </a> </div> <br> ...

java - How to save/open files on server with GWT -

i have birt report i've created in gwt , i'd save server , open up. feel hardcoding url wrong route go (ie c:/files/foo/foo.html) i'm not having luck figuring out way of doing it. tried using gwt.getmodulebaseforstaticfiles() if use unsatisfied link error in birt. can use save/open file, considered best practice? thanks. edit: bad wording, birt report generated server-side. i'd able save server side , open in new browser window (using window.open i'd imagine?). nothing uploaded client side. if birt report static file (not generated during runtime of application) can create simple servlet read file , copy data outputstream of response. if it's generated @ runtime, client request server, server generate , return url location of report. client can open report url. example: if birt located under foo/foo.bar can map servlet /foo/*. after mapping user request url www.yourselver.com/foo/foo.bar servlet @ doget method can read file , stream content...

Adding a Jenkins "Are you sure ..." dialog -

i have jenkins jobs affect production servers. nice have "are sure want this?" dialog when user runs 1 of these jobs. have not found plugin this. has out there tried this? you add "are sure?" parameter build. when user hits "build now" asked enter parameter, choice "yes/no" or string. check parameter via shell or batch step , "exit 1" if not set yes.

azure - log4net issue - Orchard on IIS8 Windows Server 2012 -

i'm deploying orchard cms onto azure vm (windows server 2012) iis8 i'm getting error: could not load file or assembly 'log4net, version=1.2.11.0, culture=neutral, publickeytoken=669e0ddf0bb1aa2a' or 1 of dependencies. system cannot find file specified. exception details: system.io.filenotfoundexception: not load file or assembly 'log4net, version=1.2.11.0, culture=neutral, publickeytoken=669e0ddf0bb1aa2a' or 1 of dependencies. system cannot find file specified. how can fix this? :( update i tried fresh copy of orchard 1.7 , issue :/ 1) check have "lib" folder deployed contains of orchards resources. should have series of resources such autofac, castle windor etc, log4net. if can't find folder @ route of copy of 1.7 issue. 2) orchard not use nuget packages, instead uses lib folder (i believe have custom versions of several of packages). if got source code version of 1.7, lib should have been present when built. check in vs...

Android app closes unfortunately -

i using eclipse libgdx framework... , set... when run android through emulator after launching when click on app icon gives me message "unfortunately app-name has stopped"... please tell me why happening... because same code works when run desktop java application through eclipse... please me out... thanks... log cat details : 08-09 19:30:45.729: w/dalvikvm(747): unable resolve superclass of lcom/badlogic/drop/mainactivity; (20) 08-09 19:30:45.739: w/dalvikvm(747): link of class 'lcom/badlogic/drop/mainactivity;' failed 08-09 19:30:45.759: d/androidruntime(747): shutting down vm 08-09 19:30:45.759: w/dalvikvm(747): threadid=1: thread exiting uncaught exception (group=0x40a71930) 08-09 19:30:45.779: e/androidruntime(747): fatal exception: main 08-09 19:30:45.779: e/androidruntime(747): java.lang.runtimeexception: unable instantiate activity componentinfo{com.badlogic.drop/com.badlogic.drop.mainactivity}: java.lang.classnotfoundexception: didn't find class ...

javascript - Should I build Node.js from source or download the OS X installer? -

i'd install node.js on os x. you can build source cloning github repo, or can download installer . for who've done node.js development on os x, tradeoffs , option recommend? i suggest not using installer, or installing via homebrew , instead use nvm install whatever version of node need. way able fluidly develop in whatever version of node choose, without having worry headache of conflicting global packages or $path cruft.

multithreading - Sending Data between Activities in Android periodically. -

i have 2 activities in android application. main activity launches thread draw oscillating pendulum, can stopped "stop" button. however, if user moves second activity, should able see the calculated coordinates , parameters of oscillation (angular velocity, etc.) calculated drawing thread in real-time. my queries : how send data thread performing oscillation second activity ? note : data generated @ regular intervals (fps), hence need send data second activity available. can use semaphores , producer-consumer solution i.e. drawing thread produces value , second activity launches thread consumes them ? my approach : have pendulum class calculate required parameters. have extended surfaceview perform drawing thread. so, thinking of having 2 semaphores (producer , consumer), let producer thread (drawing thread) update parameters, , wait consumer(the thread launched second activity) fetch them, , repeat cycle. another idea : let drawing thread stop executing whe...

java - Is it possible to generate the file 'build.xml' from the command line in Ant? -

i looking script build process. able build build.xml file manually, , run following command create jar file: system("ant -f ~/build.xml") i rebuild build.xml file every time run script ensure changes in build.xml file. there ant command can run build build.xml file? for reference, using intellij idea create build.xml file. there other common ways customize build in ant. like: introducing properties (possibly excluded build.properties file) , regular expressions wherever feasible. these should cover of use cases in ant. for more sophisticated stuff, can go more logic using ant-contrib tasks . as alternative: if you'd still stick generation of custom build.xml file every time, go xslt transformation so. not common practice, i'd say. or go maven , suggested in comment or even go grails however, choose fitting solution, should tell more details on build.xml changes you'd achieve.

mysql - php login script if returns else even though login info is correct in db -

this block of code login admin backend of page i'm building. parses 'else' statement echoing "incorrect information" statement. saying isn't finding credentials created on server have checked , double checked. confirmed connection script working. i'm stumped. appreciated. <?php session_start(); if(isset($_session["manager"])) { header("location: index.php"); exit(); } ?> <?php // parse log in form if user has filled out , pressed "log in" if (isset($_post["username"]) && isset($_post["password"])) { $manager = preg_replace('#[^a-za-z0-9]#i', '', $_session["username"]); // filter numbers , letters $password = preg_replace('#[^a-za-z0-9]#i', '', $_session["password"]); // filter numbers , letters // connect mysql database include "../php/connect_to_mysql.php"; $sql = mysql_query("selec...

mysql - Updating a Table Column from a Count in another table -

i'm trying update column in table result of count table. here code: (and it's working) update software2 set totalsoft = ( select count(*) links sftwr = software2.softwarename) but when try use instance instead = (in last line) no results... code: update software2 set totalsoft = ( select count(*) links sftwr '%software2.softwarename%') occurrences 0. help? update software2 set totalsoft = ( select count(*) links sftwr concat('%', software2.softwarename, '%') ) if put column name in quotes treated string. not column content used static string 'software2.softwarename'

jquery - Attaching events to images inside iframe -

i have iframe (with id=iframe) , trying attach onclick event each one. iframe within domain. $("#iframe").contents().find('img').each(function () { $(this).on('click', function (event) { $('#image-box', window.parent.document).show(300); window.parent.document.getimage(this); }); }); thanks in advance i had load iframe first otherwise wouldn't work. solution, therefore, looks this: var iframe = $("#iframe"); iframe.load(function () { iframe.contents().find('img').each(function () { $(this).on('click', function (event) { $('#image-box', window.parent.show(300)); window.parent.getimage(this); }); }); });

Reading a particular line in a csv file in C++ -

this question has answer here: in c++ there way go specific line in text file? 4 answers i have csv file contains many rows of data. function passes linenum argument. when user enters 4 linenum want read 4th line in csv file. thought way go through \n 's , count them,stop when count linenum-1, , proceed read next line. think decent way of doing this, thoroughly confused implementation. love here code void readcsv( int linenum){ ifstream infile ("/media/logging/darsv1.csv"); string line; string dataarray[226900]; int = 0; int endofline =0; int a, b, c, d, e; while (getline (infile, line)) { //printf(line.c_str()); istringstream linestream(line); string item =""; int itemnum = 0; if (linenum==1) { printf(" line number 1. "); while (getline (...

python - Gathering every other string from list / line from file -

i have been scripting around 2 weeks, , have learnt reading file. what want every other entry original list , store in new list. best way it? with open("test.txt",mode="r") myfile: file = myfile.read().splitlines() username = [] in range (len(file)): if file.index(file[i])%2 == 0 or file.index(file[i]) == 0: username.append(file[i]) print(username) please bear in mind have studied python around ten hours far - i'm quite happy seemed work. there @ least couple ways accomplish same thing less code. slice notation python has way of iterating on every nth element of array called slice notation . can replace entire loop following line username.extend(file[0::2]) what means grab every 2 nd element starting @ index 0 , add username array. the range() function you can use different version of range() function, allows specify start, end , step, list so. for in range(0, len(file), 2): username.append(file[i]) the r...

drawing text in PlayN doesn't appear -

i'm trying draw rectangle text on it, see rectangle, there no text. doing wrong? part of code drawing: canvasimage image = playn.graphics().createimage(100, 50); canvas canvas = image.canvas(); canvas.setfillcolor(color); canvas.fillrect(0, 0, 100, 50); canvas.setfillcolor(textcolor); canvas.setstrokecolor(textcolor); canvas.drawtext("test", 0, 0); layer.surface().drawimage(image, 0, 0); thanks btw, i'm running html version. the problem text drawen y coordinate , setting y 0 text wasn't shown.

import - Python installing PyQt4 module to custom software -

this i've been researching past few hours far nothing come out of it. basically have software use python 2.5.5. not have qt module in it. so in attempt install did this. downloaded executable qt pyqt4-4.10.2-gpl-py2.7-qt4.8.4-x64. run exe. installed in python 2.7 site-packages. then moved folder software python 2.5.5. there no site-packages folder created it. next step go on instruction http://docs.python.org/2/install/ , use alternate installation: windows (the prefix scheme) file location inside program. cant run python setup.py install --prefix="\temp\python" (with location of python) because python not defined , on. i'm pretty sure thats wrong way it. how or information how it? software dont have documentation. thanks, bye. that binary version of pyqt4 supports python2.7, no matter do, won't run python2.5. the last pyqt4 version binary python2.5 pyqt4.9.4 , if want have chance of making work should try version. note software dist...

asp.net mvc - MVC RadioButtonFor default checked when enum but not for int in viewmodel -

noticed new thing today while trying solve problem have. viewmodel: [required] public paymentoption paymentoption { get; set; } enum: public enum paymentoption { creditcard, invoice } view: <div> @html.radiobuttonfor(x => x.paymentoption, paymentoption.creditcard, new dictionary<string, object> {{ "id" , "cc" }}) credit card @html.radiobuttonfor(x => x.paymentoption, paymentoption.invoice, new dictionary<string, object> {{ "id" , "in" }}) invoice </div> if changed paymentoption property int none of radiobuttons checked default when rendering view. public int paymentoption { get; set; } if paymentoption property paymentoption enum 1 of radiobuttons checked default , in html source input radio has checked=checked . public paymentoption paymentoption { get; set; } why behavior? shouldn't same both int , enum paymentoption property?

eclipse - How to stop GDB from initialising memory -

i have embedded gui application debugging in eclipse. however, when launch debug, gdb spends 90 seconds writing zero's of gui memory. is there way tell not that? gdb spends 90 seconds writing zero's of gui memory. you mistaken, gdb does no such thing (at least not default).

c++ - Keep getting Protocol "" is unknown error in Qt -

qurl downloadurl = qurl::fromencoded(downloadurlstr.toascii()); qdebug() << downloadurl.tostring(); qnetworkrequest req(downloadurl); req.setattribute(qnetworkrequest::user, id); qnetworkreply *finalreply = nam->get(req); connect(finalreply, signal(finished()), this, slot(datafetchfinished())); i have above code in qt 4.8.4 application, in datafetchfinished() slot keep detecting error: protocol "" unknown the debug output is: "http://192.168.1.1/servlet/com.roving.report.view.excel.excelreportservlet?file=661&columns=0&srctype=definebean&width=0&height=0&reportparamsid=100583&cachedid=662&t_i_m_e=1376086878417&pagestyle=0" any appreciated!

LINUX what is intel's i3 processor family name? -

i have dell inspiron 1564 intel i3 im trying download debian operating system i have different options: (for download) amd64 armel armhf i386 ia64 kfreebsd-i386 kfreebsd-amd64 mip smipsel powerpc sparc s390x which appropriate processor intel i3 architecture http://www.debian.org/distrib/netinst amd64 likely, it's 64 bit version makes best use of processor (more registers , better use of more 3gb memory per process mainly) as alternative consider i386, tends make better use of memory if have less 3gb.

xcode4 - How does one compile and link NASM code with Xcode? -

note question pertains xcode 4, though additional information other versions of xcode welcome. part 4 of tutorial @ cocoa factory recommends generating object code with nasm-2.09.10 -f macho64 hello64.asm (after putting nasm-2.09.10 in /usr/bin ) and linking with gcc -m64 -mmacosx-version-min=10.6 -isysroot /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.7.sdk -o hello64 hello64.o and that's fine, don't want compiling/linking @ command line, i'd click build , run , have done me. imagine there must way xcode use commands compile source when build , how?

asp.net mvc 4 - An attempt to retrieve content from returned the HTTP status code 502. Please check the URL and try again -

when twilio trying access rest api url via post incoming sms seeing error. "an attempt retrieve content returned http status code 502. please check url , try again. what error , how fix it? error coming server or twilio side? missing on side? looking @ twilio web site given here: http://www.twilio.com/docs/errors/11200 it says need set content-header. how do that? new web api , twiml. edited: this have under webapi.config public static class webapiconfig { public static void register(httpconfiguration config) { config.routes.maphttproute( name: "defaultapi", routetemplate: "{controller}/{id}", defaults: new { id = routeparameter.optional } ); my route config has public class routeconfig { public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( name: "...

Find the sum of all the primes below two million. Project euler, C -

so, seems working nicely, program doesn't give me correct answer. mine 142,915,960,832, whereas should 142,913,828,922. differece 2,131,910 (if still can subtract numbers on paper haha) , have no idea did 2 millions. me? #include <stdio.h> #include <math.h> #define below 2000000 int isaprime (int num); int main (void) { int i; float sum = 0; (i = 2; < below; i++) { if (isaprime(i) == 1) { sum = sum + i; printf ("\n%d\t%.1f", i, sum); } } getch(); return 0; } int isaprime (int num) { int i; (i = 2; <= sqrt(num); i++) { if (num % == 0) { return 0; } else { ; } } return 1; } using float sum problem. largest integer k such integers [-k, k] exactly representable in 32-bit float 2^24 1 ; after start losing precision in integers. since sum ou...

javascript - How to raise a jquery event when an element with some class is created dynamically -

is possible raise jquery event when element class created dynamically? mean. have following; ... <div id="lotocontent"></div> ... using jquery ajax, i'm retrieving several rows server , appending them "lotocontent" div. each row has empty span element looks this <span class="lotodatetime" data-date="123456"></span> the value of data-date attribute unix time-stamp retrived database. once rows added, following javascript function called; function processdatetimes() { //process dates $('.lotodatetime').each(function () { var timestamp = $(this).data('date'); $(this).text(getdatetimefromserverunixtimestamp(timestamp)); }); } function getdatetimefromserverunixtimestamp(timestamp) { //this function takes unix time-stamp , converts date , time // 08/09/2013 12:09 based on browser time } this works fine, wondering if there way automatically call processdatetimes...

html - Float forcing min-width on responsive div elements? -

hello have div following css {background: purple; max-width: 800px; min-width: 300px; height: 200px; float: left;} unfortunately being forced min width (if remove float fine). is floats do, or have made error somewhere? jsfiddle: http://jsfiddle.net/bhy3h/ this expected behaviour. div block element , takes 100% width (if no css rule applied). but if float div, modifing original flow, stops behaving block, takes width needed based on content (or as specified min-width/max-width). so, no, not doing wrong. edit: if correctly understand trying achieve, happens if add width:100% div style? http://jsfiddle.net/gptrt/1/

php - display number as image in sql -

i'm designing website neighbor potential restaurant wants open. need create page testimonials/review. i'd code number of stars in sql, i'm not sure how it. essentially i'm looking way determine integer of ratings field (1-5) , each number, display star image. so: if rating = 1, display star.png once if rating = 2, display star.png twice ... if rating = 5, display star.png 5 times i'm not sure how write code so. the website being written in php , css. i'd avoid jquery, javascript, .net, , forth, i'm not familiar them , 1 keeping site date. here's i've got far, it's not working right, , syntax error: $result = mysqli_query($con,"select * reviews"); while($row = mysqli_fetch_array($result)) { if (rating = "1"()){ echo '<img src="star.png">' . } else if (rating = "2"()){ echo '<img src="star.png"><img src="images/star.png">...

objective c - AVCaptureScreenInput and kCGWindowListOptionOnScreenBelowWindow -

i doing screen capture avcapturescreeninput. app has window configuration options. i want record screen not record window in recorder application. quicktime if screen recording, example. i think found it, i'm not sure how or if can used together. kcgwindowlistoptiononscreenbelowwindow found in cgwindow.h in core graphics framework. avcapturescreeninput part of avcaptureinput.h in avfoundation framework. if taking single screenshot, can pass kcgwindowlistoptiononscreenbelowwindow , windowid windows below window's level captured. can accomplish goal setting capture app's window high level if works. i'm relatively new objective-c ands not clear me if possible use kcgwindowlistoptiononscreenbelowwindow avcapturescreeninput. if is, provide tips on resulting code needs like? how access pixel buffer of nswindow in osx? as far know, there no way exclude specific windows os x's built-in display recording apis: avfoundation's avcapturescreeninp...

rubygems - Rails ERROR: While executing (Gem::RemoteFetcher::UnknownHostError) -

i try install rails command gem install rails --no-ri --no-rdoc , error occur.below output of error gem install rails --no-ri --no-rdoc fetching: multi_json-1.7.8.gem (100%) installed multi_json-1.7.8 fetching: tzinfo-0.3.37.gem (100%) installed tzinfo-0.3.37 fetching: atomic-1.1.12.gem (100%) building native extensions. take while... installed atomic-1.1.12 fetching: thread_safe-0.1.2.gem (100%) installed thread_safe-0.1.2 fetching: activesupport-4.0.0.gem (100%) installed activesupport-4.0.0 fetching: builder-3.1.4.gem (100%) installed builder-3.1.4 fetching: rack-1.5.2.gem (100%) installed rack-1.5.2 error: while executing gem ... (gem::remotefetcher::unknownhosterror) no such name (https://rubygems.org/gems/rack-test-0.6.2.gem) what should solve problem? it looks source either isn't responding or gem can't found @ source. try gem install rack-test . if gives error try switching source you're getting gem from. first add source gem source -a 'ht...

how to add c++11 support to syntastic vim plugin? -

Image
i using syntastic in c++11 project. when editing in vim, , save (:w) syntastic plugin gives me errors on every initializer list {} , each loops c++11 features it's missing. i installed syntastic using pathogen. here 2 examples of error getting on initializer lists , each loops (both c++11 compile fine): turns out c++ linter (syntax checker) of syntastic has many options can set on .vimrc (unfortunate, wish project specific, .clang_complete solution). to enable c++11 standards , use libc++ library clang (which project using) added following lines ~/.vimrc let g:syntastic_cpp_compiler = 'clang++' let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++' it works beautifully.

windows - How to check if a local user account still have the same password -

i have powershell script following on windows 7 computers: get random password secure server-side application reset password of specific local user account using password value as next step, want periodically check if password saved on server still valid. now, using validatecredentials system.directoryservices.accountmanagement.principalcontext (see powershell check local admin credentials ) involves unencrypt password , send computer purpose. do see better way check if password still valid avoiding use clear text password ? possible compare hash, or else ? regards. you can check attribute passwordage , little math see if last time password changed time set password.

ios - iphone - didSelectRowAtIndexPath: only being called after long press on custom cell -

Image
i creating 1 table view based application. have created custom table cell table, contains 2 labels, 1 image , 1 button. table view data source method working properly. using xib both custom cell , view controller class , connect delegate , data source file's owner. problem when select table row, didselectrowatindexpath not getting fire. mentioned way fire hold down on cell 3-4 seconds. have idea why happening? thanks pointers... here table view methods.. - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { return 1; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return [finaladdonsarray count]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; newcustomcell *cell = (newcustomcell*)[tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { nsarray *nib...

ruby on rails - Does foreman restart processes gracefully? -

i'm use foreman upstart export in production start infinite rake tasks. my humble "daemons" simple this: task magic: :environment loop make_stuff_happen sleep 10 end end i'd know if foreman doesn't kill processes when asked restart (eg. capistrano deploy), since don't want corrupt operations occur because of this. and if how prevent it? if export, may have file on configuration app-jekyll-1.conf contain this start on starting app-jekyll stop on stopping app-jekyll respawn exec su - username -c 'cd /some/directory; export port=5000; bundle exec jekyll serve -w >> /tmp/a pp.log/jekyll-1.log 2>&1' which configuration of ubuntu upstart. now when restart service upstart, call initctl restart http://upstart.ubuntu.com/cookbook/#restart calling initctl restart send sigterm signal job https://serverf...

How to remove UINavigationBar inner shadow in iOS 7? -

inner shadow example i'm trying put nav bar below other 1 make 1 tall nav bar. in ios 7 uinavigationbar has inner shadow on top , on bottom of it. need remove it. didn't found solution. looks shadow prerendered, in fact appears in 0.4 second after view appears. i've tried shadow still there. removed horizontal line below bar code: for (uiview *view in [[[self.navigationcontroller.navigationbar subviews] objectatindex:0] subviews]) { if ([view iskindofclass:[uiimageview class]]) view.hidden = yes; } but can't figure out how remove shadow. lot! i've tried this: [self.navigationcontroller.navigationbar setshadowimage:[[uiimage alloc] init]]; but code doesn't remove horizontal line below bar (this method needs custom background image). use xcode version 5.0 (5a11365x) the "horizontal" line @ bottom of navigation bar it's shadowimage. can removed applying empty uiimage . according documentation have set custom background ...

javascript - Marquee not displaying all text - cutting off at different points -

my marquee doesn't seem displaying text have placed in div. gets cut off @ point. idea how can show text? this code far (demo @ http://jsfiddle.net/ylwhe/ ) html <div id="marquee">they came down village, crossing ghostly forests, falling apart. bags full: garlands, amethysts, gold, frankincense, myrrh. incredible strings arrived them: heavenly sounds drew water marble stones, provoking visions never seen before. brought tired magicians? why had such music enchanted our sordid souls? no answer available? did need one? voices overheard told of incredible tales: children following mice, drowning, dead. fear turned shivering salty statues, unable back. many years later, explorers ventured , found tiny town, every inhabitant eternally still, imprisoned forever strange chords.</div> css #marquee { color: #000; height: 16px; padding-bottom: 5px; } js $(function() { var marquee = $("#marquee"); marquee.css({"overf...

jni - convert yuv to mp4 by ffmpeg on android -

i have convert yuv mp4 ffmpeg on android. when convert wav mp4 works well. when convert yuv or yuv + wav mp4, got errer message said error decoding aac frame header anybody knows happened? following full debug log transferyuv2mp4() enter __transfer_yuv_to_mp4() enter __transfer_yuv_to_mp4() argv[00/17] = ffmpeg __transfer_yuv_to_mp4() argv[01/17] = -loglevel __transfer_yuv_to_mp4() argv[02/17] = debug __transfer_yuv_to_mp4() argv[03/17] = -y __transfer_yuv_to_mp4() argv[04/17] = -i __transfer_yuv_to_mp4() argv[05/17] = /sdcard/111.yuv __transfer_yuv_to_mp4() argv[06/17] = -i __transfer_yuv_to_mp4() argv[07/17] = /sdcard/3.wav __transfer_yuv_to_mp4() argv[08/17] = -c:a __transfer_yuv_to_mp4() argv[09/17] = aac __transfer_yuv_to_mp4() argv[10/17] = -strict __transfer_yuv_to_mp4() argv[11/17] = experimental __transfer_yuv_to_mp4() argv[12/17] = -b:a __transfer_yuv_to_mp4() argv[13/17] = 56k __transfer_yuv_to_mp4() argv[14/17] = -preset __transfer_yuv_to_mp4() argv[15/17] = ul...

c# - Can't grasp the difference between Freeze/Inject/Register -

before starting, i'm big fan of autofixture, i'm still in curve of learning how use tool. having developed autofixture mr ploeh , contributors. so let's start question. according autofixture/automoq ignores injected instance/frozen mock the interesting part of above link given code mock<isettings> settingsmock = new mock<isettings>(); settingsmock.setup(s => s.get(settingkey)).returns(xmlstring); isettings settings = settingsmock.object; fixture.inject(settings); to mark answer can rewritten fixture.freeze<mock<isettings>>() .setup(s => s.get(settingkey)).returns(xmlstring); it looks syntaxic sugar, using freeze method way write in fluent interface creation of mock, configuration, , injection in autofixture container. after doing research on web, there're functional difference between freeze , inject. found question: https://github.com/autofixture/autofixture/issues/59 point answer how can freeze null instance ...

Inheritance and template method in C++ -

i stuck in problem of conception in c++ : i made pool template class same std::list stores objects , calls constructor placement new , destructor of stored object. then made objectallocator class has getobjectwithclass template method. want have class interface can have poolobjectallocator subclass acts bridge between objectallocator , pool template class. but there no way create getobjectwithclass virtual because template method. template <class t> class pool { ... public: t& getfreeobject(); ... } class objectallocator { public: template <class t> t* getobjectwithclass(); // need method virtual }; class poolobjectallocator : public objectallocator { std::map<int, void *> pools; public: template <class t> t* getobjectwithclass() { int type = t::gettype(); pool<t> *pool; if (this->pools.find(type) == this->pools.end()) { pool = new pool<t>(); pools[type] = pool; } else { pool = s...

c# - Compile a library without checking references -

Image
i given legacy solution not buildable due broken references, code etc. there 50 library-projects , need make slight change 1 of these library, compile library , use in production working system deployed. i don't want make long way making solution buildable, fixing hundreds of issues etc. is there way skip reference checking , build needed library? you can (taking backup , then) collect of dll/assemblies remove of projects don't build solution then include dll's directly reference via add reference -> browse , selecting dll's this work if can right dll's match source version trying rebuild. whilst should case (version control etc) - experience tells me can hardest part.

javascript - Possible ways of detecting Adblock? I've tried so many things -

so i've signed adsense , put in on url shortening project. ad displayed on header of site. (above navbar). , when users have adblock enabled, pretty ruins header part of site. now did research, found a topic here already, didn't me @ all. if has ways of detecting adblock, appreciate it! function handle_adsense_blocker() { if (typeof(window.google_jobrunner) == 'undefined') { // doesn't seem work opera if ( navigator.useragent.match(/opera/i) ) { return; } // replace adsense ads else } } // add window load event window.settimeout('handle_adsense_blocker()', 3000);

javascript - Method DrawImage in Firefox does not work correctly with green pixels? -

for example, when paint on canvas image of 1 pixel, , attempt see painted on canvas, different color? in code below, first image pixel has color rgba (0,255,0,255), when try bring him red component, 1 instead of 0, why? <html> <head> <meta charset="utf-8"> </head> <body> <div class="bg" align="center" id="head"> <canvas id="canvas" width="1" height="1"></canvas> </div> <div align="center"> <h1 id="result">loading...</h1> <i><pre id="nav">loading...</pre></i> <img id="img" src="data:image/png;base64,ivborw0kggoaaaansuheugaaaaeaaaabcayaaaaffcsjaaaaaxnsr0iars4c6qaaaarnqu1baacxjwv8yquaaaajcehzcwaadsqaaa7eazurdhsaaaansurbvbhxy2d4z/afaaqbaf9eluglaaaaaelftksuqmcc" height="10%" border="1" /> </div...

android - Saving object with linkedlist - error on API 10 -

when saving object linkedlist on android api 10 obtain error: 08-10 14:37:45.091: e/androidruntime(29845): fatal exception: thread-17 08-10 14:37:45.091: e/androidruntime(29845): java.lang.illegalargumentexception: no char field 'exponential' 08-10 14:37:45.091: e/androidruntime(29845): @ java.io.emulatedfields.put(emulatedfields.java:459) 08-10 14:37:45.091: e/androidruntime(29845): @ java.io.emulatedfieldsfordumping.put(emulatedfieldsfordumping.java:83) 08-10 14:37:45.091: e/androidruntime(29845): @ java.text.decimalformatsymbols.writeobject(decimalformatsymbols.java:591) 08-10 14:37:45.091: e/androidruntime(29845): @ java.lang.reflect.method.invokenative(native method) 08-10 14:37:45.091: e/androidruntime(29845): @ java.lang.reflect.method.invoke(method.java:507) 08-10 14:37:45.091: e/androidruntime(29845): @ java.io.objectoutputstream.writehierarchy(objectoutputstream.java:1219) 08-10 14:37:45.091: e/androidruntime(29845): @ java.io.objectoutputstream.wr...

html - Is it possible to remove a radio button group set to its default value from the get parameter list? -

this question getting "nice" short urls input form, "pure" html, when javascript off. form, gives user few choices, each in form of radio buttons, users alter @ 1 value default settings, or none @ all: <form method=get action="form.html"> setting 1: <input type="radio" name="val1" value="default1" checked>&nbsp;default value <input type="radio" name="val1" value="alt1">&nbsp;alternative value <input type="radio" name="val1" value="other1">&nbsp;other alternative value <br> setting 2: <input type="radio" name="val2" value="default2" checked>&nbsp;default value <input type="radio" name="val2" value="alt2">&nbsp;alternative value ... </form> so, when user submits form, url this: form.html?val1=defaul...

vb.net 2010 - Change the Bold properties -

i have problem in code: if richtextbox1.font.bold = true richtextbox1.font.bold = false else richtextbox1.font.bold = true end if here problem:"richtextbox1.font.bold = false" (this property readonly), need help. here's simple example: private sub button1_click(sender system.object, e system.eventargs) handles button1.click if richtextbox1.font.bold = true richtextbox1.font = new font(richtextbox1.font, fontstyle.regular) else richtextbox1.font = new font(richtextbox1.font, fontstyle.bold) end if end sub

Python: AttributeError: 'NoneType' object has no attribute 'start' -

got small issue, modified python module match new html template, giving me error if use , in old module working fine can point me have in order use new module , update website template. well, you're matching different regex: html_post_start = re.search('<div class="articleline2"></div>', html) vs html_post_start = re.search('<div class="excerpt"></div>', html) one matches, other doesn't (returning none ).

php - real_escape_string not cleaning up entered text -

i thought proper way "sanitize" incoming data html form before entering mysql database use real_escape_string on in php script, this: $newsstoryheadline = $_post['newsstoryheadline']; $newsstoryheadline = $mysqli->real_escape_string($newsstoryheadline); $storydate = $_post['storydate']; $storydate = $mysqli->real_escape_string($storydate); $storysource = $_post['storysource']; $storysource = $mysqli->real_escape_string($storysource); // etc. and once that's done insert data db this: $mysqli->query("insert newsstoriestable (headline, date, dateadded, source, storycopy) values ('".$newsstoryheadline."', '".$storydate."', '".$dateadded."', '".$storysource."', '".$storytext."')"); so thought doing take care of cleaning invisible "junk" characters may coming in submitted text. however, pasted text copied web-page html...