Posts

Showing posts from July, 2012

google analytics - How to fire a tag if certain element on the page? -

i'm trying fire tag if "id = success" element on page. possible? thank you. i assume use new interface (since old interface phased out in case). assume "success" element there when page loaded (i.e. not created dynamically). go variables, scroll down "user defined variables2 click "new", select "dom element". "selection method" preselected "id", can leave that. in "element id" enter the, well, id of element (i.e. "success" in case). variable hold text of "success" element. go triggers. click "new", select "pageview". in "trigger type" dropdown select "dom ready" (you can read id after elements have rendered). pageview provides event necessary fire tag. klick "fire tag on". in dropdown select custom variable previous paragraph. condition enter "contains" , 1 of words success element contains. alternatively sh

suse - RPM gives a warning during un-installation if file does not exist -

some files of rpm package (depending on conditions) deleted in %post scriptlet causes warning during uninstallation: "remove failed: no such file or directory" note: problem not occur in systems older versions of rpm , noticed on rhel7 , sles12. while trying figure out, found following code in rpm sources (fsm.c): /* * missing %ghost or %missingok entries not errors. * xxx: non-existent files ever actual error here? afterall * that's we're trying accomplish here, * , complaining job done seems kinderkarten * level "but turn!" whining... */ if (rc == rpmerr_enoent && missingok) { rc = 0; } /* * dont whine on non-empty directories now. might able * track @ least of expected failures though, * such when knowingly left config file backups etc behind. */ if (rc == rpmerr_enotempty) { rc = 0; } if (rc) { int lvl = strict_erasures ? rpmlog_err : rpmlog_wa

node.js - Unable to post form details using Express js -

my express code: var express = require('express'); var bodyparser= require("body-parser"); var app = express(); app.use(bodyparser.urlencoded({ extended: false })); app.set('view engine', 'ejs'); app.get('/', function(req, res){ res.render('default', {title: 'home', users: ['a', 'b', 'c']}); }); app.post('/me', function(req, res){ res.send("2nd page"); var t1= req.body.username; console.log(t1); }); my template: <form method="post" enctype="multipart/form-data" action="/me"> <input type="text" name="username"> <input type="password" name="password"> <input type="submit"> </form> i'm trying print form values in submitted page have not added jquery or in head section what&#

java - Add String Values from a for loop to list -

this question has answer here: how make new list in java 21 answers public static void printfiles(nodelist node) { (int = 0; < node.getlength(); i++) { node file = node.item(i); string nodevalue = file.getattributes().getnameditem("urlname").getnodevalue(); system.out.println(nodevalue); } } output: 0a4f171c-e0a4-4aa8-b43b-3989c235ff58.txt 0ccfa1a4-16b0-4e1f-abc9-e17907bb591f.txt 17c0545b-377e-4e0a-bb45-29f38fc91533.txt 3b341bf0-2cd7-46fe-a834-5b67804e5ff1.txt 48121209-d58e-4565-83b7-05062799be6e.txt 511b7a89-e4de-4f6e-9c8f-5ba65f675d7b.txt compress.txt dadadada.txt e0c44cb9-2b1c-444c-a429-64531ea6a9a0.txt e68b1d1d-9a66-4678-a6c1-76c64ae8be08.txt hgafgahfka.txt jdjajhdajdajd.txt test1.txt test2.txt i parsed xml document , got values through loop alues need in single plac

authentication - Restrict Auth & Session Cookies to a Subdomain in ASP.NET MVC5 -

i have multi-tenanted application several clients, distinguished subdomain: client1.mydomain.com client2.mydomain.com etc i'm using forms authentication , asp.net auth & session cookies on client set subdomain, e.g. client1.mydomain.com. means if browse client2.mydomain.com i'm not logged in , browser doesn't post client1 cookies. should be. however has been picked our security testing can take cookie values client1 , use values create cookies client2 (we've done in firebug). asp.net accepts these cookies , thinks you're authorised on client2. how can configure asp.net doesn't happen? the forms element in web.config allows set domain can't use i've multi-tenanted app. i'm setting cookie with formsauthentication.setauthcookie(username, false); but don't see why limit subdomain. you should add domain name user data of cookie. have switch cookie api: formsauthenticationticket ticket = new formsauthenticationticket(

console - asp.net (vb) pages with a dos style output display -

i have vb.net console app performs file maintenance actions such copying directories , files backup purposes. i have been asked create web based version of app can accessed, , use output style window similar audience used console app. essentially terminal/console style window embedded in asp.net page, display output progress on file copy activities. i can write copy , other file related commands. is possible? thanks help.

javascript - Call Angular-function upon $scope-variable change -

i new angularjs , trying set function gets called upon whenever variable changed. currently have dropdown-menu, ng-model bound $scope.userrating. , trying function gets called when user changes value using dropdown. i have been looking @ $watch, not quite sure on how work. tried make ng-click function on in html, ng-clicks don't seem trigger. you should use $watch . example- $scope.$watch('modalvarible',function(newval,oldval){ //do code } here on change of variable 'modalvarible' watch called.

unity3d - Google cardboard for unity disables AA on android device -

i'm developing simple vr app android using google cardboard sdk unity. i'm using unity 5(free), , latest version cardboard package unity(0.4.9), testing on sony xperia z3 compact(lolipop) , on samsung galaxy note 3(kitkat) the issue i'm having is, can't turn on anti-aliasing, or rather google sdk package, seems disable it. dont mind little jagged corners, thing corners flickering when far away enough. tried moving textures apart(since flickering result of overlapping), issue still persists. it can't issue unity exporting android, since if build same project(test example provided inside google cardboard unity package) using stock camera provided unity, insted of cardboard main gameobject), aa working. cant simpler that, once cube , 1 camera... have tried turning on , off 32-bit display buffer option in player settings, tried forcing open gl es 2.0 , various other tick/untick checkbox inside unity tips found across web, no success. so question is, else havin

Android Canvas SurfaceView -

i'm wondering 1 specific behavior drawing screen using surfaceview , canvas. when i'm locking canvas manipulating pixels of screen in surfaceview , there 1 thing need do: overdraw previous pixels of canvas e.g. color black or so. now happened me forgot , previous drawings visible in current frames. furthermore each layer drawn again , again if there not one(or 2 because on android drawings tripple buffered) buffer there generated more buffers , pixel data seems loaded out them layer layer. so drawings not overdrawn drawn layer layer mentioned. beside fact looks animated , not going "vsync" (refreshrate) of display plus leaving me wondering performance issues, fact annoys me because can't figure out why pixels set desperately. it should this: i draw circle @ x,y on first frame on 2nd draw circle @ x+1,y+1 now there 2 circles on canvas because haven't overwritten first frames pixels now going on , drawing circle each frame @ position.... n

asp.net - webclient request via authentication -

Image
i'm calling clients endpoint "get" json array. so var json = new webclient().downloadstring(url); they using authentication , have username , password. possible submit username , password. maybe need add custom headers? can't find exact examples i'm after 401 - unauthorized: access denied due invalid credentials. you may try specify credentials: var json = new webclient { credentials = new networkcredential(username, passwd) }.downloadstring(url);

unicode - Using UTF-8 for MySQL -

if assuming one-byte characters not work unicode characters, need pay attention before using utf-8 in mysql? there no single-byte 8-bit encoding in utf8. 2, 3, or 4 bytes long. for example, data containing single-byte 8-bit encoding such hex e9 é instead of 2-byte hex c3a9? in case need client has "latin1" saying set names latin1 , or equivalent in client language. if have c3a9, need set names utf8 . your table needs have character set utf8 either on table or column(s). if not address question, please elaborate. a lot more discussion found in my charset blog .

Azure virtual network for WebSite and VM -

Image
i have vm hosted in azure , use " manage acl " filter ip addresses allowed access. i need allow website hosted in same azure account, , same location (west europe) acces vm. i created virtual network , added dns vm , website, gives vm ip 10.0.0.5 , website 1 10.0.0.4 in subnet 10.0.0.0/11 . back " manage acl " gave access subnet and website : the problem: website still can't access vm ! doing wrong ? thanks. if vm still blocking traffic website, possible either vm firewall on way or accessing vm using public ip address. if want achieve acls in virtual network, better feature use network security groups .

java - Convert JavaUtilList to NSArray? -

using j2objc have javautillist: var javaarraylist:javautillist = javaarraylist() i want convert list nsarray: var arr:[string] = // ???? how can convert javautillist objective-c/swift nsarray? you use iterator cycle through every item: static inline nsarray *arraywithjavautillist(id <javautillist> list) { nsmutablearray *array = [[nsmutablearray alloc] init]; id <javautiliterator> iterator = [list iterator]; while ([iterator hasnext]) { id object = [iterator next]; [array addobject:object]; } return [nsarray arraywitharray:array]; }

html - Content following after jquery, bouncing instead of flowing -

what's wrong? content following jquery script not flowing it's relative position on jquery click. instead bouncing. http://jsfiddle.net/sywgrkep/1/ <div>hey you</div> you can use jquery .slidetoggle function. $("#pfcontainer_inner_phead_clicker").click(function () { $("#pfcontainer_inner_phead_slider").slidetoggle(200); }); http://jsfiddle.net/sywgrkep/3/

hibernate - Hibenate criteria API with "in clause" -

i have native sql, want move hibenate's criteria api, here is: select * hv_lma_vi t0 t0.hv_id in (select t2.hv_id z_lszerg_hv t4, z_lsz_erg t3, herstellungsvariante t2 ((t3.lsz_id = 204) , ((t4.hv_id = t2.hv_id) , ((t3.erg_id = t4.erg_id) , (t3.lsz_id = t4.lsz_id))))); all needed entites (hv_lma_vi, z_lszerg_hv, z_lsz_erg,) exist. from can understand of query, close to: detachedcriteria detachedcriteria = detachedcriteria.forclass(herstellungsvariante.class) .createalias("propertytot3", "t3") .createalias("t3.propertytot4", "t4") .add(restrictions.eq("t3.lsz_id", 204)) .setprojection(projections.property("hv_id")); session.createcriteria(hv_lma_vi.class) .add(property.forname("hv_id").in(detachedcriteria)) .list();

sql - Can someone tell me how to put a $ with numbers? -

i have query have use convert function return unitprice decimal 2 digits right of decimal , $ left of number. for example : 10 should $10.00 can tell me how insert $? this code far select convert(varchar, unitprice, 1) varchartotal dbo.[order details] this type of thing should always done in ui. surely wherever you're displaying data has way format value currency, , culture (what happens when need display euros or yen or different symbol?). that said, problem simple string concatenation can solve: select '$' + convert(varchar, unitprice, 1) varchartotal dbo.[order details] note: don't approve of ever being used in production environment. edit: there's confusion whether mean mysql or sql server. if you're using mysql, can't use convert here, can cast char instead: select concat('$', cast(unitprice char(20))) varchartotal dbo.[order details]

html - Hide img alt tag on image hover in Javascript? -

i want hide browser popup shows when hover images have alt attribute. i need attribute still on html pages, it's indexed google, don't want users see when hover image. does know how this? thank you! it's quick , dirty, rid of alt attributes on images. [].foreach.call(document.images, function(img) { img.setattribute('alt', ''); }); as scott pointed out, alt attribute isn't 1 responsible showing text on hover. can change script remove either. [].foreach.call(document.images, function(img) { img.title = ''; // property style syntax works });

call python cloud endpoint api from android app -

i have created api in cloud endpoint , deployed in app engine. in python. have generated library , have imported in project.its in import import com.appspot.corner_fresh.fresh_api.freshapi; how can access methods in api. have methods fresh_api.user.insert , fresh_api.user.detail . not detailed documentation of python endpoint. i tried final httptransport transport = androidhttp.newcompatibletransport(); jsonfactory jsonfactory = new jacksonfactory(); freshapi.builder builder = new freshapi.builder( transport, jsonfactory, null ); builder.setapplicationname( appname ); freshapi service = builder.build(); try { json response = service.fresh_api.users.list( ).execute(); toast.maketext(getapplicationcontext(), response.tostring(), toast.length_short).show(); } catch (ioexception e) { toast.maketext(getapplicationcontext(), "sexyfghfd", toast.length_short).show(); } but, first couldn't understand it. then, pass appname in builder.se

Save date in db using mysql in php -

i trying save date in mysql db in php, couldnt figure problem out code is: $effectivedate = strtotime("+1 hours", strtotime($time)); $new_date = date("y-m-d h:i:s",$effectivedate); mysql_query('update table set date=$new_date id='.$row['id']); but date never changes whats problem? you need quotes around date: mysql_query('update table set date="$new_date" id='.$row['id']) or die(mysql_error());

hash - Finding md5 of files recursively in directory in python -

i want find md5sum of files starting "10" ( exe, doc, pdf etc) hence not checking file extension start 2 digits. far i've script traverse through directory , print out such files couldn't checksum printed each of them: def print_files(file_directory, file_extensions=['10']): ''' print files in file_directory extensions in file_extensions, recursively. ''' # absolute path of file_directory parameter file_directory = os.path.abspath(file_directory) # list of files in file_directory file_directory_files = os.listdir(file_directory) # traverse through files filename in file_directory_files: filepath = os.path.join(file_directory, filename)

android - Maximo Anywhere WorkManager build failed -

i try build android apps while creating apps build failed following errors . d:\ibm\anywhereworkmanager\build.xml:87: following error occurred while executing line: d:\ibm\anywhereworkmanager\anywhere-apps-builder.xml:720: following error occurred while executing line: d:\ibm\anywhereworkmanager\anywhere-apps-builder.xml:716: failed building application: com.worklight.builder.exception.worklightbuildexception: java.io.ioexception: unable delete directory d:\ibm\anywhereworkmanager\apps\workapproval\android\native\assets\www\default\dojo\cldr\nls\zh-hans-mo. @ org.apache.tools.ant.projecthelper.addlocationtobuildexception(projecthelper.java:551) i know answer might seem obvious, if have of files mentioned in failure (d:\ibm\anywhereworkmanager\apps\workapproval\android\native\assets\www\default\dojo\cldr\nls\zh-hans-mo) open ( commandline, eclipse, other editor), cause issue.

Is it feasible to keep millions of keys in state of Spark Streaming job for two months? -

i'm trying solve (simplified here) problem in spark streaming: let's have log of events made users, each event tuple (user name, activity, time), e.g.: ("user1", "view", "2015-04-14t21:04z") ("user1", "click", "2015-04-14t21:05z") now gather events user analysis of that. let's output analysis of: ("user1", list(("view", "2015-04-14t21:04z"),("click", "2015-04-14t21:05z")) the events should kept 2 months . during time there might around 500 milion of such events, , millions of unique users, keys here. my questions are: is feasible such thing updatestatebykey on dstream, when have millions of keys stored? am right dstream.window no use here, when have 2 months length window , have slide of few seconds? p.s. found out, updatestatebykey called on keys on every slide, means called millions of time every few seconds. makes me doubt in design , i

c# - Wrapping entity framework exceptions on Open -

if user under service running doesn't have access database, ef fail following exception: system.data.entity.core.providerincompatibleexception: error occurred while getting provider information database. can caused entity framework using incorrect connection string. check inner exceptions details , ensure connection string correct. here's inner exception (that has specific details): system.data.entity.core.providerincompatibleexception: provider did not return providermanifesttoken string. ---> system.data.sqlclient.sqlexception: login failed user '[redacted]'. @ system.data.sqlclient.sqlinternalconnection.onerror(sqlexception exception, boolean breakconnection, action`1 wrapcloseinaction) @ system.data.sqlclient.tdsparser.throwexceptionandwarning(tdsparserstateobject stateobj, boolean callerhasconnectionlock, boolean asyncclose) @ system.data.sqlclient.tdsparser.tryrun(runbehavior runbehavior, sqlcommand cmdhandler, sqldatareader datastream, b

asp.net mvc - Suitability of an aging nuget package (RazorJS)? -

there's nuget package called razorjs ( http://www.nuget.org/packages/razorjs ) allows 1 use mvc razor engine syntax within .js javascript file. this package has 7k downloads nuget.org, given need use in commercial environment should concerned package last published 4 years ago in 2011 , therefore may not maintained ?

javascript - Get status from checkbox with PHP and Bootstrap CSS -

i trying create contact form using php , bootstraps css. got of things working, need status multiple checkboxes , post "labels" checked boxes in mail. know doesn't work simple , i've seen online pages using javascript or ajax etc. can't working, page: --update-- thank answer once again still getting 500 error page: http://prntscr.com/6u21xy <?php if(isset($_post['submit'])) { $message= 'full name: '.$_post['fullname'].'<br /> subject: '.$_post['subject'].'<br /> phone: '.$_post['phone'].'<br /> foreach($_post['check_list'] $check) { $message .= .$check . '<br>'; } email: '.$_post['emailid'].'<br /> comments: '.$_post['comments'].' '; require "phpmailer-master/class.phpmailer.php"; //include phpmailer class // instantiate class $mail = new phpmailer(); /

java - Spring Boot/Web with MySql database -

i have read various question, spring tutorials , looked @ different example projects, still not it. among others these: unable connect spring mysql http://www.codejava.net/frameworks/spring/spring-mvc-with-jdbctemplate-example my goal gradle spring boot/web application connects mysql database . my problem there many different ways configure project. i use few xml possible. so question is, whether possible achieve goal without having single xml file , if - how? or if need xml file(it should pom.xml think). explanation why need , file in general. please note: have 0 knowledge how configure spring, mysql, hibernate. things may straightforward you, unclear me. appreciate explanantions. edit2 : i got sample application running using spring initializer but, sample application uses maven - uses pom.xml: <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.

jquery - Pass question mark url with Ajax load in a div -

i have simple ajax-load function loads php file div '#content_box' via form. month , year parameters determined respectively #dm , #dy. submit button has passed id #ds. wondering, best way pass these parameters browser url (i.e. how obtain url such www.site.com/ddchart?dm=june&dy=2014&ds=go )? $(document).ready(function(){ $('#df').submit(function(){ var month_ddchart = $('#dm').val(); var year_ddchart = $('#dy').val(); source_ddchart = '/data/ddc-'+month_ddchart+'-'+year_ddchart+'-body.php'; $('#content_box').load(source_ddchart); event.preventdefault(); }); });

javascript - Autocomplete Jquery, and show results -

how can create search, autocomplete json file, , after submit value show resultes in new page data of value selected here html file: <form action="/dosomething"> <input/> <button type="submit"></button> </form> my json file : [ { "title": "stackoverflowsite1", "link": "www.stackoverflow.com" }, { "title": "stackoverflowsite2", "link": "www.stackoverflow2.com" }, { "title": "stackoverflowsite3", "link": "www.stackoverflow3.com" } ] how can parse data autocomplete , showing results after that's ? please, , thank ! form submit whatever action have directed to. call autocomplete on field want fill, define data, , should off races. <form action="/dosomething">

java - Hot to show only two digits after decimal using double -

i use: pricetextview.settext(string.format("%.2f",price)); price double. works when have retrieve value textview , convert double following error: java.lang.numberformatexception: invalid double: "1,2" is there way same thing , avoid error? here code complete: double prezzodouble = double.parsedouble(this.prezzo); prezzotextview.settext(string.format("%.2f", prezzodouble)); quantitasceltaedittext.addtextchangedlistener(new textwatcher() { string prezzounitario=prezzo; public void aftertextchanged(editable s) { int quantitasceltaint = integer.parseint(quantitasceltaedittext.gettext().tostring()); if(quantitasceltaint>=1) { string prezzototale = string.valueof(string.format ("%.2f", (calcoloprezzototale()))); prezzotextview.settext(prezzototale); } else { prezzotextview.settext(prezzounitario); } } public void beforetextc

java ee - Accessing a JSP via a Servlet -

Image
i learning java ee , i'm pretty new mvc development, thank in advance patience. i'm trying write simple jsp accessible via servlet, getting 404 error when try reach following urls : http://localhost:8080/pro/inscription http://localhost:8080/inscription i don't see went wrong, or forgot write. appreciate in regard. here project tree structure (eclipse): here files have developed. inscription.jsp <%@ page pageencoding="utf-8" %> <!doctype html> <html> <head> <meta charset="utf-8" /> <title>inscription</title> <link type="text/css" rel="stylesheet" href="/inc/styles/css/form.css" /> </head> <body> <form method="get" action="inscription"> <fieldset> <legend>inscription</legend> <p>vous pouvez vous inscrire via ce formulaire.</p> &l

mvcrazortopdf - Cannot renders nested list within divs correclty in itextsharp -

i use itextsharp & mvcrazortopdf generate pdfs in azure websites. nested lists in div tags or table cell cannot rendered correctly - become 1 single line. here example: <div> <ul> <li> test1 <ul> <li>test1.1</li> </ul> </li> <li>test2</li> </ul> </div> http://demo.itextsupport.com/xmlworker/ in demo page rendered as: test1 test1.1 test2 any appreciated!

rstudio - Multiple conditions for ifelse statements in R -

this question has answer here: how create vector indicating matches between elements of 1 vector , element in another? 1 answer responses$status has multiple statuses: invited, attended, registered, downloaded, sent, added i tried create new binary column using code: responses$hasresponded <- ifelse(responses$status == c("responded", "attended", "downloaded", "contacted", "requested"),1,0) this code runs, not doing want do. is, code 1 of these statuses ("responded", "attended", "downloaded", "contacted", "requested") , , 0 rest. %in% friend. splitting bit readability: okresp <- c("responded", "attended", "downloaded", "contacted", "requested") responses$hasresponded <- as.numeric(

microcontroller - how are function addresses cast or assigned for interrupt vectors in C? -

let's have micro controller , know when receives interrupt jump address 0x8000 (just example). how define in c, seems might similar casting address variable can read or write memory. usually support package comes pragma statement or other way indicate interrupt code is. want understand how in standard c. kind of function pointers or something? not straight c answer here, here's how i've seen done on systems i've worked with: the best way place function @ address use linker script of sort. lets control how code align , run. not sure flavor of c using, i've used had ability set locations via linker. next up, define pointer @ location "jump" instruction wherever want interrupt code live. best done assembler , .org statement though. how did on old hardware allowed change vector did changing actual jump op-code point elsewhere.

javascript - busboy won't receive uploaded files -

my form simple. uses ng-flow handle file uploads: <form class="form-horizontal" enctype="multipart/form-data"> <div flow-init="{target: '/test', testchunks: false, query: {'_csrf': '{{csrf}}', 'somestring': 'teststring'} }" flow-files-submitted="data.flow.upload()" flow-name="data.flow"> <input type="file" flow-btn/> </div> </form> once image selected, ng-flow post target route. seems image sent since request payload has bunch of things like: 1048576 ------webkitformboundaryw2yag9m602icpd0q content-disposition: form-data; name="flowcurrentchunksize" the image isn't big (~1mb) on nodejs side (with express): var busboy = require('connect-busboy')({ limits: { filesize: 10 * 1024 * 1024 } }); router.post('/test', busboy, function(req, res) { console.log('t

c# - Inserting method differences between EF4/6 -

Image
i began using ef6. in past insert object, code fake example (i'm writing medical software, hence, vitals) : using (databasethingy objectcontext = new databasethingy(connection)) { vitals pcrvital = vitals.createvital(0, pcrentity.idpcr, timetaken, pulse); objectcontext.vitals.addobject(pcrvital); objectcontext.savechanges(); return pcrvital; } now read tells me so: using (databasethingy objectcontext = new databasethingy(connection)) { vitals pcrvital = new vitals(){ idvitals = 0, idpcr = pcrentity.idpcr, timetaken = timetaken, pulse = pulse }; objectcontext.vitals.add(pcrvital); objectcontext.savechanges(); return pcrvital; } the first method not exist when use ef6. benefit first method auto create constructor minimum (non nullable) columns ( edit ) if edmx generated off of existing database. simple thing go check database see required, having list auto put constructor quite wo

config - nginx ignoring some websites -

i have serious problem. it arised when editing website. html wasn't rendered correctly , shortly after "welcome nginx!" default page. tried renaming website in ispconfig , create new 1 old domain, still same problem. problem arises, when create new websites. nginx redirecting default site. but many other websites working fine! altough have same config... i'm confused , hope can me! i soluted problem. it because of line: fastcgi_pass 127.0.0.1:9093; i changed fastcgi_pass 127.0.0.1:9000; and works o_o

xml comments - C# XML Documentation of methods in Abstract classes -

i have generic abstract base class has methods on it. methods have xml comments on them such: /// <summary> /// controller working instances of {tmodel} /// </summary> public abstract class basecontroller<tmodel> : apicontroller { /// <summary> /// creates {tmodel}. /// </summary> [httppost] public task<tmodel> post([frombody] tmodel model) { ... return ... } } i able implement such: /// <summary> /// controller working instances of personmodel /// </summary> public class personcontroller : basecontroller<personmodel> { } and have xml comments generated personcontroller mimic comments on base class. allow fancy https://github.com/domaindrivendev/swashbuckle pick xml comments , display them nicely personcontroller. currently comments come out follows: <?xml version="1.0"?> <doc> <assembly> <name>mylibrary</name>

R Droplevels Function Fail With Factor -

my dataframe named 'data' contains variable named 'income' 26 levels. want delete or drop level 'refused' there 25 levels. below truncated printout of levels. see number 26 'refused': > levels(data$income) [1] "under $1 000" "$1 000 2 999" "$3 000 3 999" , on... [25] "$150000 or over" "refused" i researched droplevels function , tried this: data <- droplevels(income$refused) this: droplevels(data, income$refused) and this: data %<>% droplevels(income$refused) i think problem may class factor. documentation on droplevels isn't easy decipher. droplevels() drops values not in use; can't use drop explicit levels. if want drop rows "refused" , drop levels factor, use this droplevels(subset(data, income!="refused"))

python - Django - present current date and time in template -

the tittle pretty self explanatory. how can 1 present current data , time in django's template? try using built-in django template tags , filters: https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#now example: it {% "js f y h:i" %}

c++ - How can I make a library framework available in Xcode 6 on OS X 10.10? -

Image
i had working on os x 10.9. i've imported library framework (aubio) 10.10 sdk folder: / applications ▸ xcode.app ▸ contents ▸ developer ▸ platforms ▸ macosx.platform ▸ developer ▸ sdks ▸ macosx10.10.sdk ▸ system ▸ library ▸ frameworks it shows in xcode. when go compile project tells me can't find header. so have import framework, manually each time project gets resaved (which can quite when using introjucer ). shows 2 copies of framework. able use import statement , build project. how can framework recognised xcode can compile project without re-importing each time? in introjucer go build-config , scroll down "extra frameworks". insert name of framework there. (at picture ios build config, it's same osx.) tip: should check juce forum: http://www.juce.com/forum there lot of people advanced juce-knowlege.

osx - Why does Xcode use the old build path after moving a project's containing directory? -

i have created simple osx command line app project xcode 6.3, called foo , , set location of foo ~/desktop . building , running project fine. clear, project path ~/desktop/foo/foo.xcodeproj . if move project's containing directory ~/desktop/foo to, ~/desktop/tmp/foo , open ~/desktop/tmp/foo/foo.xcodeproj , , build project, see xcode creates ~/desktop/foo/build/ , on. seems xcode still using old build path rather build directory relative project ( ~/desktop/tmp/foo/build/ ). why this? using typical installation of xcode , have not modified configuration of xcode nor project or build settings. xcode 5 did not behave way. yes, project has been cleaned. i can attribute accumulated cruft after installing, removing, , updating xcode various 6.x betas on past year. after deleting xcode configuration via defaults delete com.apple.dt.xcode , things behaving expected.

Watir-webdriver click action returns true/success but does not really do the click action -

i have span element cascades div, @ button text "okay,got it." . html follows: <span class="dijit dijitreset dijitinline defaultbutton xwtbutton xwt-textbutton xwt-textbuttonfocused dijitfocused" role="presentation" widgetid="xwt_widget_form_textbutton_2"> <span class="dijitreset dijitinline dijitbuttonnode" role="presentation" data-dojo-attach-event="ondijitclick:__onclick"> <span id="xwt_widget_form_textbutton_2" class="dijitreset dijitstretch dijitbuttoncontents" aria-labelledby="xwt_widget_form_textbutton_2_label" role="button" data-dojo-attach-point="titlenode,focusnode" tabindex="0"> <span class="dijitreset dijitinline dijiticon dijitnoicon" data-dojo-attach-point="iconnode"></span> <span class="dijitreset dijittogglebuttoniconchar">\u25cf</span>

c# - android emulator get connection to localhost visual studios -

oh ok on android emulator trying parse json , using visual studio c# web service in between. each time fire of emulator returns null, how can fix this? have uploaded json file website , works correctly can't see make work on emulator. file called tryjson.json , can on internet using http://localhost:62446/tryjson , website http://www.website.com/tryjson on emulator trying http://10.0.2.2:62446/tryjson , http://10.0.2.2/tryjson yet return null can possibly wrong? know json correct because if http://www.website.com/tryjson in emulator url comes back. issue localhost connection not know what. the alias " http://10.0.2.2:62446/tryjson " should have worked, since documentation says localhost requests should use adress ( http://developer.android.com/tools/devices/emulator.html ). but try using ip adress. if use windows, open cmd , type ipconfig you should see ip adress, 192.168.x.xxx. use in url app requesting.

file permissions - Regardind a Java sandbox -

i have stack of .java files submissions programming contest. want run said files (in sandbox) , expect them accept input text file (provided me) , save output text file. what permissions should using make sure untrusted .java files can only output text file desired file location? if running in unix, can create user has permissions output in folder. long aren't running admin rights should pretty easy.

java - Jenkins: Duplicate building of jars in a single build -

i using jenkins 1.596 along maven 3.1.1. have multiple branches in repository , using following goals build: '-t 5 clean install' when start build, shows following log: started user anonymous building in workspace /var/lib/jenkins/jobs/<my_job>/workspace > git rev-parse --is-inside-work-tree # timeout=10 .... [workspace] $ /usr/local/apache-maven/apache-maven-3.1.1/bin/mvn -s /var/lib/jenkins/.m2/settings.xml -t 5 clean install [info] scanning projects... it shows projects , reactor build order. executes tests , builds jars. following success message gets displayed after completion of build: build success [info] ------------------------------------------------------------------------ [info] total time: 3:39.752s (wall clock) [info] finished at: wed apr 15 00:02:57 bst 2015 [info] final memory: 104m/406m now, issue is, after success message, repeats whole build again. starts scanning poms, downloads jars, executes tests , again, can see success message

how do I tell rails to not render html for json requests? -

if make curl request api endpoint , there problem (in development), see: >curl --user me:mypassword http://localhost:3000/api/v1/magic_endpoint.json <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>action controller: exception caught</title> <style> ... stuff <body> <header> <h1> activerecord::pendingmigrationerror </h1> </header> ... more stuff which annoying , obnoxious. how can tell rails not return html when json asked for? have seen many questions similar on here answers redirect 404/500 in routes.rb custom errors controller , manually render json 'internal error' or 'not found', not want that. rails outputting actual error, in case, activerecord::pendingmigrationerror , , don't want hide that.. don't want have visually parse bunch of html markup figure out error is. you add

jquery - Fading between svg sprite background-position using background-check.js -

i have logo on site need fade between light , dark version. logo on moving slider, , using brilliant 'background-check' script ( http://www.kennethcachia.com/background-check/ ) determine logo should displayed. script achieves applying class logo, either 'background--light' or 'background--dark'. these classes determine solely background-position of svg sprite si displaying logo. currently, change of classes means logo 'moves' place rather fades, , none of standard solutions have found online such adding state change work working these classes. can point me in right direction? pure css solution preferable, open jquery if required. thanks markup <a href="#" class="logo check">logo</a> css .logo.background--dark { background: url(images/ui-sprite.svg) no-repeat -120px 0; } .logo.background--light { background: url(images/ui-sprite.svg) no-repeat 0 0; } this has been solved, adding second logo elemen

ruby - Unicorn error adding listener -

i having issues getting unicorn server , running. try run unicorn using: bundle exec unicorn -c /var/www/docninja/unicorn.rb -e development -d -p 8080 i following error: i, [2015-04-14t23:54:52.117609 #123] info -- : listening on addr=/var/www/docninja/tmp/sockets/unicorn.docninja.sock fd=10 i, [2015-04-14t23:54:52.118624 #123] info -- : listening on addr=0.0.0.0:8080 fd=11 i, [2015-04-14t23:54:52.119553 #123] info -- : worker=0 spawning... i, [2015-04-14t23:54:52.127642 #123] info -- : master process ready i, [2015-04-14t23:54:52.129109 #126] info -- : worker=0 spawned pid=126 i, [2015-04-14t23:54:52.129559 #126] info -- : refreshing gem list f, [2015-04-14t23:59:07.536943 #130] fatal -- : error adding listener addr=/var/www/docninja/tmp/sockets/unicorn.docninja.sock /usr/local/rvm/gems/ruby-2.1.2/gems/unicorn-4.8.3/lib/unicorn/socket_helper.rb:152:in `bind_listen': socket=/var/www/docninja/tmp/sockets/unicorn.docninja.sock specified not socket! (argument$

android tablelayout fixed columns - not getting desired results -

i new android development. i've tried linearlayout , tablelayout . i need simple fixed scrollable table 3 columns, can't single list rows need...i have listview , listactivity adapter sorted. basically want: 3 columns fixed widths, adjusting different screen sizes (thus percentages?) the first column has title , should largest. if text exceeds space, ellipsize it the second column price third column icon , should far right |-----------------------------------------| | title exceeds th....| $500 | icon | | title fits | $1000 | icon | | other title | $25 | icon | | long title th... | $1200 | icon | |-----------------------------------------| this latest xml: <?xml version="1.0" encoding="utf-8"?> <tablelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <tablerow&

javascript - Updating ng-repeat on changes to scope properties not associated with bound data -

i'm working on angular (1.2.1) app, , i've got directive ng-repeat in template so: <div ng-repeat="item in list | filter: filterlist"></div> <button ng-click="setcolormode('red')">show red items</button> <button ng-click="setsizemode('small')">show small items</button> <!-- etc... --> something in directive controller: $scope.list = [ { color: 'red', size: 'large' }, { color: 'blue', size: 'small' } //... ] $scope.colormode = null; $scope.sizemode = null; $scope.setcolormode = function(value){$scope.colormode = value;} $scope.setsizemode = function(value){$scope.sizemode = value;} $scope.filterlist = function(item){ if ($scope.colormode){ if ($scope.colormode != item.color) return false; } if ($scope.sizemode){ if ($scope.sizemode != item.size) return false; } return true; } colormode

javascript - Make a div to fill the rest of the available screen height -

Image
i have structure: i make content2's min-height = height of screen - height of other divs . with html/css below, outcome greater screen height. how can wanted? copyright part (footer) inside content2, want make content2's height exact in screen. body { margin:0; border:0; background-color:#24373b; color: #fff; } #headerbg { min-width:980px; background-color:#000; } #header { width:980px; } #content1 { width:980px; } #content2 { width:960px; padding:10px; margin-top:30px; background-color:#355258; min-height:100hv; } <body> <div id="headerbg"> <div id="header">header</div> </div> <div id="content1">content1</div> <div id="content2">content2</div> </body> you using 100hv instead of 100vh min height. fixed: #content2{ width:960px; padding: