Posts

Showing posts from May, 2012

java - Ignore android generated files fro, GIT -

Image
i working on android (on windows os) project , don't want submit generated files. created .gitignore file in root dir notepad , added lines: shale/bin/classes/com/shale/activities/ shale/gen/com/shale/activities/ but when running in cmd git status see this: what should make git ignore this? i know git reading .gitignore file, because have create text file test.txt , added . gitignore , git ignored it. thanks it seems you've committed files before adding them .gitignore. try remove them command (it won't delete files): git rm --cached <your-files> commit changes, , on, git should ignore changes files. additionally can check out example .gitignore android projects .

uml sequence diagram - modelling generic behaviour that is applied to operations -

Image
i have sequence diagram client makes initial call set session. after initial call, every subsequent operation (e.g. call x, call y, call z) called on server checked see if session exists. there way describe behaviour generically without having show each , every call? guess 1 option add note, there may better way? since sequence diagram show particular execution (client , server should :client , :server in diagram) difficult introduce factorization. use interactionuse reuse sequence fragment in case not since have 1 message ("check session"). don't forget diagrams views of systems , particularly sequence diagrams view of particular transaction. don't have show in diagram. need not show "check session" messages in diagram , use 1 show server checks session, maybe state diagram.

Why isn't my html responding? -

my html doesn't show content wrote. objective i'm trying accomplish make button on right "div" make random joke out of 5 spawn on left div. problem don't know how make function make button spawn joke. joke in separate html use replace default 1 in left div when load html. i'm sorry if that's incoherently confusing, thank committing. this have far: the primary html: <html> <head> <title>free jokes!</title> <meta charset="utf-8"> <link href="final project.css" rel="stylesheet"> </head> <body> <h1 id="shadow">welcome free jokes!</h1> <div id="left" src="left.html"/> <div id="right" src="right.html"/> </body> </html> the left div html: <!doctype html> <html> <head> <title>free jokes!</title> <script> var ran

Jquery color pallete exctraction from url/website? -

is there jquery plugin or tool enables extract pallete of (for example) 3 colors or hex/rgb values websites according url you've entered? i'm trying include on webpage google , did not find that, similar pages so. for example perfect example of i'm searching to: http://www.colorcombos.com/grabcolors.html i suppose there more behind of beside jquery... idea? any , suggestion appreciated. this requires server side approach, e.g. loading page/stylesheet php , analyzing contents.

java - i got "login failure all modules ignored" exception when i try to use my custom login module on jboss 7.1 -

i got "login failure modules ignored" exception when try use custom login module on jboss 7.1 . trying use module jboss module , lib class got exception , stack: error [org.jboss.security.authentication.jbosscachedauthenticationmanager] (http--127.0.0.1-8088-1) login failure: javax.security.auth.login.loginexception: login failure: modules ignored @ javax.security.auth.login.logincontext.invoke(logincontext.java:921) [rt.jar:1.6.0_20] @ javax.security.auth.login.logincontext.access$000(logincontext.java:186) [rt.jar:1.6.0_20] @ javax.security.auth.login.logincontext$4.run(logincontext.java:683) [rt.jar:1.6.0_20] @ java.security.accesscontroller.doprivileged(native method) [rt.jar:1.6.0_20] @ javax.security.auth.login.logincontext.invokepriv(logincontext.java:680) [rt.jar:1.6.0_20] @ javax.security.auth.login.logincontext.login(logincontext.java:579) [rt.jar:1.6.0_20] @ org.jboss.security.authentication.jbosscachedauthenticationmanager.default

How can I add values to an AngularJS <select> without changing the data source? -

i have coded following: <select data-ng-disabled="!option.selectedsubject" data-ng-model="option.selectedcontentstatus" data-ng-options="item.id item.status item in option.contentstatuses"> <option style="display: none" value="">select content status</option> </select> this give me list of statuses me select from. add 1 addition list value of "99" , name of "all". tried: <select data-ng-disabled="!option.selectedsubject" data-ng-model="option.selectedcontentstatus" data-ng-options="item.id item.status item in option.contentstatuses"> <option style="display: none" value="">select content status</option> <option value="99">all</option> </select> but not work. see select content status , additional option 99 not appear. is there way can make possible a

iphone - Xcode Exit with Error 254 in iOS sdk -

first of all, know there many questions on topic couldn't find solution me. suddenly,i getting clang error follow: 1. /volumes/xcode/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator6.0.sdk/system/library/frameworks/corefoundation.framework/headers/cfstring.h:154:2: current parser token 'if' clang: error: unable execute command: segmentation fault: 11 clang: error: clang frontend command failed due signal (use -v see invocation) apple clang version 4.1 (tags/apple/clang-421.11.66) (based on llvm 3.1svn) target: i386-apple-darwin11.4.0 thread model: posix clang: note: diagnostic msg: please submit bug report http://developer.apple.com/bugreporter/ , include crash backtrace, preprocessed source, , associated run script. clang: error: unable execute command: segmentation fault: 11 clang: note: diagnostic msg: error generating preprocessed source(s). command /volumes/xcode/xcode.app/contents/developer/toolchains/xcodedefault

python - Switching between editor and console in PyDev -

i use key combination ctrl + alt + enter send code selection eclipse (juno) pydev editor interactive console. passes control console. i wondering if there way automatically (or using shortcut) return control code editor. in preferences of eclipse, go "pydev/editor/interactive console" , uncheck "focus console when evaluate command sent editor". leave focus in editor, while evaluating code in console.

hbase - GWT-RPC method returns empty list on success -

i creating webpage having celltable.i need feed table data hbase table. i have written method retrieve data hbase table , tested it. but when call method gwt asynchronous rpc method rpc call succeeds returns nothing.in case returns empty list.the alert box show list's size 0. following related code. please help. greetingservice.getdeviceiddata(new asynccallback<list<devicedriverbean>>(){ public void onfailure(throwable caught) { // show rpc error message user system.out.println("rpc call failed"); window.alert("data : rpc call failed"); } public void onsuccess(list<devicedriverbean> result) { //on success window.alert("data : rpc call successful"); //devicedatalist.addall(result);

c# - Unity resolves last registration when class registered with multiple interfaces -

public interface { } public interface b { } public interface c : a, b { } public class foo : c { } iunitycontainer unity = new unitycontainer(); unity.registertype<a, foo>(new transientlifetimemanager(), new injectionfactory(container => { throw new exception(); })); unity.registertype<b, foo>(new transientlifetimemanager(), new injectionfactory(container => { throw new exception(); })); unity.resolve<a>(); //uses registertype<b, foo> injectionfactory i expected unity use "a" injectionfactory. unity maintains 1 build plan per build key second registration overwriting first registration (for foo). when registering, first mapping created between , foo , second applies injection members target type (foo) based on build key (type: foo, name: null). so, mapping between , foo separate injection members applied foo. to illustrate more overwriting of registration, believe following functionally equival

python - Fail to install lxml in MacOS 10.8.4 -

i having trouble installing lxml mac os. having following error when building it. error have when using pip install lxml /private/var/folders/9s/s5hl5w4x7zjdjkdljw9cnsrm0000gn/t/pip-build-khuevu/lxml/src/lxml/includes/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found i have installed libxml2 brew: brew install libxml2 brew link libxml2 --force i'm new mac. in ubuntu, mean libxml2-dev package must installed. updated: here pip.log: "~/.pip/pip.log" 124l, 8293c requirement_set.install(install_options, global_options, root=options.root_path) file "/usr/local/cellar/python/2.7.5/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1185, in install requirement.install(install_options, global_options, *args, **kwargs) file "/usr/local/cellar/python/2.7.5/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.eg

ajax - Read dynamically created elements data attribute in jquery? -

this code http://jsfiddle.net/amolw/6kdhg/ buttons created dynamically (usually data buttons come through ajax request). simplicity i've hard coded values. problem when execute thishotel = $(this).data('hname'); undefined in variable thishotel . same thing happens if replace buttons anchor tag. this in example div id=hotels . have worked if have gone div , selected button. propose solution though. http://jsfiddle.net/6kdhg/3/ you can use target of event information want. $("[id^='hotel']").on('click', function (e) { thishotel = $(e.target).data('hname'); $("#selected").html("selected hotel " + thishotel); }); e event got triggered , access it's target.

regex - Scrape div contents using PHP and cURL -

i'm new curl. have been trying scrape contents of this amazon link , (ie., image, book title, author , price of 20 books) html page. far i've got print page using below code <?php function curl($url) { $options = array( curlopt_returntransfer => true, curlopt_followlocation => true, curlopt_autoreferer => true, curlopt_connecttimeout => 120, curlopt_timeout => 120, curlopt_maxredirs => 10, curlopt_url => $url, ); $ch = curl_init(); curl_setopt_array($ch, $options); $data = curl_exec($ch); curl_close($ch); return $data; } ?> $url = "http://www.amazon.in/gp/bestsellers/books/1318209031/ref=zg_bs_nav_b_2_1318203031"; $results_page = curl($url); echo $results_page; i have tried using regex , failed; have tried possible 6hrs straight , got tired, hoping find solution here; isn't enough solution tq in advance. :) update: found helpful site (click he

html - CSS, Width:100% and the iPhone - what more can I try? -

i quite way through pretty css solution make mobile site our e-commerce site. it's going quite well, apart fact x-axis consistently has margin shouldn't there - have put in css width 100% properties. the thing has worked in visual practice (it made y-scrolling stuttery) addition of: html { overflow-x:hidden; } so although looked great , wanted couldn't scrolling fixed, pointless mobile site. on top of added page detect screensize: <meta name="viewport" content="width=device-width,initial-scale=1" /> i think somewhere media query causing havoc: @media screen , (max-width: 480px) { because place specifies 480px aspect of anything, , that's margins continue to. i'm doing wrong here? in hindsight i'm not entirely sure got 480px - think copy , paste job! other things have tried removing absolute positioning lot of elements, making sure has width of auto , displaying in block. i'm out of ideas , want overflow-x

javascript - blur event fired on scroll of div on IE -

i have text box user types something, suggestions shown above textbox. these suggestions wrapped inside "div" , can scroll if exceed height. inputfld.on("blur", function(){ //some code close suggestion div if clicked outside inputfld (with check click on suggestion item) }); thus above code if click outside inputfld, hide "suggestions" div wrapper. now issue when there lot of suggestion items , scrollbar. if try scroll through items on ie, blur event gets fired , closes suggestions wrapper div. this not happen on other browsers though. how handle on ie? you can try catch clicks , check if click on else suggestion div: $("body").bind('click', function(e) { var target_div_id = e.target.id; //get id of clicked element if (target_div_id !== 'suggestion_div') { //check whether clicked element = suggestion_div $('#suggestion_div').hide(); } });

shell - How to print the name of my current directory's parent directory -

i hope phrased question clearly. specifically, this: i use test or perhaps case statement determine if directory name contained in variable $dir either current directory (.) or it's parent directory (..) of course can echo current directory (echo $pwd), simplest way echo parent of $pwd? thanks. you can use ${pwd%/*} : $ echo $pwd /home/me/test/t $ echo ${pwd%/*} /home/me/test as expression ${pwd%/*} stripping shortest match of /* of $pwd : from bash reference manual → 3.5.3 shell parameter expansion : ${parameter%word} the word expanded produce pattern in filename expansion. if pattern matches trailing portion of expanded value of parameter, result of expansion value of parameter shortest matching pattern deleted. if parameter ‘@’ or ‘ ’, pattern removal operation applied each positional parameter in turn, , expansion resultant list. if parameter array variable subscripted ‘@’ or ‘ ’, pattern removal operation applied each member of array in tu

java - How to depend on two different versions of a library? -

i using elasticsearch , jackrabbit (or...i trying too). jackrabbit seems depending on lucene 3.6.x , elasticsearch depending on 4.3.1. using maven , jboss 7.1.1. lucene 4.3.1 on classpath h*** breaking loose in log because jackrabbit requires older lucene. how solve this? you need take conflicting libraries wish use (elastic search , jackrabbit) , make both jboss as7 modules . jboss 7 modular classloading can "contain" each of them own dependencies separate module , expose application api use. its bit complicated (full docs here ) allow have each of them use own version of lucene - each packed module of theor dependency tree. edit - there's more info on how export of module's content in te jboss modules documentation . want make sure dont export lucene out of of modules

javascript - Jquery qtip error in IE7 and 8 , click on link does not work at the first time -

i'm using qtip 1 build tooltip hyperlinks. works fine in browsers except ie7.. works when click twice on link. when click first time on link debugger not throw exception print : [object object] console. which not give me idea error.. what cause behavior ?

jquery mobile - <input /> leaves its outlines on other pages -

i have input box placed in header data-role="header" of jquery mobile page. <form id="form-search" class="form-search" style="display: none; background-color: #fff; border-bottom: 1px solid #ccc;"> <input type="search"** placeholder="enter search query" name="search-query" id="search-query" value="" data-mini="true" /> </form> when form gets submitted, page changed $.mobile.changepage() there still outline search box. how possible? i tried using blur() on inputbox after form submitted doesn't work. place inputbox leaves trace on other page.

c# - Errors in named query (NHibernate) -

using hbm file: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping assembly="brokerplatform.core" namespace="brokerplatform.core.model.common" xmlns="urn:nhibernate-mapping-2.2"> <import class="ratingdto, brokerplatform.core"/> <import class="clientdto, brokerplatform.core"/> <import class="documentdto, brokerplatform.core"/> <import class="userdto, brokerplatform.core"/> <resultset name="ratingsresultset"> <return alias="rv" class="ratingdto, brokerplatform.core"> <return-property column="rv.id_rating" name="id_rating" /> <return-property column="rv.total" name="total" /> <return-property column="rv.rating" name="rating"></return-property> </return> <return-join alias="u

ios - Save a Single row of an entity in coredata instead of whole entity or context -

i developing app need download images server , save them in core data. want when each single image come must save in core data database. when image complete download generates notification want save row containing image in core data not full entity or context. plz if can thankfull him. you couldn't save property of entity. in general don't care save , how saved, because save context changes.

android - Dialogue Like Activity is not Finishing on touch outside -

Image
i created activity looks dialog .this did achieve requestwindowfeature(window.feature_no_title); display display = getwindow().getwindowmanager().getdefaultdisplay(); layoutparams params = getwindow().getattributes(); params.height = (display.getheight()*3)/4; params.width = (display.getwidth()) / 2; params.alpha = 1.0f; params.dimamount = 0.5f; params.gravity=gravity.top | gravity.right;; getwindow().setattributes((android.view.windowmanager.layoutparams) params); setcontentview(r.layout.search_activity); linearlayout layout = (linearlayout)findviewbyid(r.id.root); linearlayout.layoutparams lp = new linearlayout.layoutparams(linearlayout.layoutparams.match_parent, linearlayout.layoutparams.match_parent); lp.setmargins(0, getintent().getextras().getint("height"), 0, 0); layout.setlayoutparams(lp); style used create this <style name="popuptheme" parent="android:theme.holo.light.dialog"> <item name="andro

Passing a GET value from HTML form to Twitter API 1.1 PHP -

i'm new , learning advice can give :) i'm making simple tool retrieve specific data twitter api 1.1 request school project. i'm using j7mbo's twitterapiexchange.php , format. created html form pass data array , can post requests api without problem. can print specific data request api when enter variables $getfield in php, when try , use form send data requests following errors: notice: undefined offset: 1 in /var/www/exp/twitterapiexchange.php on line 158 warning: invalid argument supplied foreach() in /var/www/exp/screen1.php on line 31 here code: ini_set('display_errors', 1); if(!empty($_get ['screen_name'])) { require_once('twitterapiexchange.php'); $settings = array( 'oauth_access_token' => "my_key_here", 'oauth_access_token_secret' => "my_key_here", 'consumer_key' => "my_key_here", 'consumer_secret' => "my_key_here

Google Play Android Developer API from C#/.NET service - (400) Bad Request -

This summary is not available. Please click here to view the post.

c# - property injection using autofac 3.1.1 -

i trying inject through property in following service, if try constructor injection works want property injection, missing? public class sodaservice { public isoda _s; //public sodaservice(isoda s) //{ // _s = s; //} public string getsoda() { return _s.sodaname; } } //soda class implementing isoda public class soda : isoda { public string sodaname { { return "default soda"; } } } public interface isoda { string sodaname { get; } } //main calling program class program { static void main(string[] args) { var container = getcontainer(); sodaservice s=container.resolve<sodaservice>(); console.write(s.getsoda()); console.read(); } private static icontainer getcontainer() { var builder = new containerbuilder(); builder.registertype<soda>().as<isoda>(); builder.regist

sql server - SQL Query (Sybase): Subtract 1 from the sum of one column depending on the value of another -

i have 2 sql queries need combine 1 due sheer size of database (most of retail store locations, fine, have much more transactions) basically, need number of transactions per employee given day. this, counting distinct number of transaction numbers per employee (each item in transaction gets own row same transaction number, needs distinct). however, there column "txnvoidmod". goal if value of column 0, count transactions normally, if value 1, need subtract off 1 because transaction voided. here sample data +------ -+------------+-------------+ |transnum| txnvoidmod | salesprsnid | +--------+------------+-------------+ | 115568 | 0 | 1339 | | 115568 | 0 | 1339 | | 114566 | 0 | 1339 | | 114566 | 0 | 1339 | | 115504 | 0 | 2555 | | 105551 | 0 | 0452 | | 105551 | 0 | 0452 | | 105551 | 0 | 0452 | | 105552 | 1 | 0452 | | 105552 | 1

javascript - jQuery - how to determine which link was clicked -

i have simple piece of php generates n copies of following code: <p class="showsdb_l2" class="center" onclick="fsd_l2('<?php print dbg;?>','<?php print $slid;?>')">click here see data</p> <div class="divsdb_l2"> </div> it generated using php, number of copies unknown front. on page have following javascript (using jquery) function fsd_l2(dbg,slid) { $(".divsdb_l2").load("test15.php?dbg="+dbg+"&slid="+slid).css('display','block'); } when text above (click here see data) clicked, should add contents of test15.php between the 2 div tags. #test15.php <?php $dbg = $_get['dbg']; $slid = $_get['slid']; print $dbg . " & " . $slid; ?> the problem have how determine of links clicked? @ present, if have 3 copies, , click one, 3 copies activated. i hope have made clear enough. i'

forms - Image upload failing in PHP -

so i'm trying set image upload form via php on localhost , after running code , connecting database okay, i'm getting error upload. since of other parts of form working after section section check, i'll add html upload input , relevant php script. <input type="file" name="image" id="image-select" /> and portion of php has deal image upload , verification after upload: $image = $_files ['image']['name']; $type = @getimagesize ($_files ['image']['tmp_name']); //never assume image upload okay if ($_files['image']['error'] !== upload_err_ok) { die("upload failed error code " . $_files['image']['error']); } //where file placed $target_path = "uploads/"; // add original filename target path $path= $target_path . basename($image); // check if image invalid before continuing if($type === false || !($type[2] === imagetype_tiff || $type[2] === ima

javascript - Adding style to links, on active -

i'm trying style menu when links active. i've got code use, not sure id's etc use, or how write css. css should maybe this? #xx a.anchorlink.active { color: #fff; } the website here: website <!--active link, index--> <script type="text/javascript"> $(document).ready(function(){ $('#xx a.anchorlink').addclass('active'); }); </script> <!--active link, other pages--> <script type="text/javascript"> $(function() { $('a.anchorlink').click(function(e) { var $this = $(this); $("#xxx").load($this.attr('href')); $('a.anchorlink').removeclass('active'); $(this).addclass('active'); // prevent default link click e.preventdefault(); }) });</script> i believe referring current page link being 'active'? pseudo state :active not work this. menu using class 'current-menu-item&#

bash - Run gdb command from shell script -

i wondering if possible pass command gdb shell script. demonstrate in code, easier understand. #!/bin/sh gdb --silent application.app b -[class method] this causes execution of script stop @ line 2, , continue when quit gdb. how pass command, if possible? :) gdb has option run commands file option --command=file . can write gdb commands inside file .

c# - Calling a generic function when type is only known at execution time -

i have generic function looks this: public static class excelimport { public static list<t> test<t>(string filename, string worksheetname) t : class { return new list<t>(excelimport.parse<t>(filename, worksheetname)); } ... } if know on type of objects perform test function, can call way (for example): list<oee.data.equipment> result = excelimport.test<oee.data.equipment>(filename.text, worksheetname.text); but fact test can applied class of oee.data namespace , users select right class in combobox before launching test function. i use switch link different call each combobox value means i'll have had new cases anytime i'll add classes oee.data. so, how can give type dynamically? code below not working: list<type.gettype("oee.data.equipment")> result = excelimport.test<type.gettype("oee.data.equipment")>(filename.text, worksheetname.text); thanks in advance! simon

javascript - addEventListener seems not to work -

addeventlistener not working, though make sure access if (the alert works). using firefox no need "attachevent" ie... function addevent(type,fnname,obj,cap) { if(obj.addeventlistener) { alert("i here"); obj.addeventlistener(type,fnname,cap); } } function changebgcolor() { var wrap = document.getelementbyid("wrapper"); nbclicks++; if (1 == nbclicks ) { wrap.style.backgroundcolor = lightcoral; } if (2 == nbclicks ) { wrap.style.backgroundcolor = lightgreen; } } function init() { var nbclicks = 0; var wrap = document.getelementbyid("wrapper"); addevent("click",changebgcolor,wrap,false); } window.onload = init; there 2 immediate issues see code: javascript throw referenceerror because variable nbclicks not in scope function changebgcolor. you should assigning strings wrap.style.backgroundcolor. in case javascript thinks they'r

api - How can I get the name of the Administrators Group? -

i looking windows 32 api function gets name of administrators group. when answer, please add full example. source code should work windows xp , later. you can use lookupaccountsid function that: byte bbuffer[128]; dword dwsize = sizeof(bbuffer); if (createwellknownsid(winbuiltinadministratorssid, null, (psid)bbuffer, &dwsize)) { wchar_t wchname[128], wchdomain[128]; dword cchname = _countof(wchname), cchdomain = _countof(wchdomain); sid_name_use use; if (lookupaccountsid(null, (psid)bbuffer, wchname, &cchname, wchdomain, &cchdomain, &use)) { // wchdomain contain builtin // wchname contain administrators } }

class - Import Classes Into Java Files -

i learning develop in java , interested in creating java classes other users can import program , use. yes, know example class simple , stupid want learn concept , start making more complex classes people can import projects. i created simple " logger " class when called logs both text console , text file readability. can call class using following commands... logger logger = new logger(); logger.create(); logger.log("this text logged console , log.log"); see below logger class. import java.io.bufferedwriter; import java.io.file; import java.io.filewriter; import java.text.simpledateformat; import java.util.calendar; import java.util.date; public class logger { filewriter fw; bufferedwriter br; file file = new file("log.log"); boolean fileexists = file.exists(); public void log(string message) { try { fw = new filewriter(file, true); br = new bufferedwriter(fw

java - Multiple @GET for different MIME - how to consume this with plain HttpURLConnection() -

i realized possible define in restful resource .java file: @get @produces("text/plain") public string getplaintexthello() { ... } @get @produces("application/json") public string getjsonhello() { ... } isn't fantastic? wait moment.... problem i consuming api simple client. code of httpurlconnection : url obj = new url("http://some.url/res/hello"); httpurlconnection conn = (httpurlconnection) obj.openconnection(); conn.setrequestmethod("get"); ... /* response ... conn.getinputstream() */ how server 'know' 1 method call serve client? regards. first of should consider using same method different types of "produces": @get @produces({ "application/xml", "text/plain"}) public string gethello() { ... } the different types of "produces" handled jaxb (in case response object...). you can define client side "accept" mime type using: string uri = "

r - customized "scale_color_gradient2" in ggplot2 -

Image
i use own specific color in image plot. new in ggplot2 had @ manual here , tried repeat of stuff; couldn't figure out how supply colorbar did graphics plot. library(reshape2) library(ggplot2) #my specific color list mycol <- vector(length=512, mode = "numeric") (k in 1:256) mycol[k] <- rgb(255, k - 1, k - 1, maxcolorvalue=255) (k in 257:512) mycol[k] <- rgb(511 - (k - 1), 511 - (k - 1), 255, maxcolorvalue=255) mycol <- rev(mycol) ncolors <- length(mycol) # graphics plot par(mar = c(5, 13, 1, 6)) image(1:ncol(volcano), 1:nrow(volcano), t(volcano), zlim = c(0, ncolors), col=mycol, axes=false, main="w matrix", sub = "", xlab= "components", ylab="genes") axis(2, at=1:nrow(volcano), labels=row.names(volcano), adj= 0.5, tick=false, las = 1, cex.axis=0.25, font.axis=1, line=-1) axis(1, at=1:ncol(volcano), labels=colnames(volcano), adj= 0.5, tick=false,las = 3, cex=1, cex.axis=0.5, font.axis=1, line=-1) # ggplot2 l

backbone.js - Problems loading backbonejs and underscorejs with requirejs -

i have problems loading libraries shim option in requirejs (maybe, because poor background on library). try in documentation , see other pages problem persist. this app folder structure: index.html js/main.js js/app/router.js js/app/app.js js/views/homeview.js js/libs/backbone/backbone-1.0.0.js js/libs/underscore/underscore-1.5.1.js js/libs/jquery/jquery-1.10.2.js js/libs/require/require-2.1.8.js all start in index.html: <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="viewport" content="width=device-width, user-scalable=no" /> <link rel="stylesheet" type="text/css" href="css/index.css" /> <title>app</title> </head> <body> <div class="page"> loading...

android - Barometer App - Where to from here? -

i working on basic barometer app , have run slight snag. want take data being received , have run through text view have setup pressure variable. here code point: import android.app.activity; import android.hardware.sensor; import android.hardware.sensorevent; import android.hardware.sensoreventlistener; import android.hardware.sensormanager; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.textview; public class barometer extends activity { textview barotext, timetext; button refresh; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.barometer_layout); uivars(); sensormanager sensormanager = (sensormanager) getsystemservice(sensor_service); sensor sensor = sensormanager.getdefaultsensor(sensor.type_pressure); sensormanager.registerlistener(new mylistener(), sensor, sensormanager.sensor_delay_normal); } public voi

php - Looking for array_map equivalent to work on keys in associative arrays -

suppose have associative array: $array = array( "key1" => "value", "key2" => "value2"); and wanted make keys uppercase. how in generalized way (meaning apply user defined function apply key names)? you can use array_change_key_case function of php <?php $input_array = array("first" => 1, "second" => 4); print_r(array_change_key_case($input_array, case_upper)); ?>

c# - How to hide MvcSiteMapNode from menu but not breadcrumbs? -

i have page don't want showing in menu. however, when on page, do want show in breadcrumbs. i'm trying isitemapnodevisibilityprovider class, can't figure out how determine whether provided sitemapnode argument inside menu or breadcrumbs. how do this? you can test html helper calling visibility provider checking "htmlhelper" element of sourcemetadata parameter. parameter passed visibility provider automatically. the names used type's fullname (the qualified name without assembly name). public class mynodenotonmenuvisibilityprovider : sitemapnodevisibilityproviderbase { public override bool isvisible(isitemapnode node, idictionary<string, object> sourcemetadata) { if (sourcemetadata.containskey("htmlhelper") && sourcemetadata["htmlhelper"].tostring().equals("mvcsitemapprovider.web.html.menuhelper")) { if (node.key == "mynode") {

mysql - ActiveRecord SQL queries not getting logged -

i have been facing weird problem time, wherein activerecord queries not getting logged in terminal, or in rails console (using activerecord::base.logger = logger.new(stdout) ). this exception get: could not log "sql.active_record" event. nameerror: undefined local variable or method `s' # activesupport::notifications::event:0x007f9ae02a60c0. i tried out few things, including reinstalling rails, no avail. apart wondering why happening, i’m unable check actual sql queries fired against database result. i ran similar ways back. i able fix adding # config/environments/development.rb config.logger = logger.new(stdout) and # config/environment.rb # prevent log buffering $stdout.sync = true

actionscript 3 - referring to textfields in for loop -

i've looked how can , nothing seems work. trying use in loop refer textfields , set them. suppose textfields named textfield0, textfield1, textfield2, etc. like: for(var i:int = 0; < numberoffields; i++) { parent.child.getchildbyname("textfield" + i).text = stringarray[i]; } any appreciated thanks let's assume hierarchy looks this 0: root:maintimeline ¬ 0: background:shape 1: textfield1:textfield 2: textfield2:textfield 3: myclip:movieclip 4: textfield3:textfield we've got "noise" in list, straight-up iteration on might not best way. could, , place if statement tests name of object, or object type, or create manual list of pointers each of these textfields. in scenario, each textfield hypothetically exist in nested container. depends on have set up. in example gave above, you're referencing object literally called "child", mean hierarchy might this... 0: root:maintimeline ¬ 0: child:

php - Design of Restful API with HTTP Basic Authentication -

note: know there lots of other stackoverflow questions dealing topic. i've read through many of them, many other websites. still have following questions. so, i'm building rest api new product. @ time api entirely private consumption our websites , phone apps. however, i'm thinking might smart design api can made public in future. authentication while i've looked @ oauth, think http basic authentication on ssl plenty secure enough our api. understand http basic authentication on ssl viable way of authenticating rest api. it's quite simple, appealing me since i'm new api development. authorization if user logs in api using username , password, given access parts of api. meaning they'll have access own content, not content of other users. further, may limited can do. in addition user accounts, plan have other other (non user) accounts more global administrative tasks. these accounts potentially have full access api. is design? or, bad authent

user interface - Existing Tkinter Code that Takes an Input String to Another String -

i posted this, however, purpose here different. believe there should code around similar this. hoping might have idea of examples (interfaces of functions act on strings). better, have block of code have available? i'm looking template base mine off of. in advance. to give idea of mean, here's function have in mind: def psi_j(x, j): rtn = [] n2 in range(0, len(x) * j - 2): n = n2 / j r = n2 - n * j rtn.append(j * x[n] + r * (x[n + 1] - x[n])) print 'n2 =', n2, ': n =', n, ' r =' , r, ' rtn =', rtn return rtn this code takes string x = [0,1,1,1,2] example (it must begin 0) , parameter j, 2, , outputs string (x = [0, 1, 2, 2, 2, 2, 2, 3] in example). it in 2 steps: first decomposes number m multiple of j , remainder. runs decomposition through function on rtn.append line. notice has cj - 1 terms c number of terms in input string , j parameter. normally, able calculate cj term