Posts

Showing posts from April, 2012

android - TextView's text alignment -

android - TextView's text alignment - <?xml version="1.0" encoding="utf-8"?> <tablelayout android:id="@+id/widget33" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:stretchcolumns="*" xmlns:android="http://schemas.android.com/apk/res/android"> <tablerow android:id="@+id/widget34" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <textview android:id="@+id/widget35" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="textview" android:gravity="center" /> <textview android:id="@+id/widget36" android:layout_width="wrap_content" android:layout_he...

c# - What can be done to fix a decorator whose root class requires the decorator instance? -

c# - What can be done to fix a decorator whose root class requires the decorator instance? - i refactoring piece of software seek create more testable/di friendly , create more extensible. original code relied on inheritance, thinking decorator more flexible design because want end user of component able insert layers below of layers creating. however, have run wall because of code in base of operations class passes this of methods. using inheritance wouldn't problem because this reference top layer type, having problem trying work out how create work decorator. here example: public interface inode { bool isreadonly { get; } void dosomething(); } public class node : inode { public node(isomefactory somefactory) { if (somefactory == null) throw new argumentnullexception("somefactory"); this.somefactory = somefactory; } private readonly isomefactory somefactory; public bool isreadonly { { homecom...

javascript - Error: $digest already in progress -

javascript - Error: $digest already in progress - i'm getting error while trying phone call function myctrl1($scope, $location, $rootscope) { $scope.$on('$locationchangestart', function (event, next, current) { event.preventdefault(); var reply = confirm("are sure want leave page?"); if (answer) { $location.url($location.url(next).hash()); $rootscope.$apply(); } }); } myctrl1.$inject = ['$scope', '$location', '$rootscope']; error is error: $digest in progress duplicated: prevent error $digest in progress when calling $scope.$apply() that error getting means angular's dirty checking in progress. most recent best practices should utilize $timeout if want execute code in next digest iteration: $timeout(function() { // code want run in next digest }); previous response: (don't utilize approach) use safe apply, this: ...

parsing - Find File based on partial file name and move file elsewhere in vbs -

parsing - Find File based on partial file name and move file elsewhere in vbs - i'm looking write vbs script following. - there mapping file contains identifier followed directory name (e.g. 123456-documents). - each line in mapping file, there document begins identifier need move elsewhere (e.g. 123456_otherstuff_dec 12.xls). - need parse total filename , take middle string (otherstuff) determine sub directory goes into. so in above example, file "123456_otherstuff_dec 12.xls" should end in directory c:.../current/documents/otherstuff/123456_otherstuff_dec 12.xls. i'm new vbs, know bit of java have been able create start on this. have far: set objfso = createobject("scripting.filesystemobject") set objfile = objfso.opentextfile("c:\documents , settings\w133960\desktop\test1\text1.txt", forreading) const forreading = 1 dim arrfilelines() = 0 until objfile.atendofstream redim preserve arrfilelines(i) arrfilelines(i) = objfile....

r - conditional query with few vectors -

r - conditional query with few vectors - this question has reply here: checking equality 1 reply short question.. next illustration data: equips <- c(1000829,1000829,1000829,1000829,10002244,10002244, 10002244,10002244,10002244,10002244) notifs <- c(306989814,306991263,306991263,306991263,306749278,306749278, 306749278,306749278,306854440,306868916) comps <- c("ignition , flame detection","ignition , flame detection","control box", "ignition , flame detection","service boiler!!!","ch components passive", "ignition , flame detection","not grouped in wcc", "electrical components","flue duct") rank <- c(1,2,2,2,1,1,1,1,2,3) df <- data.frame(equips,notifs,comps,rank) equip number machine, there 2 machines, notifs number visits => rank show numb...

linux - Installing android-sdk or adt-bundle on Ubuntu 12.04 -

linux - Installing android-sdk or adt-bundle on Ubuntu 12.04 - so on previous laptop i've installed android-sdk-linux , eclipse separately without adt-bundle , without issues whatsoever. also, installed under home directory. now have new laptop (clean slate) start with, wanted seek , install adt-bundle correct/conventional directory (which understand /usr/local/ ). but after extracting bundle /usr/local/ weird issues adb not beingness executable, etc. opening eclipse yields lot of errors regarding sdk , adt , , adb . what right method of doing this? step-by-step or otherwise comprehensive set of methods appreciated. also, there reason why should consider installing android-sdk-linux , eclipse separately instead of using adt-bundle ? thanks in advance :). help me larn more linux filesystems , administrations little bit too! it seems problem in linux filesystem permissions of folder. in case of home directory owner of files user, in case of /usr/local...

c# - Testing Linq Queries EF and the Repository Pattern -

c# - Testing Linq Queries EF and the Repository Pattern - trust me, i've read many articles , questions here on so. haven't found satisfactory answer. take matt robert's tutorial on repository pattern , unit testing example: i don't it.. both repositories contain exact same query logic? appears so, , if how useful pattern? mean whenever alter query in false repository, have alter query logic in actual repository - sounds pita , recipe problems. i maintain query in one method , test method. later occurred me, this: //student can db or false list public person getstudent(ienumerable<student> students,int studentid) { homecoming students.firstordefault(s =>s.personid ==studentid); } //unit test assert.isnull(getstudent(fakestudentlist, -1)) //actual code var pupil = getstudent(entities.students,-1) is there pattern mimics above? if so, it? or in fact how repository pattern works? if so, why sense repository pattern duplicates c...

Ember.js pass route from controller to linkTo -

Ember.js pass route from controller to linkTo - in controller have next definition: this.tabs = ember.a([ ember.object.create({ title:"all contacts", active:true, linkto:"contact.list.all" }), ember.object.create({ title:"my contacts", active:false, linkto:"contact.list.my" }) ]); and in html have next loop: {{#each tab in tabs}} <li {{bindattr class="tab.active:active"}} > {{#linkto tab.linkto data-toggle="tab"}} {{tab.title}} {{/linkto}}</li> {{/each}} when run view error saying "the route tab.linkto not found", because linkto helper exepects route object. i've tried passing route straight using e.g. linkto:app.router.router.gethandler("contact.list.my") but same error. ...

objective c - How to make NSURLRequest to obtain a Twitter request token? -

objective c - How to make NSURLRequest to obtain a Twitter request token? - i trying obtain request token twitter code: nsmutableurlrequest *murlrequest = [[nsmutableurlrequest alloc]initwithurl:[nsurl urlwithstring:@"https://api.twitter.com/oauth/request_token"]]; murlrequest.httpmethod = @"post /oauth/request_token http/1.1"; [murlrequest setvalue:@"user-agent" forhttpheaderfield:@"coupled http"]; [murlrequest setvalue:@"oauth oauth_callback=\"http%3a%2f%2fbytolution.com\"" forhttpheaderfield:@"authorization"]; [murlrequest setvalue:@"api.twitter.com" forhttpheaderfield:@"host"]; [murlrequest setvalue:@"accept" forhttpheaderfield:@"*/*"]; nshttpurlresponse *urlresponse; nserror *error; nserror *serializationerror; nsdata *responsedata = [nsurlconnection sendsynchronousrequest:murlrequest returningresponse:&urlresponse error:&error]; nslog(@"data: %@, res...

Python Regular Expression for Extrating URL -

Python Regular Expression for Extrating URL - i'm working on regular look , wondering how extract url html page. want print out url line: website is: http://www.somesite.com everytime link found, want extract url there after **website is:** help appreciated. will suffice or need more specific? in [230]: s = 'website is: http://www.somesite.com ' in [231]: re.findall('website is:\s+(\s+)', s) out[231]: ['http://www.somesite.com'] python expression

Overriding JSF component methods with jQuery -

Overriding JSF component methods with jQuery - i want override onblur() , onfocus() methods of p:inputtext (commentinput) component using jquery. i'm struggling getting fixed html id of component guess. tried far: jquery(document).ready(function() { $(document.getelementbyid("[#{p:component('commentinput')}]")).onblur(function() { $(this).css({'background-color':'#dfd8d1'}); }); }); or: jquery(document).ready(function() { $("[id='#{p:component('commentinput')}']").onblur(function() { $(this).css({'background-color':'#dfd8d1'}); }); }); both giving same result: uncaught typeerror: object [object object] has no method 'onblur' . xhtml code similar this: <h:form id="dtform"> <p:outputpanel id="datatablepanel"> <p:datatable id="datatable"> <p:column id="column"> ...

Javascript WYSIWYG editor that works in a chrome packaged app -

Javascript WYSIWYG editor that works in a chrome packaged app - are there wysiwyg editors work in chrome packaged app. of them don't seem work increased security policy. chrome complains tinymce using unload. have tried nicedit, cleditor, wymeditor , few others(can't quite remember). i ended making own. documentation on page makes easy. https://developer.mozilla.org/en-us/docs/rich-text_editing_in_mozilla javascript google-chrome google-chrome-extension wysiwyg

android - ImageView layout -

android - ImageView layout - essentially i'm looking scaletype="centercrop" without center. i having problem making imageview display correctly when it's larger screen dimensions. i'm trying display imageview starts top=0 , left=0 , not scaled. it's okay image not fit on screen. right have in relative layout: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/postagram_blank_large"/> </relativelayout> i've tried using wrap_content on relativelayout height , width. i've played scaletype using scrollview . problem scrollview image both taller ...

c# - Poorly performing query needs rewriting -

c# - Poorly performing query needs rewriting - i have piece of code that's performing badly, , need rewite introduce proper clause before starting .tolist however, that's i'm getting stuck. currently code looks lke (roughly, i've taken of search criteria out create easier display) var widgets = b in _caspentities.widgets.include("widgetregionlogs") .include("widgetstatuslogs").include("widgetvoltagetests") select b; ienumerable<widget> results = widgets.tolist(); if (comboboxregion.selectedvalue.tostring() != "0") { results = b in results b.currentregionlog != null && b.currentregionlog.regionid == int.parse(comboboxregion.selectedvalue.tostring()) select b; } if (comboboxstatus.selectedvalue != null) { results = b in results b.currentstatuslog != null && b.currentstatuslog.statusid == comboboxstatus.sel...

java - count button clicks -

java - count button clicks - i want count number of times button clicked using gui. i did code: private void jbutton1actionperformed(java.awt.event.actionevent evt) { int clicked = 0; clicked++; system.out.println(clicked); } but showing output "1", each time click button. i want every time click button show me count. ex: if click button 2 times should give me output of "2". you resetting counter every time click, because have defined variable within action method. seek not doing that. int clicked = 0; // move outside private void jbutton1actionperformed(java.awt.event.actionevent evt) { // int clicked = 0; -- resets 0 each time clicked++; system.out.println(clicked); } java swing jbutton

environment variables - The data in php://input is not equal to the data parsed and placed in $_POST -

environment variables - The data in php://input is not equal to the data parsed and placed in $_POST - i'm working out odd bug in wordpress, , don't know how wordpress works, ran around hr trying isolate problem , see root of issue comes from. turns out problem thing isn't updating because $_post not have info beingness requested. at top of file i'm accessing browser, before other code, did following: echo file_get_contents("php://input"); print_r($_post); exit(); i see wordpress uses $_post catch-all global , writes well. thought maybe wordpress kicks info out somewhere couldn't find that. @ top of file anyways, before else happens @ all.. don't think it's possible variables modified before that the output widget-text%5b3%5d%5btitle%5d=test&widget-text%5b3%5d%5btext%5d=thisisatest&sidebar=sidebar-1&sidebar-1_position=1&sidebar-2_position=&sidebar-3_position=&sidebar-4_position=&sidebar-5_positi...

ios - iPhone Camera Overlay issue -

ios - iPhone Camera Overlay issue - i using custom overlay photographic camera in iphone app,i have followed this tutorial. problem is-the overlay comes before shutter opens,means on shutter users can see overlay items(buttons,image etc) i have tried timer,to delay overlay appearance time of shutter opening animation,but not right way. any improve idea? -(void)onshowcam { nslog(@"sdadas"); overlay = [[customoverlayview alloc] initwithframe:cgrectmake(0, 0, screen_width, screen_heigth)]; overlay.delegate = self; ..... try utilize cameraoverlay=[[imagepickercontroller alloc]initwithframe:cgrectmake(0, 0, screen_width, screen_heigth)]; imagepicker.sourcetype=uiimagepickercontrollersourcetypecamera; imagepicker.delegate=self; imagepicker.showscameracontrols=no; imagepicker.cameraflashmode=uiimagepickercontrollercameraflashmodeoff; [imagepicker setcameraoverlayview:cameraoverlay]...

java - Select multiple contacts Android -

java - Select multiple contacts Android - i need select multiple contacts cell phone android application. have searched @ many websites there nobody has proposed built in solution. uri allows me select single contact want open view of contacts check boxes. help highly appreciated in regard. java android

functional programming - Readin a two-dimensional array using scala -

functional programming - Readin a two-dimensional array using scala - suppose have txt file named "input.txt" , want utilize scala read in. dimension of file not available in beginning. so, how build such array[array[float]]? want simple , neat way rather write code in java iterates on lines , parse each number. think functional programming should quite @ it.. cannot think of 1 now. best regards if input correct, can in such way: val source = io.source.fromfile("input.txt") val info = source.getlines().map(line => line.split(" ").map(_.tofloat)).toarray source.close() update: additional info using source check this thread scala functional-programming

xml - XSLT: Combine elements without duplicated -

xml - XSLT: Combine elements without duplicated - i want transformation xml text combining elements, avoiding duplicates in output. xml that: <a> <b> <param1>value0</param1> <param2>value1</param2> </b> <b> <param1>value2</param1> <param2>value3</param2> </b> <c> <param3>valuec1</param3> <d> <param4>value0</param4> <param5>value4</param5> </d> <d> <param4>value0</param4> <param5>value5</param5> </d> <d> <param4>value2</param4> <param5>value6</param5> </d> </c> <c> <param3>valuec2</param3> <d> <param4>value0</param4> <param5>value5</param5> </d> </c> </a> and output: object: param1=va...

c# - How to add Like/Unlike functionality in GridView? -

c# - How to add Like/Unlike functionality in GridView? - if come in values manually in database can view on wall not know how insert value programatically on clicking 'like'. query fired on clicking 'like' (which in every row below msg) "insert tbl_like (scrapid,fromid,likestatus) values(a*,sessionuserid,1)"; a* = must scrapid of particular row in clicked. database table: scrap_table: scrapid | fromid | toid | msg like_table: likeid | scrapid | fromid | likestatus source code: <asp:gridview id="gridviewuserscraps" itemstyle-verticalalign="top" autogeneratecolumns="false" gridlines="none" width="100%" showheader="false" runat="server" alternatingrowstyle-backcolor="#a5a5a5" cellpadding="4" forecolor="#333333" datakeynames="scrapid" onitemcommand="commandlinkclicked"...

jsp - displaying extra > on option tag -

jsp - displaying extra > on option tag - i using alternative tag insides input tag due requirement below. but result showing > . <input type="checkbox" <option></option>> i don't know if checkbox type input tag has alternative attribute.. your alternative attributes there means nothing, seek remove alternative tag.. show checkbox also.. jsp

Rails 3 validate presence of many columns with custom messages -

Rails 3 validate presence of many columns with custom messages - is there way specify many validations more concisely? validates :col_a, :presence => {:message => 'col_a cannot blank'} validates :col_b, :presence => {:message => 'col_b cannot blank'} validates :col_c, :presence => {:message => 'col_c cannot blank'} i'd settle generic message if had to. you can give multiple field names validator validates :col_a, :col_b, :col_c, :presence => true you can specify multiple validators in same line. validates :col_a, :col_b, :col_c, :presence => true, :numericality => true the total error message contain field name. don't need add together field name prefix. if want utilize custom message then: validates :col_a, :col_b, :col_c, :presence => {:message => "empty value found"} ruby-on-rails ruby-on-rails-3 validation

host float constant usage in a kernel in CUDA -

host float constant usage in a kernel in CUDA - i using cuda 5.0. noticed compiler allow me utilize host-declared int constants within kernels. however, refuses compile kernels utilize host-declared float constants. know reason seeming discrepancy? for example, next code runs fine is, not compile if final line in kernel uncommented. #include <cstdio> #include <cuda_runtime.h> static int __constant__ dev_int_constant = 1; static float __constant__ dev_float_constant = 2.0f; static int const hst_int_constant = 3; static float const hst_float_constant = 4.0f; __global__ void uselesskernel(float * val) { *val = 0.0f; // utilize device int , float constants *val += dev_int_constant; *val += dev_float_constant; // utilize host int , float constants *val += hst_int_constant; //*val += hst_float_constant; // won't compile if uncommented } int main(void) { float * d_val; cudamalloc((void **)&d_...

c# - How to validate TextBox and label values -

c# - How to validate TextBox and label values - need validate label values(get database) , textbox values(user enters). if textbox field value greater label value means, have show error or warning message. here's simple javascript validator looking for. demo: output: script: class="lang-js prettyprint-override"> document.getelementbyid( 'numbers' ).addeventlistener( 'keyup', function ( event ) { if( event.srcelement.classname == 'validate' ) { var value = event.srcelement.value, validationvalue = event.srcelement.nextsibling.textcontent; if( isnan( value ) ) { event.srcelement.nextsibling.classname = 'error-nan'; } else if( parseint( value ) > parseint( validationvalue ) ) { event.srcelement.nextsibling.classname = 'error-too-large'; } else { event.srcelement.nextsibling.classname = ''; }; }; } );...

iphone - getting empty UITable with AFNetworking JSON Parsing -

iphone - getting empty UITable with AFNetworking JSON Parsing - i trying parse json info afnetworking afjsonrequestoperation. getting empty uitable reason. i managed without afnetworking. could please have @ code google drive #import "afnetworking.h" #import "afjsonrequestoperation.h" @interface kkviewcontroller () @end @implementation kkviewcontroller @synthesize movies = _movies, count = _count; - (id)initwithstyle:(uitableviewstyle)style { self = [super initwithstyle:style]; if (self) { // custom initialization } homecoming self; } - (void)viewdidload { [super viewdidload]; self.movies = [[nsarray alloc] init]; // info youtube nsurl *url = [[nsurl alloc] initwithstring:@"http://gdata.youtube.com/feeds/api/playlists/pl0l3xlkh7unvldr0zz3xzzup2teny_qap?v=2&alt=jsonc&max-results=50"]; nsurlrequest *request = [[nsurlrequest alloc] initwithurl:url]; afjsonrequesto...

why the cygWin grep gives error? -

why the cygWin grep gives error? - i trying recursively search below string in c# files. why gettig error? took me lontime install cygwin , have been using unix forever, not acting unix's grep. noteworthy using cygwin windows7. thanks grep -r 'new iintf' *.* grep: *.*: no such file or directory grep -r 'new iintf' *.cs grep: *.cs: no such file or directory there may no files matching *.* in current directory. perhaps mean grep -r 'new iintf' . grep cygwin

iphone - Can't set property with custom setter -

iphone - Can't set property with custom setter - i've tried implement next locationmanager: starting update users location - (void)startstandardupdates { if (self.locationmanager == nil) { self.locationmanager = [[cllocationmanager alloc] init]; } self.locationmanager.delegate = self; self.locationmanager.desiredaccuracy = kcllocationaccuracybest; // set motion threshold new events self.locationmanager.distancefilter = kcllocationaccuracynearesttenmeters; [self.locationmanager startupdatinglocation]; cllocation *currentlocation = self.locationmanager.location; if (currentlocation) { self.currentlocation = currentlocation; } } implementing custom setter property send notifications - (void)setcurrentlocation:(cllocation *)currentlocation { self.currentlocation = currentlocation; nslog(@"%f", currentlocation.coordinate.latitude); //notify app of location alter nsdictionary *u...

php - mysqli not displaying image from database -

php - mysqli not displaying image from database - im changing mysqli , because im learning pretty hard. doing wrong? images appear broken , prints file name, know simple question ive tried searching net no result. sorry im learning <?php include_once("db_conex.php"); $query = "select * employees order cost asc"; $query = mysqli_real_escape_string($db,$query); if($result = mysqli_query($db,$query)){ while($row = mysqli_fetch_object($result)){ echo "<br /><br />"; echo '<img src="/upload/ " border=0>', $row->photo; echo "<br /><br />"; echo '<b> city: </b>', $row->city; echo '<b> price: </b>', $row->price; echo '<b> bath: </b>', $row->bath; echo '<b> bath: </b>', $row->bed; echo '<b> description: </b...

active directory - Is it possible to import x509Certificates to windows phone? -

active directory - Is it possible to import x509Certificates to windows phone? - certificate used sign pkcs requests or pdf-s created on phone. there mechanizm it? can connect advertisement , ca windows phone app? thanks yes, can email cer file, download cer file or launch app , install custom certificates on wp8. see code sample in previous reply of mine @ tls connection: override certificate validation windows-phone-7 active-directory windows-phone-8 x509certificate x509

c++ - OpenSSL private key read error(PEM_read_bio_RSAPrivateKey) -

c++ - OpenSSL private key read error(PEM_read_bio_RSAPrivateKey) - i trying read privatekey openssl , vc++, getting error " openssl error: error:0906d064:lib(9):func(109):reason(100) ".. my private key : -----begin rsa private key----- miicxqibaakbgqcnhvs+q65lvg2xoclttygpgt9faysgztrcowhedo8tx1dyprcx 2i8x/cvb9nmfdakt65agfalbzrofbpcr2mq4wddviz31ksuymqi4t68ylwnt89ge wqf6aokpy1e2bw+odxc+mpbtpyxy1rujas/abt5vxi7gwkn9fsj3mm9bjqidaqab aogacxuxnmxrpjzoj0fee9tnfsxwm5jcrs2jbhhwxjygi/yagvytusfmrtj3iheh itnld3siaxpj/qscrshy2nef8up60v7rf8bs+sbicnhbdz8zokxn9defcwjkil55 dv0ghjox6ugwuukuaihcm2egg5eooq8psuxy8lppwlvfuyucqqdbkfg9y/q/3lmb cdyfbpsp3qvma+fdgcw9lrxtowhu0rken/cc3rfkhmehfsw9ghur8qbpydva6d9h y7kxya7lakeawtjteo/zavexh/+ygiql6w89bhltamwiekxpqtane86kddcekyde fridgk1zhdouddmahwojqjjzy/njreq8bwjbamoj6u3vkzjd8ex8jq5ye6nsyt3d mz73xl5mo6l9sjryy0kx/+dnkiro+koyfngef8bxtcsluallsnisybf0htucqqcr dd4cvgjhjpop4wktxt6bjsd6lckyu9+yuq8/rfnc0hqyxhzwkx7ucft2spbxfyk2 j4v9+v+ncs13dzztj+tzakbi6uwht...

jade mixin arguments with bracket throw an syntax error -

jade mixin arguments with bracket throw an syntax error - i create mixin this( knockout virtual elem binding) mixin ko(condition) != "<!-- ko "+condition+'-->' // /ko but when want call +ko('if:condition()') it throw error : uncaught syntaxerror: unexpected token illegal maybe ast parse issue suppose way work arount it? all right found ugly way deal it +ko("if:condition(\u0029") jade

html - why public websites does not use single page interface (SPA)? -

html - why public websites does not use single page interface (SPA)? - why not recommended utilize single page interface public websites? now-a-days search engines capable crawling spi sites proper web page design. is there other reason? this less stackoverflow question , more give-and-take forum question, comes mind concept of websites "break button". for big websites, single page application design hard because giving users range of functionality , interactivity coupled ability move fluidly , forth between states introduces problems. user has nail button 95 times leave site, or hits button 1 time expecting go "back" within application , instead leaves site , loses state unexpectedly. it's great in theory hard in practice. html web-crawler single-page-application singlepage

ImportError: No module named django.core.wsgi Apache + VirtualEnv + AWS + WSGI -

ImportError: No module named django.core.wsgi Apache + VirtualEnv + AWS + WSGI - good eve everyone! so trying publish site on amazon's ec2 instance, , maintain getting 500 error. dunno why. have been looking @ tutorials, , can't figure why wrong this.... thanks! //log files [sun feb 17 23:12:48.066802 2013] mod_wsgi (pid=2102): target wsgi script '/srv/www/app/poka/apache/wsgi.py' cannot loaded python module. [sun feb 17 23:12:48.066840 2013] mod_wsgi (pid=2102): exception occurred processing wsgi script '/srv/www/app/poka/apache/wsgi.py'. [sun feb 17 23:12:48.066864 2013] traceback (most recent phone call last): [sun feb 17 23:12:48.066889 2013] file "/srv/www/mysite/poka/apache/wsgi.py", line 26, in <module> [sun feb 17 23:12:48.066920 2013] django.core.wsgi import get_wsgi_application [sun feb 17 23:12:48.066945 2013] importerror: no module named django.core.wsgi //apache config files wsgiscri...

backup - hbase export row size limit -

backup - hbase export row size limit - i want create backup of hbase table using hbase export. problem rows big , java heap space error. there parameter can give in order limit copied size in each step? i utilize next command: hadoop jar /usr/lib/hbase/hbase-0.90.3-cdh3u1.jar export tablename backuppathonhdfs numberofcolumnfamiliesversions or hbase org.apache.hadoop.hbase.mapreduce.export tablename backuppathonhdfs numberofcolumnfamiliesversions you can utilize export tool, is, hadoop jar hbase-*-snapshot.jar export , regexp param (if starts ^ ) or interpreted row key prefix lastly argument. details see in source seems not yet documented (should work 0.91.0 on). backup hbase

Dropdownlist in asp.net mv3 without using razor -

Dropdownlist in asp.net mv3 without using razor - i have collection ienumerable in model contains multiple product objects. product object has fields id,name cost,etc. i want create dropdownlist in view of product ids without using razor. you can manually generate html iterating on product collection. work you? <select name="productid" id="productid"> @foreach(var p in model.products) { <option value="@p.sku">@p.description</option> } </select> edit: aspx / webforms view engine <%if(model.productcollection!=null) {%> <select name="productid" id="productid"> <% foreach (var p in model.productcollection) {%> <option value="<%:p.id%>"> <%:p.id%> </option> <% }%> </select> <% }%> asp.net-mvc

kendo ui - Change Category Label Location to Outside of Chart Area -

kendo ui - Change Category Label Location to Outside of Chart Area - i'm working pretty simple kendo ui chart. when values go below zero, axis labels remain near 0 axis. caused text , bars overlap, not optimal. i labels show @ bottom of chart area. 1 know how this? see below, 'approved' text overlapping gray bar. i'd label @ bottom of chart area. @gman, you're looking axiscrossingvalues . valueaxis: { min: -10, max: 10, // keeps default axis @ 0 crossing point // , moves "label" axis bottom axiscrossingvalues: [0, -10] } take @ code sample here: http://jsfiddle.net/design48/7c3np/ , alter axiscrossingvalues y-coordinate -8 or something. hope helps. kendo-ui

joomla2.5 - Joomla 2.5 Article Menu Assignment -

joomla2.5 - Joomla 2.5 Article Menu Assignment - i trying assigning menu category blog type. article category custom created , @ level 2. means have root article category 'rootcategory'. if assign menu category fine. have kid category under 'root category' child- 1. if assign menu showing error. category not found . please help me . in advance have linked "child- 1" valid article/ category blog /... has not status "registered" or "special"? could provide url? joomla2.5

apache - PHP spits a new line before any output -

apache - PHP spits a new line before any output - i have vps 1&1 centos 5.2 64-bit. last tuesday i've upgraded php , installed imagemagick had upgrade many other packages, including apache, mysql, perl, etc. lots of stuff got upgraded in process beingness finish noob went it. now problem websites this: 1. 2. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/ xhtml1/dtd/xhtml1-transitional.dtd"> (a new line on every single php file before output) i tried ob_start(); , die(trim(ob_get_clean())); no luck. new line continues persist. i briefly checked /etc/php.ini nil standing out. what can do? shot in dark, check php.ini auto-prepend-file value. might pointing blank default file happens have line break. php apache

add option value of the select box dynamically using javascript -

add option value of the select box dynamically using javascript - i want populate year in select javascript. did next code. <html> <head> <script type="text/javascript"> $(document).ready(function(){ var cur_year=new date().getfullyear(); var obj=document.getelementbyid("yr"); alert(obj); (var = 2000; <= 2020; i++) { opt = document.createelement("option"); opt.appendchild(document.createtextnode(value)); opt.selected = selected; opt.value = i; opt.text=i; obj.appendchild(opt); } }); </script> </head> <body> <select id="yr"> <option>year</option> </select> </body> </html> i don't know wrong in this. want populate year , want select cur...

php - PHPSoap converts a non-repeatable field into an array in case of multiple occurence -

php - PHPSoap converts a non-repeatable field into an array in case of multiple occurence - i've defined soap webservice xsd type defining non-repeatable field. if provide many occurrences of field, expect phpsoap throw exception or wrong, converts array (as expected if repetition allowed). here extract of xsd part of wsdl : <xsd:complextype name="orderitem"> <xsd:sequence> <xsd:element type="xsd:string" name="orderid" maxoccurs="1"/> <!-- maxoccurs useless default value 1 suremore ... --> <xsd:element type="xsd:string" name="sku"/> </xsd:sequence> </xsd:complextype> if send request message, got array behind soap layer (i expected exception) : <orderitem> <orderid>12345685</orderid> <sku>sku123456</sku> <orderid>12345686</orderid> </orderitem> here var_dump of orderitem object r...

html5 - HTML image tag seems like have some margin or padding -

html5 - HTML image tag seems like have some margin or padding - i working on new porfolio website development, i'm development stage , started walking @ problem. seems image tags little margin or padding on bottom have 4px exact. have margins , padding 0 put, not resolved. how solve this? i love hear you. images typically vertically aligned baseline of text, causes bit of spacing @ bottom. using vertical-align: middle or vertical-align: top should prepare issue. here's example: http://jsfiddle.net/jga5f/2/ html html5

xml - Simplexml to database using php -

xml - Simplexml to database using php - i using amazon api retrieve list of actors store in database. maintain getting duplicate entries , hoping help me out if possible. here doing $i = $result->items->item->itemattributes->actor; echo "actor :"; $alist = array(); foreach ($i $a) { $alist[] = $a; print_r($alist); } and result. array ( [0] => simplexmlelement object ( [0] => tommy lee jones ) ) array ( [0] => simplexmlelement object ( [0] => tommy lee jones ) [1] => simplexmlelement object ( [0] => john goodman ) ) array ( [0] => simplexmlelement object ( [0] => tommy lee jones ) [1] => simplexmlelement object ( [0] => john goodman ) [2] => simplexmlelement object ( [0] => peter sarsgaard ) ) array ( [0] => simplexmlelement object ( [0] => tommy lee jones ) [1] => simplexmlelement object ( [0] => john goodman ) [2] => simplexmlelement object ( [0] => peter sarsgaard ) [3] => simplexmleleme...

dll - Standard input/output in C# process -

dll - Standard input/output in C# process - my application app using other application subapp . when app needs subapp creating process subapp , putting info subapp stdin , reading subapp stdout . the problem subapp using library writes stdout . fragment of subapp code: outsidelibrary.dosomeinitialization(); // <-- writes stdout stream input = console.openstandardinput(); stream output = console.openstandardoutput(); info = (dataformat)formatter.deserialize(input); //do job formatter.serialize(output, result); is there way prevent code don't have writing stdout? assuming want disable 3rd party component output , have command on rest of subapp code can next trick: redirect standard output null @ application bootstrap. when need write stdout temporary set standard output normal, write , set null again. using system; using system.collections.generic; using system.linq; using system.text; using system.io; namespace stdio { class programm...

jquery - fadeOut() single div over multiple -

jquery - fadeOut() single div over multiple - i have 3 divs class "page". each div there "info" div shows informations div. what wanted accomplish when click text under "page" div fadeout , "info" fadein. even if know nil of jquery, managed working. html is: <div id="content"> <div class="page"><p class="click">click me open</p></div> <div class="info"><div class="closebut"></div></div> <div class="page"><p class="click">click me open</p></div> <div class="info"><div class="closebut"></div></div> <div class="page"><p class="click">click me open</p></div> <div class="info"><div class="closebut"></div></div> ...

c# - How does a Generic Method Work? -

c# - How does a Generic Method Work? - i picked tutorial on msdn allow user of app alter , save settings. after head scratching think understand of it, except 1 thing. let's start relevant part of original code. stands in class called appsettings. property i'm using test son1. understand this: at end of code, got this: // property , set son1 key. public int son1 { { homecoming getvalueordefault<int>(son1keyname, son1default); } set { if (addorupdatevalue(son1keyname, value)) { save(); } } } if set property, it's easy. calls method: public bool addorupdatevalue(string key, object value) { bool valuechanged = false; // if key exists if (settings.contains(key)) { // if value has changed if (settings[key] != value) { // store new value ...

datatable - data table conflict with require-jquery.js -

datatable - data table conflict with require-jquery.js - current application 1 has used require-jquery.js. have implemented jquery info table. working fine when remove "require-jquery.js". when include require-jquery.js getting error below: error: mismatched anonymous define() module: function ( $ ) { see structure: jquery.min.js require-jquery.js jquery.datatables.js and this: tickerdashboardtable = $('#tickerdashboardtable').datatable( {} ); i don't know how utilize require-jquery.js. how can resolve issue. <script data-main="scripts/main.js" src="scripts/jquery.js"></script> create main.js contains similar to: require(["jquery", "jquery.alpha", "jquery.beta"], function($) { //the jquery.alpha.js , jquery.beta.js plugins have been loaded. $(function() { $('body').alpha().beta(); }); }); you have phone call scripts utilize "...

MongoDb: Search value in ranges in different situations -

MongoDb: Search value in ranges in different situations - first. we have follows records in db { _id:1, values: [ 1 ,5 ,6 ,8]}, { _id:2, values: [5 ,7 ,8,10 ,40 ,1]}, { _id:3, values: [50 ,60 ,5 ,1 ]} i need query records whitch consist 'values' range 8 - 10. result must {_id:1},{_id:2} query ({values:{'$gte':8,'$lte':10}}) homecoming records , not right result, due 'values' array!! second. we have follows records in db {_id:1, from: 1, to:100}, {_id:2, from: 101, to:200}, {_id:3, from: 201, to:300}, {_id:4, from: 301, to:400} ... i need found records element 205 within range from-to . result {_id:3} query({from:{'$lte':205},to:{'$gte':205}) is slow , dont utilize indexes {from:1,to:1} @ all; i'm bit confused. can help, please. thank you. case 1: range query on array values edit: did test using wrong values. as documentation explains, using conditional operators on array values (and i...

android - A Local Service implementation closely related to Application Life Cycle -

android - A Local Service implementation closely related to Application Life Cycle - in app. have extended application class myapp, , have few activities a,b,c,d default activity or root activity. want start service (say myservice) within oncreate of myapp , stop when user logs out application, however need strong way communicate between activities (a,b,c,d), myapp , myservice. application launched sec time memory. oncreate of myapp not called start service onclick of signin button within activity a. have number of questions :- i have tried both startservice , bindservice problem startservice don't service reference future use. if utilize bindservice create service visible through out application life cycle till explicitly stop it. way applicable in case ? what best way implement communication between service , myapp / activities , vice verse ? communication mean 2 type of communication, 1. needs ui thread i.e. start activity, show dialog etc. 2. myservice.dosomehin...

python - Marking classes and/or methods as deprecated in Sphinx -

python - Marking classes and/or methods as deprecated in Sphinx - is there way mark class and/or method deprecated in sphinx? can find deprecated alternative modules. using generic admonition work, wouldn't carry semantic meaning. i think you're looking deprecated . python documentation deprecated python-sphinx

node.js - How to run CANVASENGINE server and physics world -

node.js - How to run CANVASENGINE server and physics world - hi. i'm using framework canvasengine node.js. i'm using box2d framework (physic engine). the problem have canvasengine framework running (so it's waiting connections). want run infinite loop stepping physics world (world.step(fps, iterations)), seems threads aren't existent in node.js. so, how can accomplish this? thanks help! setinterval(function(){world.step()},1000/60) should step world @ 60 fps node.js