Posts

Showing posts from August, 2015

jquery - How to change the bootstrap css width into 1000px? -

in bootstrap container width fixed in 1170px, convert container width 1000. so, please 1 can answer me , tell me procedure. css override: body .container { width: 100%; !important; } or fixed width: body .container { width: 1000px; !important; } but if use bootstrap-responsive , lose reponsiveness need configure in css declarations.

c# - Upload files to a specific folder in dropbox -

i using example upload files dropbox: http://cgeers.com/2012/03/11/dropbox-rest-api-part-5-file-upload/ which is: public filesysteminfo uploadfile(string root, string path, string file) { //... } the method has 3 parameters: root: root relative path specified. valid values sandbox , dropbox. path: path file want upload. file: absolute path local file want upload call method follows: var file = api.uploadfile("dropbox", "photo.jpg", @"c:\pictures\photo.jpg"); dropbox api says same example: https://www.dropbox.com/developers/core/docs#files-post so no mentioning of "parent folder".. how can upload files under specific folder instead of root? cant do var file = api.uploadfile("dropbox", @"myfolder\photo.jpg", @"c:\pictures\photo.jpg");

c# - Looking for Delete statement for this Select statement -

i have db in production , have been brought in make changes. going except can't delete execute. know it's because of joins , incorrect ref. integrity etc. can't change that. select statement below executes without issue , displays in gridview: select [stock inventory].materialnumber, [stock inventory].[optimum stock] optimum_stock, customerservice.part, customerservice.samplesrequired, customerservice.frequency, customerservice.country [stock inventory] inner join customerservice on [stock inventory].materialnumber = customerservice.part i looking use delete link part of generated table if have not provided enough information, please let me know since mentioned needing delete both tables this: begin transaction declare @deleted table (materialnumber int) --whatever data type need delete s output deleted.materialnumber @deleted [stock inventory] s inner join customerservice c on s.materialnumber = c.part delete c cu...

css - iPhone 3/4 pixel perfection -

i have question, client needs mobile website , has display pixel perfect on mobile devices (emphasis on iphone). i have .psd design 640px wide. this website tells me older iphones (<= 3) have width of 320px , newer ones (>= 4) have width of 640px. my question - how make single page display same on both older , newer devices? know newer versions have retina display, leave width , adjust 640px or scale .psd down 320px , adjust that? thanks! you'll need use meta viewport tag browser knows calculate dimensions based on device. define css classes using percentages (not pixels). an example looks this: <meta name="viewport" content="width=device-width"> and blog post: http://www.quirksmode.org/blog/archives/2010/09/combining_meta.html if need load different images different screen densities, can try using window.devicepixelratio determine screen density , use javascript load correct image. http://www.quirksmode.org/blog/arch...

asp.net - Long text in ssrs report viewer pushes column past end of table -

i have column in ssrs report holds long text field, such "notes". in designer , in preview mode, on export excel , pdf, looks fine. however, in report viewer on asp.net page, pushes containing column far beyond defined width of column. ideas how make not this, or break in export if alter rendered text somehow? insert rectangle first inside column cell text box data.

How to install a C# Windows Service on a remote server? -

hi have developed c# windows service in visual studio. able install service on local machine , works fine. want able install on remote server . can tell me how this? my service built on windows service vs template, it's simple . i not geeky, useful tutorial, manual can understand. i running vs 2010 professional. you need have remote desktop access server. when in can via commandline using this: c:\windows\microsoft.net\framework\v2.0.50727\installutil /logtoconsole=true c:\path\to\service.exe then can manage (start it, set auto start, stop it, restart it) going start | run , typing services.msc then press enter. to uninstall use: c:\windows\microsoft.net\framework\v2.0.50727\installutil /u /logtoconsole=true c:\path\to\service.exe but need have stopped service first. note: there new util in newer .net releases - notes while ago when built 2.0 service. in c:\windows\microsoft.net\framework\ version number matches .net you're developing in....

iphone - How to constantly check GPS Signal strength -

Image
i want display gps signal strength in form of image like: can't find documentation or example. have tried this: if (self.locationmanager.location.horizontalaccuracy < 0) { ...@"no"]; } else if (self.locationmanager.location.horizontalaccuracy > 163) { ...@"poor"]; } else if (self.locationmanager.location.horizontalaccuracy > 48) { ...@"average"]; } else { ...full } but seams code nothing. how can monitor gps signal strength, possible? where code located? code should in delegate callback: - (void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation or ios 6.0 , above: - (void)locationmanager:(cllocationmanager *)manager didupdatelocations:(nsarray *)locations

Join values from ruby array but keep their type -

i've got array : a = [27624, 22, 33, "ema", "test", 11, nil] when a.join(',') 1 bing string values joined. how can same effect strings retain type. output should : "27624, 22, 33, 'ema', 'test', 11" a.map{|e| e.is_a?(string) ? "'#{e}'" : e}.join(',') alternatively: (this may not have desired effect - particularly nil , other types haven't included here) a.map(&:inspect).join(',')

Slow MySQL queries in Python but fast elsewhere -

i'm having heckuva time dealing slow mysql queries in python. in 1 area of application, "load data infile" goes quick. in area, select queries slow. executing same query in phpmyadmin , navicat (as second test) yields response ~5x faster in python. a few notes... i switched mysqldb connector , using sscursor. no performance increase. the database optimized, indexed etc. i'm porting application python php/codeigniter ran fine (i foolishly thought getting out of php speed up) php/codeigniter executes select queries swiftly. example, 1 key aspect of application takes ~2 seconds in php/codeigniter, taking 10 seconds in python before of analysis of data done. my link database standard... dbconn=mysqldb.connect(host="127.0.0.1",user="*",passwd="*",db="*", cursorclass = mysqldb.cursors.sscursor) any insights/help/advice appreciated! update in terms of fetching/handling results, i've tried few ways. initial q...

html - overriding parent contentEditable with javascript -

i have div this: <div id="op" contenteditable="true">hello<div class="dynamic">......sth </div> <div class="dynamic"> ...sth </div> .......<div class="dynamic"> </div>.. <div class="dynamic"> </div>..</div> the divs inside div id "op" created dynamically , appended "op" appendchild method. after dynamic divs added, need change contenteditable of div "op" false while divs inside of "op" true. basically, being said, target able modify divs true contenteditable appended div false contenteditable.i did this: document.getelementbyid("op").setattribute("contenteditable",false); document.getelementsbyclassname("dynamic").setattribute("contenteditable",true); this not work , think reason simple. although modified contenteditable of "dynamic" class divs, still inside div has ...

SSH with X11 forwarding in Perl -

i have tried perl modules net::ssh:perl , net::openssh no avail. x11 forwarding work because if "ssh root@host" , execute x application such "xterm" window back. here things i've tried: $self->{'ssh'} = net::openssh->new("root:pw@".$hostname); print $self->{'ssh'}->capture("env"); #the display variable not set won't work print $self->{'ssh'}->capture("xterm"); nope $self->{'ssh'} = net::openssh->new("root:pw@".$hostname, master_opts => ['-x' => '']); print $self->{'ssh'}->capture("env"); #the display variable not set won't work print $self->{'ssh'}->capture("xterm"); #nope print $self->{'ssh'}->capture({master_opts => ['-x']}, "xterm"); #nope nope, net::ssh::perl $self->{'ssh'} = net::ssh::perl-...

Objective-C - iOS - Singleton explanation -

this code of singleton + (aldata *)sharedinstance { static aldata *_shared; if(!_shared) { static dispatch_once_t oncepredicate; dispatch_once(&oncepredicate, ^ { _shared = [[super allocwithzone:nil] init]; }); } return _shared; } + (id)allocwithzone:(nszone *)zone { return [self sharedinstance]; } - (id)copywithzone:(nszone *)zone { return self; } #if (!__has_feature(objc_arc)) - (id)retain { return self; } - (unsigned)retaincount { return uint_max; } - (void)release {} - (id)autorelease { return self; } #endif now, singletons have seen being called in way : [[singleton sharedinstance] instancemethod]; but want call in way : [singleton classmethod]; to when create method : + (bool)decide:(bool)var { [self sharedinstance]; if (var) return no; else return yes; } instead, if want proceed in first way have declare method in way : - (bool)decide:(bool)var { if (var) retu...

Customize reports.html file inside jbehave\view folder -

i have customize reports.html file created inside jbehave\view folder. there example available same. you must check this official reference.

docx - Why Office OpenXML splits text between tags and how to prevent it? -

i'm trying work docx files using phpword library , templating system. have found , updated someones (cant remember name, not important) path library can work tables (replicate rows , use standard setvalue() phpword on each of row). if create own document, data in xml in normal structure, variable replaced ${variable} in own tag this: <w:tbl> <w:tr> ... ${variable} </w:tr> </w:tbl> i simplified code, in actual code there number of other tags descibing sizes, styles, etc. my problem have proccess documents other people prohibited make big changes, document @ point table 1 blank row. add ${variable} variables , run through phpword. problem is, fails. after doing research , found out source xml looks this: .... ... ${va ... riab ... le} .... (again heavily simplified, picture) this structure problem me, because function clone rows uses strpos(), substr() , re...

php - Display categories from a database -

i updating my site . can see have list of catagories (example: free offers, gifts, accessories). these catagories list promotions , link single page , each 1 of promotion saved in mysql under dbname xclocouk_mobile , table mobi , each 1 has promo_cat field name category underneath it. i know how connect database. want know how index page read , display list of catagories found under promo_cat listed above? i need them list title shown on page done manually. not want display duplicates. how can accomplish this? $q = "select promo_cat mobi"; $result = mysql_query($q,$connection); while($output = mysql_fetch_array($result)) { echo $output['category']; } edit: this list duplicates if there duplicates in database, else won't. if have duplicates in db, use "select distinct(promo_cat) .. "

How numerically solve an complex integral using the MATLAB -

i'm trying solve equation: k=sqrt((r*t)/(4*pi*lambda))*integral -inf inf of exp(-((lambda+f*neta)/r*t-x)^2*r*t/4*lambda)/exp(x)+1 regard x where, neta interval 0 1 , others symbols (r, t, f, lambda , pi) have constant values. i tried use these codes: code 1 clear all; close all; clc; f = 96485.34; r = 8.3145; t = 298.15; lambda = 0.2; neta=0:0.1:1; pi=3.1415; f=@(x) exp(-((lambda+f*neta)/r*t-x).^2*r*t/4*lambda)/(exp(x)+1); q=integral(f,-inf,inf); k= sqrt((r*t)/(4*pi*lambda)).*q code 2 clear all; close all; clc; f = 96485.34; r = 8.3145; t = 298.15; lambda = 0.2; neta=0:0.1:1; pi=3.1415; x= 0:100; f(x)=exp(-((lambda+f*neta)/r*t-x).^2*r*t/4*lambda)/(exp(x)+1); q=quadl('f', 0, 100); k= sqrt((r*t)/(4*pi*lambda)).*q but these codes return errors not know solve. can me, please? thanks the problem neta. if scalar value code fine. how propose integrate on neta interval respect different variable? mean? tried taking individual values neta 0 1 , calcula...

java - How to set a variable in Install4j -

i have compiler variable called myvariable. in script set - context.setvariable("myvariable",new string("szzz")); however, when use variable has not changed value system.out.format("var %s!!!\n",context.getcompilervariable("myvariable")); outputs original value running debug version of installer shows variable has been changed i confused , appreciate clarification thanks graham labdon your mixing 2 different variable systems. context#setvariable sets , installer variable, context#getcompilervariable gets value of compiler variable. compiler variables fixed @ compile-time, cannot changed @ runtime. use context.getvariable("myvariable") to value of installer variable.

java - Moving ImageView on HorizontalScrollView -

i displaying panoramic photo, , want imageview move according sensor orientation (my phone's orientation determines image view , it's wide display entirely @ once). when invoke methods change imageview (e.g. setx) application crashes. doing in ui thread, don't know why doesn't work. code refers sensor works fine. any appreciated. public class imageactivity extends activity { private imageview imageview; private locationmanager locationmanager; private string provider; private sensormanager sensormanager; public float val = 0; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_image); locationmanager = (locationmanager) getsystemservice(context.location_service); criteria criteria = new criteria(); provider = locationmanager.getbestprovider(criteria, false); location location = locationmanager.getlastknownlocation(provider); sensormanager = (sensormanage...

postgresql - Amazon Redshift: Insert data into table from S3 using Java API -

i have file in s3. issue commands using java aws sdk, take data , place redshift table. if table not exist create table. have been unable find clear examples on how wondering if going wrong way? should using standard postgres java connectors instead of aws sdk? connect ( http://docs.aws.amazon.com/redshift/latest/mgmt/connecting-in-code.html#connecting-in-code-java ) , submit create table , copy commands

active directory - Delphi XE2: Retrieving LastLogon Int64 to TDateTime conversion -

i trying lastlogin information ad @ work. have 1200 accounts. when run query , include lastlogin information, 40 - 45% of accounts, correct date returned. others, default value. 01-01-1601 or 01-01-1970, depending on kind of conversion use. when use slow: net user /domain, can extract last login information, instead of 10 seconds, need 10 minutes. obviously, want faster. here code use: var li: olevariant; int64value: int64; localtime: tfiletime; systemtime: tsystemtime; filetime : tfiletime; begin try li := rs.fields[fieldnumber].value; int64value := li.highpart; int64value := int64value shl 32; int64value := int64value or li.lowpart; filetime := tfiletime(int64value); result := encodedate(1601,1,1); if filetimetolocalfiletime(filetime, localtime) if filetimetosystemtime(localtime, systemtime) result := systemtimetodatetime(systemtime); except result := 0; end; end; the above works, in 40 - 45% of cases. either va...

c# - Using Autofac with Dynamic Proxy that output message automatic -

public interface ilog { void write(string msg); } public class mylog : ilog { public void write(string msg) { console.writeline(msg); } } public interface icanlog { ilog log { get; set; } } public interface imyclass { void test(); } public class myclass : imyclass, icanlog { public ilog log { get; set; } public void test() { log.write("test"); } } i using autofac castle dynamicproxy, , try let myclass test method output "begin"/"end" automatic. public class myloginterceptor : iinterceptor { public void intercept(iinvocation invocation) { console.writeline("begin"); invocation.proceed(); console.writeline("end"); } } the following test code: containerbuilder builder = new containerbuilder(); builder.registertype<mylog>().as<ilog>(); builder.register(c => { proxygenerator g = new proxygenerator(); object proxy...

android - need buttons to spread out dynamically according to screen width -

Image
i working on app had it's button layout configured statically. happens on wider screens (siii, note, tablets etc.) table layout remains same size on of them , doesn't "spead out" dynamically. how can code adjusted accomplish this? <tablelayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="0dp" android:gravity="center_vertical" android:orientation="vertical" > <tablerow android:id="@+id/tablerow1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" > <relativelayout android:id="@+id/stoolrelative" android:layout_width="match_parent" android:layout_height="wrap_content...

java - Cropping image lowers quality and border looks bad -

using math, created following java-function, input bitmap, , have crop out centered square in circle cropped out again black border around it. rest of square should transparent. additionatly, there transparent distance sides not damage preview when sending image via messengers. the code of function following: public static bitmap edit_image(bitmap src,boolean makeborder) { int width = src.getwidth(); int height = src.getheight(); int a, r, g, b; int pixel; int middlex = width/2; int middley = height/2; int seitenlaenge,startx,starty; if(width>height) { seitenlaenge=height; starty=0; startx = middlex - (seitenlaenge/2); } else { seitenlaenge=width; startx=0; starty = middley - (seitenlaenge/2); } int kreisradius = seitenlaenge/2; int mittx = startx + kreisradius; int mit...

jquery - Hide or relocate scrollbar -

i'm trying create sort of "notification center" website. allow users view important information. however, notification center can long occasionally, set containing div overflow: scroll. issue when notification center hidden (or set margin-left: -99%), scrollbar shows on 1% of div constitutes trigger. there way reposition scrollbar or hide when notification center hidden? i'm using bootstrap, , content of notification center wrapped in div class="container", when try set overflow: scroll on container, doesn't work. code @ https://github.com/mathmatrix828/mstudios/blob/master/index.php , lines 27-97 live example @ http://matrixstudios.org/ when "hide" notification center, set css of container div overflow:hidden , remove scrollbars.

rubygems - Running into gems error on Rails 4 -

i'm relatively new rails, , i'm trying create basic spree app using rails 4.0. tried install extension (spree_fancy) store, , while running bundle exec rails g spree_fancy:install command, keep seeing message: unsupported rails environment compass. before installing extension, see app load on local, i'm met with: nomethoderror and: undefined method `empty?' nil:nilclass i'm assuming error caused spree_fancy. there way fix this? if not, how go removing spree_fancy gem? removed gemfile, ran gem uninstall spree_fancy , , reinstalled bundle, did not seem trick. any appreciated. the current released version of spree not support rails 4. there branch of spree supports rails 4 can read more @ spree rails 4 blog post . i don't believe spree_fancy supports rails 4, relies on compass not support rails 4. there couple of branches support rails 4, spree_fancy isn't configured use them. short version: spree on rails 4 isn't ready pri...

Perl String::Approx for values that taken from MySQL DataBase -

when apply string::approx values taken database, doesn't check matching words. the program follows... use string::approx qw (amatch); @matches = qw(); %matchhash = qw(); @x=$search_keyword; $i=0; $j=0; $l=1; $qry1="select * auctioncategoriesname"; $prp1 = $dbh1->prepare($qry1); $prp1->execute(); while(my $row1=$prp1->fetchrow_hashref()) { $y=$row1->{'name'}; @name="(['$y'])"; @match = grep { amatch (@x, @$_) } @name; $cnt=$#match; if($cnt < 1) { $matches[$i]=$match[0]; $i++; } } connections db perfect. i want approximately matched names db amoung values present in $row1->{'name'} . values must kept stored in $matches[$i] . call values as: foreach $k (@matches) { print "$k <br/>" } as richard said line unnecessary :- @name="(['$y'])"; you write $y , perl right thing. the grep followed if duplication of same work. am...

sql server - SQL count distinct values of another value -

say have table looks column names (cusip_nbr, partc_nbr) lets called table title table_cusip (sorry don't know how format btw) cusip_nbr ----- partc_nbr 00162q106 ------------ 0756 00162q106 ------------ 0231 00162q106 ------------ 0756 00162q106 ------------ 0231 231292106 ------------ 0412 231292106 ------------ 0395 231292106 ------------ 0101 231292106 ------------ 0291 43129u101 ------------ 0756 43129u101 ------------ 0395 43129u101 ------------ 0921 43129u101 ------------ 0756 what sql code can write return table (basically @ cusip_nbr , see how many distinct participant numbers there per cusip_nbr)? -> 00162q106 has 2 distinct members, 231292106 has 4, , 43129u101 has 3. (this snip of table have 1,300 cusip_nbrs need count members for) cusip_nbr ---- nbr_of_members 00162q106 ----------------- 2 23129106 --------------------4 43129u101------------------ 3 select cusip_nbr, count(distinct partc_nbr) nbr_of_members table_cusip group cus...

Rails 3 multi-step form with intermediate calculations not param or stored -

models procedure , option have habtm relationship model quote builds prices on basis of parameters first 2 tables in multi-step form. step 1 queries procedure , helper file (or module) extracts relevant data. def quote_procedure procedure = procedure.where(['id = ?',params[:quote][:procedure_id]]).first end and various calculations run, identifying related options. @ point, want run calculations for_each related option. however, not parametrised , not stored values of table quote. no @, no params ... i have not found proper syntax process relevant data options table. helper (eventually module, i'll have execute calculations): def quote_option option = option.where(['id = ?', self.id]) end def my_calculation (quote_option.sum_operational_costs / quote_option.procedure_speed) * params[:quote][:quantity] end however, if in controller @options = option.where(['procedures_options.procedure_id = ? , option_type_id = ?', params[:quo...

in kendoui.web.2013.2.716 requiring kendo.culture.xx-XX.min.js produces an invalid request for kendo.core.min.js -

i have upgraded kendoui.web.2013.1.514 kendoui.web.2013.2.716 , have noticed in parts of code require (through require.js) kendo.culture.xx-xx.min.js file unsuccessful request kendo.core.min.js happens , error in console. this did not happen kendoui.web.2013.1.514 , think part inside kendo.culture.xx-xx.min.js files might blame: ("function"==typeof define&&define.amd?define:function(e,n){return n()})(["../kendo.core.min"] also reference kendo.core appears present in minified versions. note have kendo.web.min.js loaded , app works fine invalid request bug? if using bundles (i.e. kendo.web.min.js ) shouldn't use requirejs load them or culture files. i'm sorry documentation didn't mention it, added section explain this .

How to force rails to store empty strings? -

i'm asking opposite of question force empty strings null ; instead, want fields empty strings stored empty strings. reason want (even in contradiction to people say ) want have partial uniqueness constraint on table works multiple database types (postgres, mysql, etc), described in question here . the psuedocode schema basically: person { first_name : string, presence: true middle_name : string, presence: true last_name : string, presence: true birth_date : string, presence: true city_of_birth: string, presence: true active: tinyint } the constraint person must unique if active; inactive people can not unique (ie, can have multiple john smiths not active, 1 active john smith). further complication: according project specification, first_name , last_name required given user, other fields can blank. our current solution applying partial uniqueness constraint use fact null != null, , set active tinyint null if not active , set 1 if active. thus, can use rai...

c# - MSTest refuses to run 64-bit? -

Image
i writing tests application using outlook redemption absolutely must run 64-bit (it connects windows mapi , outlook x64). unfortunately, cannot life of me make run test in 64-bit. have tried using .runsettings file (edited indicate 64-bit) , .testsettings file (also edited), , have selected test>testsettings>default processor architecture>64-bit , no avail. every time, system.environment.is64bitprocess false, , when load dll connect outlook , mapi dreaded com exception: wrong os or os version application (exception hresult: 0x800401fa (co_e_wrongosforapp)) indicates 64-bit outlook installed , process trying access 32-bit. i have restarted vs 2012 after making settings changes have read somewhere restart may necessary. have other suggestions? could write console app runs informal tests , reports status, next step these tests integrated automated build. appreciated. edit screenshot of host settings page in .testsettings experiment interestingly, did litt...

java - Kerberos authentication not running when client and server on same machine -

i getting following error when trying trying access application same machine jboss server running org.springframework.security.authentication.badcredentialsexception: kerberos validation not succesfull @ org.springframework.security.extensions.kerberos.sunjaaskerberosticketvalidator.validateticket(sunjaaskerberosticketvalidator.java:69) @ org.springframework.security.extensions.kerberos.kerberosserviceauthenticationprovider.authenticate(kerberosserviceauthenticationprovider.java:86) @ org.springframework.security.authentication.providermanager.doauthentication(providermanager.java:120) @ org.springframework.security.authentication.abstractauthenticationmanager.authenticate(abstractauthenticationmanager.java:48) @ org.springframework.security.extensions.kerberos.web.spnegoauthenticationprocessingfilter.dofilter(spnegoauthenticationprocessingfilter.java:131) @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filter...

openshift application url returns 404 error -

i using openshift opencart hosting. created url http://store-iosx.rhcloud.com/ . due few problems thought of restarting scratch. deleted application using web console. recreated url adding php 5.3 runtime. following whenever visit url http://store-iosx.rhcloud.com/ 404 error ... not know how debug . can suggest ? more on gets redirected http://store-iosx.rhcloud.com/app time.. it resumed working after last git commit. don't 404 errors.. think takes time reset url.. bit of patience necessary.

ios - array of images in document directory -

i have select multiple images from iphone through elc controller. the images are stored in array now i want to store this array of images in document directory so please help me someone.. - (void)elcimagepickercontroller:(elcimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsarray *)info { if ([self respondstoselector:@selector(dismissviewcontrolleranimated:completion:)]){ [self dismissviewcontrolleranimated:yes completion:nil]; } else { [self dismissmodalviewcontrolleranimated:yes]; } (uiview *v in [_scrollview subviews]) { [v removefromsuperview]; } cgrect workingframe = _scrollview.frame; workingframe.origin.x = 0; nsmutablearray *images = [nsmutablearray arraywithcapacity:[info count]]; for(nsdictionary *dict in info) { uiimage *image = [dict objectforkey:uiimagepickercontrolleroriginalimage]; [images addobject:image]; uiimageview *imageview = [[uiimageview alloc] initwithimage:image]; [imageview setcontentmode:uiviewcontentmode...

asp.net - RadGrid Error is neither a DataColumn nor a DataRelation for table DefaultView -

i trying set primary key value datakeyname attribute in radgrid giving me cryptic error "cap_id neither datacolumn nor datarelation table defaultview." indeed primary key of table specify in radgrid. how can solve this? <telerik:radgrid id="radgrid1" runat="server" allowpaging="true" allowsorting="true" cellspacing="0" gridlines="none" datasourceid="sqldatasourcecapabilities" autogeneratecolumns="true" autogeneratedeletecolumn="true" autogenerateeditcolumn="true" onpagesizechanged="radgrid1_pagesizechanged" onitemcommand="processthiscommand"> <clientsettings> <scrolling allowscroll="true" usestaticheaders="true" /> </clientsettings> <mastertableview datakeynames="cap_id" datasourceid="sqldatasourcecapabilities...

batch script to open an command window and run directory scan -

i'm trying create batch script opens a 1) command window 2) command prompt pointing c (come root) 3)run dir /s command performs extensive scan of system starting root. the window should not dissapear. but i' m able come come c prompt , command window disappears, have posted script here . please let me know i'm going wrong . start cmd /c cd / && dir /s edit : issue fixed answer start cmd /c cd / && dir /s you can use cmd /k switch pass in commands, such as: cmd /k "pushd c: & cd\ & dir /s"

android - java splitting textboxes using bufferreader -

hi figuring out how split strings heres code: because using bufferedreader , have 2 textboxes reads both text boxes (the 1st textbox type john), second textbox type peter) output johnpeter trying split textboxes instead of reading 1 line straight. bufferedreader reader = new bufferedreader(new inputstreamreader( req.getinputstream())); string name; while ((name = reader.readline().tostring()) != null) { statement stmt; string[] players = name.split(""); string playero = players[1]; string playerx = players[2]; current output is: player 1 :j player 2 :o i output be: player 1 :john player 2 :peter as is, won't able split string want to, there's no clear delimiting character. if stored "john peter" or "john,peter" or that, easier split. then need change string[] players = name.split(""); to string[] players = name.split(" "); or string[] ...

node.js - how to upload file from ng-controller? -

how can upload file angular controller. doing like, on ng-click calling upload_file() function declared inside controller. , want use $http.post("url", data).success().error(); url of node upload service. it's working fine when use . without using action there, want upload function. not getting how attach file selected data here. want send data along file. can upload in way trying? please me... you can use angular-file-upload library: basically need $http.post this: $http({ method: 'post', url: config.url, headers: { 'content-type': false }, transformrequest: function (data) { var formdata = new formdata(); formdata.append('file', myfile); (key in mydata) { formdata.append(key, mydata[key]); } return formdata; } ...

c# - RemoveDuplicates function - how can I set multiple columns? -

i'm trying use removeduplicates function using excel.interop , i'm stuck how pass column array. know cannot pass simple int[] array, gives exception @ runtime, , can pass single integer , works, want able select columns use @ runtime. my current code in c# looks this: using excel = microsoft.office.interop.excel; private void removeduplicates(excel.application excelapp, excel.range range, int[] columns) { range.removeduplicates(excelapp.evaluate(columns), excel.xlyesnoguess.xlno); } and works fine if using 1 column, if columns array has more 1 value, first 1 used. in vba, equivalent function be: sub removebadexample() dim colstouse colstouse = array(1, 2) selection.removeduplicates columns:=evaluate(colstouse), header:=xlyes end sub which fails use both columns. however, if change this: selection.removeduplicates columns:=(colstouse), header:=xlyes it works fine. guess question equivalent in c#? this test run worked...

python - Iterating over PyoDBC result without fetchall() -

i'm trying process large query pyodbc , need iterate on rows without loading them @ once fetchall(). is there , principled way this? sure - use while loop fetchone . http://code.google.com/p/pyodbc/wiki/cursor#fetchone row = cursor.fetchone() while row not none: # row = cursor.fetchone()

javascript - how to combine extjs graphical elements and easelJs elements -

i want combine extjs app creates window , easeljs canvas when try load them @ same time window's screwed :( here code. there conflict movable windows? have put windows in container? i'm brand new stuff, i've been tinkering extjs week , been messing easel js 2 days. i'm week.5 experiences js if question seems noob apologies. var myimage; var stage; function init() { stage = new createjs.stage("democanvas"); myimage = new createjs.bitmap('dbz.jpg'); stage.addchild(myimage); stage.update(); myimage.addeventlistener("click", function(){ var seed = new createjs.bitmap("seed.jpg"); seed.alpha = 0.5; stage.addchild(seed); stage.update(); }); //end seed } //end easel var animals = ext.create('ext.data.store', { fields: ['itemid', 'name'], data: [{ "itemid": 'mycat', "name": "mycat" }, { 'itemid' : 'mydog', ...

ios - CoreBluetooth: Can you connect to a peripheral device that is not advertising -

if ios application has paired ble peripheral has gone out of advertising mode, can connect using device-specific uuid , retrieveperipherals , , connectperipheral ? if not, there 1 mode peripheral can advertise in, or there varying levels of privacy/identification can set when advertising? no, cannot. create connection peripheral device, device have advertise using connectable advertising. device wants connect, have reply 1 of advertisements connection request.

jquery - Appending an Array and String in javascript into a variable -

how can run getelementbyid on array , string in javascript , set variable not null example foo["dog"] x = getelementbyid(foo[0]+"food") , x = dogfood <script> var myrows = new array(); $(function() { $("#check").click(function(){ myrows=[] $(".head input:checked").not("#selectall").each(function(){ myrows.push($(this).parent().attr("id")); }).value; alert(myrows); }); $("#subbut").click(function(){ var x; var r=confirm("are sure you?"); if (r==true){ x="you pressed ok!"; }else{ object.cancel; } **alert( myrows[0]+"servername" + " before" ); for(var =0; i< myrows.length; i++){ alert(myrows[i] +"rootname" +" in loop" ); var j= document.getelementbyid(xmyrows[i] +"rootname" ); alert(j+" after...

asp.net mvc - issue about partial view -

Image
i have view below. there column named "durum". set record's value online or offline this. change value on page. when click online image, becomes offline. make using ajax below: @foreach(var item in model) { ........ ........ @if (item.online == true) {<img id="img_online_@item.id" src="/areas/admin/content/images/icons/online.png" class="cursorpointer" title="offline yap" onclick="setonlinestatus('/bank/editstatus',@item.id)" />} else{<img id="img_online_@item.id" src="/areas/admin/content/images/icons/offline.png" class="cursorpointer" title="online yap" onclick="setonlinestatus('/bank/editstatus',@item.id)" />} } i write above code every page. want put online/offline part partial view. want put online/offline state partial view. need send id , online values partial. tried send 2 parmeter partial view, not. can ...

c# - How to redirect user to another Url from MVC Custom Router Handler? -

i working custommvcrouterhandler, based on logic want redirect user url customhandler. public class custommvcrouterhandler : iroutehandler { public ihttphandler gethttphandler(requestcontext requestcontext) { if (requestcontext.httpcontext.request.isauthenticated) { if (logic true) { string orginalurl = "/home/aboutus"; // redirect url = "/home/companyprofile"; return new mvchandler(requestcontext); } } return new mvchandler(requestcontext); } } how redirect user "home/companyprofile" customrouterhandler ? you can use underlying asp.net response object redirect user url. requestcontext.response.redirect("/home/companyprofile"); requestcontext.response.end(); it send redirect response browser , end http request processing.

c - Gather variables from multiple files into a single contiguous block of memory at compile time -

i'd define (and initialize) number of instances of struct across number of *.c files, want them gather @ compile time single contiguous array. i've been looking using custom section , using section's start , end address start , end of array of structs, haven't quite figured out details yet, , i'd rather not write custom linker script if can away it. here's summary of first hack didn't quite work: // mystruct.h: typedef struct { int a; int b; } mystruct; // mycode1.c: #include "mystruct.h" mystruct instance1 = { 1, 2 } __attribute__((section(".mysection"))); // mycode2.c: #include "mystruct.h" mystruct instance2 = { 3, 4 } __attribute__((section(".mysection"))); // mystruct.c: extern char __mysection_start; extern char __mysection_end; void myfunc(void) { mystruct * p = &__mysection_start; ( ; p < &__mysection_end ; p++) { // stuff using p->a , p->b } } in order use...

asp.net mvc 4 - Html.ActionLink generates the wrong link based on routes.MapRoute -

i guess still don't understand routing. i have 3 controllers admincontroller dashboardcontroller projectgroupscontroller for dashboard, want url /dashboard/ . admin section, however, want 2 different controllers. /admin/overview should using admincontroller , , /admin/projectgroups/ should using projectgroupscontroller . this how routing looks like routes.maproute( name: "adminoverivew", url: "admin/overview", defaults: new { controller = "admin", action = "overview" }, namespaces: new[] { "com.controllers" } ); routes.maproute( name: "adminsubs", url: "admin/{controller}/{action}/{id}", defaults: new { action = "index", id = urlparameter.optional }, namespaces: new[] { "com.controllers" } ); routes.maproute( name: "default", url: "{controller}/{actio...

ajax - PHP json_encode json with variation of array. JSON Sometimes do not appear in firebug as JSON -

does json specific array structure? when used in $value['date'][0] = "12-21-2012"; $value['name'][1] = "joe"; echo json_encode($value); it seems detect json under firebug however, when switched around firebug not seem see json $value[0]['date'] = "12-21-2012"; $value[1]['name'] = "joe"; echo json_encode($value); is behaving normally?

html - Adjust divider width if image is present -

i have divider float left property housing text, divider float right housing image. total width of both dividers should no bigger 735 , reserving 200 image. how can adjust width of first divider 535 if image present , 735 if image hidden? <div style="width:735px"> <div style="float:left; width=????????> text here </div> <div style="float:right"> <img src="../images/biteme.png" alt="" style="height:auto; width:auto; max-height:115px; max-width:200px; display:block" /> </div> </div> to in pure css easy, you'd need different approach. float 1 div , other automatically take remaining space demo http://jsfiddle.net/kevinphpkevin/gaur5/ img { width: auto; height: auto; max-width: 200px; display: block; } set img css display: none , see other div takes remaining space.