Posts

Showing posts from February, 2013

asp.net mvc - Azure # many sites - one login ( Single Sign On ) -

plan : many asp net 4.5 sites hosted on azure (will mapped different domains) --> how share login between sites? option 1 : use 1 database sites - how each site login , site "master site" hold the database? option 2 : use database each site 1 global database users(+forums posts) option 3 : ( combine 1+2 ?! ) 2 database , 1 users users(+forums posts) + 1 data either option , don't know how ... i'm using codefirst membership provider if login sitea login siteb , etc ( got point ) is "same domain" if sites sits on azure? you need use azure access control service (acs) part of windows azure active directory. create 1 acs namespace , add applications urls relying parties in namespace through portal. after need add sts reference visual studio (that comes when install windows identity foundation) each of application giving url of acs service namespace. you have add custom identity provider against need authentica

javascript - Gmail-like countdown timer not working -

i've been trying recreate countdown timer similar 1 gmail uses when disconnected internet. ajax request fails begin short countdown makes ajax request , if fails again begin longer countdown , forth. once determined countdown value reached (lets 1 minute), countdown maintained @ 1 minute until internet connection recovered or servers comes back. i don't want use plugin because code embedded in micro-controller has limited space , prefer not place external file practical reasons, though jquery library external. everything should trigger onload , , continue automatically (i.e. no control inputs used). so far i've developed code want if ajax request succeeds or fails if there latency on ajax request status (as example having server down) browser won't produce immediate result , code fails. i know stated above because took server down , been firebug on mozilla firefox see ajax result (success or failure) wasn't triggered keep waiting several seconds. help

oop - Extending an Android Parcelable class -

i have customaddress class extends android.location.address class implements parcelable . i trying make customaddress implement parcelable to stuck when creating class parcel. want when creating customaddress from parcel first fill in fields super class address and own fields. have implemented creator field: public static final parcelable.creator<customaddress> creator = new parcelable.creator<customaddress>() { public customaddress createfromparcel(parcel in) { return new customaddress(in); } public customaddress[] newarray(int size) { return new customaddress[size]; } }; but in customaddress(parcel in) creator, can't call super(in) because doesn't exist in android.location.address . can access android.location.address.creator . how fill in fields using creator ? edit: link android address class https://developer.android.com/reference/android/location/address.html here similar question , mark murphy's exc

java - how to return null to int method -

iam new programming.iam wrking on quiz game software. here want count down printed "3,2,1,go...go...go" package t2; import java.util.scanner; import java.util.timer; import java.util.timertask; public class stopwatch { static int interval; static timer timer; public static void main(string[] args) { scanner sc = new scanner(system.in); int delay = 1000; int period = 1000; timer = new timer(); interval = 3; system.out.println("3"); timer.scheduleatfixedrate(new timertask() { public void run() { system.out.println(setinterval()); } }, delay, period); } private static final int setinterval() { string go="go...go...go"; if (interval == 2) { timer.cancel(); return go; } return --interval; } } this says setinterval() has int return value.if place system.out.print("go"); in place of return go; prints go , prints 1 out of requirement.

java - dynamically naming a text file as output -

i have loop in each iteration text file should generated. problem naming text file. because of lack of knowledge in java, don't know how should name output files dynamically. names should dependent index of loop. in advance. using printstream. just build file name index variable. for(int x = 0; x < 10; x++){ string filename = "file_" + x + ".txt"; file file = new file(filename); }

airplay - Keep UIWindow size after setting it's UIScreen value -

i'm using airplay, primary content of ipad beamed appletv fine. when want different information on ipad on appletv, i'm getting resolution issues. i instantiate uiwindow: _atvwindow = [[uiwindow alloc] initwithframe:cgrectmake(0, 0, 2048, 1536)]; nslog indicates window frame size want i set uiwindow ipad screen _atvwindow.screen = [[uiscreen screens] objectatindex:0]; nslog indicates window frame 1024x768 it's retina ipad. want size remain retina , set images accordingly. once add retina quality images (as you'd expect) way big. ideas what's causing or missing here? have tried read frame size screen comes in [notification object] object? - (void)handleconnectedscreen:(uiscreen *)screen withviewcontroller:(uiviewcontroller *)controller { if(!_airplaywindow) { cgrect frame = screen.bounds; _airplaywindow = [[uiwindow alloc] initwithframe:frame]; _airplaywindow.backgroundcolor = [uicolor clearcolor];

jquery - getJSON using an external url -

i attempting read external json file script: $.getjson('http://www.earthquake.usgs.gov/earthquakes/feed/geojson/1.0/hour',function( json ) { //$.getjson('hour',function( json ) { $.each( json.features, function( i, item ){ alert(item.properties.mag); }); }); when use external url, script doesn't work, however, when use local hour file (that copied , pasted external url) script works fine. why? i'm going "that guy" posts answer type of question. you can't due same origin policy (google it!) actually, if need this, can setup proxy using php , use proxy obtain necessary data.

javascript - How to delete file in a dir using php script -

i want delete image inside profile_images folder. tried unlink(base_url() . "_profile_images/912aea1dd8144e07894f788978b917d3.jpg"); and error occured a php error encountered severity: warning message: unlink() [function.unlink]: http not allow unlinking filename: controllers/controller.php line number: 100 i used codeigniter implement action. there way delete file? you attempting delete url string, should php full path , filename file able unlink it. not sure path is, php has several functions should full directory path file. $_server['document_root']; // php's document root, it's start.

ruby - saving utf8mb4 strings to mysql -

i have json string has utf8mb4 characters. first parse json, , encode result json. after save resulting json mysql database. (this simplified flow of execution, there real-life reason why first parse json , encode back). the problem database ends prefix of json string put there , cut off right @ first utf8mb4 character. here code: require 'json' require 'mysql2' tablename = 'my_table' settings = { :database => "my_database", :host => "localhost", :password => "my_password", :username => "my_username" } @database = mysql2::client.new settings @json = %q({"test":"begin \ud83d\ude04\ud83d\udc4d\ud83d\udc4f\ud83d\udd14 end"}) begin obj = json.parse @json rescue json::parsererror => e @json.force_encoding 'utf-8' encoded = @json.valid_encoding? ? @json : @json.encode!('utf-8', invalid: :replace, undef: :replace) obj = json.parse encoded end q = &q

Android Difference between View.getLeft() vs View.getScrollX() -

what difference between view.getleft() vs view.getscrollx() ? please don't copy , paste definition documentation, because below getscrollx() return scrolled left position of view. getleft() left position of view relative parent i think 2 values should same, sample program of mine, if view.scrollby(20, 0) see getscrollx() return 20 , view moved right, getleft() remains zero i confused, because if visually view being scrolled right 20px, left position should updated well, still 0 obviously can't same, otherwise there no need have 2 different methods return same result please help getleft() returns views location relative parent. how has scrolled not impact @ all. scrolling impacts contents of view, not location. a quote android documentation regarding getleft(): for instance, when getleft() returns 20, means view located 20 pixels right of left edge of direct parent. getscrollx() , on other hand, lets know how content in view has moved. v

user interface - Java SWT menubar item stuck "on" after subshell created -

Image
this undoubtedly trivial problem, cannot seem figure out i'm doing wrong. situation simple: have application creates additional dialog window show user. main application has menubar menu items have keyboard shortcuts. when invoke menu item using keyboard shortcut, , main program creates new window, when user closes new window , shown main application again, menubar item stays stuck highlighted/"turned on" look. code replicate i'm seeing on mac os swt 4.2 this: import org.eclipse.swt.swt; import org.eclipse.swt.events.selectionadapter; import org.eclipse.swt.events.selectionevent; import org.eclipse.swt.layout.filllayout; import org.eclipse.swt.widgets.button; import org.eclipse.swt.widgets.display; import org.eclipse.swt.widgets.menu; import org.eclipse.swt.widgets.menuitem; import org.eclipse.swt.widgets.shell; public class tester { public static void createshell(shell parent) { final shell newshell = new shell(parent, swt.dialog_trim | swt.re

list - curl and getting 100 URLs in parallel -

cat urllist.txt | xargs -p0 -n1 curl | grep "href=" > out.txt this works fine connects 1 url @ same time. how can curl 100 urls @ same time? instead of using xargs, use parallel it. quite similar xargs instead fires commands in parallel - hence name...

Google App Engine : Domain name stopped working -

i got domain name i'd bought through third party work gae app. a month ago, working fine. now, however, when try use i'm getting message gae : 404. that’s error. requested url / not found on server. that’s know. this message same number of different , valid paths. eg. the requested url /admin not found on server. that’s know. the app still running , working fine through http://appname.appspot.com/ . calls finding way gae, because that's what's giving me 404. and, say, working month ago. what did change in meantime? nothing. or rather, have migrated legacy store high replication store, problem appeared before did that. anyone got idea should looking @ try debug this? note : may seem off-topic so. i'm asking here because gae mailing group has message telling me official place gae support. ok. looks google apps deleted account ... presume because hadn't verified owned domain name within 14 day limit. (something happened without them s

html - Applying background images to an image element -

i'm having bit of trouble applying background images image element. know if possible? what want have gallery next , previous buttons change position based on size of image, planning on having next , previous buttons set in class applied image being shown. here's gallery for: http://reveriesrefined.com/myftp/stack_1/ an image element resize fit size of image. if valid css apply background-image img element, covered up. not mention can't click background-image. a better solution write buttons html. can use css move buttons far left , far right, or if want position them veritcally, top , bottom. <style> .image_cont { position: relative; display: inline-block } /* left , right styling */ .image_next_btn { position: absolute; left: 0; top: 50%; margin-top: -10px; } .image_prev_btn { position: absolute; right: 0; top: 50%; margin-top: -10px; } /* or top , bottom styling */ .image_next_btn { position: absolute; left: 50%; top: 0

php - Submitting random string from an array, submits the string after echoed string -

every time click submit name of element i'm voting on changes element shows after current echoed element when entered database. suggestions on how fix this? can't seem figure out. lets echo shows example2 on value in form. click example2 example1 gets saved in database. i'm not sure how fix this. help. here's code: the array setup i'm using: $array = array("example1","example2","example3"); $random = $array; shuffle($random); <?php echo array_pop($random);?> php: action i'm using post method in form. $mysqli = new mysqli("", "", "", ""); if ($mysqli->connect_error) { echo "failed connect mysql: (" . $mysqli->connect_error . ") " . $mysqli->connect_error; } if (!$mysqli->query("insert table(id, name, votes) values (id, '".$random."', '".$votes."')")) { echo "multi-insert failed:

ruby - Only Last Parameter being passed into Object -

my app supposed create image object each image selected in input field of form. it–the create action– iterates on :picture param , each entry, supposed create new image object. however, seems create image object last image selected in input box. why not functioning properly? controller class admin::imagescontroller < applicationcontroller respond_to :html, :json #before_filter :split_hash, :only => [ :create, :update ] def index @album = album.find(params[:album_id]) @images = @album.images.all end def new @album = album.find(params[:album_id]) @image = @album.images.new end def create params[:image][:picture].each |image| @album = album.find(params[:album_id]) @params = {} @params['picture'] = image @image = @album.images.build(@params) end if @image.save flash[:notice] = "successfully added image!"

How to find the associated polygon from pixel canvas HTML5 -

i working on html5 canvas application. able find co ordinates , hex value of point clicking on canvas. if suppose clicking area have filled polygon (and know color of polygon). there way or algorithm return enclosing co-ordinates drew polygon ?? solution store polygon points in objects or array , use canvas method: var boolean = context.ispointinpath(x, y); by storing points objects/arrays can iterate through collection re-build path each polygon , call method above (no need redraw polygon checks). if have hit know object current. can store other meta data on these objects such color. example you can make simple class store coordinates color (a basic objectyou can extend needed): function polygon(pts, color) { this.points = pts; this.color = color; return this; } then define points: /// object collection var mypolygons = []; /// add polygons mypolygons.push( new polygon([[10,10], [30,30], [70,70]], 'black') ); mypolygons.push( new po

html - Adobe Flash Player Settings not show Remember button -

Image
have adobe flash player application, when page loads shows popup ( adobe flash player settings ), in popup doesn't show remember checkbox. please help. there 2 different kind of popup: the first 1 displayed when application try access webcam or microphone. 1 not display remember option. 1 see in application; the second 1 displayed programmatically performing call security.showsettings() it practice open security panel before trying access of webcams / cameras / microphones of user anyway. in case don't develop application still want display popup remember option, can right-clicking on , select settings... . privacy tab should second one.

regression - Want some general info about 'Golden Testing' -

i want know 'golden testing' is. in investigation, there golden file , expected result. , daily regression test compares today's output file golden file. can explain theory of golden testing? and practically how can implement test program? i want recommended framework libraries this. does boost.test cover kind of testing? thank much! in advance. from boost mailing list (the url below), received useful answer question. http://lists.boost.org/boost-users/2013/04/78334.php i decided read , apply "fit developing software: framework integrated tests". thanks.

joomla - chrome doesn't load images -

Image
i using joomla 2.5 , have been trying load bunch of images in page. load fine in ff/safari don't load in chrome. originally code this: <div id="sponsors"> <img src ="<?php echo $apath; ?>/images/ads/ad__03.png" /> <img src ="<?php echo $apath; ?>/images/ads/ad2.png" /> <img src ="<?php echo $apath; ?>/images/ads/ad3.png" /> <img src ="<?php echo $apath; ?>/images/ads/ad4.png" /> <img src ="<?php echo $apath; ?>/images/ads/ad5.png" /> <img src ="<?php echo $apath; ?>/images/ads/ad6.png" /> <img src ="<?php echo $apath; ?>/images/ads/ad7.png" /> </div> which rendered as: in chrome. i checked network tab in dev tools. there 2 attempts made images load: the template works in other browsers. have tried moving images other folders, chrome refuses show images. i

Swipe pages using Viewpager and fragment in Android -

Image
i got problem regarding app,i need create swipe pages in android below image.i have searched lot got android-undergarment library using can swipe layout: as below: mdrawergarment = new drawergarment(this, r.layout.main); mdrawergarment.setslidetarget(drawergarment.slide_target_content); but need swipe activity not layout how that? possible using same library or guide me library. here image: hope me @thanks!!

javascript - Form reset and programmatically set values -

i trying reset form using: myform.reset(); i tried set values way: //solved setting $('#mytextcontrol').attr('defaultvalue', 'my initial value'); //thanks robg $('#mytextcontrol').val('my value'); $('#mytextcontrol').attr('value', 'my value'); //solved setting $('#mytextcontrol').attr('defaultchecked', false or true); $('#mycheckboxcontrol')attr('checked', 'checked'); //finally works radios too, shown here -> http://jsfiddle.net/4vakp/2/ $('#myradiocontrol')attr('checked', 'checked'); the way update value important, can see here -> http://jsfiddle.net/4vakp/3/ updating value using attr fix value default: wrong radio2.attr('checked', true); text2.attr('value', 'my text2'); this not set value default (as expected): correct radio.prop('checked', true); text.val('my text'); this works fine w

iphone - Xcode upgrate problems from v4.5.2 to v4.6.1 -

i upgraded xcode v4.5.2 v4.6.1 on notice applications connect server not connecting respective servers.. tried google , not successful in getting apt solution. is there have do? missing understand here respect update? any suggestions more helpful. edit : didn't download .dmg file ios development center. installed itunes.. mean mac appstore

iphone - Apple Push Notification not working on shared server -

i want send apn (apple push notification) php script. php script working fine , receive notification in iphone device when sending localhost when upload same script same .pem file shared server returns error... warning: stream_socket_client() [function.stream-socket-client]: unable connect ssl://gateway.push.apple.com:2195 (connection refused) in /mypath/sendpushnotification.php on line 28 failed connect: 111 connection refused from source know send apn port 2195 must open not possible in shared server plan. tried using dedicated server , it's working , receive notification on device. tried hard find solution shared server didn't find solution. my question: possible send apn without opening port 2195 shared server? if yes give guidance. no, not possible send apn message without using 2195 port. if want send push notification message shared server, try using third party tools http://urbanairship.com/ .

javascript - KineticJS - Patterns and Fills on Images -

i have canvas i'm creating kineticjs , adding transparent png images canvas. when stacked on top of each other, makes 1 image of outfit different parts. what want allow user click on pattern , change specific piece of outfit pattern. need fill in non-transparent parts of 1 of images pattern. found way didn't use kineticjs , looks this: ctx.globalcompositeoperation = 'source-in'; var ptrn = ctx.createpattern(fabrica, 'repeat'); ctx.fillstyle = ptrn; ctx.fillrect(0, 0, 375, 260); my question is, there way same steps outlined above kineticjs? also, did first try without using kineticjs, when applied above code layer, filled in of images because on same layer. i'm guessing need change code either use multiple layers or add images groups in single layer. thinking right here? , better option i'm trying accomplish? multiple layers? or multiple groups on single layer? thanks can provide. if want custom drawing use kineticjs shape object

html5 - HTML 5 audio tag issues (no sound) with phonegap on android 4.x -

platform : android version 4.x issue : html 5 audio tag compiled : framework phonegap i have been trying play simple sound html 5, cant work. i read there general "not supporting" thing going on android, understand it, version 4.x supports html 5 audio tag. config.xml did enable of features in eg. file access, device access , so, tried include features. let u guys know. html working atm, figured maybe should go directly try , sound out, make costum controls jq. <audio controls="true"> <source src="media/sound.mp3" type="audio/mpeg"> <source src="media/sound.ogg" type="audio/ogg"> <source src="media/sound.wav" type="audio/wav"> browser not support html5 audio. </audio> conclusion far havent hear sounds, tried trigger different ways like: var newsound = new audio("sound.ogg"); newsound.play(); any idea or suggestion

c# - Enable/Disable Required field validator from cs page? -

i have 2 textbox , 2 buttons in page. one hidden , other 1 displayed. when click button1 , save data of 2 textbox , validate each textbox requiredfieldvalidator . then when click button2 , hide ( button2 ) , show hidden textbox . both textbox has requiredfieldvalidator validating against button1 's event click. now issue when enter text 1st textbox , click save, button click validating required field hidden field. want validate 2 textbox when showing. how can avoid this? well can simple use enabled="false" property of requiredfieldvalidator . your markup based on question. <asp:textbox runat="server" id="tb1"></asp:textbox> <asp:requiredfieldvalidator runat="server" id="rfv1" controltovalidate="tb1" errormessage="*" validationgroup="gvsave"> </asp:requiredfieldvalidator> <asp:textbox runat="server" id="tb2" visible="f

php - Datatables sorting -

i have problem sorting data using jquery plugin data tables. form table database result , got default sorting, sort first column descending: <table cellpadding="0" cellspacing="0" border="0" class="display datatable tabela" id="tabela4"> <thead> <tr> <th>id</th> <th>counter bw</th> <th>counter color</th> <th>status</th> </tr> </thead> <tbody> <? foreach ($db_result->result() $row):?> <tr class="gradec"> <td><?=$row->service_id;?></td> <td><?= $row -> counter_bw; ?></td> <td><?= $row -> counter_color; ?></td> <td><div class="<?= $row -> service_status; ?>"><?= $row -> service_status; ?></div></td> </tr> <? endforeach; ?> <

encryption - Is there any alternative to the map class in C++? -

i'm making simple rsa crypter in c++ , have calculation algorithms done, ran problem of getting text input , converting numbers can xor numbers , vice versa. so, wondering if there simple alternative std::map class in c++ in do. text["a"] = 1; if there better way please tell me. if not picky actual numeric values (ie, don't care value 'a' should have long has one), pleased know char represented in-memory (at least) 7-bits encoding can interpreted number. supposing have char c , can say: (int)c have converted integral value. on computers, char 8 bits, value either in [-128,+127] or in [0, 255] (it's implementation detail whether char signed or not). can "force" (there) [0, 255] "violent" cast unsigned char .

iphone - Save blob'type in database -

i want save data of ios, nsdata database of fmdb , such as: nsurl *url=[nsurlurlwithstring:@"http://pic17.nipic.com/20111023/7050178_121536234000_2.jpg"]; nsdata *date=[nsdata datawithcontentsofurl:url]; nsstring *img=[nsstring stringwithformat:@"insert name(picture) values('%@')",date ]; bool judge1=[self.database executeupdate:img]; but doesn't work. try this, nslog(@"\ncreating db"); nsstring *str = @"create table if not exists images (image1 blob);"; int res = sqlite_error; res = sqlite3_open([@"aa.sql" utf8string], &database); res = sqlite3_exec(database, [str utf8string], null, null, null); sqlite3_stmt *updstmt =nil; const char *sql = "insert images (image1) values (?);"; res = sqlite3_prepare_v2(database, sql, -1, &updstmt, null); if(res!= sqlite_ok) { nslog(@"error while creating update statement:%s", sqlite3_errmsg(database)); } uiimage *img = [uiimage im

How to hide jQuery datatables -

how hide jquery datatables, when want toggle datatable's visibility? problem if write hide statement hides rows, not headers , footer. how can hide datatable fully? for hiding, used below code: var otable = $('#example').datatable(); // 'example table id' otable.hide(); try this $('#example').parents('div.datatables_wrapper').first().hide();

c - need assistance resizing a bitmap file -

i trying resize bitmap file. file regular file taken command prompt, takes integer determines how file resized by, and, once taken in, processed , outputs resized image of file. feel i'm close, close doesn't count. here code have: for (int = 0, bheight=abs(bi.biheight);i<bheight; i++) { buffer = malloc(sizeof(rgbtriple) * bi.biwidth); // iterate on pixels in scanline (int j = 0; j < bi.biwidth; j++) { fread(&triple, sizeof(rgbtriple), 1, inptr); // temporary storage (int k=0; i<factor;k++) { buffer[k]=triple; } } //iterate on each pixel factor times // write rgb triple outfile for(int i=0;i<factor;i++) { fwrite(&buffer[i], sizeof(rgbtriple),1,outptr); } } maybe can steer me in right direction. also, purposefully did not post code. if needed diagnose problem, please let me know. your i/o scary, should load of image memory before star

c# - Regex - Getting data from inside round brackets separated by commas -

this question has answer here: extract comma separated portion of string regex in c# 4 answers i still learning regex , new it. i have following data add(2,3); i integer values within parenthesis '()' while getting individual values of following integers separated ',' stored variable in array list in expected outcome should be result[0] = 2; result[1] = 3; another sample data add(2,3,1); and result following result[0] = 2; result[1] = 3; result[2] = 1; i have tried using following expression ' @"\d+"' when i'm parsing data reads digits in string. expression have tried '((\d\,\d))' reads first example not second. whole code snippet string s = "add(2,3,1);"; matchcollection matches = regex.matches(s, @"\d+"); string[] result = matches.cast<match>().take(10).select(

ios - Loading a nib file inside a UIViewController -

i'm experimenting on how load nib files uiviewcontroller . i have created separate nib file called email . first noticed when view controller loaded, initwithnibname method isn't getting called. called viewdidload method manually this, [self initwithnibname:@"email" bundle:[nsbundle mainbundle]]; it did not work. got warning saying expression result unused . and searched on internet , came across this article , implemented loadview method described so, - (void)loadview { [super loadview]; uinib *nib = [uinib nibwithnibname:@"email" bundle:nil]; [nib instantiatewithowner:self options:nil]; } the method gets called still view controller empty! can tell me i'm overlooking here , how can done? thank you. update: first off, responses. voromax , svena 's answers suggest should remove segues , load nibs automatically i'm not fond of. anil's answer works find , have 1 last hurdle jump. i have multiple nib f

java - How can i use methods of a class to a new class? -

well have menu method in class shows menu in emulator when clicked. how can use method new class b i want methods use class b : public boolean oncreateoptionsmenu(menu menu) { super.oncreateoptionsmenu(menu); //inflates menu or show activity menuinflater awesome = getmenuinflater(); awesome.inflate(r.menu.main, menu); //main xml main return true; } //this manipulate menu public boolean onoptionsitemselected(menuitem item){ switch (item.getitemid()) { case r.id.menusweet: startactivity(new intent("sweet")); return true; case r.id.menutoast: toast andeggs = toast.maketext(mainactivity.this, "this toast", toast.length_long); andeggs.show(); return true; default: return super.onoptionsitemselected(item); } } depending on want do, have 2 big options (among many): subclassing , composition: subclassing so if class b specialization of class a's be

sql - How to write trigger which copies value of a column of a table to another column of another table? -

i have table tblbilling , tbltotalfee . 1 of column in tblbilling named remainingamount , in tbltotalfee have column named due previous month . want whenenver insert value in remaining amount want value automatically inserted due previous month . trying write trigger.but can't right?? can me?? i tried: alter trigger [dbo].[trg_billing_totalfee] on [dbo].[tblbilling] after insert insert tbltotalfee(duefrompreviousmonth) select remainingamount inserted give example: create table tblbilling (id int identity(1000,1) primary key, remainingamount int ) go create table tbltotalfee (id int identity(1000, 1) primary key, duefrompreviousmongh int) go create trigger tr_tblbillingsync on tblbilling after insert insert tbltotalfee (duefrompreviousmongh) select remainingamount inserted go insert tblbilling select 25 union select 27 union select 33 go select * tblbilling select *

AJAX script manager within a masterpage in asp.net -

i'm using ajax in page under masterpage. have problem location of script manager. don't want script manager pages, one. this master page : <div> <asp:contentplaceholder id="contentplaceholder1" runat="server"> </asp:contentplaceholder> </div> and page want add script manager it <asp:content id="content2" contentplaceholderid="contentplaceholder1" runat="server"> <asp:scriptmanager id="scriptmanager1" runat="server"> </asp:scriptmanager> <asp:textbox id="textbox1" runat="server" width="120"></asp:textbox> <asp:numericupdownextender id="numericupdownextender1" runat="server" targetcontrolid="textbox1" maximum="9" minimum="1" width="120"> </asp:numericupdownextender>

asp.net - Displaying Image in grid -

Image
i'm using radgrid , in grid there buttons imageurl . , in ie8 have problems displaying them correctly (horizontally) , not so thought should change width of button happen dont know why happening ... have change width 20px 30px can please me how change normal in every other browser (horizontally both images ... my code <telerik:radgrid id="rggrid" runat="server" datasourceid="sqldatasource1" allowsorting="true" allowpaging="true" pagesize="20" allowfilteringbycolumn="true" showstatusbar="true" width="100%" cellspacing="0" gridlines="none" onitemcommand="rggrid_itemcommand"> <mastertableview autogeneratecolumns="false" datakeynames="organisationid"> <norecordstemplate> can't find organisations display </norecordstemplate> <

xna - reading , zoom and move images like remote sensing image (e.g jpg,tiff,img) by managed DX -

excuse me,my english poor try describe questions clearly. first want operate (read,zoom,move,zoom rectangle) image format jpg,tiff , img . have try gdal,using rasterio zoom , move ,but result quite strange.it's slow gdi+.i have asked other people,however ,the answer may rasterio read image direct hard disk, gdi+ things in ram. , maybe images operated small images ,small 4000*3000. operate images in gdi+.but think if can same things in directx? mean use directx instead gdi+.because think more fast. , because can use c#,so think there people give me suggestion managed dx or xna thx~~~ if if understood question, trying build simple image viewer. if can xna , work fast. all need load image , display screen, pan , zoom simple. read tutorial : http://rbwhitaker.wikidot.com/spritebatch-basics

jquery - $.ajax error handling in chrome -

hi working jquery form post. when post form, working fine in ie, not working chrome. put code here: $(document).ready(function(){ $('#signup').submit(function(){ var username = $('#username').val(); var password = $('#password').val(); var cpassword = $('#cpassword').val(); var email = $('#email').val(); if(password != cpassword){ alert("passwords not equal"); $('#cpassword').css('border','1px solid red'); }else{ $.ajax({ type :'post', url :'http://localhost/tmc/includes/ajax-signup.php', data :({password:password,username:username,email:email}), success : function(msg){ alert(msg); }, }); } //$("#submit").hide(); });

unity3d - Integration Awesomomium in Unity - RenderBuffer is an ambiguous reference between UnityEngine.RenderBuffer and AwesomiumMono.RenderBuffer -

i have integrate awesomium in unity 3d. have went on steps defined in http://labs.awesomium.com/unity3d-integration-tutorial-part-1/ but when have drag webtexture.cs on player object giving below error. assets/webtexture.cs(226,13): error cs0104: renderbuffer' ambiguous reference between unityengine.renderbuffer' , `awesomiummono.renderbuffer' kindly assist! thanks, vandana i have fixed own in webtexture.cs (class file provided awesomium) has ambiguity in reference. instead of ** renderbuffer _rbuffer = webview.render();** call awesomiummono.renderbuffer _rbuffer = webview.render(); it fix , load web container.

ms access - COUNT evaluate to zero if no matching records -

take following: select count(a.record_id) newrecruits ,a.studyrecord_id visits inner join ( select record_id , max(modtime) latest visits group record_id ) b on (a.record_id = b.record_id) , (a.modtime = b.latest) (((a.visit_type_id)=1)) group a.studyrecord_id; i want amend count part display 0 if there no records since assume count evaluate null . i have tried following still no results: iif(isnull(count(a.record_id)),0,count(a.record_id)) newrecruits is issue because join on record_id ? tried changing inner left received no results. q how above evaluate 0 if there no records matching criteria? edit: to give little detail reasoning. the studies table contains field called 'original_recruits' based on activity before use of database. the visits tables tracks new_recruits (count of records each study). i combine these in query (original_recruits + new_recruits)- if there have been n

amazon s3 - Hbase on AWS EC2 -

i'm planning host website , want use hbase db. website photo sharing/hosting thing , not want use rdbms. want experience on hosting, learning hbase , issues faced , fixed web developers , backend designers. in short, want create , host website in python + hbase purpose of learning them i've experience ec2 , s3 , using aws infrastructure. what i'm thinking of reserving: 3 default (1.7 g) instances hbase 3 more webserver + memcached if necessary i want figure out if okay start with. of course, time, benchmarks, code optimisation , buy larger instances (if can afford them) if required. as of now, above specs okay if targeted 1000 users? the users viewing photographs or adding comments apart uploading pics. assume 1 user upoloads 20 photos per week on average. i'm looking answers : "no, hbase can run in 1 medium size instance thousand users...." or "oh god 3 default servers 1000 users..." 1000 users total, or 1000 users co

java - jsf ajax trigged after jquery validation function -

i'm facing problem within jsf ajax request , jquery event. i'm using jquery event validate form part : jquery(".btnnextstep").live("click", function(e) { var error = !validate(id); ... return error; and under same button, have ajax event : <h:commandbutton type="button" value="etape suivante" class="btn btn-large btn-primary btnnextstep" id="btnformidentite"> <f:ajax execute="identite" render="@none" /> </h:commandbutton> the problem ajax request submited if jquery event return false ! how can request sent after jquery validation function ? i have tried onevent on f:ajax seem it's not possible call function inside of jquery namespace: (jquery(document).ready( function() {...) i hope understand problem. thanks. try define validate function : function vlidatenextstep() { var error = false; error = !validate(id);

python - How to restrict user input in QLineEdit in pyqt -

i have qlineedit , want restrict qlineedit accept integers. should work inputmask. dont want use inputmask , because if user clicks on qlineedit cursor @ position mouse clicked. , user need navigate 0 position , type eve wants. is there alternate this. you can use exception handling validating this: number = self.ui.number_lineedit.text() try: number = int(number) except exception: qtgui.qmessagebox.about(self, 'error','input can number') pass you can use validators validate input strings.

wpf - MVVM and collections of VMs -

Image
a common senario: model collection of item models. e.g house collection of people. how structure correctly mvvm - particulary regard updating model , viewmodel collections additions , deletes? model house contains collection of model people (normally list<people> ). view model housevm contains house object wraps , observablecollection of view model peoplevm ( observablecollection<peoplevm> ). note end here housevm holding 2 collections (that require syncing): 1. housevm.house.list<people> 2. housevm.observablecollection<peoplevm> when house updated new people (add) or people leave (remove) event must handled in both collections model house people collection and the vm housevm peoplevm observablecollection. is structure correct mvvm? there anyway avoid having double update adds , removes? your general approach fine mvvm, having viewmodel exposing collection of other viewmodels common scenario, use on place. not recommend exposing i

Same parent revision twice for a mercurial changeset -

is there canonical explanation why same parent revision listed twice given mercurial changeset resulting merge. unfortunately, not have chance tell, caused situation in observed case. might situation caused trying perform empty merge operation. any hints appreciated! we found out possible way cause kind of situation... the situation can reproduced tortoisehg selecting local version , "merge local" checking option "discard changes merge target (other) revision". this not result in calling hg merge (as 1 assume), hg debugsetparents . shot ourselves in foot forcing mercurial set both parents same revision.

perforce - p4 list jobs of a particular user -

p4 server 2010.2/347035 i trying list jobs created me in p4. hoping following command work p4 -u xxx jobs -m 50 but not. above command not list me jobs xxx user instead shows me jobs. questions how can list jobs? (or particular user's job) is there way petty print output generated p4? p4 commands have tabular output , tabular output? you want 'p4 jobs -e reportedby=calmstorm' or maybe 'p4 jobs -e ownedby=calmstorm'. since job spec customizable, exact syntax depend on fields have defined jobspec. have @ http://www.perforce.com/perforce/doc.current/manuals/cmdref/jobs.html#1040665 more information jobs query language. regarding pretty-printing, there isn't built command line itself. many users use scripting tool such perl, python, or ruby these purposes; there perforce packages major scripting languages can pick favorite one. or use p4v -- it's got nice gui searching , viewing jobs.

I have one Bitmap image. I want to crop a region in this bitmap by cocos2d in android? -

i have 1 bitmap image. want crop region in bitmap cocos2d in android? can me? code: private animation inittvanimation() { animation animation = new animation("abc", 0.2f); (int = 1; < 4; i++) { try { = assetmanager.open(new ccformatter().format("tv00%02d.png", i)); bf=bitmapfactory.decodestream(is); bitmap=bitmap.createbitmap(bf, 0, 0, bf.getwidth(), bf.getheight()); bitmap2=bitmap.createbitmap(bitmap, 140, 195, 743, 380); animation.addframe(bitmap2); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } return animation; }

r - Efficient comparison of POSIXct in data.table -

hello looking efficient way of selecting posixct rows data.table such time of day less 12:00:00 (note millisecond not required, can use itime example) set.seed(1); n = 1e7; dt = data.table(dts = .posixct(1e5*rnorm(n), tz="gmt")) dt dts # 1: 1969-12-31 06:35:54.618925 # 2: 1970-01-01 05:06:04.332422 # --- # 9999999: 1970-01-03 00:37:00.035565 #10000000: 1969-12-30 08:30:23.624506 one solution (the problem here cast costly if n big) f <- function(t, st, et) {time <- as.itime(t); return(time>=as.itime(st) & time<=as.itime(et))} p <- function(t, s) { #geektrader solution ep <- .parseiso8601(s) if(grepl('t[0-9]{2}:[0-9]{2}:[0-9]{2}/t[0-9]{2}:[0-9]{2}:[0-9]{2}', s)){ first.time <- as.double(ep$first.time) last.time <- as.double(ep$last.time)-31449600 secofday <- as.double(t) %% 86400 return(secofday >= first.time

php - Programatically DOC/DOCX to PDF -

Image
i'm having issue trying convert doc/docx pdf programatically. i'm following this answer . i'm using pyodconverter mentioned in answer above. asked web hosting install openoffice , did, when ran whereis soffice gave me /usr/bin/soffice . so, have piece of code: adocpdf filename=$1 extension=$2 service='soffice' if [ "`ps ax|grep -v grep|grep -c $service`" -lt 1 ]; unset display /usr/bin/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard & sleep 5s fi python /home/[mysite]/public_html/docpdf/documentconverter.py /home/[mysite]/public_html/docpdf/$filename$extension /home/[mysite]/public_html/docpdf/$filename.pdf index.php <?php $filename = "teste"; $extension = ".doc"; $output = array(); $return_var = 0; exec("/home/[mysite]/public_html/docpdf/adocpdf {$filename} {$extension}", $output, $return_var); print_r($output); print($re