Posts

Showing posts from July, 2012

arrays - Porting IDL code, lindgen function to Python -

afternoon everyone. i'm porting on idl code python , it's been plain sailing until point far. i'm stuck on section of idl code: nsteps = 266 ind2 = ((lindgen(nsteps+1,nsteps+1)) mod (nsteps+1)) dk2 = (k2arr((ind2+1) < nsteps) - k2arr(ind2-1) > 0)) / 2. my version of includes rewritten lindgen function follows: def pylindgen(shape): nelem = numpy.prod(numpy.array(shape)) out = numpy.arange(nelem,dtype=int) return numpy.reshape(out,shape) ... , ported code k2arr array of shape (267,): ind2 = pylindgen((nsteps+1,nsteps+1)) % (nsteps+1) dk2 = (k2arr[ (ind2+1) < nsteps ] - k2arr[ (ind2-1) > 0. ]) / 2. now, problem code makes ind2 array where, looking @ idl code , errors thrown in python script, i'm sure it's meant scalar. missing feature of these idl functions? any thoughts appreciated. cheers. my knowledge of idl not used be, had research little. operator ">" in idl not equivalent of python (or other la

visual studio - Keep common functions in separate cs file? (C#) -

i have common functions apppath() used in several windows forms of application, instead of declaring in each form, place in separate cs file. i have created separate class cs file, gave different namespace (modutilities) , put functions inside modutilities class. namespace modutilities { public class modutilities { // functions such apppath().... } } but can't figure out how use function modutilities inside different windows forms need it. trying use "using modutilities", instead of creating new instance (modutilities modu = new modutilities()) can me? if methods static within class, can do using modutilities; then var = modutilities.apppath(); if not, you'll need create instance of class. modutilities mod = new modutilities();

Android: view local html file not showing all browsers -

my app generating html file, want show user, code follows - uri uri = uri.parse("file://" + filename); intent browserintent = new intent(intent.action_view); browserintent.setdataandtype(uri, "text/html"); browserintent.addcategory(intent.category_browsable); startactivity(browserintent); it shows me "complete action using" lists firefox browser. have chrome, opera & dolphin browsers installed well. why dont choose of them ? thank you. you can use rooted phone, grab chrome apk, use apktool take inside manifest. there see chrome support schemes http/https/about/javascript usually, , file scheme once in following intent filter: <intent-filter> <action android:name="android.intent.action.view"/> <category android:name="android.intent.category.default"/> <data android:mimetype="multipart/related" android:scheme="file"/> </intent-filter> so can try change mime t

android - Generating new objects from findViewById() method -

i create new xml file (beside main one) in layout folder describe views. my idea use findviewbyid method find view style want (differentiating them id) , generate instance of object. is possible android api means? i feel maybe not 'correct design' choice, save me pain create styles programmatically. i know can create copy method, trying avoid because managing xml files simpler.

c# - Call view javascript function from javascript file -

i have jquery template being loaded values after ajax call done , not on view load. on page load javascript calls , function script.js file. need script.js file call function view. how call listload function script.js var limit = 5, dir = ' desc', sort = 'created', index = 0, autoscroll = false; function getdataurl(index, action) { return '/team/linking/listitemlinks/@model.itemid/?type=@model.itemtype'; } function listload() { alert('test'); } corey, as per understanding, invoke function in js file view , after js file invokes function residing in same view. i think can achieve (by theoritically) because, when page loads, clubs js. consider, if js file points master/layout page , when inner page loads have cumulative js (from page,outside js files , master/layout pages). can call function residing in page js (need verify). i think jquery may have similar kind of stuffs, because calling jquery using external file,

ios - I need to format and display specified contents from the URL in webView -

i creating rss feed app , need format feeds in webview , display description . here code: - (void)viewdidload { [super viewdidload]; nsurl *myurl = [nsurl urlwithstring: [self.url stringbyaddingpercentescapesusingencoding: nsutf8stringencoding]]; nsurlrequest *request = [nsurlrequest requestwithurl:myurl]; [self.webview loadrequest:request]; } instead of loading contents of specified url need format , display "description" of rss feed. have parsed data need format in web view . code parsing (prepareforsegue): - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([[segue identifier] isequaltostring:@"showdetail"]) { nsindexpath *indexpath = [self.tableview indexpathforselectedrow]; nsstring *string = [feeds[indexpath.row] objectforkey: @"link"]; nslog(@"description : %@" , string); [[segue destinationviewcontroller] setur

Can we override methods in WCF or web services? -

i want know if can override wcf methods or web service methods. if so, how? try overloading wcf service methods [servicecontract] public interface imycalculator { [operationcontract(name="addfloats")] float add(float operand1, float operand2); [operationcontract(name="addintegers")] int add(int operand1,int operand2); }

iphone - RestKit send post request, parse the result? -

i'm trying pull data web service api , parse received json... i've been though restkit tutorials, couldn't find information on doing post request! right have code: -(void) loadperformers { // create our request mapping rkobjectmapping* requestmapping = [rkobjectmapping mappingforclass:[jsonoperationmodel class]]; [requestmapping addattributemappingsfromarray:@[@"requesttype"]]; // create our data mapping rkobjectmapping* datamapping = [rkobjectmapping mappingforclass:[datamodel class] ]; [datamapping addattributemappingsfromarray:@[@"status"]]; // create our performer mapping rkobjectmapping* performermapping = [rkobjectmapping mappingforclass:[performermodel class] ]; [performermapping addattributemappingsfromarray:@[@"idperformer", @"name", @"rate", @"isinwatch", @"rating", @"pictureurl", @"lastmodifieddate"]]; // create ou

ios - How to do an if statement with a button? -

i'm new objective-c , learning bit bit, , have question it. i made iphone app incrementing or decreasing number, example, , default number set 0. pressing up, down or restart button have different command options. put play if statement, ex. when label number (0) equals 5 (5) have popup box, or text saying "you have reached number 5"; learn , able implement in future app or game. viewcontroller.h #import <uikit/uikit.h> int number; @interface viewcontroller : uiviewcontroller { iboutlet uilabel *count; } - (ibaction)up:(id)sender; - (ibaction)down:(id)sender; - (ibaction)restart:(id)sender; @end viewcontroller.m #import "viewcontroller.h" @interface viewcontroller () @end @implementation viewcontroller - (ibaction)up:(id)sender { number = number + 1; count.text = [nsstring stringwithformat:@"%i", number]; } - (ibaction)down:(id)sender { number = number - 1; count.text = [nsstring stringwithformat:@"%i

python - Constant Variable is being changed -

i'm remaking battleship game, , have constant variable called sea holds empty board. however, variable being modified, , don't know why (or where). suspect it's being passed reference player_board , when player_board modified, sea. how stop happening? here code. you'll see on bottom print out sea, , it's been modified. from random import randint #constants , globals ocean = "o" fire = "x" hit = "*" size = 10 ships = [5, 4, 3, 3, 2] player_radar = [] player_board = [] player_ships = [] ai_radar = [] ai_board = [] ai_ships = [] #classes class ship(object): def set_board(self, b): self.ship_board = b def edit(self, row, col, x): self.ship_board[row][col] = x def __repre__(self): return self.ship_board #set variables last_ship = ship() #holds last ship made in make_ship() sea = [] # blank board x in range(size): sea.append([ocean] * size) #functions def print_board(): row in range(size):

java - why no reference variable used to add method in awt -

i going through awt first time in java, found how create button in creating object button - instance b1 - , add component container using add method [add(b1)] . in case noticed was, add() method of parent class may container has been inherited, , button b1 directly added without having reference calling method add() ( .add() ) , petty confusing me. how method called without using dot operator? if method belongs object in, either directly or through inheritance parent, don't have prefix method anything. can use add(); if want clear, can use this keyword specify method belongs object in. work same above: this.add();

cmd - How can you get the clipboard contents with a Windows command? -

for example, can copy file clipboard this: clip < file.txt (now contents of file.txt in clipboard.) how can opposite: ???? > file.txt so contents of clipboard in file.txt ? you can use paste.exe software in order paste text describing. http://www.c3scripts.com/tutorials/msdos/paste.html with can do: paste | command to paste contents of windows clipboard input of specified command prompt or paste > filename to paste clipboard contents specified file.

php - (solved) sending mail with attachment trouble -

i have problem sending of mails attachment. have function: function mail_att($to, $subject, $message, $anhang) { $absender = "sender"; $absender_mail = "noreply@example.org"; $reply = "noreply@example.org"; $path = $anhang; $uploadname = "anhang.pdf"; $trenner = md5( time() ); // mail header $mailheader = "reply-to: " .$absender. "<" .$absender_mail. ">\r\n"; $mailheader .= "return-path: ".$absender_mail."\r\n"; $mailheader .= "message-id: <".$absender_mail.">\r\n"; $mailheader .= "x-mailer: php v" .phpversion(). "\r\n"; $mailheader .= "from: ".$absender."<".$absender_mail.">\r\n"; $mailheader .= "mime-version: 1.0\r\n"; $mailheader .= "content-type: multipart/mixed;\r\n"; $mailheader .= " boundary = " .$trenner;

for loop - R, Create data.frame conditional on colnames and row entries of existing df -

i have follow question . i creating data.frame conditional on column names , specific row entries of existing data.frame. below how resolved using for loop (thanks @roland's suggestion... real data violated requirements of @eddi's answer), has been running on actual data set (200x500,000+ rows.cols) more 2 hours now... (the following generated data.frames similar actual data.) set.seed(1) <- data.frame(year=c(1986:1990), events=round(runif(5,0,5),digits=2)) b <- data.frame(year=c(rep(1986:1990,each=2,length.out=40),1986:1990), region=c(rep(c("x","y"),10),rep(c("y","z"),10),rep("y",5)), state=c(rep(c("ny","pa","nc","fl"),each=10),rep("al",5)), events=round(runif(45,0,5),digits=2)) d <- matrix(rbinom(200,1,0.5),10,20, dimnames=list(c(1:10), rep(1986:1990,each=4))) e <- data.frame(id=sprintf(&quo

How to parse mapquest geocode JSON in iOS -

i trying parse json result mapquest geocode api. nsdictionary *jsonreponsedic = [nsjsonserialization jsonobjectwithdata:mapquestdata options:0 error:&error]; nsmutablearray *resultsarray = [jsonreponsedic objectforkey:@"results"]; nsdictionary *locationdic = [resultsarray objectatindex:0]; nslog(@"loc dic %@", locationdic); nsstring *city = [locationdic objectforkey:@"adminarea5"]; nslog(@"city : %@", city); i can parse until locationdic, returns loc dic { locations = ( { adminarea1 = us; adminarea1type = country; adminarea3 = ca; adminarea3type = state; adminarea4 = "santa clara county"; adminarea4type = county; adminarea5 = "los altos"; adminarea5type = city; displaylatlng = { lat = "37.37964"; lng = "-122.11877"; }; dragpoint = 0; geocodequali

jquery - Retrieve multiple model values from radio button asp.net c# mvc4 -

i have razor table generated customer model. put radio-button table user select customer want, have action bar @ top of table, i'm looking able retrieve both customer id , customerfirstname field using 1 radio-button. possible jquery or c#? right have radio-button getting customer's id not name. if unique customer name field can use jquery ajax post pass these 2 fields controller. ideas? here radio-button html: `<input type="radio" class="radiobtnclass" name="selectedcustomer" value="@item.id" />` also have field: `<input type="hidden" id="hdncustomerid" />` then of action bar actions edit: `<li>@ajax.actionlink("edit", "edit", new { id = "0" }, new ajaxoptions { httpmethod = "get" }, new { @class ="opendialog", data_dialog_id = "aboutldialog", data_dialog_title = "edit", id = "btneditcustomerid&

wordpress - Cookie issue in the site http://www.easybusinessregistration.com.au/ -

i have 3 forms here on site http://www.easybusinessregistration.com.au/ user fill out. there big cookie or cache issue site. every time user need clear browser cookies , cache whenever made changes in forms, site keeps on taking older form. site in wordpress , forms created using gravity forms http://www.easybusinessregistration.com.au/sole-trader-business-registration-formb/ . i using same gravity form on other sites there, forms wroking fine issue site only. i had similar problem pages not refreshing after had edited code, css. download plugin "w3 total cache" , empty cache in general settings of plugin whenever edit code. it's practice every time download or delete plugin also.

html - How to access content of leaflet popups -

i creating leaflet-popup set of html elements: var popupbox = document.createelement('div'); $(popupbox) .addclass('popup-box') .attr("id", "mypopup"); var popupboxcontent = document.createelement('div'); $(popupboxcontent) .addclass('some-class') .html('foo') .appendto(popupbox); myleafletobject.bindpopup(popupbox); unfortunatly not able access elements later on. example trying do: $('popup').append(somenewhtmlelement) fails. can help?

sql - select from two tables and conditionally collapse one column -

i have list of products upc | name | price | qty ---------------------------- 1 | apple | 1.00 | 3 2 | peach | 2.00 | 7 3 | melon | 1.75 | 2 and saleproducts upc | price ------------ 2 | 1.90 i want select products sale price saleproducts (if product on sale). came with: select t1.upc, t1.name, min(t1.price) 'price', t1.qty ( select p.upc, p.name, p.price, p.qty products p union select sp.upc, null, sp.price, null saleproducts sp ) t1 group t1.upc; output: upc | name | price | qty ---------------------------- 1 | apple | 1.00 | 3 2 | peach | 1.90 | 7 3 | melon | 1.75 | 2 can suggest more elegant way accomplish this? im aware of similar question goal grab whichever price lower, coalesce wouldn't work. the restriction is, must use vanilla sql, no stored procs or if's. try instead using case : select p.upc, p.name, case when sp.price not null case when p.price > s

java - PHP image path different for every user -

hi ive run thought simple obstacle however, become quite hassle want display picture on website different every user logged in. tried <img src="<?php echo 'screenshots/img_$username.png' ?>" /> i didnt think work im not sure go on 1 have java application saves images file on users computer uploads them server , saves them "img_someusername.png" username going different every person how can user logged in see or picture , not else's profile picture on facebook? try instead. <img src="screenshots/img_<?php echo $username; ?>.png" />

TCP socket not receiving in Android service after a while -

my service receive phone call information dsl router "fritz!box". when calling, router sends phone number service @ port 1012. works, after while service not receive anymore. service running, not reason, reads nothing router. no exception thrown, service remain in while loop... public class callmonitorservice extends service { @override public int onstartcommand(intent intent, int flags, int startid) { notification notification = new notification(icon, "service", system.currenttimemillis()); intent notificationintent = new intent(this, main.class); notificationintent.setflags(intent.flag_activity_clear_top | intent.flag_activity_single_top); pendingintent pendingintent = pendingintent.getactivity(this, 0, notificationintent, 0); notification.setlatesteventinfo(this, "title", "text", pendingintent); notification.flags |= notification.flag_no_clear; startforeground(1337, notificati

regex - How do I mutate a tritium variable string? -

i've fetched entire list of classes body variable so: $page_code = fetch("self::body/@class") but want grab 1 class out. tried using replace() , regex on variable contents think something's syntax: $page_code { text() { replace(/[^a-z]*/, '') } log("@@@@@@@@@@@@@@ page code " + $page_code) } i think code want is: $page_code { replace(/[^a-z]*/, '') } log("@@@@@@@@@@@@@@ page code " + $page_code) since $page_code string, don't need open text() scope. also, log() statement should outside, or else log current value of $page_scope. see here: http://tester.tritium.io/8ccb7ef99a0fd2fcbd60bd74cc137b040f57555e

Nothing to build: Eclipse Issues for C++ -

i have experience java , eclipse, i'm new c++, , trying teach myself. apologize if simple question, or 1 has been asked (though looked around while.) i'm on windows 8. i'm trying make sorted linked list (which relatively unimportant.) get: info: nothing build working. here's code: /* * sortedlist class */ #include <string> #include <fstream> #include<iostream> #include "sortedlist.h" using namespace std; //the listnode structure struct listnode { string data; listnode *next; }; //the head of linked list , pointer nodes listnode head; listnode *prev, *current; // insert string list in alphabetical order //now adds string list , counts size of list int insert(string s){ //make new node listnode temp; temp.data = s; //the node traverse list prev = &head; current = head.next; int c = 0; //traverse list, insert string while(current != null){ prev = current; current = current->next; c++; } //insert temp

How can I send file from local directory to sftp using spring? -

i want transfer local file on sftp using java spring. how can this? please provide example if possible. you can refer example @ https://github.com/spring-projects/spring-integration-samples/tree/master/basic/sftp this has basic example for 1.transfers files remote local directory 2.transfers files local remote directory 3.interact remote sftp server commands note : first functionality achieved via polling concept also spring sftp integration adapter documentation available @ - http://docs.spring.io/spring-integration/reference/html/sftp.html

dojo - Programmatically set dgrid row as active -

i'm trying programmatically set dgrid row active , not selected . have dojo dgrid ondemandlist using selection , keyboard mixins. using select(row) method can programmatically select given row, row not active . when row active , can use , down arrow keys navigate rows above , below it. when row selected , row highlighted arrows keys not work. clicking row mouse make active , selected , i'm trying build interface 100% usable keyboard. ok, took me awhile got figured out. trying add focus row. code doing in dgrid/keyboard.js under _focusonnode method. the actual code change focus row currentfocusednode row focusednode is: if(currentfocusednode){ // clean previously-focused element // remove class name , tabindex attribute put(currentfocusednode, "!dgrid-focus[!tabindex]"); if(has("ie") < 8){ // clean after workaround below (for non-input cases) currentfocusednode.style.position = "";

Show taps in iOS App Demo Video -

i making demo videos of ios apps, of made xcode , others of made in unity3d. plan use elgato game capture hd capture demo videos not sure how show "taps." found touchpose, when changed main.m suggested instructions on github page got error messages saying qappdelegate , qtouchposeapplication undefined. added import "qtouchposeapplication" got error message suggesting change qappdelegate appdelegate. when did build failed. when left qappdelegate, added qappdelegate project , imported main.m error messages went away build still failed. doing incorrectly? found no tutorials on touchpose online , confused. alternatively, there other easy solution, example using elgato software or other software or framework? tried reflector wifi not fast enough support frame rates it. aware use unity , "build osx" or in case of xcode apps screen record simulator prefer single, foolproof solution of apps. thanks! i had trouble touchpose figured out how u

javascript - Passing Object function into data() in d3 -

http://bl.ocks.org/mbostock/1134768 hey guys, i'm new javascript, , learning use d3 render data. i'm trying understand what's going on in code above, in particular, in snippet: // add rect each date var rect = cause.selectall("rect") .data(object) // weird me.... .enter().append("svg:rect") .attr("x", function(d) { return x(d.x); }) .attr("y", function(d) { return -y(d.y0) - y(d.y); }) .attr("height", function(d) { return y(d.y); }) .attr("width", x.rangeband()); what's object constructor doing in .data() ? think data() force evaluation of function, in effect object being created? why needed insert rectangle each element of each array in causes ? see this answer . it being used identity function - bound selection before, remains bound. pattern necessary because have call .data() update selection. personally dislike obfuscating code this; rather .data(function(d) { return d;}) obvious

c# - Open popup with linkbutton -

i using bootstrap modal popup, , div (for example) popup [using repeater] <div id="messagecontent">hello world!</div> this pop-up can opened doing (this works): <a href="#messagecontent" role="button" class="btn" data-toggle="modal">open popup</a> but want pass databinder.eval -values <a href=""></a> , , not possible, tried linkbutton : <asp:linkbutton id="lbopenmessage" runat="server" commandname="openmessage" commandargument='<%#eval("messageid")%>'>open popup</asp:linkbutton> but not abled call <a href="#messagecontent"></a> in linkbutton open pop-up. when this: <asp:linkbutton id="lbopenmessage" runat="server" commandname="openmessage" commandargument='<%#eval("messageid")%>'> <a href="#messagecontent" role=

Giving change in quarters, dimes, and nickels, using Python -

i don't understand assignment: write python program prompts user enter cost of item, , prompts user enter amount paid in cents. print change number of quarters, dimes, , nickels return (assume prices multiple of 5 cents). here's code: i = int(input('how did item cost')) p = int(input('how did pay')) e = p-i q = e/25 q = e%25 d = q/10 d = q%10`` n = d/5 n = d%5 print (' q = ',q,'\n d = ',d,'\n n = ',n) this solution using division. import math change = 50 quarterdif = change / 25 change -= math.floor(quarterdif) * 25 dimedif = change / 10 change -= math.floor(dimedif) * 10 nickeldif = change / 5 change -= math.floor(nickeldif) * 5 print(str(quarterdif) + str(dimedif) + str(nickeldif))

excel - Preference Votes Data to Groups -

Image
i have problem creating formula or vba macro sorts 'preference voting' data appropriate groups students selecting summer camp electives. historically, we've done voting , sorting on paper, , i'd move little less time consuming many, many rounds of electives @ camp. ive created form fill out, gives me spreadsheet elective preferences. looks kids b c 1001 2 3 1 1002 3 1 2 1003 3 1 2 1004 3 1 2 1005 3 1 2 1006 3 1 2 1007 3 2 1 1008 3 2 1 1009 2 1 3 1010 3 1 2 1011 2 1 3 what id able run macro or (even better) dynamic function sorts voters categories - this b c 1001 1002 1007 1010 1003 1008 1011 1004 1009 1005 1006 basically - elective has no first choice votes initial count = 0. elective b has 8 first choice votes, initial count 8, elective c has 3 first choice votes initial count 3. need these @ least close balanced (plu

mysql - Jetty 9 JNDI setup - Class not found: org.eclipse.jetty.plus.jndi.Resource -

i'm trying configure jndi entry in jetty 1 of applications. i've put mysql jar: mysql-connector-java-5.1.24-bin.jar in lib/ext i've edited start.ini , changed options to: options=server,websocket,resources,ext,plus i've uncommented lines: options=jndi options=plus etc/jetty-plus.xml when run: service jetty start get: java.lang.classnotfoundexception: org.eclipse.jetty.plus.jndi.resource in file:/usr/share/jetty-distribution-9.0.4.v20130625/etc/jetty.xml i've checked plus jar in /usr/share/jetty/lib jar tf jetty-plus-9.0.4.v20130625.jar |grep jndi/resource.class gives: org/eclipse/jetty/plus/jndi/resource.class so class there. the jndi entry defined in etc/jetty.xml: ... <new id="fhxprime_test" class="org.eclipse.jetty.plus.jndi.resource"> <arg><ref refid="server"/></arg> <arg>jdbc/fhxprime_test</arg> <arg> <new class="com.mysql.jdbc.jdbc2.optio

r - ggplot2 scatterplot and labels -

Image
i attempting produce scatter plot using ggplot2 library. data frame (called scatterplotdata) in form: 115 2.3 120 1.6 . . . 132 4.3 (the ... signifies many other similar values). essentially, 2 column data frame. have labels go along each of points. firstly, i'm having trouble scatterplot itself. i'm using following code: p <- ggplot(scatterplotdata, aes("distance (bp)", "intensity")) p + geom_point() however, using above code, following plot: obviously, it's not scatter plot. so, i'd helpful if point out i'm doing wrong. secondly, it's labels. have many datapoints have risk of overlapping datapoints. how should go putting on labels each point using ggplot? also, states use directlabels package overlap free labelled scatterplot using different colors, however, i'm not sure how go ggplot haven't found documentations regarding use of directlabels ggplot . any either (or both) question(s) appreciated - thanks.

html - Building my first CKEditor plugin using Twitter Bootstrap Icons -

following tutorial i'm trying create first plugin ckeditor, main idea here allow users pick select element (just 1 @ time) of icons in here need build , don't know how select element contains every class of elements "icon-circle-arrow-up", "icon-globe" , on users can pick , write code wherever want , if it's possible render element on ckeditor area, of course twitter bootstrap class should include css links. have done far piece of code: ckeditor.plugins.add('twitter-icons', { init: function(editor) { editor.inserthtml(); } }); where inserthtml() write editor <i class="some_class">&nbsp;</i> , some_class should take value picked users in select element. or ideas in how continue here? update 1 after research got this: ckeditor.plugins.add("tbootstrap", { requires: ["richcombo"], init: function(editor) { var config = editor.config, lang = editor.lang.form

html5 - Extract a table using ajaxjquery response -

i take whole html code page extracting table. here code. $(document).ready(function () { alert("hello"); $.ajax( { url: '/member/downloadurldata', type: "post", datatype: "html", async: true, cache: false, beforesend: function (request) { }, success: function (data) { // $('#rdata').load('data #container'); alert(data); var thehtml = $.parsehtml(data).filter('#container>table:first').html(); $("#rdata").append(thehtml); }, error: function (xmlhttprequest, textstatus, errorthrown) { }, complete: function (xmlhttprequest, textstatus) { } }); <div id="rdata"> </div> but cant extract table.the problem shown in error log '#container>table:first' not function. how can solve

vb.net - close a form without using invoker method? -

hi have main form has several mdi forms . have user authentication check if users given rights mdi form . happens on form load , if user not have rights close. wanted ask wether there method other invoker method. me.hide me.begininvoke(new methodinvoker(addressof me.close)) since interface mdi, assume you're using menu or button, @ least click event, open form. put authenmtication in click event handler before open form, , if authentication fails notify user of instead of opening form. not more efficient use of resources, more secure since system lag leave information on form visible before closed.

android - Build Google SDK example with Eclipse with release mode -

Image
i try build google drive sdk examples in eclipse v22.01: (the example website follows:) https://developers.google.com/drive/quickstart-android when used debug build,it builded fine , executed fine on table device. however, when tried build on release mode, failed. my process follows: 1. go "file"->"export" 2. create private keystore (this step succeeded.) 3. build apk i've checked post update proguard , downloaded , replaced jars in proguard checked post check '"android private libraries' , checked items on "order , export" tab. still failed. [edit 1] found solution. just uncheck 'drive api' (see picture reference) (i not sure if 'android dependencies' needed or not. maybe unchecked.) i add '-dontwarn com.google.**' 'proguard-android.txt' , worked. here errors messages got: [2013-07-24 12:03:43 - mainactivity] proguard returned error code 1. see console [2013-07-24 12:03:43 - m

asp.net - Multiple command in one linkbutton control -

i'm new asp.net development. ask if possible 1 link button have 2 or more commands? what want happen link button should able handle edit , update commands. once click link in grid view, show data on respective controls (i.e textbox name have data of clicked) once edit data on textbox , click same link update , save in database. <asp:templatefield headertext="id"> <itemtemplate> <asp:linkbutton id="lnkedit" runat="server" commandargument='<%#eval("id")%>' commandname="update" headertext="id" sortexpression="id" text='<%#eval("id")%>'> </asp:linkbutton> </itemtemplate> </asp:templatefield> thanks in advance. please help!. :) its not possible have multiple commandname 1 linkbutton,but when

android - AIDL, bind and unbind IExtendedNetworkService Service -

i use aidl interface iextendednetworkservice ussd code. application work after reboot device. tried bindservice after install app didn't work. problem how way bind service without reboot device . code: interface: package com.android.internal.telephony; interface iextendednetworkservice { void setmmistring(string number); charsequence getmmirunningtext(); charsequence getusermessage(charsequence text); void clearmmistring(); } service public class cdussdservice extends service { private string tag = "thang-nguyen"; private boolean mactive = false; broadcastreceiver receiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { if (intent.getaction().equals(intent.action_insert)) { // activity wishes listen ussd returns, activate mactive = true; log.d(tag, "activate ussd listener"