Posts

Showing posts from June, 2015

asp.net - How can I store a UserID and Name with the LoginControl? -

i have logincontrol works great, however, want store more information being authenticated or not. store userid of user when make changes can call userid , record made changes. here code. dim db new dataclassesdatacontext dim user = (from usertable in db.users _ select usertable _ usertable.active = true , _ usertable.name = logincontrol.username , _ usertable.password = rc.cryptedtext _ ) if user.count = 1 e.authenticated = true else e.authenticated = false end if i want able call userid later, i'm able login , access pages fine, session("userid") = logincontrol.username would great long session doesnt cleared. try may you. http://www.c-sharpcorner.com/uploadfile/syedshakeer/1789/ http://www.15seconds.com/issue/020220.htm http://www.exforsys.com/tutorials/asp.net-2.0/forms-authentication-i...

merge - Merging selective lines of code using Git? -

i force git always merge using (kind of) 3-way conflicts resolution. moreover, want point of being able choose single lines. at moment merging 2 branches. however, if possible, i'd know how perform task when merging multiple branches. git tries 3-way merging default (the recursive strategy 2 heads, , octopus strategy 3+ heads). if want see 3-way resolution options when manually merging, try setting merge.conflictstyle config option diff3 . (see configuration section of git-merge man page details on option.)

RSA: java.lang.OutOfMemoryError -

i facing java.lang.outofmemoryerror throwing here : com.rsa.certj.cert.attributevalueassertion.clone do have idea that? you should find out, objects occupy heap space. see main java.lang.outofmemoryerror: java heap space

android - Dynamically adjust the height of group headers in an ExpandableListView -

i have expandablelistview (elv) groups having linearlayout. have set height of group value (38dip in case, equivalent 2 lines of text). if group heading long , take more 2 lines, not shown in elv item - part of view gets scrolled. on other hand, if change android:layout_height "wrap_content" in linearlayout, groups show lines. line widths variable, i.e., short titles show 1 line , long titles show 2, 3 or 4 lines. looks ugly. implement height max("38dip", "wrap_content"). there way this? even programmatically, not seem getting actual height of group if set android:layout_height "wrap_content". suggestions there? could not solve problem directly. added following xml layout file of group: android:paddingtop="7dip" android:paddingbottom="7dip" that makes layout looking less congested wanted in first place. moving on - interested if else have better solution.

javascript - How can I defer loading UpdatePanel content until after the page renders? -

old hand @ asp.net, new updatepanel. have reporting page executes length sql query... takes 10 seconds right now. have page render, placeholder text (loading...) , have updatepanel kick off actual time-consuming reporting process , render report when it's done. so... theory use registerstartupscript() kick off , drop string getpostbackeventreference() trigger updatepanel update. problems crop up: 1) can use getpostbackeventreference w/ updatepanel or need trigger other way? use method on button inside update panel? 2) event gets triggered when postback reference updatepanel? it's not clear me. i've got call databinding code somewhere! again, maybe need use button inside? i had similar recently, here's how did (right or wrong): the trick "hidden async postback trigger". <asp:updatepanel id="upfacebookimage" runat="server"> <contenttemplate> <!-- updatepanel content --> </contentt...

sql - Oracle performance when dropping all tables -

Image
i have following oracle sql: begin -- tables c in (select table_name user_tables) loop execute immediate ('drop table '||c.table_name||' cascade constraints'); end loop; -- sequences c in (select sequence_name user_sequences) loop execute immediate ('drop sequence '||c.sequence_name); end loop; end; it given me dev, , have no idea how works, drops tables in our database. it works, takes forever! i don't think dropping of tables should take long. what's deal? and, can script improved? note: there somewhere around 100 tables. "it works, takes forever!" forever in case meaning less 3 seconds table :) there more dropping table dropping table. there dependent objects drop - constraints, indexes, triggers, lob or nested table storage, etc. there views, synonyms stored procedures invalidate. there grants revoked. table's space (and of indexes, etc) has de-allocated. all of activity generates recursive ...

html - How do I show a snippet of code or a block of code followed by an example of the code? -

i learning basics of xhtml , attempting use tag code , pre display snippets or blocks of code respectively. how show working example of code e.g. <p>code sample</p> <code> #p1 {font-family: arial;} </code> how display working example of code below it? you won't able map kind of code actual html/css using html/css alone. try using javascript achieve this, mileage may vary haven't done kind of thing before. when wrote html/css articles code examples + working samples you're doing, used write style attributes containing example css, or style sample elements id, manually, i'm not sure if you're looking kind of solution.

wpf - Can't change MediaTimeline's RepeatBehavior after it's started? -

i'm running mediaelement using mediatimeline , mediaclock. however, when change repeatbehavior after it's started has no effect, i.e. when set repeatbehavior.forever , begin(), changing repeatbehavior(1) has no effect - timeline continues forever. likewise if timeline set repeatbehavior(1) changing repeatbehavior.forever afetr clock has started has no effect , timeline stops @ it's original duration. it's duration doesn't updated these changes. yet cannot change duration either. is there way change repeatbehavior after clock has started? you can try stopping animation, changing repeatbehaviour , launching animation same point stopped, user doesn't notice stopped.

sql - why do i need left outer join if i have right outer join? -

possible duplicate: when or why use right outer join instead of left? what ever functionality left outer join can interchanging table names.then, need having 2 outer joins ( left , right) ? if there specific need can body explain example ? why use >= when < same thing? mostly it's convenience thing.

sharepoint - Detect whether a font is installed on client browser? -

i have requirement need check in sharepoint page whether custom font installed on browser running or not. accordingly need update css class makes use of font. so there way through can detect whether font available on client browser (ie , firefox)? answer stackoverflow, noted @ryan better place post question: detecting font in javascript

windows installer - Installshield: can it generate an .msi file? -

can installshield generate .msi file? what difference between express , professional versions of installshield? there reason professional? yes has option output single .msi installer. http://www.flexerasoftware.com/products/installshield/features.htm

winforms - Why am I getting these errors in C#? -

edit: i got rid of of errors. help. there's wrong while loop (in form class), basically, tests see winner of "race" in application, , starts application (shark.swim). once finds out winner is, needs "payout" method in bet class. so here's have. while loop: private void racebtn_click(object sender, eventargs e) { public int[] finishingorder = new int[4]; bool sharkfinished = false; public int place = 1; public int numsharksfinished; while (numsharksfinished < 4) { sharkfinished = false; (int = 0; < 4; i++) { if (finishingorder[i] == -1) { if (sharks[fish].swim();) { finishedorder[i] = place; sharkfinished = true; numsharksfinished++; } } if(sharkfinished = true) ...

Django how do i view query in manage shell -

how can see django queries manage shell interface i have tried using gives me queries pass through django server from django.db import connection connection.queries() i have seen somewhere, can't remember where?? django how view query in manage shell there 2 ways view query in shell . first, if using queryset can use query attribute of queryset. e.g. qs = mymodel.objects.all() print qs.query second when query not visible immediately. e.g. when updating queryset using update() . in case can: from django.db import connection mymodel.objects.all().update(foo = 'bar') print connection.queries # print connection.queries[-1] # if want see last query i have tried using gives me queries pass through django server i don't understand mean "gives me queries pass through django server". trying see queries while running application? in case use django-debug-toolbar or snippet referred @rubayeet .

android thread issue -

i have android application display images downloaded server. downloading of image 1 thread , displaying image in main class. on compiling emulator shows error alert application stopped unexcpectedly. main application(class extends activity) thread?? please me thanks in advance you can use adb logcat more detailed information

PartialFunction type inference in Scala -

let's consider following function: def printpftype[t](pf:partialfunction[t, _])(implicit m:manifest[t]) = { println(m.tostring) } then define following test class: case class test(s:string, i:int) i can't write this: printpftype { case test(_,i) => } because compiler can't infer first parametric type of partialfunction. have specify explicitly: printpftype[test] { case test(_,i) => } but test type appears twice. there technique avoid this? how can type inferer avoid duplicate? see thread . type inference cannot handle problem. quote spec: an anonymous function can defined sequence of cases { case p1 => b1 . . . case pn => bn } appear expression without prior match. the expected type of such expression must in part defined . must either scala.functionk[s1, . . . , sk, r] k > 0, or scala.partialfunction[s1, r], argument type(s) s1, . . . , sk must determined, result type r may undetermined.

iphone - UIKit keys missing in info.plist file -

i want add uiapplicationexitsonsuspend key in info.plist file but ui related keys missing. what should done ui related keys in info.plist file i have default frameworks uikit, foundation , coregraphics added project. if in project.xcodeproj file, search info.plist. entry missing this: pliststructuredefinitionidentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist";

ruby on rails - accepts_nested_attributes_for and new records -

i'm using accepts_nested_attributes_for following models: user model: class user < activerecord::base has_many :competences has_many :skills, :through => :competences, :foreign_key => :skill_id accepts_nested_attributes_for :skills end skill model: class skill < activerecord::base has_many :competences has_many :users, :through => :competences, :foreign_key => :user_id end competence model: class competence < activerecord::base belongs_to :user belongs_to :skill end the skill table has "name" attribute. how can have accepts_nested_attributes_for not create new skill record if record same skill name exists? you can avoid creating new skill validating skill name unique: class skill < activerecord::base validates_uniqueness_of :name end i guess want know though, how associate existing skill name have specified new user instead of creating new skill when 1 exists. if trying suggests me attributes shoul...

sql - How can I easily store my C# data structure(XML serialiazable) into a database? -

i have c# data structure consists of classes , collections have references each other. using serialization store structure in xml, works handy way save/load structure application. if want able save/load structure database, there simple way? should use linq? just 100% clear linq has nothing storing data in database. linq language query c# syntax resembles sql. so in order answer question @ entity framework (i'd recommend if using .net 4.0) or linq sql

Deploying a web app with Crystal Reports -

i ahve web app deployed , works fine. crystal reports fine on deployed website on server. on development machine i have not changed reports should exact same on server. when upgraded pc, installed vs2010 without installing 2008. have errors when try view reports on development pc. have downloaded cr vs2010 , included reference still error.. could not load file or assembly 'crystaldecisions.web, version=10.5.3700.0, culture=neutral, publickeytoken=692fbea5521e1304' or 1 of dependencies. system cannot find file specified. i don't care error right on development pc, need deploy latest version today , afraid reports going break on server. should remove cr reference on development machine before deploying? edit...i know issue, registered assembly set version on server (10.5.3700.0) not version on machine 14.0.2000.0 can downgrade vs2010 run on 10.5.3700.0 can deploy , test?

Mysql Covert rows to columns -

i have table order numbers, first name, last name, question , answers. there 5 questions asked user, each answer question generates 1 row of data, produces 5 rows per user. need query returns order number, first name, last name , questions , answers converted columns, returning 1 row per user. any appreciated thanks, larry seems want join table 5 times. something like select q1.first_name, q1.last_name, max(q1.question), max(q1.answer), max(q2.question), max(q2.answer),max(q3.question), max(q3.answer),... questions q1 join questions q2 on q1.first_name=q2.first_name , q1.last_name=q2.last_name join questions q3 on q1.first_name=q3.first_name , q1.last_name=q3.last_name q1.order_number = 1 , q2.order_number = 2 , q3.order_number = 3 ... group q1.first_name, q1.last_name using max collapse down rows unique first name/last name pairs.

Get a called functions list in PHP -

in php, get_included_files() returns array names of included files. in similar fashion, there way array names of called functions parameters? i trying achieve want , came reasonable solution. make class named debug , include above every file want debug in. build function prints nicely information stored in $calls . class debug { private static $calls; public static function log($message = null) { if(!is_array(self::$calls)) self::$calls = array(); $call = debug_backtrace(false); $call = (isset($call[1]))?$call[1]:$call[0]; $call['message'] = $message; array_push(self::$calls, $call); } } call function everytime declare function first line in functionbody: debug::log($message(optional) )

Delphi - Convert byte array to string -

how convert byte array string (base 256) in delphi? use built-in setstring command. sets string required length , copies bytes. there's no need array null-terminated. in fact, if array has zero--valued bytes in it, they'll correctly appear within string; won't terminate string. setstring(ansistr, pansichar(@bytearray[0]), lengthofbytearray); if have unicodestring , you'll need halve length parameter since measures characters, not bytes: setstring(unicodestr, pwidechar(@bytearray[0]), lengthofbytearray div 2); see also, converting tmemorystream string in delphi 2009 .

How do we "test" our security policy? -

disclaimer: @ place of work aware that, none of security experts, can't avoid hiring security consultants true picture of our security status , remedial actions vulnerabilities. question asked in spirit of trying little less dumb , bit more aware of issues. in place of work, small business sum total of 7 employees, need work on reviewing our application security flaw , vulnerabilities. have identified 2 main requirements in security tester: they competent, thorough , know stuff. they able leave clear idea of work need make our security better. this process iterative have scan, remedial work , repeat. regular occurrence going forward. the problem have is: how know 1? and, if we're reasonably sure of 1, how on earth proceed 2? our first idea light security scanning on our code ourselves , see if identify definite issues. then, if security consultants choose identify issues , few more we're on way 1 , 2. problem i've been trawling interweb days looking @ o...

iphone - Objective c "for each" (fast enumeration) -- evaluation of collection? -

it seems experimentation collection expression evaluated once. consider example: static nsarray *a; - (nsarray *)fcn { if (a == nil) = [nsarray arraywithobjects:@"one", @"two", @"three", nil]; nslog(@"called"); return a; } ... (nsstring *s in [self fcn]) nslog(@"%@", s); the output is: 2010-10-07 07:37:31.419 widephotoviewer lite[23694:207] called 2010-10-07 07:37:31.420 widephotoviewer lite[23694:207] 1 2010-10-07 07:37:31.425 widephotoviewer lite[23694:207] 2 2010-10-07 07:37:31.425 widephotoviewer lite[23694:207] 3 indicating [self fcn] called once. can confirm specified (as opposed merely observed) behavior? what have in mind doing this: for (uiview *v in [innerview subviews]) { instead of this: nsarray *vs = [innerview subviews]; (uiview *v in vs) { thoughts? this kind of loop called "fast enumeration" (look @ nsfastenumeration object). apple's documentation ...

javascript - innerHTML alignment question -

i have js code brings in random images , text (captions). captions centered under images , them left aligned -- can tell me how might edit span.innerhtml =shuffled[i].text; to make text left aligned under image? in advance if can answer it! { var td = document.getelementbyid("title"+i); var link = td.getelementsbytagname("a")[0]; var image = link.getelementsbytagname("img")[0]; var span = link.getelementsbytagname("span")[0]; image.src = ibase + shuffled[i].image; link.href = urlbase + shuffled[i].href; span.innerhtml =shuffled[i].text; image.alt = shuffled[i].text; } there's nothing in javascript centering text. looks existing stylesheet rule might doing this. if can edit css, i'd recommend approach first. if not, try adding this: span.style.textalign = "left"; i'm assuming span contains text you're trying align left.

eclipse - Incrementally compiling java source files -

i want compile changed changed java source files. know eclipse doing inside jdt plugin . question , possible without eclipse installtion ? i meant possible small subset of jars eclipse plugins , use compiler compile changed java files through ant script ? thanks jijoy both ant , maven know how compile files have changed, or depend on files have changed. in case of maven, happens default. ant using depend task. you need aware of limitations of these mechanisms. in particular, ant depend task not detect kinds of dependencies not made explicit in java class file format.

Custom jQuery Validation .addMethod question -

i have form validates zip codes on min/max length basis. need have zip min 5 digits countries except australia needs 4. here im having trouble with: $.validator.addmethod( "auszip", function(value, element) { if ($("#country").val("aus") && ("#postalcode").length < 4)) { return false; } else return true; }, "australian zip code must @ least 4 digits" ); then in rules rules: { postalcode: { required: true, minlength: 5 //for countries except aus auszip: true // aus } } is length not way go? i'm assuming all validation rules must pass, means minlength fail if have length of 4. also, you're missing $ before ("#postalcode").length . also line sets value of #country . $("#country").val("aus") you want get value, , compare "aus" . $("#country"...

ant targets are outputting too many times -

i've got ant file looks this: <?xml version="1.0" encoding="utf-8"?> <project name="p" default="compile" basedir="."> <path id="compile.cliclasspath"> <fileset dir="./webcontent/web-inf/lib"> <include name="*.jar" /> </fileset> </path> <target name="init"> <!-- create time stamp --> <tstamp /> </target> <target name="compile" description="compile source" > <javac srcdir="./src/" destdir="c:\temp\build"> <classpath refid="compile.cliclasspath" /> </javac> </target> <target name="createwar" depends="compile" description="create web archive"> <war destfile="c:\temp\client.war" webxml="./webcontent/web-inf/web.xml" needx...

scala - Use of lazy val for caching string representation -

i encountered following code in jaxmag's scala special issue: package com.weiglewilczek.gameoflife case class cell(x: int, y: int) { override def tostring = position private lazy val position = "(%s, %s)".format(x, y) } does use of lazy val in above code provide considerably more performance following code? package com.weiglewilczek.gameoflife case class cell(x: int, y: int) { override def tostring = "(%s, %s)".format(x, y) } or case of unnecessary optimization? one thing note lazy vals that, while calculated once, every access them protected double-checked locking wrapper. necessary prevent 2 different threads attempting initialize value @ same time hilarious results. double-checked locking pretty efficient (now works in jvm), , won't require lock acquisition in cases, there more overhead simple value access. additionally (and obviously), caching string representation of object, explicitly trading off cpu cycles possibly la...

arrays - PHP Array_Unique Problem -

i don't know php well, please bear me. my client has database information , 1 of fields ff_date_time in format "tue oct 5 14:43:10 2010". there lot of entries in here , need display list of days have entries: ie, tue oct 5, 2010 thurs oct 7, 2010 , on. there may hundreds of entries on day, when pull in dates db need go through , extract right data , filter it. here's have far: $query = "select ff_date_time booth_submit"; $query_result = mysql_query($query); $datetimes = array(); $dates = array(); while ($row = mysql_fetch_array($query_result)) { $datetimes[] = $row['ff_date_time']; } ($i = 0; $i < sizeof($datetimes); $i++) { $temp = explode(" ", $datetimes[$i]); $dates[] = ($temp[0]." ".$temp[1]." ".$temp[2]." ".$temp[4]); # breaks date_time 'mon oct 5 2010' format } $dates = array_unique($dates); ($i = 0; $i < sizeof($dates); $i++) { echo('<a ...

c# - A way to launch address book and select email recipients -

my requirement is, from win forms application, want launch outlook address book (and/or global address list - exchange server), choose recipients , populate textbox email addresses (or) distribution list. any clues? searched several forums, no 1 addresses scenario. this article couple of years old may you: http://www.developer.com/net/csharp/article.php/3701241/interacting-with-outlook-from-a-winforms-application.htm

makefile - make to compare two folders -

i want use makefile compare 2 folders. if 2 folders equal don't anything, if different want create folder. here makefile complaining about: #bindirexists:=t ifeq "../.build" "../topica" /bin/sh: ifeq: not found make: *** [checkdest] error 127 the makefile following: projname=topica top=.. srcdir=src builddir=.build src=topica.cpp executable=topica.exe cc=g++ ################################# #macros: define bindirchk #bindirexists:=$(shell if [ -d '$(top)/$(1)/$(2)/' ]; echo "t"; else echo "f"; fi ) ifeq "$(strip $(top)/$(1))" "$(strip $(top)/$(2))" echo "t" else echo "f" endif endef define mkbuilddirs @echo creating build directories $(top)/$(1) , $(top)/$(1)/$(2) $(shell mkdir -p $(top)/$(1) $(top)/$(1)/$(2)) endef ################################# #main targets , pre-reqs all: checkdest #$(cc) $(srcdir)/$(src) -o $(top)/$(builddir)...

encoding - Why is PHP's utf8_encode breaking my utf-8 string? -

i'm doing kind of roundabout experiment thing i'm pulling data tables in remote page turn ics can find out when sports team playing (because can't find anywhere information more readily available in table), that's give context. i pull data using curl , parse using domdocument . take , parse info need. what's giving me trouble opposing team. when display data on initial php page, it's correct. when write ics file, special utf-8 characters messed up. thought utf8_encode solve problem, seems have opposite effect: when run function on data, stuff displayed on page (which had been displaying correctly), not in separate ics file (which writing incorrectly), incorrect. example: turns "inđija" "inÄija." any tips or resources far dealing utf-8 strings in php? server (a remote host) doesn't have mbstring installed either, pain. utf8_encode encodes string in iso 8859-1 utf-8. if put utf-8 it, it's going interpret if iso 8859-1...

php - Any way to direct 'returned' emails for various errors? -

we manage website gives agents ability enroll members across country. @ times, member or agent enter bad email address during enrollment process , important pdf'd information cannot delivered member. similarly, agent may try , recruit sub-agent , have same issue. is there anyway automatically redirect returned emails (delivery status notification (failure)) responsible party instead of our primary email? i.e. agent 1 recruits agent 2. email attempted send recruit@domain.com address agent 2 invalid. system automatically recognizes message type, formats , sends agent 1 note saying email he/she entered bad. note: using google apps standard of our mail delivery while our platform built on php , mysql. make special email example "recruit-system@domain.com" , send every mail account. after sending recruiting mali via account, make shure save destination e-mail adress in database connected according agent sent mail can determine sent email afterwards. make s...

python - How to deal with IndentationError? -

i following error: file "imp.py", line 55 key = key() ^ indentationerror: expected indented block with following code: # caesar cipher max_key_size = 26 def getmode(): while true: print('do wish encrypt or decrypt or brute force message?') mode = raw_input().lower() if mode in 'encrypt e decrypt d brute b'.split(): return mode else: print('enter either "encrypt" or "e" or "decrypt" or "d" or "brute" or "b".') def getmessage(): print('enter message:') return raw_input() def getkey(): key = 0 while true: print('enter key number (1-%s)' % (max_key_size)) key = int(raw_input()) if (key >= 1 , key <= max_key_size): return key def gettranslatedmessage(mode, message, key): if mode[0] == 'd': key = -key translated = '...

objective c - componentsSeparatedByCharactersInSet gives me a bunch of empty strings -

ok, first , foremost, using gnustep way learn objective-c, there may differences between gnu , apple implementation. being said, shouldn't affect question. anyways, understand conundrum, please parse following code visual receptacles: #import <cocoa/cocoa.h> int main() { nsautoreleasepool * pool = [[nsautoreleasepool alloc] init]; nsenumerator * lineenumerator = [[nsarray arraywithobjects: @"jim 1", @"steve 3", nil] objectenumerator]; nsstring * s; while((s = [lineenumerator nextobject])) { nsarray * parts = [s componentsseparatedbycharactersinset: [nscharacterset whitespaceandnewlinecharacterset]]; nslog(@"%@", parts); } [pool drain]; return no; } and following output: 2010-10-07 10:03:50.809 a.out[24512] (jim, "", "", "", "", 1) 2010-10-07 10:03:50.812 a.out[24512] (steve, "", "", 3) my expected output be: 2010-10-07 10:03:50.809 a.out[2451...

How to reduce the size of an image in C# and .NET 3.5? -

Image
i have screen shot take in mobile app. screen shot takes 32 kb when saved png on disk. i sending these central sql server , 32 kb big amount of times need store screen shot (approx 2500 times day). is there kind of trickery can save smaller? here code using take bitmap bytes (to send server storage): memorystream stream = new memorystream(); _signatureimage.save(stream, imageformat.png); return stream.toarray(); _signatureimage bitmap , screenshot in question. here example of screen shot saving: things pop mind (but don't know how them): reduce actual height , width of image (but in way not distort it). change black , white image (not sure if see real space savings this) compress more (i don't because not readable database). note, has done programatically, , cannot take long, complex image manipulations out. thanks help. private static image resizeimage(int newsize, image originalimage) { if (originalimage.width ...

sql server - Importing/Pasting Excel data with changing fields into SQL table -

i have table called animals. pull data table populate system. i excel data lists of animals need go in animals table. the excel data have other identifiers, breed, color, age, favorite toy, veterinarian, etc. these identifiers change each new excel file. may repeat, others brand new. because fields change, , never know new fields come each new excel file, animals table has animal id , animal name. i've created values table hold other identifier fields. table structured this: animalid value fieldid datafileid and have fields table holds key each fieldid in values table. i because alternative keep big table fields may not used each time need add data. big table lot of null columns. i'm not sure way way either. can seem overly complex. but, assuming way, best way excel data values table? list of animals easy add animals table. each identifier (breed, color, etc.) have copy or import values , update table assign matching fieldid (or create new fieldi...

java - Retrieve JTextField text value -

i'm trying retrieve text value jtextfield first need cast component object (java.awt.component) jtextfiel... mi code this component[] x = this.getcomponents(); for(int = 0; < x.length; i++) { if (x[i] instanceof jtextcomponent) { //retrieve text...something //(jtextfield)x[i].gettext(); } } i'm doing because know controls of mi page in "x" (jlabels , jtextfield) components , that's why i'm making cast jtextfield. i'm lost here , don't know if right way it. time! ((jtextcomponent) x[i]).gettext(); should work. (just because x[i] instance of jtextcomponent , doesn't mean it's neccesarily jtextfield though.) jtextcomponent has .gettext() casting jtextcomponent should ok.

vb.net - Compare two string ArrayLists -

i have 2 array lists dim colors1 = new arraylist colors1.add("blue") colors1.add("red") colors1.add("yellow") colors1.add("green") colors1.add("purple") dim colors2 = new arraylist colors2.add("blue") colors2.add("green") colors2.add("yellow") i find out colors missing colors2 found in colors1 look @ using except method. "this method returns elements in first not appear in second. not return elements in second not appear in first." so can put colors 2 first argument , colors1 second. edit: meant can put colors 1 first , colors 2 second. edit2: (per sean) var missingfrom2 = colors1.except(colors2);

What are some BI tools that integrate well with Sharepoint 2007? -

we use moss 2007 our company intranet site , looking create dashboards performance kpi's etc. weve been using ssrs 2005, cognos excel services , bdc. i've demoed dundas dashboard comes sharepoint web part viewing dashboards in sharepoint. there other bi platforms out there integrate sharepoint 2007? performancepoint integrated 2010, of 2007 have buy separate. bi package.

c# - Problem accessing .NET web service from Windows app -

i have ajax web application. asp pages accessing various web services part of application using standard microsoft .net ajax extension apis. now, have call of web services windows app. it works when add web reference project on local development machine. but when try access web service production, redirected login page. i using windows xp , iis5.1 in development , windows 7/iis 7 in production. this line web.config: <authentication mode="forms"> <forms name=".localcookies" loginurl="login.aspx" protection="all" timeout="60" path="/"/> </authentication> i've tried set mode "none" getting windows authentication screen. any idea how change configurations? if can away no security on web services (e.g. internal server), change site's security settings allow anonymous access web service. <!-- put beneath closing </system.web> ...

java - How to pause a Thread's Message Queue in Android? -

i queuing bunch of runnables thread via handler.post(). ability send note thread should pause. by pause mean, finish runnable or message working on, don't go next message or runnable in message queue until tell continue. in case else finds way question, ended going threadpoolexecutor, using example code in it's documentation creating pausablethreadpoolexecutor: http://download.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/threadpoolexecutor.html it doesn't use message queue or looper accomplishes trying do, create queue of runnables able paused and/or canceled. has added bonus of being able spread queue on specified number of threads.

sql server - What does "materializing" temporary table mean? -

i have noticed quite few mentions of word "materializing" when people talking using temporary tables in sql server. can expand on means? trying better understanding of means in terms of using temp tables? thanks! s the term "materializing" used in context of view. when create clustered index on view, materialize view; means view's data stored table on disk, , updated automatically when tables participate in view updated. if view not materialized, sql server must compute data in view performing joins in view definition every time query performed (though results may cached, or what-have-you).

qt creator - What's the best agile toolchain for Qt? -

i'm curious if else has recommendation qt friendly toolchain. we're evaluating using following: bug/issue tracking - atlassian jira (already in use) ide - qt creator (already in use) code coverage - gcov (are there easy ways integrate dev/ci environment?) unit testing - qtestlib , boost test code review - either atlassian crucible (expensive) or reviewboard (free) nightly build/check-in build - hudson, cruiscontrol or atlassian bamboo. advice? code analysis/style checker - vera++? cppcheck? suggestions? source code monitoring - atlassian fisheye (only if go crucible), viewvc. advice? are there other tools should take at? thanks! bugs: bugzilla ide: qtcreator many people hate if enforce use of 1 ide on other, specially if have opensource developers. code coverage: in order use gcov code coverage, ci environment needs build software appropriate set of flags , execute code. note gcov not reporting, need lcov generate statistics gcov generated f...

.net - A program does not work on one of the vmware servers -

the vb.net exe runs fine on 1 of vmware servers gives following message on clone of same. there no event entries , program not start. its running on windows server 2003. thoughts on how debug/tackle this? [program name] has encountered problem , needs close. sorry invenience. if in middle of something, information working might lost. [close] when cloned machine, did sysprep generate new machine name , new sid? if not, run weird issues. this vmware thread contains howto cloning machines

c# - Reference an ASP control inside a function or class method -

how reference asp.net control on page inside function or class. private void pageload(object sender, eventargs e) { //an example control page txtusername changetext(ref txtusername, "hello world"); } private void changetext(ref htmlgenericcontrol control, string text) { control.innertext = text; } will change text of txtusername control? i tried , working private void pageload(object sender, eventargs e) { changetext(txtusername, "hello world"); } private void changetext(textbox control, string text) { control.text = text; } yes, should, assuming it's @ appropriate point in page lifecycle, nothing else messes afterwards. (i don't know details of asp.net lifecycles. however, it's worth mentioning there's absolutely no reason pass reference here. suggests don't understand parameter passing in .net - suggest read my article on it - once understand (and reference/value type distinction) kinds of things may b...

Django: Models: How can I make the app_label appear in all caps? -

if manually set app_label, there way set caps? using acronym app name , little confusing not have in caps. if set app_label on new project, have no users or data, kind of issues should when setting user permissions , database tables?

perforce - Put P4 move operation in a non default changelist -

i'm trying p4 move retain perforce history. p4 moves created delete/add operation in default changelist. documentation assures me p4 move retain history via 'integration record'. now want submit p4 move (delete/add) operation part of changelist. how make sure perforce move rather delete/add indicated changelist , lose history? can see if 'activation record' created when changelist submitted? you can use p4 opened see status of opened files in changelist. following sequence of commands illustrates happens during p4 move . $ p4 open icons.zip $ p4 opened //full/depot/path/to/icons.zip#1 - edit default change (ubinary) $ p4 move icons.zip foo.zip //full/depot/path/to/foo.zip#1 - moved //full/depot/path/to/icons.zip#1 $ p4 opened //full/depot/path/to/foo.zip#1 - move/add default change (ubinary) //full/depot/path/to/icons.zip#1 - move/delete default change (ubinary) $ p4 changelist change 350425 created 2 open file(s). $ p4 opened //full/depot/path...

c# - GetFields of derived type -

i trying reflect fields in derived type it's returning fields of base type. public class basetype { string basevar; } public class derivedtype : basetype { string derivedvar; } in function: derivedtype derived = new derivedtype(); fieldinfo[] fields = derived.gettype().getfields(); this return basevar, not derivedvar. i've tried different bindings , doesn't seem make difference. also, i'm doing in asp.net within app_code basevar defined in app_code , derivedvar user control defined in app_controls types not in scope. as is, return nothing default binding public fields only. as also, derivedtype isn't derived basetype with: fieldinfo[] fields = derived.gettype().getfields(bindingflags.nonpublic | bindingflags.instance); it returns derivedvar. i've checked in linqpad. if change derivedtype derived basetype, can both fields with: fieldinfo[] fields = derived.gettype().getfields(bindingflags.nonpublic | bindingflags.inst...

JavaScript function declaration and evaluation order -

why first 1 of these examples not work, other ones do? // 1 - not work (function() { settimeout(somefunction1, 10); var somefunction1 = function() { alert('here1'); }; })(); // 2 (function() { settimeout(somefunction2, 10); function somefunction2() { alert('here2'); } })(); // 3 (function() { settimeout(function() { somefunction3(); }, 10); var somefunction3 = function() { alert('here3'); }; })(); // 4 (function() { settimeout(function() { somefunction4(); }, 10); function somefunction4() { alert('here4'); } })(); this neither scope problem nor closure problem. problem in understanding between declarations , expressions . javascript code, since netscape's first version of javascript , microsoft's first copy of it, processed in 2 phases: phase 1: compilation - in phase code compiled syntax tree (and bytecode or binary depending on engine). phase 2: execution - parsed code interpreted. the syntax function declaration is:...

FireFox CSS Table Extra Border Line -

Image
i encountered table border line css problem in firefox, when css border-collapse collapse, , have 2 merged cells, 1 of them has 1px border. unwanted border line exists on right. problem not exist in other browsers, ie , chrome don't have problem. firefox version mozilla/5.0 (windows; u; windows nt 5.1; zh-cn; rv:1.9.2.8) gecko/20100722 firefox/3.6.8 (.net clr 3.5.30729) my tested doctype is: <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> . <table cellspacing="0" cellpadding="0" style="position: absolute; width: 217px; left: 0px;border-collapse:collapse"> <colgroup><col col="0" style="width: 72px;"><col col="1" style="width: 72px;"><col col="2" style="width: 72px;"> </colgroup> <tbody> <tr tridx="0" style="height: 19px;"> <td rowspan="2" colspan="2...

concurrency - Access guarantees of ML Refs? -

are there access guarantees ml's ref type in face of concurrent access? i hope @ least ref access atomic in (e.g. never have ref invalid memory location :-). however, it'd depend on implementation threads not part of ml/sml spec afaik. the 'volatility' (consistent view of read/write ref across threads/processors), access underlying object @ least 2 other thing need considered. again, ask implementation concurrency.

regex - ANTLR match to end of input -

i'm trying match grammar entire string, , have error out if cannot consume entire input. basically, pseudo regex: \whitespace* [a-za-z]+ [-]? [a-za-z]+ \whitespace* $ according this , eof should work. so, consider grammar: start : chars eof ; chars : ('a'..'z')+ ; if set input "hello" in code: var ss = new antlr.runtime.antlrstringstream(input); var lex = new autocompletelexer(ss); var tokens = new commontokenstream(lex); var parser = new autocompleteparser(tokens); return (basetree)(parser.start().tree); i ast 2 children, hello , eof , expected. if set input "hello#" , gives same tree, , doesn't complain hash @ all. i'm not sure i'm doing wrong. i found problem, exceptions getting trapped lexer instead of propagating code. so, adding this: class throwalllexer: querylexer { public throwalllexer(icharstream input): base(input) { } public overri...

svn - Keep track of who has checked out repositories -

centos 5.3 subversion 1.4.2 our company know has checked out project. currently have internal server repositories located. we using websvn view repositories. however, keep track of has checked out repository. is there anyway subversion can this. or there web interface websvn can this? many advice, i dont think there straight forward way this. probably can find has run svn checkout grepping http access log. think svn uses options/propfind checkout, uses mkactivity checkin , forth. for centos below command should help * grep -h '\"options ' /etc/httpd/logs/access_* | cut -d ' ' -f 1 | sort | uniq however give checkout history day one. there no way can find if removed working copy after checkout. above command can enriched changing apache configuration store access logs day/hour/week/etc , grep latest file. way can results day/hour/week , on.

Multiple Methods in a jQuery Event -

i'm having difficulty writing jquery code. i'm trying pass multiple methods through event handler $(foo).click(methodone , methodtwo); purpose of first method fade out current view , hide , purpose of second method display alternate view. whatever reason click accepting 1 method, , i'm quite positive can accept @ least 2. here code: $(document).ready(function(){ $("#slide1").hide(); $(".items img").click(function() { if ($(this).hasclass("active")) { return; } $(".items img").removeclass("active"); $(this).addclass("active"); $(".slide1").click(fadeout,showslide1); $(".slide0").click(fadeout,showslide0); }); }); function fadeout() { $(this).stop().fadeto("medium", 0); $(this).hide(); } //slide 0 has been clicked function showslide0(){ $("#slide0").stop().fadeto("medium", 1); } ...

what is the best syntax to built any jquery plugins? -

i want build own plugins in jquery. so want know best syntax , way of coding(way of using variables,options,functions,methods etc...). i want build plugins menus+dropdowns,image gallery etc... what issues should keep in mind while building jquery plugins. i want build every plugin in jquery. kindly please guide me create awesome plugins in jquery -thank stackoverians , jquerians. i think did not google it. developing jquery plugin jquery plugins/authoring building first jquery plugin learn how create jquery plugin if going develop jquery plugins practice ok otherwise existing jquery plugins easy use , time saving. list of useful jquery plugins 240 plugins jquery http://plugins.jquery.com/

C++: Modifying array values for const -

consider following: int a[2]; cin >> a[0] >> a[1]; const int d = a[1] - a[0]; cout << d << "\n"; a[1] = 5; a[0] = 2; cout << d << "\n"; i'm bit confused now. why print same value d? why doesn't changing array values change value of d? @ point in time value of d determined , stored? thanks! the value of d determined in line assign it. can't change because values in expression used calculate changes, if weren't declared const . (few programming languages have variables work excel spreadsheet cells: cost of recomputing unpredictable significant.) if want value of d change, have explicitly assign new value, compiler won't let unless remove const .

what can I use to create a game for iphone like DOODLE LAUNCH? -

hey, downloaded game doodle launch today , think pretty cool, make similar game using sort of engine? has physics , uses iphone tilt controls... suggestions?? this link in case want check out...: http://itunes.apple.com/us/app/doodle-launch/id393793976?mt=8 cocos2d popular, easy-to-use game engine: http://www.cocos2d-iphone.org/ it doesn't have physics default, many people add box2d physics engine: http://www.box2d.org/ here's clear tutorial on using 2 on ios: http://www.raywenderlich.com/457/intro-to-box2d-with-cocos2d-tutorial-bouncing-balls

timer - how to get length of time of visitor in asp.net -

i using asp.net 2.0. have 5 web pages in project. want calculate length of time visitor view page. outline tracking system: server-side: when visitor requests page, generate unique id , include in page. save unique id user, page, , other information wish track. client-side using javascript: when window.onunload fires, send ajax call server user has finished page identified unique id. looking id saved in step 1, update length of time visited. alternatively, use google analytics, stellar job of tracking visitors.

iphone - Access Photo Library in cocos2d -

i creating game using cocos2d. want need insert image photo library application. can please tell how can access photo library through cocos2d? thanks in advance... you should able access users photo library in normal fashion. far using selected photo, different question. ;-)

Creating workbooks with C# and Excel 2007 interop -

i'm curently using excel 2003 generate reports, i'm thinking of migrating excel 2007. problem of users still have excel 2003 installed on pcs, i'll give them posibility choose generate - excel 2007 or excel 2003 compatible report. question : can excel 2007 interop save workbooks in compatibility mode ? thanks! save workbook http://msdn.microsoft.com/en-us/library/bb214129%28v=office.12%29.aspx format http://msdn.microsoft.com/en-us/library/bb241279%28v=office.12%29.aspx excel 2003 xlexcel8 http://www.rondebruin.nl/saveas.htm

python - Allow hop-by-hop headers in Django proxy middleware -

i need implement http proxy in django , google safari led me project called django-webproxy . although no longer maintained, it's quite simple. of logic relies on simple proxy middleware class intercepts requests django wsgi server , handles it. if middleware returns data, wsgi server passes client if returns nothing, django handles request passing other middleware. everything works fine, pretty much, need implement proxy authentication mean have send 407 status code client proxy-authenticate header. sin't allowed django hop-by-hop header , django throws exception. how can hack/force/kludge django allowing me send hop-by-hop headers? fyi, ihe code middleware class can found here . from django.core.servers import basehttp del basehttp._hop_headers['proxy-authenticate'] del basehttp._hop_headers['proxy-authorization'] this worked me.

java - Building a right angled triangle with recursion -

i have homework required print asterick make draw triangle. when drawtriangle(0); * when drawtriangle(1); * ** when drawtriangle(2); * ** * * **** when drawtriangle(3); * ** * * **** * * ** ** * * * * ******** when drawtriangle(4); * ** * * **** * * ** ** * * * * ******** * * ** ** * * * * **** **** * * * * ** ** ** ** * * * * * * * * **************** when drawtriangle(5); * ** * * **** * * ** ** * * * * ******** * * ** ** * * * * **** **** ...

c# - Getting Image Size -

i have found way find image size in c# , code build .net 3.5 , want use .net 2.0 . is there way here or .net code of ? public static class imagehelper { const string errormessage = "could not recognise image format."; private static dictionary<byte[], func<binaryreader, size>> imageformatdecoders = new dictionary<byte[], func<binaryreader, size>>() { { new byte[]{ 0x42, 0x4d }, decodebitmap}, { new byte[]{ 0x47, 0x49, 0x46, 0x38, 0x37, 0x61 }, decodegif }, { new byte[]{ 0x47, 0x49, 0x46, 0x38, 0x39, 0x61 }, decodegif }, { new byte[]{ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a }, decodepng }, { new byte[]{ 0xff, 0xd8 }, decodejfif }, }; /// <summary> /// gets dimensions of image. /// </summary> /// <param name="path">the path of image dimensions of.</param> /// <returns>the dimensions of specified image.</returns> /// <excepti...

gridview - Get Telerik Grid columns Header Text -

i need rename grid headertext. grid generate using autogenerated columns.i getting data in datatable , assigning grid. after assigning grid using function called after databind() , format grid cells not headertext. can me out problem? foreach (gridcolumn column in grdtestcertificate.columns) { string[] strcolumn = column.headertext.split('|'); column.headertext = strcolumn[1]; } it return 0 counts of columns. aah got solutions, foreach (gridcolumn column in grdtestcertificate.mastertableview.rendercolumns) { column.headertext = ""; } grdtestcertificate.rebind(); point answer if got solution.

Authentication settings in IIS 7.5 and ASP.Net, what is difference? -

Image
i start learn web programming using iis 7.5 in windows 2008 r2, , asp.net 4. i notice both iis , asp.net can define authentication rules. in iis, there form authentication setting can redirect user specified page authentication, below: and then, in asp web.config file, find similar settings: <authentication mode="forms"> <forms loginurl="~/account/login.aspx" timeout="2880" /> </authentication> when finish both settings, assume page request redirect login.aspx page. didn't. confused. how 2 sets of configs work together? , why page request not redirected? thanks update finally working , think understand now. website structure below: it modifying autherization rules. deny unauthorized users root: <authorization> <deny users="?" /> </authorization> css files should allowed users, have styles\web.config: <authorization> <allow users="*...