Posts

Showing posts from September, 2011

php - Different URLs when calling the base_url() function -

i have php file following content: <script type="text/javascript" src="<?php echo base_url();?>js/example1.js"></script> <script type="text/javascript">var base_url = '<?php echo @base_url(); ?>';</script> ........ <input type="hidden" id="testvpn" value="<?php echo base_url(); ?>js/example.js"/> ........ when try open page locally, everything's ok: <script type="text/javascript" src="http://example.com/js/example1.js"></script> <script type="text/javascript">var base_url = 'http://example.com/';</script> ........ <input type="hidden" id="testvpn" value="http://example.com/js/example.js"/> ........ when try open page on web vpn, want see: <script type="text/javascript" src="https://mywebvpn.com/+csco+numbers++/js/example1.js"></s

javascript - How to inheritance function from the main object to other objects dynamic? -

i want create dynamic new objects (someanimal) in case example frog under object ' game '. inside game.frog want inheritance game function init frog frog have function init , other animals clone function init . game.frog.init(), game.lion.init() ...... game.n...int() the animal below many help. game.frog = { init: function(){ this.property1 = something; this.property2 = something; this.property3 = something; this.property1000 = something; } }; my code: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title> - jsfiddle demo</title> <script type='text/javascript'>//<![cdata[ window.onload=function(){ var game = { init: function(){ this.property1 = 1; this.property2 = 2; this.property3 = 3; this.property1000 = 1000; }, cons: function(gameanima

javascript - Function execution order -

this question has answer here: is chrome's javascript console lazy evaluating arrays? 6 answers why javascript object show different values in console in chrome, firefox, safari? [duplicate] 1 answer i have following piece of code: function() { $.getjson( myurl + '/get_data', function(data) { function sort_data(first, second) { return (first.sort - second.sort); } console.log(data); console.log(data.sort(sort_data)); } ... snipped brevity data array of objects, each object has sort field, integer. default in random order. after executing code above tells me data before , after sort identical. @ least both console.log outputs same (and sorted). however, if skip sor

c - Valgrind shows memory leak on empty program on Mac OSX 10.8 -

Image
valgrind installed using brew. #include <stdio.h> #include <stdlib.h> int main() { return 0; } gcc -g -o hello hello.c valgrind --tool=memcheck --leak-check=yes ./hello this not memory leak need worry about. imageloader part of os x runtime , responsible loading binaries , dynamic libraries. allocates memory once, during initialization , forgets it, it's harmless because it's small block of memory allocated once. , bunch of things valgrind doesn't aren't incorrect. should add these suppression file .

android - Google maps api v2. Failed to Load Map. Could not connect to google servers -

i getting error when run application on real device. main_activity.java, protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); int chkgoogleplayservices = googleplayservicesutil .isgoogleplayservicesavailable(context); if (chkgoogleplayservices != connectionresult.success) { googleplayservicesutil.geterrordialog(chkgoogleplayservices, (activity) context, 1122).show(); } else { supportmapfragment sfm = (supportmapfragment) getsupportfragmentmanager() .findfragmentbyid(r.id.map); mmap = sfm.getmap(); mmap.setmaptype(googlemap.map_type_normal); lm = (locationmanager) getsystemservice(context.location_service); criteria criteria = new criteria(); criteria.setaccuracy(criteria.accuracy_fine); // location update locationlistener listener = new locationlistener() {

php - How to insert multiple ID's in one linked table? -

i want insert de employeeid , knowledgeid in knowledgedetail. creates employee nothing in knowledgedetail. i'm there no code, have tried many things have no idea. first in addprofile.php make profile , @ least choose yoour knowledge. question if make profile , choose knowledge how de id's in knowledgedetail. table 1 employees : employeeid, name, establishment, e-mail, phonenumber, photo, description table 2 knowledge : knowledgeid, knowledge table 3 knowledgedetail : knowledgedetailid, employeeid knowledgeid employeeid out employees have relation employeeid out knowledgedetail and knowledgeid out knowledge have relation knowledgeid out knowledegedetail addprofile.php <?php include("connection.php"); ?> <!doctype html> <html> <head> <title>information system</title> <link rel="stylesheet" type="text/css" href="css/test.css"> <meta charset ="utf-8">

Regex for currency in Java string.replaceAll() (not php, not javascript) -

i'm trying prices text in java , i'm usign regex i can't rid of 113 : string str="jañlskd f añlksdj fñlaks: 19,05€ | jfañlskdjf: 22€ jañlsdkf dkjfls 113: 15€ jñalkdf dk añldf: añlkdsj fdlkf dlkfajs 19,05€ buy"; str.replaceall("[^0-9+€|^0-9+,0-9+€|^ ]",""); result is: 19,05€ | 22€ 113 15€ 19,05€ i want dismiss numbers no € @ end too. what i'm doing wrong? thanks the full answer question is: don't use replaceall (is more complicated in case). use matcher find positive matches. example: pattern p = pattern.compile("[0-9]+(?:,[0-9]+)?(?=€)"); matcher m=p.matcher(nodevalue); string res=new string(); while (m.find()) { res+=m.group()+" "; } string prices=res.split(" "); thanks (specially hamza).

android - java.lang.NullPointerException in AsyncTask -

i'm trying "optimize" app's code using asyctask, receive java.lang.nullpointerexception error. can please me figure out i'm doing wrong? package it.vscreazioni.farmachimica; import java.io.ioexception; import java.io.inputstream; import java.util.arraylist; import java.util.list; import javax.xml.parsers.documentbuilder; import javax.xml.parsers.documentbuilderfactory; import javax.xml.parsers.parserconfigurationexception; import org.w3c.dom.document; import org.w3c.dom.nodelist; import org.xml.sax.saxexception; import android.app.progressdialog; import android.os.asynctask; import android.os.bundle; import android.widget.listview; import com.actionbarsherlock.app.sherlockactivity; import com.actionbarsherlock.view.menu; public class mostratutti extends sherlockactivity { final listview lv = (listview) findviewbyid(r.id.listview); final list<listviewitem> items = new arraylist<mostratutti.listviewitem>(); final arraylist<st

asp.net mvc - StringLength/Minlength validation doesn't prevent user from posting the form with no value -

i have following property on viewmodel [stringlength(20, minimumlength = 1, errormessageresourcename = "error_stringlength", errormessageresourcetype = typeof(global))] public string leaguename { get; set; } if string ends being larger 20 characters validation fire , not allow user post form. however, if field blank, means leaguename property has length of less 1 allow user post form. i know resolved using required attribute, why validation not working expected in scenario? it design. this validation logic stringlength: public override bool isvalid(object value) { this.ensurelegallengths(); int num = value == null ? 0 : ((string) value).length; if (value == null) return true; if (num >= this.minimumlength) return num <= this.maximumlength; else return false; } as can see, when string null stringlength returns true.

Add a GridView to a ListView in Android -

i'm trying create listview consist of 2 types of elements: strings , gridview. i.e. putting both strings , gridview inside 1 single listview. the layout should this: string item 1.1 string item 1.2 string item 1.3 string item 1.4 gridview item 1 gridview item 2 gridview item 3 gridview item 4 string item 2.1 string item 2.2 string item 2.3 string item 2.4 is there way this? as per can show first item in gridview, , acts regular string element in listview. the code can viewed here: customlistviewactivity.java sectionadapter.java main.xml header_row.xml simple_list_row.xml grid_list_row.xml any appreciated :) to answer own question: based on this answer created class works well: public class nonscrollablegridview extends gridview { public nonscrollablegridview(context context, attributeset attrs) { super(context, attrs); } @override protected void onmeasure(int widthmeasurespec, int heightmeasurespec

javascript - Cordova/Phonegap Plugins for Blackberry -

in phonegap application implement login twitter , facebook, , sharing blackberry. there plugins available that? preferably, single plugin handle ios, android , blackberry. if you, have ported phonegap app webworks , let invocation framework ( in case of bb10 ) me.

iis 7.5 - Azure ARR error while enabling disk cache -

we have azure hosted service, , need setup arr (application request routing) on it. followed blog http://robindotnet.wordpress.com/2011/07/ , arr working fine. need enable diskcaching , i'm trying below command: %windir%\system32\inetsrv\appcmd.exe set config -section:system.webserver/diskcache /+"[path='c:\cache',maxusage='0']" /commit:apphost >> c:\setdiskcache.txt but getting below error: error ( message:new drivelocation object missing required attributes. cannot add duplicate collection entry of type 'drivelocation' unique key attribute 'path' set 'c:\cache'. ) and there no content getting cached in folder. direction or appreciated. below complete cmd file reference: cd /d "%~dp0" start /wait msiexec.exe /i webfarm_amd64_en-us.msi /qn /log c:\installwebfarmlog.txt start /wait msiexec.exe /i requestrouter_amd64_en-us.msi /qn /log c:\installarrlog.txt %windir%\system32\inetsrv\appcmd.exe set c

asp.net - jQuery--result length -

i'm using asp.net , jquery cascading dropdown. i'm getting values not getting bind. result of json giving length total chars not total records the result { "table": [ { "voyagemasterid": 3, "voyagecode": "9101" }, { "voyagemasterid": 7, "voyagecode": "1617" } ] } but giving length 93 but here total records 2 hence when bind values dropdown not getting bind. my json : $.ajax({ type: "post", contenttype: "application/json; charset=utf-8", url: "port.aspx/code_get", data: "{serviceid:'" + $(".ddlservice").val() + "'}", datatype: "json", success: function (data) { try { success(data.d);

ios - Add allocated buffer to NSMutableDictionay -

is possible add dynamically allocated buffer using malloc nsmutabledictionary , free after add directly. correct? no, very, bad. call free, os can re-use memory, use of buffer bad. if want put data in mutable dictionary, use nsdata instead. if reason need store malloc'd buffer ( e.g. got library), you'll need wrap in object class. you can call free wrapper object's dealloc, free won't called until wrapper object released ( handled arc once dictionary released. @interface mallocedmemorywrapper @property ( nonatomic, assign) void* wrappedmemory; @end @implementation mallocedmemorywrapper - (mallocedmemorywrapper*) initwithmemory:(void*) memory { self.wrappedmemory = memory; } - (void) dealloc { free( self.memory); } @end }

internet explorer - HTML5 Video with full cross browser compatibility -

i guidance on best proven method of creating html5 video section on website cross browser compatible, works in responsive layout ( not fixed dimensions ) , support ios/ipad , other mobile devices. have looked @ several articles including ( http://diveintohtml5.info/video.html ). have tried mediaelement.js , video.js , have still had problems on older internet explorer browsers ( ie8 , below ) ie9 works fine. if body point me in correct direction achieving html5 video great im not getting going wrong! alot. to clarify, did try technique dive html5 use flowplayer play flash version of video ie8 , below? code , working example @ end of http://diveintohtml5.info/video.html the example on page seems work me on ie7 , ie8, though i'm testing on virtual box on mac might change something. good luck!

php - Make a multiple delimiter REGEX for preg_split -

i need split multiple lines in multiple files different delimiters. think preg_split should job never worked pcre regex stuff. change delimiters consistent adds unnecessary calculations. q: delimiters consist of (,)(;)(|)(space) , curious how build such regex. put characters in square brackets [] : $parts = preg_split('/[,;| ]/', $string, null, preg_split_no_empty); you can use \s instead of space character, matches kinds of whitspace, such tabs , newlines.

entity framework - EF Migrations - straight to final schema -

my schema has evolved on many iterations. have set of migrations taking schema empty db 1 dozens of tables , scores of columns. along way there have been several additions of tables, columns , constraints, followed (in light of experience or new knowledge or changes in spec) removal or alterations. table or column name has been re-used or re-purposed. now, ef migrations seems able run through sequence creating, altering, dropping, creating again, altering, etc., latest schema, feels wrong. in extreme case there might dozens of migrations creating tables followed dozens more dropping tables until final schema might 1 or 2 tables (unlikely, know). option go scratch final tables feel right. in ruby days activerecord migrations there option build final schema, without stepping through , possibly undoing or redoing work along way. of course meant keeping complete ddl version of schema date after each migration, somehow felt more elegant. has done similar entity framework?

visual studio 2012 - How to display native types when debugging in VS2012 for mixed mode C++/CLI MFC app -

possible duplicate of this question . i have mfc project uses /clr switch , c++/cli code use .net component. on vs2005. on upgrading vs2012 update 2, during debugging, no values or types shown native data types. learned new mechanism native data type visualization (natvis) introduced in vs2010 , extended / enhanced in vs2012. following information on that page , unchecked managed c++ compatibility mode , c/c++ edit , continue . after this, breakpoints became disabled , stopped being hit. using "only managed" debugger, breakpoints hit no values shown. finally, used "mixed" debugger , used __debugbreak() force break. resulted in integer values being shown if local autos; , data types picked correctly. however, std::string or cstring values not shown , instead type shown in value column. similarly, pointers, class members, or functions argument values not shown , type information, undefined value, or out of scope shown in value column. the behav

ruby on rails - Link back to page visited before form -

i have listing page, form, thank page. need put link on thank page takes user page on before form varies. i've tried using this: = link_to "back", :back but takes them previous page, form. well, can set method in form page collect url. basic idea use custom session variable store previous url , keep next session. suppose form's action somecontroller#new, then class somecontroller < applicationcontroller after_filter "save_my_previous_url", only: [:new] def save_my_previous_url # session[:previous_url] rails built-in variable save last url. session[:my_previous_url] = uri(request.referer || '').path end end then in thank page, can my_previous_url by session[:my_previous_url] this should able suit case, previous url 2 pages ago. disclaimer: not verified. idea only. add session belongs controller. not helper can use directly in view. need define instance variable in controller , can use in view. this

xcode - NSCollectionView: Go to the next view on selection with Selected Item -

i new os x , have started dealing nscollectionview. trying take show nscollectionview array of imageview labels. , on selection of image want open new viewcontroller class. able show array of images , labels in collection view lost on how go new view selection made in nscollectionview , how show image selected new viewcontroller class. i having nstabview , in having customview in showing collectionview. , in awakefromnib doing populate collectionview -(void)awakefromnib { arritems = [[nsmutablearray alloc]init]; nsmutablearray *imagearray=[[nsmutablearray alloc]initwithobjects:@"baby-girl-wallpaper-2012-7.jpg",@"cute-little-baby-girl.jpg",@"joker_hd_wallpaper_by_riddlemethisjoker.jpg",@"the-dark-angel-wallpaper-hd.jpg",@"hd-wallpapers-1080p_hdwallpapersarena_dot_com.jpg",@"lion_hd_wallpaper.jpg",@"ganesh_painting.jpg",@"krishna-wallpaper.jpg",@"leon_userpic_79630_fire_lion_by_alex_barrera.jp

tsql - Conflict between UPDATE and SELECT -

i have table db.data_feed update using t/sql procedure. every minute, procedure below executed 100 times different data. alter procedure [db].[update_data_feed] @p_market_date varchar(max), @p_curr1 int, @p_curr2 int, @p_period float(53), @p_mid float(53) begin begin try update db.data_feed set mid = @p_mid, market_date = convert(datetime,@p_market_date, 103) cast(market_date date) = cast(convert(datetime,@p_market_date, 103) date) , curr1 = @p_curr1 , curr2 = @p_curr2 , period = @p_period if @@trancount > 0 commit work end try begin catch --error code end catch end end when users use application, read table, per sql below. potentially select can run thousands of times in 1 minute. (questions marks replaced parser appropriate date/numbers) declare @m

java - Conditionally sort results in hibernate -

here tables i'm working with. there user table has predefined columns ('name' in example below) , attributes table used making schema extension possible. attributes table stores values new extended attributes key-value pairs('title' , 'mobile' attributes in example below) , 'user' column used joining main user table. arrangement works operations, not able think of way sort on of attributes users. user table: --------------- id name ============== 1 jon 2 harry attributes table: -------------------------------- user attr_key attr_value ================================ 1 title engineer 1 mobile 111-2222-4444 2 title manager 2 mobile 111-0000-5555 result of joining 2 tables above(few columns intentionally skipped): -------------------------------------------- id name attr_key attr_value ============================================ 1 jon title

windows - how i can fill the grid when it is in DataControlDetailDescriptor in devexpress in wpf -

how can fill grid when inside datacontroldetaildescriptor in devexpress in wpf and itemssourcepathand value should assign itemssourcepath. dxg:datacontroldetaildescriptor itemssourcepath="accessprofiles". <dxg:gridcontrol autopopulatecolumns="true" horizontalalignment="left" margin="-9,52,0,0" name="gridcontrol1" verticalalignment="top" height="415" width="623" masterrowexpanding="gridcontrol1_masterrowexpanding" autoexpandallgroups="true" > <!--itemssource="{binding path=bindd, mode=oneway}"--> <dxg:gridcontrol.view> <dxg:tableview name="tableview1" showtotalsummary="true" /> </dxg:gridcontrol.view> <dxg:gridcontrol.detaildescriptor> <dxg:datacontroldetaildescriptor x:name="detail1" itemssourcebinding="{binding path=bindd

java - Is Aparapi provide task parallism? -

is aparapi (api in java open cl) provides task parallelism or provides data parallelism. if provides task parallelism, guarantee tasks execute on separate devices aparapi isn't api in java opencl, it's parallel processing library. you execute aparapi kernel either on gpu, or cpu. if choose run aparapi kernel on gpu, either aparapi fails cross compile kernel gpu, or gpu can't cope aparapi's output, attempt fall cpu. when this, generate warning. aparapi try run kernel on single device, , not on lot of different devices. if intend this, manually need decide whether , how want this. i hope answers question.

c# - Sort generic list descending order -

i have method in controller public actionresult index() { return view(db.posts.tolist()); } how can list in descending order? instead of starting id:1 starts @ last id in table public actionresult index() { return view(db.posts.orderbydescending(p => p.id).tolist()); }

java - How to calculate a arithmetic expression (String) and return the answer? -

i know how calculate easy expression without variables. how do, when in line have expression "x"? example (x+1)*(x-1) in example program should return: x^2 - 1 it's non-trivial endeavor. suggest @ what's out there. example symja

Optimising Android/Java Code - Creating multiple instances of the same object type -

i have working application want optimise code. below 1 example create 10 separate imagebuttons (note incrementing objectname , xml reference each) , set listeners. can suggest more optimal way of doing this, perhaps in dynamic method/loop please? thanks.... private void initialisebuttons() { imagebutton imagebutton1 = (imagebutton)this.findviewbyid(r.id.imagebutton1); imagebutton1.setonclicklistener(this); imagebutton imagebutton2 = (imagebutton)this.findviewbyid(r.id.imagebutton2); imagebutton2.setonclicklistener(this); imagebutton imagebutton3 = (imagebutton)this.findviewbyid(r.id.imagebutton3); imagebutton3.setonclicklistener(this); imagebutton imagebutton4 = (imagebutton)this.findviewbyid(r.id.imagebutton4); imagebutton4.setonclicklistener(this); imagebutton imagebutton5 = (imagebutton)this.findviewbyid(r.id.imagebutton5); imagebutton5.setonclicklistener(this); imagebutton imagebutton6 = (imagebutton)this.findviewbyid(r.id.imagebu

java - FusionCharts: X-axis values not like expected -

Image
i using fusioncharts i'm facing problems. 0 on x-axis @ index not 0 (i marked in red color) on the snapshot below. another problem line not drawn? this figure : this xml code: <chart caption="" xaxisname="quantity (finished items)" yaxisname="cost" numdivlines="9" linethickness="2" showvalues="0" showlegend="1" canvaspadding="0" legendiconscale="1.4" numvisibleplot="15"> <categories> <category x="0" label="0"/> <category x="5000" label="5000"/> <category x="10000" label="10000"/> <category x="15000" label="15000"/> <category x="20000" label="20000"/> <category x="25000" label="25000"/> <category x="30000" label="30000"/> <category x="35000" label="3500

xml parsing - Python: get all content of specific XML tags -

i have parsed xml file , need content <name> tags. so far i've come this: xml_tag = dom.getelementsbytagname('person')[0].toxml() xml_data = xml_tag.replace('<name>','').replace('</name>','') this gets first tag. how create list of name tags content in it? usually use lxml these things looking @ code, or somethin similar should work. xml_tag = dom.getelementsbytagname('person')[0] xml_data = [elem.nodevalue elem in dom.getelementsbytagname('name')]

c# - How to abort thread that use AcceptTcpClient() inside? -

accepttcpclient() prevents app exit after called thrd.abort() . how exit application when in listening? you should able interrupt call accepttcpclient() closing tcplistener (this result in exception being thrown blocking accepttcpclient() . should not aborting thread, bad idea in few specific circumstances. here's brief example: class program { static void main(string[] args) { var listener = new tcplistener(ipaddress.any, 12343); var thread = new thread(() => asyncaccept(listener)); thread.start(); console.writeline("press enter stop..."); console.readline(); console.writeline("stopping listener..."); listener.stop(); thread.join(); } private static void asyncaccept(tcplistener listener) { listener.start(); console.writeline("started listener"); try { while (true) { using

jsf - Primefaces how to fire another event after datatable select event -

i have datatable selection , commandbutton. problem if user doesn't select item datatable , clicks button, selecteditem object returns null. think datatable's selection event runs after commandbutton's action method. what want is; if user doesn't select item datatable , clicks button, create new selecteditem object. after button's action method runs, datatable changes null. <p:panel id="panel1"> <p:datatable selection="#{mycontroller.selecteditem}" selectionmode="single".... //some other stuff </p:panel> <p:panel id="panel2"> //some other stuff <p:commandbutton value="create" action="mycontroller.create".... </p:panel> my controller; selecteditem selecteditem = new selecteditem(); public void create(){ selecteditem = new selecteditem(); } you can try this: .xhtml <p:datatable var="result" selection="#{mycontroller.sel

Bash - Exit parent script from child script -

i have bash parent script on unexpected input calls error logging child script logs error. want execution halt when error occurs , error script called. if call exit error handling script not stop parent script executing. how may go stopping parent script child? try.. #normal flow [[ $(check_error_condition ]] && /some/error_reporter.sh || exit 1 so, when error_reporter exit exit status > 0 parent terminate too if error_reporter exit status = 0 parent continues... you don't want stop parent child ( the parents don't behavior ) :), instead want tell parent - need stop , stop (if want) ;)

Multiple mysql joins causing issue with query -

i'm using following query filter , score results assigned categories working right now. however, if try join, able factor in tag matches scoring, run in issue lots of results returned aren't assigned 3 categories. here's working query... select distinct results.*, ( 3*(match(body) against('*' in boolean mode)) + 5*(match(title) against('*' in boolean mode)) + 1*usefulness + 30*(match(body) against('""' in boolean mode)) + 20*(match(title) against('""' in boolean mode)) + 5*shares ) score results inner join categories c on results.id = c.result_id c.name in ('refinance', 'condo', 'usda') , ( results.scope = 'all' or results.scope = 'hi' ) ,

ruby on rails - Pass values from loop inside controller to view -

for simplicity, using easy example. i have controller method: def test @books.each |book| @book_id = "emi:#{book.id}" @book_test = ....(some function) end end how pass '@book_id' & '@book_test' values loop view page? please note don't want repeat code in view page. want pass values in loop view page. you have @books in test method why making loop in method? in view file directly no repetation needed. or other wise make 2 arrays @book_ids , @book_tests , collect prepared values , use them in views following: def test @book_ids=[] @book_tests=[] @books.each |book| @book_ids << "emi:#{book.id}" @book_tests << ....(some function) end end

Git pull wih www-data permissions -

i have git repository has dev, test , staging branches pulled vhost on server. need able git pull on server using user account files pulled owned www-data user (and group). when used svn sudo www-data , svn update --username --password options authenticate against svn user maintain correct file ownership. there way git (i use ssh keys rather password authentication). you want set option on repository you're pulling (extract git config ): core.sharedrepository when group (or true), repository made shareable between several users in group (making sure files , objects group-writable). when (or world or everybody), repository readable users, additionally being group-shareable. when umask (or false), git use permissions reported umask(2). when 0xxx, 0xxx octal number, files in repository have mode value. 0xxx override user’s umask value (whereas other options override requested parts of user’s umask val

javascript - HighCharts Pie Chart legend Alignment -

basically i'd use data name , value in legened, have them spaced data name aligned left , data value aligned right this; name1 val1 name2 val2 etc. defaults name1 val1 name2 val2 with space in between set, if name 1 10 characters , name 2 8 characters staggered this; name1isthis val1 name2lookslikethis val2 any appreciated. here code , fiddle. http://jsfiddle.net/hancr/1/ $("document").ready( function(){ $('#container').highcharts({ chart:{type:'pie'}, credits:{enabled: false}, colors:[ '#5485bc', '#aa8c30', '#5c9384', '#981a37', '#fcb319', '#86a033', '#614931', '#00526f', '#594266', '#cb6828', '#aaaaab', '#a89375' ], title:{text: null}, tooltip: { pointformat: '<b>{point.y}%</b>', percentagedecimals: 1

asp.net mvc 4 - JQuery plug in, JavaScript syntax, cascading dropdown MVC4 followup, multi-level cascade -

first of all, post cascading drop-downs in mvc 3 razor view has been helpful. have used initial syntax, , have gotten cascading drop down work. have added more parameters functions called in controller, change list contents. here view not use "plugin". @model holtermanagementui.models.cruduserviewmodel @{ viewbag.title = "edit"; } @scripts.render("~/bundles/jquery") <script type="text/javascript"> $(function () { $('#selecteddivisionid').change(function () { var selecteddivisionid = $(this).val(); $.getjson('@url.action("regions")', { divisionid: selecteddivisionid, isactive: true }, function (regions) { var regionsselect = $('#selectedregionid'); regionsselect.empty(); $.each(regions, function (index, region) { regionsselect.append( $('<option/>') .attr('value',

oracle - SQL average by customer per month -

the table 'transactions' list of transactions date , customerid , cost per unit ( price ) , quantity . i need report groups transactions months , gives count, total income , average income per customer. i'm having trouble figuring out how insert group customerid select statement: select extract(month date) month, count(*) purchases, sum(price*quantity) income, avg(sum(price*quantity)) <-- needs grouped customerid aswell month transactions date between i2 , i3 group extract(month date); the closest can like: select extract(month date) month, count(*) purchases, sum(price*quantity) income, ( select avg(sum(price*quantity)) transactions group customerid, extract(month date) ) transactions t date between i2 , i3 group extract(month date); but approach stops making sense after think minute since nested select return multiple rows. , if add where clause , remove group date in second

linux device driver - Reading multi-channel serial usb in pure data -

i have multichannel serial data 8 channel adc chip i'm connecting computer via serial-usb cable. want use these separate channels in pure data, pd_comport object doesn't read multi-channel serial data. i've scoured pd discussion fora there's no mention of how this. thoughts on how can go it? per definition serial connection single-channel. if have multiple (synchronized) channels, it's called parallel . so problem 1 of 2 following: parallel serial streams if transmitting 8 adc-channels via different serial connections, (special) cable should register 8 different devices (e.g. /dev/ttyusb5 , /dev/ttyusb6 , ... /dev/ttyusb12 ). in case, use multiple [comport] objects (one each serial device want interface) single multiplex stream in (more likely) case, adc transmits it's 8 channels in single serial connection multiplexing data, have demultiplex serial stream yourself. how this, depending on actual format of data. assuming adcs 8bit , hav

html - NavBar Image Links Aren't Working, but code is perfect. What's up? -

so here's current html code, within <head> section: <ul class="nav"> <li> <a href="http://www.greg-holmes.com/#/title" target="_blank"> <img src="img/home.png"> </a> </li> ... <!-- deleted elements readability --> <li> <a href="http://www.instagram.com/djspiffy" target="_blank"> <img src="img/instagram.png"> </a> </li> </ul> here's css goes along it: .nav { border-width: 1px 0; list-style: none; margin: 0; padding: 0; text-align: center; } .nav li { display: inline; } .nav { display: inline-block; padding: 10px; } the code live @ greg-holmes , reason links aren't working. you need put html code inside <body> tag not <head> tag

css - Bootstrap is adding more icons than called for in rails -

i trying add user icon header. bootstrap adding more icons code calls for, going on? in advance! <ul class="nav pull-right"> <% if user_signed_in? %> <li><%= link_to "edit profile", edit_user_registration_path %></li> <li><%= link_to "logout", destroy_user_session_path, method: :delete %></li> <% else %> <li><%= link_to "", new_user_session_path, class: "icon-user" %></li> <% end %> </ul> http://i.minus.com/i7krj72g9gmsd.png i using responsive navbar btw. i don't have bootstrap icons in rails project test this, see if works: <%= link_to raw("<i class='icon-user'></i>"), new_user_session_path %>

Check updates in specific directory in svn c# -

i'm trying check if svn subdirectory updated, , if so, update entire working directory. here do: svnclient svnclient = new svnclient(); svnworkingcopyclient workingcopyclient = new svnworkingcopyclient(); svninfoeventargs svninfo; svnworkingcopyversion workingcopyversion; uri svnrepository = new uri(m_svnaddress + /local/trunk/somefolder"); svnclient.getinfo(svnrepository, out svninfo); workingcopyclient.getversion("c:\\workspace\\somefolder", out workingcopyversion); int recentsvnrevision = unchecked((int)svninfo.revision); int currentversion = unchecked((int)workingcopyversion.end); if (recentsvnrevision != currentversion) // stuff the problem recentsvnrevision set latest revision number of entire directory on svn, , not revision of /local/trunk/somefolder directory. any ideas? you can use latest revision number specific directory: svninfoeventargs info; client.getinfo(remotepath, out info); return info.lastchangerevision; where