Posts

Showing posts from July, 2014

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c++ - How can I cope with 32bit/64bit mismatches when doing IPC via SendMessage? -

i have piece of c++ code reads out text of tree item (as contained in plain common controls tree view ) using tvm_getitem window message. tree view receives mesage in different process, i'm using little bit of shared memory structure pointed 1 of arguments window message. have work since remote process not under control (i'm writing application similiar spy++). this works in principle, fails in case target process substantially different: if code of target process built unicode defined own code wasn't, 2 processes have different ideas structure of string members in tvitem structure . solved using iswindowunicode call , explicitely sending either tvm_getitema or tvm_getitemw (recoding result if necessary). if calling process built in 32bit mode , target process 64bit (or other way round), layout (and size) of tvitem structure structure different since pointers have different size. i'm trying find way solve second issue. particular use case (getting tree

Is Voltdb supported by Ruby on Rails? -

can use voltdb ruby on rails? no, while voltdb have ruby gem available http://rubyredtomatoes.com/2010/11/01/still-voltdb-and-ruby , http://rubygems.org/gems/voltrb , http://github.com/beljun/voltrb not supported ruby on rails. in voltdb schema (tables , indexes) , access (sql within java stored procedures) must defined in advance.

arrays - Java - Sort Categories -

ok heres need do. i've got file contains names of categories , called "categories.txt" have files names of categories, e.g "mail.txt","news.txt" etc, , files contain link names such "hotmail" , "bbc news". i'm looking count number of links in each category can putting contents of each category array , finding size of it. after need display categories 1 links 1 least. i'm not sure how go @ all, appreciated. i have far change position of categories in arraylist depending on size of file. seems throw error @ end of code after first change has taken place. ideas why? iterator itty = parts.iterator(); int = -1; int count = 0; int tempcount = 0; string tempname = ""; while (itty.hasnext()){ i++; catname = parts.get(i).tostring(); parts addmenu = new parts("" + catname); count = addmenu.links().size(); if (i > 0){ if (tempco

windows - Weird Error in production Web application (W2k8 R2/IIS7 64bit/.NET 3.5) -

after migrating our production web application new server encountering error quite hard track down: faulting application name: w3wp.exe, version: 7.5.7600.16385, time stamp: 0x4a5bd0eb faulting module name: kernelbase.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0 exception code: 0xebf00baa fault offset: 0x000000000000aa7d faulting process id: 0xc90 faulting application start time: 0x01cb9ddb02758bf5 faulting application path: c:\windows\system32\inetsrv\w3wp.exe faulting module path: c:\windows\system32\kernelbase.dll report id: ceecffda-0c1c-11e0-9900-0019998d9a4d basically, kills worker process , restarts web application afterwards. wer unable produce dump , process orphaning in iis7 not -- worker process terminated , no dump created. the application run fine couple of days , crash error. has ever dealt error? i suggest go ask debugdiag 1.2 beta microsoft, http://blogs.msdn.com/b/tess/archive/2010/09/30/debug-diag-1-2-beta.aspx that s

iphone - App works in Simulator but not on Device - NSMutableArray -

i have problem app, run on simulator when launch on idevice got error: terminating app due uncaught exception 'nsinvalidargumentexception', reason: '*** -[nsmutablearray insertobject:atindex:]: attempt insert nil object @ 0' 0 corefoundation 0x3513cfd3 __exceptionpreprocess + 114 1 libobjc.a.dylib 0x303928a5 objc_exception_throw + 24 2 corefoundation 0x350bff99 -[__nsarraym insertobject:atindex:] + 472 3 corefoundation 0x350bfda7 -[__nsarraym addobject:] + 34 .... program received signal: “sigabrt”. in debugger can see problem. error comes there, @ addobject: for (int = 0; < [arrayvalues count]; i++) { f = [[nsnumberformatter alloc] init]; [f setnumberstyle:nsnumberformatterdecimalstyle]; mynumber =[f numberfromstring:[arrayvalues objectatindex:i]]; [arrayvalues2 addobject:mynumber]; [f release]; } he

asp.net - Fallback Route in ASP MVC if action doesn't exist -

the default route in mvc {controller}/{action}/{id} part quite helpful being able set default if incoming url doesn't include parameter there way specify default action when action doesn't exist on controller? what want achieve being able have controllers several specific actions , own catchall uses url grab content basic cms. for example products controller like: public class productscontroller: controller{ public actionresult productinfo(int id){...} public actionresult addproduct(){...} public actionresult contentfromcms(string url){...} } where default route handle /products/productinfo/54 etc request url of /products/suppliers/acme return contentfromcms("suppliers/acme"); (sending url parameter nicer not needed , parameterless method request fine). currently can think of 2 possible ways achieve this, either: create new constraint reflects on controller see if have action of given name , use in {controller}/{action}/{id} route all

touch event in box2d? -

is there way identify, whether touch point in body in world?? i afraid don't need that, because body in upper layer world if exists, if point both in body , in world, must body respond.

java - Problem when using JXL Formula like SUM() AVG() STDEV() returns #VALUE! when it refers values from another sheet -

i want populate values in sheet , use jxl formula values sheet , write sheet... when try run sample code string filename = "c:\\input.xls"; workbooksettings ws = new workbooksettings(); ws.setlocale(new locale("en", "en")); writableworkbook workbook = workbook.createworkbook(new file(filename), ws); writablesheet s = workbook.createsheet("input", 0); writablesheet s1 = workbook.createsheet("output", 1); s1.addcell(new number(3, 0, 5)); s1.addcell(new number(3, 1, 6)); s1.addcell(new number(3, 2, 1)); s1.addcell(new number(3, 3, 6)); s1.addcell(new number(3, 4, 1)); formula formula = new formula(3,5,"average(output!d1:output!d5)"); s.addcell(formula); i getting last value in avg list has output =average(output!d5) jar used : jxl 1.0.jar.... solution tried : 1) instead of giving has formula gave has label label labe

jquery - how to get parent link of fancybox? -

how parent window url inside child window of fancy box if you're referring accessing containing document's url iframe, try: window.top.location.href

.net - How to get indirect groups of an AD user? - C# -

i'm using directorysearcher groups of ad user in member of using 'memberof' property. according this msdn page 'memberof' property returns direct groups in user member. how can indirect groups of user too. for ex. group -> user x, user y, group b group b -> user z group c -> user z i want result group a, group b, group c user z since indirect user of group a. update okie. i've followed this codeproject article groups recursively. still builtin group 'domain users' missing list. mean built in groups wont appear in directory searcher? you have define own method of iterating through direct groups until reach common root all. need perform ldap query against each group , use same memberof attribute determine groups group belongs to. can time intensive, particularly if groups numerous , laid out web-like.

compiler construction - Detect undefined symbols in C header file -

suposse coded c library provides bunch of "public" functions, declared in mylib.h header file. functions supposedly implemented in (say) mylib.c file compiled (say) static lib mylib.c -> mylib.o -> mylib.a . is there way detect forgot provide implementation of declared function in mylib.h ? (yes, know unit testing, practices, etc - and, yes, understand meaning of plain function declaration in c). suppose mylib.h declares void func1(); , function not coded in provided library. trigger error if linker needs use function. otherwise, compile ok , without warnings - afaik. there way (perhaps compiler dependent) trigger warning declared not implemented functions, or there other way deal issue? btw: nm -u lists not undefined declared functions, "used" library, i.e., functions trigger error in linking phase if not declared somewhere. (which makes sense, library object file not know header files, of course.) basically, reliable way have program

sql - Getting lowest values in GROUP BY -

with test_data ( select 1 key, 1 a, 2 b dual union --# lowest key=1 select 1 key, 2 a, 1 b dual union select 2 key, 3 a, 3 b dual union --# lowest key=2, lowest b select 2 key, 3 a, 4 b dual union select 2 key, 4 a, 5 b dual ) i'm trying group key , , retrieve lowest a , corresponding b (lowest b in case of ties), plus sum of b s: key first_b sum_b ---------- ---------- ---------- ---------- 1 1 2 3 2 3 3 12 i can realize sub-select select key, min(a) a, first_b, sum(b) sum_b ( select key, a, b, first_value(b) on (partition key order a, b) first_b test_data ) group key, first_b but wonder if there way avoid sub-select, like select key, a, sum(b) sum_b, min( first_value(b) on (partition key order a, b) ) first_b test_data group key, which raises ora-30483: window functions not allowed here thanks in advance, peter are looki

Anyone recommend any good ASP.NET JQuery Ajax tutorials? -

i'm working on web forms site , in need of learning jquery funky ajax methods on site. recommend sites? thanks louis merry xmas! jquery call page methods jquery consume asp.net web services datalinking , templating plugins more on datalinking

validation - An ASP.NET MVC validator to make sure at least one checkbox is checked -

i have asp.net mvc 2 project in i've created data transfer object receive data web page form. form has 2 groups of checkboxes on it. want validate object make sure @ least 1 of checkboxes in each group checked. i'm doing validation on server side user won't able hack around client-side validation. (i add client-side validation jquery later; that's easy.) my understanding have create own custom validationattribute data transfer object class, don't understand how create , use 1 can accept arbitrary list of checkbox properties make sure @ least 1 of them true. guessing have call attributes this: [atleastonecheckbox("set1check1", "set1check2", "set1check3", errormessage = "you must check @ least 1 checkbox in set 1.")] [atleastonecheckbox("set2check1", "set2check2", "set2check3", "set2check4", "set2check5", errormessage = "you must check @ least 1 checkbox in

reflection - WebSphere wsadmin ClassNotFound Exceptions -

i'm trying use wsadmin jython deploy ear file. before actual deployment, need run db update using java class. i'm running classnotfoundexception isn't making sense me. background: ear file exploded. wsadmin tool started following options: -wsadmin_classpath %cp% -javaoption -dpython.path=%cp% both of point same classpath, contains necessary jars. the jython script gets connection database, , calls utility class create database script. utility class uses reflection load other classes classpath (that hard-and-fast requirement of library using, can't changed). looks this: from liquibase import liquibase def main(args): conn = getconnection(args) updater = liquibase(conn) updater.update() during update() method, liquibase uses reflection instantiate java classes. classnotfoundexception, example classnotfoundexception: com.foo.customupdate in script, can import com.foo.customupdate class , no errors: from com.foo import customupdate c =

javascript - wholesale replacement of options html string within select? -

i 'toggle' list of options in select box. i have 2 sets of options strings (american states , canadian provinces). however, notice in dom, select object has no 'innerhtml' property (at least not according w3schools). do have go , remove , replace options 1 one? how do this? making use of jquery , this: var html = '[your html string options elements]'; $('#myselectid').empty(); $('#myselectid').append(html); as one-by-one idea, make sure keep in mind general slowness of dom interaction. wholesale replacement entire string going pretty quick, if manipulate dom each element in select expect slow.

boost for windows, first time use -

i downloaded boost 1_45_0 windows. have vc++6 installed on windows 7 64bit pc. in windows introduction, i'm told try compile small lambda program. placed boost in root of c:, have c:\boost\boost_1_45_0. added "c:\boost\boost_1_45_0" "include" environment variable in windows advanced system settings what else need before c when try compile @ command prompt, following: c:\test\boost>cl /ehsc /i c:\boost\boost_1_45_0 boost.cpp microsoft (r) 32-bit c/c++ optimizing compiler version 12.00.8804 80x86 copyright (c) microsoft corp 1984-1998. rights reserved. boost.cpp c:\boost\boost_1_45_0\boost/config/suffix.hpp(596) : error c2039: 'typeinfo' : s not member of '`global namespace'' c:\boost\boost_1_45_0\boost/config/suffix.hpp(596) : error c2873: 'typeinfo' : s ymbol cannot used in using-declaration c:\boost\boost_1_45_0\boost/mpl/aux_/yes_no.hpp(56) : fatal error c1506: unrecov erable block scoping error you using c

c# - How Run A Stored Procedure (with Parameters - Has A return Value) From Code Behind? -

how can use stored procedure (with parameters - has return value of type int ) code behind? my stored procedure looks : alter procedure [dbo].[sp_noskheh_sumoftotalpay] @co_id int ----------------- declare @sum bigint ----------------- begin select @sum = sum(totalpay) noskheh (co_id = @co_id) return @sum end i want use @sum in code behind ... would please show me way doing ? thanks in advance best regards you need set sqlconnection , sqlcommand . if have code return @sum statement in end, need (define parameter of type return_value): using(sqlconnection _conn = new sqlconnection(-your-connection-string-here)) using(sqlcommand _cmd = new sqlcommand("dbo.sp_noskheh_sumoftotalpay", _conn)) { _cmd.commandtype = commandtype.storedprocedure; _cmd.parameters.add(new sqlparameter("@co_id", sqldbtype.int)); _cmd.parameters["@co_id"].value = 5; // whatever value want _cmd.parameters.ad

c# - Proper error handling with windows service that loads external assembly/dll -

i have windows service loads bunch of 'plugins' .dll files. uses reflection this: try { assembly assembly = assembly.loadfile("myplugin.dll"); type[] types = assembly.gettypes(); foreach (type t in types) { type[] ifaces = t.getinterfaces(); foreach (type f in ifaces) { if (f.name == "myplugin") { ptype = t; break; } } if (ptype != null) break; } } catch { addtolog("failed"); } obj = activator.createinstance(ptype); object[] parameters = new object[1]; parameters[0] = _pluginname; try { ptype.invokemember("initializeplugin", bindingflags.default | bindingflags.invokemethod, null, obj, parameters); } catch (exception ex) { addtolog(_pluginname + " - initializeplugin error: " + ex.message); } problem having if

WPF: Detect when Window loses focus -

how detect when window loses focus? use window.deactivated event . you may looking application.deactivated event , fires if user switched different application.

javascript - Trigger anonymous function inside setInterval immediately -

so have timer looks this my_timer = setinterval(function(){ do_something_amazing(); do_more.stuff_here(); var etc_etc = "foo" + bar; }, 1000); and want run immediately, , every second after that. tried appending () end of function, caused run once (because not returning function setinterval?). tried return this; possibly return function itself, did no either. random guess. is there way can work without creating named function? thanks! use arguments.callee : my_timer = setinterval((function(){ do_something_amazing(); do_more.stuff_here(); var etc_etc = "foo" + bar; return arguments.callee; })(), 1000);

Using SQL & Perl together - Which should be used for common functions? -

i didn't find dupes of question, if there 1 or more, i'm sorry - please comment link. the question basic, answer. if i'm using perl execute & act upon database, avenue (perl vs. sql) should place burden on when shared functions involved? functions - len , if/else , concat , many more arithmetic functions, example common both systems. this sql statement loaded case blocks , other operations can replicated perl. so, if same logic implemented in perl, worth re-writing? conditions influence decision take burden of 1 system , place on other? select distinct s.id stu_id, stu_id.fullname stu_name, p.major1 major, p.minor1 minor, s.reg_hrs, nvl(st.cum_earn_hrs,0) ttl_hrs, p.adv_id curr_adv_id, adv_id.fullname curr_adv_name, case when (p.adv_id <> 35808 , p.major1 = 'ns')

python - Read-only Django object manager? -

i doing agressive caching , i'd make sure nobody accidentally writes code updates database directly. imagine way solve rename normal object manager .rw_objects caches use, , replace .objects manager logs warning on non-updating access , throws exception if tries update it. i've written object manager , query set i'm not sure how go checking whether query updating database. any suggestions? i'm thinking 2 approaches here. create custom manager, override _insert() , _update() raise exception / log query, , get_query_set() return custom queryset overrides create() , get_or_create() , , update() . if you're using django 1.2, create database connection in settings.py call "read_only" , , create custom manager returns querset using connection (like def get_query_set() return super(readonlymanager, self).get_query_set().using("read_only") , , mark connection read-only. (one way create read-only user database connection "re

iphone - Save Video to iPad Videos app -

i have been trying use uisavevideoatpathtosavedphotosalbum save video (stored locally within application). when try save it, error saying "operation failed because video file invalid , cannot played." file minute long , .mp4 file. don't have problem playing mpmovieplayer, won't save. here code: nsstring *path = [[nsbundle mainbundle] pathforresource:@"videofile" oftype:@"mp4"]; uisavevideoatpathtosavedphotosalbum(path, self, @selector(status:didfinishsavingwitherror:contextinfo), nil); is method not designed work ipad? says "savedphotosalbum". mean have go through photos app view it, or name of method , in videos app? if me work out, appreciate it. it should work long uivideoatpathiscompatiblewithsavedphotosalbum() returns true. however, i've had issue before , seemed have better luck creating , alassetslibrary object , using method: - (void)writevideoatpathtosavedphotosalbum:(nsurl *)videopathurl completionblock:(

c# - Invalid Argument - Interfaces inherited, as works, implicit casting does not. What gives? -

i have function has signature of update(ienumberable<inotifypropertychanging> things) and class doohickey : inotifypropertychanging, inotifypropertychanging{} when try do list<doohickey> doohickeys = new list<doohickey>(); update(doohickeys); an exception gets thrown stating: cannot convert 'system.collections.generic.list<doohickey>' 'system.collections.generic.ienumerable<system.componentmodel.inotifypropertychanging>' what gives? doohickey inherits inotifypropertychanging interface , list inherits ienumerable interface! how come passing object , expecting cast down doesn't? i've included references inotifypropertychanging signify doohickey linq-to-sql class; in case bit of context matters. this won't work because there no implicit conversion between list<doohickey> , ienumerable<notifypropertychanging> . need call: update(doohickeys.cast<inotifypropertychanging>()); the

lucene.net - Lucene field from TokenStream with stored values -

i have field needs come token stream; cannot instantiated string , analyzed tokens. example, might want combine data multiple columns (in rdbms) single lucene field, want analyze each column in own way. cannot concat them single string analyze resulting string. the problem running fields created token streams cannot stored, makes sense in general case since stream may not have obvious string representation. however, know string representation, , store that. i tried adding same field twice, once being stored , having string data , once coming token stream, seems can't done. apart hack adding field name of "myfield__stored" there way this? i using 2.9.2. i found way. can sneak in instantiating normal field calling settokenstream later: field f = new field(name, stringvalue, store, analyzed, tv); f.settokenstream(tokenstreamvalue); because reader/string value indexed if token stream value null, token stream value indexed. store methods @ string/reader

jquery - Hours of Day, Days of Week Visual Screen for Web Application -

i need visual frame application. there hours of day(no need minutes 1:00pm, 1:15pm, 1:30pm, 1:45pm, 2:00pm or that, 1:00pm , 2:00pm enough) , days of week(no need weeks of month) , user able select hours of each day. in program, sunday 1-2 has selected, monday 9am-1pm , 3pm-6pm have selected or that... how can that. searched jquery find this: http://www.webdesignbooth.com/9-useful-jquery-calendar-and-date-picker-plugins-for-web-designers/ , not me or dont can modify 1 of them , suitable program? you can use simple list (or div, or option) timepicker addon every list item. timepicker lets yuo use hours (and minutes if need that).

How to download a file from a server using Java Socket? -

i have assignment uploading , downloading file server. managed uploading part using java sockets having hard time doing downloading part. should use range: downloading parellel. in request, should have range: header. don't understand how receive file http request. examples have seen uploading file. did it. can upload .exe, image, .pdf, , when download them (by browser), there no errors. can me downloading part? can give me example beacuse didn't it. you need read http response same socket on put request. starting point, print out. when familiar it, start parsing it. file in there.

ASP.NET MVC 3 WebGrid - Conditional Column Formatting -

is there anyway conditional formatting webgrid in asp.net mvc 3? i know can say: ... grid.column("propertyname", "header name", style: "bold") ... and render html td says: class="bold" . what want, render tds in 1 style , other tds in style. like: ... grid.column("propertyname", "header name", style: (item) => (item.property > 100) ? "bold" : "normal")) .... but causes error "best overloaded method match ... has invalid arguments." any idea if possible? thanks .jim biddison i know i'm kind of late answer, if still looking kind of conditional formating / column value binding webgrid here's somehting works : @grid.gethtml( columns: grid.columns( grid.column(format: (item) => (item.someproperty !=null) ? html.raw("i've got value") : html.raw("i don't :(")) ) )

multithreading - Python threads garbage collection -

is running thread eligable garbage collection if thread object reasigned? example: class a(threading.thread) def run(): while true: #do stuff = a() a.start() time.sleep(60) = a() at point, though thread still doing stuff, can interpreter destroy original a() thread? if does, there way prevent happening? my guess no. there's still reference thread in whatever structure python uses keep track of things. i'll test out, i'd astonished if didn't work. edit check out: #!/usr/bin/env python import threading, time class a(threading.thread): def __init__(self, name): threading.thread.__init__(self) self.name=name self.count=0 def run(self): while self.count<10: print self.name, "running!" time.sleep(1) self.count+=1 a=a("first") a.start() time.sleep(5) a=a("second") a.start() first

foreign keys - How do I delete all the rows of a table with a recursive structure (MySQL)? -

i have table in db, in every row has parent id id of row in table (the table represents tree-like structure). empty table. when perform delete table_name true; i error (foreign key constraint). how empty table anyway? clarification: want delete whole table's contents, not tables themselves. when create foreign key relationships, need specify on delete cascade . edit: there's pretty reference right here: http://en.wikipedia.org/wiki/foreign_key

c++ - Can I make a button/icon in a MFC toolbar that can't be clicked? -

i have subclass of cmfctoolbar contains few buttons, 1 toggling setting , others displaying current state (shown 1 @ time). need other buttons not clickable- if user clicks on them, should not depress. there way prevent button depressing without making disabled (because grayed out) or add icon toolbar has no interaction? it's been while since i've done mfc, i'm not sure of name, of control, think can put icon in clabel (or maybe clabelimage). don't want use button because button supposed clicked, i.e., looks push-able. want label shows state, that's labels for.

c++ - "multiple definition of..." error for a full specialisation of a template function -

have project configuration: ./main.cpp ./type_traints/typetraints.cpp ./type_traints/typetraints.hpp ./type_traints/chapter_20.hpp the ./type_traints/cmakelists.txt file is: cmake_minimum_required (version 2.8) add_library(chapter_20 typetraints.cpp) and ./cmakelists.txt follows: cmake_minimum_required (version 2.8) project (mpl) add_subdirectory(type_traints) include_directories(type_traints) link_directories(type_traints) add_executable (mpl main.cpp) target_link_libraries(mpl chapter_20) relevant parts of files (most includes omitted) include: ./type_traints/chapter_20.hpp #ifndef chapter_20_guard #define chapter_20_guard #include <typetraints.hpp> void chapter_20() { test_23(); } #endif //chapter_20_guard ./type_traints/typetraints.hpp #ifndef type_traints_guard #define type_traints_guard namespace details { template<class t> const char* class2name() { return "unknown"; }; template<> const char* class2nam

datepicker - jQuery Tools - disable weekend days -

i'm looking solution, how disable weekend days (sat, sun) in jquery tools datepicker. know there solution jqueryui, need this, because project 99% complete, digging code else isn't idea @ time. http://flowplayer.org/tools/dateinput/index.html you add : $(".date").dateinput({ change: function() { var dayofweek = this.getvalue('ddd'); if( dayofweek === 'sat' || dayofweek === 'sun'){ this.hide(); return false; } } }); further enhancements: you pop alert box warn user cant choose weekends you style css make weekends disabled

xml - how to put templates/inheritance in config files? -

i'm working on model variety of categories of objects, each variety of versions. i'd have these available defaults in config file, allow users customize defaults. this general case like: <containers> <container1> <object1> <param1>42</param1> <param2>3.14159</param2> </object1> <object2> <param3>2.71828</param3> <param4>auto</param4> </object2> </container1> </containers> i process next block , have resulting object structure identical created previous block. <templates> <object1 id="object1_1.0"> <param1>42</param1> <param2>1</param2> </object1> <object2 id="object2_1.0"> <param3>2</param3> <param4>auto</param4> </object2> </templates> <containers> <container1> <object1 ref="

hl-line-mode emacs color change -

Image
emacs' hl-line-mode need change it's horrible yellow color, know how can that? i use (set-face-background hl-line-face "gray13") . here's looks black background. very subtle. notice when moving cursor, wanted. if want see display of various colors, try (list-colors-display) . show list of colors in new buffer. edit : heh heh, since getting upvoted pretty pictures, here "live": (ps: animated gif produced cropper tool , animatedgif plugin .)

visual studio 2008 - using MS windows server 2003R2 as a VS2008 dev machine -

at work im required used windows 2003 service pack 2 vs 2008 development environment running on intel quad core pc. intel 920 @ 2.67ghz , 12 gig ram does have info on how tweak os optimize software dev on such machine. i numerous problems, such (for developing c# asp.net 2.0 apps , winforms applications unexplained ide environment lockups , crashes cant auto geenrate datasets in asp.net, ide locks up screen corupption , seem lack of resource issues when 2 instances of vs 2008 open projects. extensive delays in gettting source code network source control box. my dev manager says network issues , theres nothing wrong on network , such , computer , neither can diagnose problem lies. i appreciate advice or suggesstions, im ready hand in notice in sheer frustration @ trying stable work enviroment there's great guide using ws2003 machine workstation @ http://win2k3.msfn.org/ , i've used ws2003 (as 2008 , 2008 r2) workstation years, , it's quite doable.

dll - Trying to use HtmlAgilityPack -

im having problems trying install htmlagilitypack.dll ver 1.4. i've copied files windows\system32 folder , tried regsvr32 htmlagilitypack.dll in run. i got following error: the module loaded entry point dllunregisterserver not found. it seems common library used many people on so dll's cant corrupted. how fix this? the reason can't use regsvr32 because html agility pack isn't com library. it's written in .net, need reference .net project. download latest zip file , extract somewhere on local hard disk e.g. c:\sharedlibs\htmlagilitypack . launch visual studio (or 1 of vs express editions) create new project or open existing one. in solution explorer right click on references , click add reference . click browse tab , browse extracted agility pack select htmlagilitypack.dll dll click ok refer codeplex site: html agility pack home html agility pack examples here's couple of links dug in everyone's favourite search e

sql server - SQL custom unit conversion -

i looking solution custom unit conversion in sql, database company used microsoft sql server, need write sql return conversion factor based on "unit conversion table" say: item: chicken wings (itemid 1001) vendor: food wholesale ltd (vendorid 5000) unitid: gram (id=10) unitid: kilogram (id=500) unitid: boxes (id=305) quantity: 1000 grams = 1kgs = 5 boxs unit conversion table: itemid | vendorid | unit1id | unit2id | quantity1 | quantity2 1001 5000 10 500 1000 1 1001 5000 500 305 1 5 question: closing stock chicken wings in gram if have 10 boxes how write sql return "conversion factor"? thanks in advance i think recursive table finds path desired unit , desired unit work best. (this assumes if there path a-->b-->c there path c-->b-->a in database. if not modified search both directions). select 1001 itemid ,5000 vendorid ,10 fromunit ,500 tounit ,cast(1000 float) fromquantity ,cast(1

slow typing in between <?php tags with eclipse helios with pdt -

i slow typing in between <?php tags eclipse helios pdt windows 7 / dual core / 3gb ram using 3.6.1 m20100909-0800 pdt 2.2.1.v20101001-2300 doesn't happen outside of php tags. turning off white-space characters worked me. pretty annoying.. i couldn't recreate on-demand , never seemed start @ particular point. work on large projects large include paths. restarting eclipse never had effect. had restart os resolve issue. find disabling whitespace-chars resolved speed issue.

c# - Why there are contentions in places with no lockings? -

i run concurrency profile of software in visual studio 2010 , found contentions on lines of code not within locks. say, new operation create array, or thread-local dynamicmethod.invoke call. contentions on assignments. not figure out why these lines cause intentions because there should no way under lockings in code. anyone experiences similar problems? think contentions displayed in vs2010 concurrency profiler should caused waiting on lock or entering piece of mutex section. thanks. newing array , jitting dynamic method both allocate memory, possible it's contention in allocator? of course, doesn't explain assignment lines...

objective c - IKImageView resize problem -

i have ikimageview fills entirety of window. when window resized, image not resize it. naturally think, i'll change zoom factor in windowdidresize. however, zoom not adjust smoothly, animates zoom whenever mouse cursor stops moving instant. want resize nsimageview does. got ideas? problem solved - stop using ikimageview , never bother again because poorly documented , buggy. trusty nsimageview.

html - textarea resize upon content inside -

how <textarea> resize upon content inside? how facebook there no scrollbar? if give me insight or link of how appreciated. not looking js answer if u know solutions don't mind. thanks jquery plugin: http://james.padolsey.com/javascript/jquery-plugin-autoresize/

java - How to parse date string to Date? -

this question has answer here: java string date conversion 13 answers how parse date string below date object? string target = "thu sep 28 20:29:30 jst 2000"; dateformat df = new simpledateformat("e mm dd kk:mm:ss z yyyy"); date result = df.parse(target); throws exception... java.text.parseexception: unparseable date: "thu sep 28 20:29:30 jst 2000" @ java.text.dateformat.parse(dateformat.java:337) the pattern wrong. have 3-letter day abbreviation, must eee . have 3-letter month abbreviation, must mmm . day , month abbreviations locale sensitive, you'd explicitly specify simpledateformat locale english well, otherwise use platform default locale may not english per se. public static void main(string[] args) throws exception { string target = "thu sep 28 20:29:30 jst 2000"; dateformat df

java - is Flying Saucer project closed? -

someone know happened flying saucer project? http://code.google.com/p/flying-saucer/ site down , can't access manuals :( upd: have solved problem. it's seems thay have problems dns. did put 204.16.104.198 xhtmlrenderer.dev.java.net to hosts file , it's happened! works fine! the project has been moved http://code.google.com/p/flying-saucer/

shell - Reading positional parameters using PHP -

i using .php page shell script. problem not know how pass positional parameters php page. #!/usr/bin/php <?php $myfile="balexp.xml"; the following not work in php page , work in shell script. myvar=$1 how pass variables php page? #!/usr/bin/php <?php $myfile=$argv[1]; see $argv more.

java - Sending mail using javamail api from IBM Websphere Application Server -

how send mail using gmail ibm websphere application server 7 using javamail 1.4 api without using certificate? either javax.mail.messagingexception: exception reading response; nested exception is: javax.net.ssl.sslhandshakeexception: com.ibm.jsse2.util.g: pkix path building failed: java.security.cert.certpathbuilderexception: pkixcertpathbuilderimpl not build valid certpath.; internal cause is: java.security.cert.certpathvalidatorexception: certificate issued ou=equifax secure certificate authority, o=equifax, c=us not trusted; internal cause is: java.security.cert.certpathvalidatorexception: certificate chaining error or must issue starttls command first javamail errors. same application works fine if run inside main function in java application. have configured mail sessions. can please provide working logic application , configuration in ?

asp.net - How to do music streaming -

i want develop web application gets media files streaming server , plays on website. how can using asp.net? windows media services should able you. if hobby make music directory virtual directory in iis , enable permission directory browsing . when user clicks on song or playlist windows media player/default player of machine should able play automatically. but if commercial reason better out sophisticated solution.

How can I send a SharePoint alert only when a particular column is changed? -

i need trigger alert, if value of particular column (say marks<8, send mail manager) changes. what should do? some kinds of lists (e.g. tasks) allow send alerts when changes item appears in particular view . read article use sharepoint filtered views stop sending alerts yourself details (appropriate section begins well need set filtered view ). if list supports feature, first create view shows items satisfy marks<8 condition , configure alert uses view.

.net - Problem with building VC++ project -

i have legacy code meant run .net 2.0 solution. didn't have chance make changes since cannot built. @ first glance errors related braces and/or semicolons mismatch, have checked well. worked several months ago other project. =/ edit: errors point part of code: #if net20 public ref class simpleaudioplayer : public system::componentmodel::component #else __gc public class simpleaudioplayer : public system::componentmodel::component #endif { this build log: build log    rebuild started: project: simpleaudioplayer, configuration: debug|win32 command lines    creating temporary file "f:\projects\fireplay\fireopssql\modules\misc\simpleaudioplayer\debug\rsp00002b51362624.rsp" contents [ /od /i "........\libs\libmad" /i "........\shared\audioengine" /d "win32" /d "_debug" /d "net20" /d "_windll" /d "_afxdll" /d "_mbcs" /fd /eha /md /yu"stdafx.h" /fp"

filesize - How to get remote file size from a shell script? -

is there way size of remote file like http://api.twitter.com/1/statuses/public_timeline.json in shell script? you can download file , size. can better. use curl response header using -i option. in response header content-length: followed size of file in bytes. $ url="http://api.twitter.com/1/statuses/public_timeline.json" $ curl -si $url | grep content-length content-length: 134 to size use filter extract numeric part output above: $ curl -si $url | grep content-length | awk '{print $2}' 134

c# - Where clause on linq query against dictionary? -

i have fixed problem of not listing data related wrong field on spawn dictionary still question if way approaching ok ? i have few checkboxs if true should add check item status , include on list. so not knowing do, came with: hashset<int> status = new hashset<int>(); if (optionsform.filterplayer.checked) status.add(0); if (optionsform.filterenemy.checked) status.add(1); if (optionsform.filtersummon.checked) status.add(2); if (optionsform.filternpc.checked) status.add(3); if (optionsform.filterobject.checked) status.add(4); if (optionsform.filtermonster.checked) status.add(5); if (optionsform.filtergatherable.checked) status.add(6); if (optionsform.filterunk.checked) status.add(7); var query = spawnlist item in spawnentities.values status.contains(item.status) orderby item.name ascending select item; but not returning me er

Problem with Authentication in sharepoint using active directory -

i using windows server 2008 machine. have active directory , sharepoint setup on machine. have user 'a' in active directory , have given user read permissions site. the problem face that, if log in user 'a' site shows "error:access denied". problem goes away if put 'a' site collection administrator, not want. want 'a' visitor can browse site. tried granting 'read' permission site 'a' still gives me access denied message. thank time. thats cause of problem page library has got disintegrated inherited permission parent site. have go page library settings , either add user viewer or start permission inheritance in page library :)

wpf - How to make a column autowrap when using data grid -

i have long string in column. how make column auto-wrapping? for datagridtextcolumn can use this <datagridtextcolumn ...> <datagridtextcolumn.elementstyle> <style targettype="textblock"> <setter property="textwrapping" value="wrap"/> </style> </datagridtextcolumn.elementstyle> <datagridtextcolumn.editingelementstyle> <style targettype="textbox"> <setter property="textwrapping" value="wrap"/> </style> </datagridtextcolumn.editingelementstyle> </datagridtextcolumn>

c# - How to order a list of paragraphs -

a have list: § 21 item § 1 item § 13 item § 3 item § 2 item i need order this: § 1 item § 2 item § 3 item § 13 item § 21 item but after newlist = (from in list orderby a.name ascending select a).tolist(); i this: § 1 item § 13 item § 2 item § 21 item § 3 item how fix it? what looking natural sort rather default lexical sort. c# comparer implements natural sort can found @ http://www.davekoelle.com/alphanum.html

Create parameterized VIEW in SQL Server 2008 -

can create parameterized view in sql server 2008. or other alternative ? try creating inline table-valued function. example: create function dbo.fxnexample (@parameter1 integer) returns table return ( select field1, field2 sometable field3 = @parameter1 ) -- call this, if it's table/view parameter select * dbo.fxnexample(1) if view execution plan select not see mention of function @ , show underlying tables being queried. means statistics on underlying tables used when generating execution plan query. the thing avoid multi-statement table valued function underlying table statistics not used , can result in poor performance due poor execution plan. example of avoid : create function dbo.fxnexample (@parameter1 integer) returns @results table(field1 varchar(10), field2 varchar(10)) begin insert @results select field1, field2 sometable field3 = @parameter1 return end subtly different, potentially big differences in perfor

sql - Android multiple databases open -

i making im client android , working databases storing contacts , other info's... in app have activity , 1 service. need open 3 databases in same time both on service , on activity. i use 3 database because want databases managed more without having problems synchronization of writing in them. (as far know need write in database synchronously because may crush). to manage databases service , activity in same time, thought singleton or static class of databasehelper me... so have started make test making 2 databasehelper global objects in activity, each 1 opens diferent database, after running project i've noticed last opened database remains opened in both objects :((, why happening? can sugest me how can make work? thank you! l.e.: after more tests, made static object of databasehelper, open service take database object activity , in same time made 2 statements, 1 in activity , 1 in service run 0 3000 , adds values same database , reads database. after run noti

php - problem with conditional switch -

the example below extráct http://php.net/manual/de/control-structures.switch.php <?php $totaltime = 0; switch ($totaltime) { case ($totaltime < 1): echo "that fast!"; break; case ($totaltime > 1): echo "not fast!"; break; case ($totaltime > 10): echo "that's slooooow"; break; } ?> i expected result "that fast." actual result "not fast!". great if 1 can explain me why? but if add case, case 0: echo "that super fast!". echoing properly. i.e "that super fast!". please me how use conditional switch statement. edit:- thanks responses. able overcome above problem modifyong switch($totaltime) switch(1) case ($totaltime < 1): means 1 php (that equation returns true) case ($totaltime > 1): means 0 php (that equation returns false) since $totaltime 0, output in other words php compares $totaltime result

javascript - jQuery selecting the top li of a menu -

sorry noobish question. i've got menu similar this: <div id="navigation"> <ul> <li><a href="url">menu item</a></li> <li><a href="url">menu item</a> <ul> <li><a href="url">sub menu item</a></li> <li><a href="url">sub menu item</a> <ul> <li><a href="url">sub sub menu item</a></li> <li><a href="url">sub sub menu item</a></li> <li><a href="url">sub sub menu item</a></li> </ul> </li> <li><a href="url">sub menu item</a></li> <li><a href="url">sub menu item</a></li> </ul> </li> <li><a href="url&quo