Posts

Showing posts from June, 2012

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.

php - Finding Maximum value from a Varchar Field -

i have database field know scores has scores value may following 123 14 56* 342 423* i storing in varchar field in database. suppose if convert integer datatype, can write max(scores) , maximum score or highest scores. integer doesnot allow special character *. (here * represent clause scores) to accomadate have made varchar. what best way highest score minimum programming method. so if execute query should answer 423* please suggest me the best way handle situation change table structure make scores of int data type. add new field in table called clause if of scores without clause , must normalize table move clause field different table.

c++ - Enumeration type comparison error -

typedef enum { type_a = 0, type_b, type_c } objtype; assume there enum type above. i'm using arm-g++ working. and macro type defined this: #define any_type ((objtype)-1) but following comparision false tested: if (param->type == any_type) something(); else error(); param->type set any_type , type objtype. logged both of them '%d' , displayed 255. it's false , error occurred. this problem has been not caused rvct (commercial arm compiler). why fail? -1 illegal value enumeration. the language standard (7.2 enumeration declarations) says: for enumeration e min smallest enumerator , e max largest, values of enumeration values of underlying type in range b min b max , b min , b max are, respectively, smallest , largest values of smallest bit-field can store e min , e max . according this, legal values 0, 1, 2 , 3 (those values can represented 2 bits). should add any_type enumerator use it.

c# - WCF - File transfer binding question -

im trying create file transfer service on wcf, got problems setting binding. im getting: content type application/soap+xml; charset=utf-8 not supported service http://localhost:8080/filetransfer . client , service bindings may mismatched. here host side configuration: http://img149.imageshack.us/img149/7203/hostj.png and here client side configuration: http://img821.imageshack.us/img821/425/clientp.png sorry images, unable paste code here... doing wrong? the error obvious on client. fixed.

validation - DTD download/caching -

i have following directive on top of master page <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> as per following article w3c starting block dtd download based on per user agent string pattern. which best way cache dtd locally or, better more, download once , reference local copy? i using iis 7.5. you use proxy server squid serve locally -- depending on "locally" means you.

cappuccino - Understanding methods syntax in Objective-C and Objective-J -

i've simple question objective-c / objective-j syntax. this method dataforitemsatindexes , gets parameters cpindextset , cpstring. should return cpdata object. don't understand what's (cpcollectionview)acollectionview . - (cpdata)collectionview:(cpcollectionview)acollectionview dataforitemsatindexes:(cpindexset)indices fortype:(cpstring)atype thanks that identifies cpcollectionview implementing data source corresponds to. useful in case view or window has multiple cpcollectionview s, data sources same object, knows view provide data to.

.net - Catch HttpException in time when file upload exceeds size -

so making file upload. have, in web.config: <httpruntime executiontimeout="300" maxrequestlength="5120"/> file can't exceed 5mb. server side code looks like: protected void button_click(object sender, eventargs e) { try { if (fupcv.filename != "") { directoryinfo di = new directoryinfo(server.mappath("cvs")); if (!di.exists) di.create(); fupcv.saveas(di.fullname + "/" + fupcv.filename); //afterwards code } } catch (httpexception ex) { response.write(ex.message); } } and can't catch exception, still "server error in '/' application." thanx help that's because request never reach code, iis never passes request code because big. i guess thing can upload via ajax , control error code returned server.

c# - Problem with too many try catch -

is possible write method outtype? trydo(func, out exception, params) call func(arg1,arg2,arg3,...) params contains arg1,arg2,arg3,... , return func return value , if exception occurred return null , set exception? can done better function signature? for example have string foo1(int i) { return i.tostring()} void foo2(int[] a) {throw new exception();} and call string t = trydo(foo1, out ex, {i}); trydo(foo2, out ex, {}); -----------edited------------------ string t; someclass c; try { t = foo1(4, 2, new otherclass()); } catch (exception ex) { log(ex); if (/*ex has features*/) throw ex; } try { foo2(); } catch (exception ex) { log(ex); if (/*ex has features*/) throw ex; } . . . i want make this. string t = trydo(f

calllog - Is it possible to detect rejected calls in Android? -

in application, nice intercept when user rejects call, i.e. choose send busy tone. there way, besides being notified when there incoming call, this? have not found in docs regarding this. information stored in call log, i.e. can poll call log see if call rejected or answered? hey. use phonestatelistener , calllog classes query recent calls list find rejected calls. http://developer.android.com/reference/android/provider/calllog.html http://developer.android.com/reference/android/telephony/phonestatelistener.html alternatively can monitor broadcasts on android.intent.action.new_outgoing_call , android.intent.action.new_incoming_call put android.permission.process_incoming_calls , android.permission.process_outgoing_calls in manifest.

asp.net - aspnet table - specify TableCell width? -

i've asp.net table , i'm trying format columns equal widths, or 4 columns of 20%, 30%, 20% , 30%. following code not working: <asp:tablecell width="30%"> the 'height' attribute works isn't 1 i'm after. appreciated. thanks it's not working because width property expecting value of unit type , defaults pixels.. couldn't find example shows how create instance of unit type of percentage which leaves me suggest how css.. give tablecell cssclass, , set width in stylesheet <asp:tablecell cssclass="tablecellwidth30"> .tablecellwidth30 { width:30%; } use style property , set width inline <asp:tablecell style="width:30%;">

objective c - Move a sprite along a slope -

i'm trying have sprite swap places sprite. far think can somehow use slope between 2 sprites' original location move them, i'm lost how increment position along slope. you'll need create vector between 2 sprites, normalize it, multiply normalized vector how want sprite move per frame, add vector sprite moving's location. didn't specify language, here little pseudo code: var p1 = sprite1.location var p2 = sprite2.location var vec = p2.subtract(p1) vec.normalize() vec.multiply(6) // want advance 6 units per move while (sprite1.location != sprite2.location) // best check epsilon sprite1.location = sprite1.location.add(vec) end

java - Inserting into Access database -

how resolve error in inserting memo in access java program? 4159 size of string the error java.sql.sqlexception: [microsoft][odbc microsoft access driver]count field incorrect the source code executes insert statement: statement.executeupdate("insert webdata values ("+"'" + list.get(y)+"','"+data+ "')"); 4159 size of data my schma : table name webdata 2 coulmun first id of type text the second field1 of type memo i have update statment have same error: statement.executeupdate("insert webdata (id,field1) values ("+"'" + list.get(y)+"','"+data+ "')"); thank you please post schema. rather doing: insert webdata values (...) you should doing: insert webdata (mycolumn1, mycolumn2) values (...) do not rely on physical column order in table, should state explicitly avoid errors.

java - New to Object Relational Mapping -

i went ahead buy book on hibernate. wanted learn on hibernate , object relational mapping in general. harnessing hibernate has topics on hibernate , think able write simple mapping classes now. problem is, think way ahead on hibernate dont know why need one. the book explains hibernate think @ lost cause not bother discuss why need hibernate , orm. can please give me useful link read orm. google hits not give me clear results. thanks. i suggest starting @ wikipedia . from there, follow links @ bottom. to provide short answer: orm used abstract data storage, database. can serve multiple purposes, among those: application programmers can add , maintain functionality of software without in-depth knowledge of database (you can write code in java, not in sql). it takes away pitfalls of having assemble sql statements strings , therefore eliminates huge source of errors. database optimization independent business logic. ensures better maintainability. optimizat

sql - mysql - selecting values from a table given column number -

is possible in mysql select value table specifying column number instead of column name ? no, can not use ordinal value of column in select clause. column order irrelevant database; ordinal value based on list of columns in select clause. ordinal value supported after select clause - ie: in group by , , order by . said, using ordinals not recommended approach because ordinals brittle -- if changes column order in select clause, query can negatively impacted.

c# - C++/CLI convert existing application do managed code -

i've got existing application written in borland c++ builder. client wants rewritten in c#/wpf. requires lot of work , complex task because need rewrite whole (huge) algorithm. thinking of way reuse code , able create gui in c#/wpf. possible? easy? how can make c++ classes visible .net ? if give me brief answers links/examples grateful. you can wrap old c++ code in c++/cli wrapper , build dll file. should visible in .net project. depending on algorithm/function structure, may change little, basic form, , way did this, following. keep in mind basic example, tried include key points: 1. define cli wrapper using namespace system; #include "myalgorithmclass" public ref class mycliwrapperclass //the 'ref' keyword specifies managed class { public: mycliwrapperclass(); //constructor //function definitions same, though types, //like string, change little. here's example: string ^ getastring(); //the "string" .net &quo

multithreading - WPF Dispather.Run throws NullReferenceException -

i working in wpf application have datagrid updated different thread. datacontext of usercontrol set datatable, , everytime click button, datatable gets updated, , hence datagrid. that's working fine. the problem when start clicking button several times, application breaks , throws following exception in dispatcher.run : location: void movetoposition(system.windows.controls.primitives.generatorposition, system.windows.controls.primitives.generatordirection, boolean, generatorstate byref) type: nullreferenceexception fullname: system.nullreferenceexception message: object reference not set instance of object. stacktrace: @ system.windows.controls.itemcontainergenerator.movetoposition(generatorposition position, generatordirection direction, boolean allowstartatrealizeditem, generatorstate& state) @ system.windows.controls.itemcontainergenerator.generator..ctor(itemcontainergenerator factory, generatorposition position, generatordirection direction,

SQL server with Rails -

i've been trying rails program access existing sql express server set on machine @ work. i've followed these instructions: github , set database.yml this: development: adapter: sqlserver mode: odbc dns: provider=sqloledb;data source=machinename\sqlexpress;uid=xxxx;pwd=xxxxx;application name=atlas timeout: 5000 now when try run script/console (or server or whatever) error: /var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:440:in `load_missing_constant':nameerror: uninitialized constant activerecord::wrappeddatabaseexception i've tried googling , changing settings , forth i've come blank. doing awfully wrong or what? br, sg i can speak using rails 3.0.3 sqlserver 2005, hope helps bit. i've added gemfile : gem 'ruby-odbc', '0.99991', :require => 'odbc' gem 'activerecord-sqlserver-adapter', :branch => "arel2", :git => "git://github.com/rail

Python code to get current function into a variable? -

how can variable contains executing function in python? don't want function's name. know can use inspect.stack current function name. want actual callable object. can done without using inspect.stack retrieve function's name , eval ing name callable object? edit: have reason this, it's not remotely one. i'm using plac parse command-line arguments. use doing plac.call(main) , generates argumentparser object function signature of "main". inside "main", if there problem arguments, want exit error message includes text argumentparser object, means need directly access object calling plac.parser_from(main).print_help() . nice able instead: plac.parser_from(get_current_function()).print_help() , not relying on function being named "main". right now, implementation of "get_current_function" be: import inspect def get_current_function(): return eval(inspect.stack()[1][3]) but implementation relies on function hav

c# - ListBox throwing ArgumentOutOfRangeException when adding to DataSource -

i'm trying use bindinglist datasource listbox in c# winforms, whenever try add items bindinglist , argumentoutofrangeexception thrown. following code demonstrates problem (assume form listbox listbox1 ): bindinglist<string> datasource = new bindinglist<string>(); listbox1.datasource = datasource; datasource.add("test1"); // exception, here. note if datasource has items in it, not exception: bindinglist<string> datasource = new bindinglist<string>(); datasource.add("test1"); listbox1.datasource = datasource; datasource.add("test2"); // appears work correctly. i can work around problem setting datasource property null before adding item, , re-setting datasource afterward, feels hack, , i'd able avoid doing so. is there (non-hack) way use empty datasource on listbox , such adding items doesn't throw exceptions? edit : stack trace: system.windows.forms.dll!system.windows.forms.listbox.selectedi

unix - Controlling terminal & a new session -

how can process (in case session leader) controlling terminal? what in program: 1. fork; 2. parent -> while(1) or smth. similar; 3. child -> setsid(); exec "man ps"; i beleived nothing in output. (child session leader , therefore has no relation old tty) got , don't understand why. man ouputs. not interactive. when press ctrl-z becomes interactive when press 'q' quites , returnes prog(parent). questions are: please explain happens @ beginning (why have press ctrl-z, read above) why man output in shell? how can man without tty connected (i checked ps, man , pager have "?" in tty column) and finally: how can new session leader acquire controlling terminal. there wayes besides open(/dev/tty) ? q. 1. 3.: child process keep access stdin, stdout etc., after setsid(). need close them explicitly (or reopen using eg. open("/dev/null",o_rdwr); ). q 4.: when session-leader without controlling-terminal

version control - Learn how to develop open source applications with many developers -

i'm solo developer , have been, i've been learning lately possibilities of source control , project collaboration. learn how work large groups of developers (say on github). think amazing learning experience, till have been developer on given project. there recourses learning how work on small portions of project bits done? books? examples? know have start somewhere, i'm not sure how. thanks. join open source project. find on github or large open source project repository using language and/or project fires imagination. read wiki/mailing lists , find out how contribute. in case, best way learn do.

progress bar - android progressbar inside edittext -

i want display progressbar(spinner) right of edittext when activity doing processing , hide upon completion, there simple way this? i'd use relativelayout , this: <relativelayout> <edittext android:id="@+id/the_id"/> <progressbar style="?android:attr/progressbarstylesmall" android:layout_aligntop="@id/the_id" android:layout_alignbottom="@id/the_id" android:layout_alignright="@id/the_id"/> </relativelayout>

XSLT Confusion with xsl:apply-templates -

i have xml file format: <?xml version="1.0" encoding="utf-8" ?> <opacresult> <valueobjects class="list"> <catalog> <notes> daily newsletter available via e-mail.&#xd; ip authenticated. login not needed within firm. </notes> <title>health law360. </title> <url>http://health.law360.com/</url> <catalogtitles class="list"> <catalogtitle> <uuid>e5e2bc53ac1001f808cddc29f93ecad8</uuid> <timechanged class="sql-timestamp">2010-12-14 09:17:10.707</timechanged> <timeentered class="sql-timestamp">2010-12-14 09:17:10.707</timeentered> <whochanged>b23de2ffe8dd49b0b0a03d1feb3e7da2</whochanged> <whoentered>b23de2ffe8dd49b0b0a03d1feb3e7da2</whoentere

Learning C# prior to learning ASP.NET MVC? -

with mild programming experience in past, wondering c# , asp.net mvc.. do guys think it's better idea learn c# before learning asp.net mvc? i've delved little both of these already, still need deciding. i think stronger mvc user if had more knowledge of c# language itself. what guys think? thanks! if you're going use c# code asp.net mvc models/controllers/etc. yes, learn c# before dive asp.net mvc . that way, you'll able better handle language issues you're going run in when composing .net mvc application. otherwise you're going trying learn 2 things @ same time , not grasp on either one.

c++ - Grouping switch statement cases together? -

i may on looking there simple way in c++ group cases instead of writing them out individually? remember in basic do: select case answer case 1, 2, 3, 4 example in c++ (for need it): #include <iostream.h> #include <stdio.h> int main() { int answer; cout << "how many cars have?"; cin >> answer; switch (answer) { case 1: case 2: case 3: case 4: cout << "you need more cars. "; break; case 5: case 6: case 7: case 8: cout << "now need house. "; break; default: cout << "what you? peace-loving hippie freak? "; } cout << "\npress enter continue... " << endl; getchar(); return 0; } no, can if - else if - else chain achi

java - Simplest way of using Hibernate Sessions -

i'm coaching student project uses hibernate persistence layer. projects @ work i'm quite familiar hibernate , can use few 'troubles'. project have problem sessions, stale objects , and 'object loaded different session'-errors. so looking simplest possible way use sessions: ideal be: sessions can fetched anywhere it shouldn't matter whether or not given object loaded session , updated session b its single-process gui application. current setting current_session_context_class thread. use static field session variable (which think causes of troubles) , fetch once. thanks assistance! cheers, reto assuming you're not teaching orm, understanding of why these errors happen isn't part of knowledge students supposed come away etc etc etc , want hibernate work database wrapper can data use while learning other things. this best bet: statelesssession session = sessionfactory.openstatelesssession(); a stateless session "au

algorithm - Split 2-3 tree into less-than and greater-than given value X -

i need write function, receives key x , split 2-3 tree 2 2-3 trees. in first tree there nodes bigger x, , in second less. need make complexity o(logn) . in advance idea. edited thought finding key x in tree. , after split 2 sub-trees(bigger or lesser if exist) 2 trees, , after begin go , every time check sub-trees i've not checked yet , join 1 of trees. problem leaves must @ same level. assuming have covered 2-3-4 trees in lecture already, here hint: see whether can apply same insertion algorithm 2-3 trees also. in particular, make insertions start in leaf, , restructure tree appropriately. when done, determine complexity of algorithm got.

php - Two-key encryption/decryption? -

i'm looking store sensitive data using php , mysql , using form of reversible encryption since need data out in plain text of use. i'll deriving encryption key users' username/password combination i'm stumped in (inevitable) event of password being forgotten. realise purpose of encryption can undone using correct key must have been addressed before.. i'm trying head around whether or not public key cryptography apply problem can think of private key still need correct decrypt data.. any ideas? i'm looking store sensitive data using php , mysql , using form of reversible encryption since need data out in plain text of use. protecting sensitive data good. now: whose data it? (yours, user's, or third party?) what need protected from? (disclosure, corruption (accidental or intentional...) who need protected uninvolved parties goes without saying. do need / want avoid accessing plaintext data (useful deniability), do

windows - pthread win32 version? (Mongoose) -

please tell me difference between pthread versions: vc2, vce2 , vse2? how choose of them must use visual c++ express 2010 mongoose webserver library? thank you!!! vce - msvc dll c++ exception handling vse - msvc dll structured exception handling vc - msvc dll c cleanup code which 1 you'd want use vc++ express 2010 depends on how want pthread clean handled. if you're linking mongoose webserver (which i'm not familiar with), think you'll want use exception handling model code compiled with. the pthreads win32 library goes fair bit of detail: library naming because library being built using various exception handling schemes , compilers - , because library may not work reliably if these mixed in application, each different version of library has it's own name. note 1: incompatibility between eh implementations of different compilers. should possible use standard c version either compiler c++ applications b

c++ - Lazy evaluation and problems with const correctness -

i have made opengl camera class uses lazy evaluation provide final projection or model-view-projection matrices through getter functions. user provides various camera parameters throughout life of instance (fov, position, etc. ), rather have projection matrix and/or mvp matrix recalculated every time parameter changed, 'changed' flag set (i.e. old cached matrix invalid). whenever user requests updated final matrix, recalculated, result cached, , const reference returned. everything sounds fine until call my: const qmatrix4x4& oe_glcamera::getmodelviewprojection() const; function const oe_glcamera instance... use const references everywhere in app extract camera data cad viewports without changing camera, getter function performs lazy evaluation on member variables if invalid - therefore breaking const-correctness. is there language feature or design paradigm i'm unaware of this? or lazy evaluation fundamentally incompatible const-correctness? aware of c

httpwebrequest - How can i call a receive activity from a xamlx workflow service using javascript? -

i need call receive activity in workflow javascript passing parameters json , need response json format too.. i tried found nothing works. hope can me... thanks the receive activity supports soap requests , @ moment there no way rest style communications it. 1 work around create regular wcf rest service wrapper workflow , have javascript client go through wrapper.

jquery - how can i stop a ajax request in ajaxSend? -

$('#speichern').live('click' , function () { var data_save = $('#form_rechn').serialize()+ '&' + 'action=save' + '&' + 'total=' + number($('#grandtotal').text().replace(/eur/g, "")); $.ajax({ type : "post", cache : false, url : 'invoice_new_action.php', data : data_save, ajaxsend : $.post("invoice_new_action.php",{"action":"before","rn": $('#rn').val()},function(huhn){ var totest = number(huhn) if ( totest == "") { } else { $('#rn').val(totest); $.fancybox('nr. existiert. '); return false; // why don't stop here? };}), error:function (xhr, ajaxoptions, thrownerror){ alert(xhr.status); alert(thrownerror); },

layout - How to make a resolution independent camera preview on android? -

i'm making android 1.6 app uses phone's camera. in order app resolution independent, need set compatible aspect ratio previewing camera on surfacelayout. in 1.6 sdk there no way supported sizes camera preview. possible use 4:3 or 3:2 aspect ratio , no errors whith that? on other hand, need way make xml layout represents surfacelayout in (unknown) aspect ratio in every resolution. assume not possible change surfacelayout size in runtime. can "dp" units? other way making layout programmatically? there apps vignette or android camera application tricks make that, black bars (vignette) or fixed buttons bar, don't know how in kind of resolution. any ideas? thanks! in 1.6 sdk there no way supported sizes camera preview. there is. can them in parsing preview-size-values camera parameter. string supportedsizesstring = parameters.get("preview-size-values"); list<size> supportedsizes = new arraylist<size>(); if (supporte

eclipse - error of grails project from svn : GroovyObject cannot be resolved -

Image
when check out new grails project svn, got error: 1.the project not built since build path incomplete. cannot find class file groovy.lang.groovyobject. fix build path try building project 2.the type groovy.lang.groovyobject cannot resolved. indirectly referenced required .class files i had config grails path, , can run-app well. but,still error warning. solved "grails tool -> refresh dependencies"

Ubuntu Linux - Spawning an application when a USB device is plugged in -

i'm trying application run whenever usb device plugged in: flash drive, camera, phone, etc. i'll start simple application "hello world". basically, when plug in camera, flash drive, or phone want computer spawn "hello world" application. is possible create sort of functionality on latest version of ubuntu linux? need create application listen event? rather have work without having have application running catch it. possible? anything need write in c. if point me in right direction, grateful. thanks, t what want udev rule -- udev daemon waits kernel events (like hardware mounts) , processes set of "rules" define. there's nice tutorial here has several examples @ end match request.

c# - Referenced assembly deploy question -

i have project a. a use library aseembly(b) referenced 3rd party library(c). i know b copies output directory. wondering whether c copies too? in cases, yes. if doesn't, we'll talk exceptions :-)

oop - Need to abstract collections of objects (C#) -

in following simplified example, need abstract collection classes in such way printfruitsandeaters(oranges, orangeeaters); or printfruitsandeaters(apples, appleeaters); becomes possible: abstract class fruit abstract class fruiteater class apple : fruit class appleeater : fruiteater class orange : fruit class orangeeater : fruiteater class applecollection : list<apple> class orangecollection : list<orange> class appleeatercollection : list<appleeater> class orangeeatercollection : list<orangeeater> i've tried templatizing method , collection classes, need access methods specific fruit , fruiteater classes: class fruitcollection<t> : list<t> class fruiteatercollection<t> : list<t> void printfruitsandeaters<t, s>(fruitcollection<t> fruits, fruiteatercollection<s> eaters) then want this: void printfruitsandeaters<t, s>( fruitcollection<t> fruits, fruiteatercollection<s&g

c# - DataContract Serialize abstract class -

i have interface iserviceinfo , abstract class serviceinfo. there several classes inherited serviceinfo, coreserviceinfo, moduleserviceinfo etc. there service contract named rootservice returns iserviceinfo. public iserviceinfo getserviceinfo() { return (iserviceinfo)new coreserviceinfo(); } i having problem serializing. can use serviceknowntype identify base class, , knowntype identify child class. problem not know serviceinfo child, since application can have plugins different child inherited serviceinfo, cannot tell serializer have child in serialized xml. i can ignore abstract class, contains common implementation need keep it. work around can have class "sampleserviceinfo" , convert info classes sampleserviceinfo , return service method, , define knowntype serviceinfo class. [knowntype(typeof(sampleserviceinfo))] public class serviceinfo : iserviceinfo but not sound pretty way it. please suggest. need write custom serializer? there way serialize b

WCF Custom Header does not Appear in Service -

i wondering if came across issue , has answer or pointer. implemented iclientmessageinspector add header soap message on client. so, inside beforesendrequest call messageheader.createheader. seems work because see message in fiddler header in collection. on service side, have custom authenticationmanager. when service call enters implementation dont see header inserted. have feeling servicemodel stack skipping header during deserialization not sure. also, not sure on how fix if happening. maybe implement equivalent of iclientmessageinspector on service side? any idea/pointers helpful. in server-side wcf code, act upon soap header client (inserted iclientmessageinspector), have used implementation of idispatchmessageinspector. in afterreceiverequest() method, use request.headers.findheader() see if expected header present.

.net - Any fresh ideas for creating websites using dotnet? -

i intend create web application , host it. want develop fresh in internet world, feed ideas saturated me though not. any guys have idea can share with..[if u dont mind] also refer me url's implemented ideas. i tried not creative enough think different :) thanks. depends on goals. if want create something, i'm sure can find ideas ideas. if want make money, luck. i've built 2 dozen sites far. , they're bringing in trickle. you can find bunch of domains @ http://www.scwebgroup.com/websites.aspx . let me know if want team on of undeveloped sites.

swing - Overlapping tabs in Java -

i had design 5 tabs using swing. each tab contains 2 or 3 sub tabs. problem is, @ run time text fields in tabs overlapping. use method refreshi18ntext(jpanelreceivedform1a) to refresh jpanel. still i'm getting problem. you need make sure using correct layout manager. oracle tutorial useful selecting , explaining each layout manager. http://download.oracle.com/javase/tutorial/uiswing/layout/using.html

Android service connection leaked after starting new activity -

i trying figure out why service leaking application. the official error getting service not registered longer. here's works: create service creates listener, when listener triggered service sets of intent start activity. new activity begins , thing. the problem: when main screen gives me option turn off service, error stated causes illegalargumentexception (when try unbind service not registered). any appreciated. here code service. i've included because seems problem is, if need more let me know. thanks in advance, here code. import java.lang.ref.weakreference; import java.util.list; import android.app.service; import android.content.context; import android.content.intent; import android.hardware.sensor; import android.hardware.sensorevent; import android.hardware.sensoreventlistener; import android.hardware.sensormanager; import android.os.binder; import android.os.ibinder; import android.util.log; import android.widget.toast; public class accelservice exte

Error while connecting to external SQL Server with an IP using SQL Management Studio 2005 -

error while connecting external sql server ip using sql management studio 2005 address title: connect server cannot connect 1.2.3.4\sqlexpress. additional information: a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified) (microsoft sql server, error: -1) for help, click: http://go.microsoft.com/fwlink?prodname=microsoft+sql+server&evtsrc=mssqlserver&evtid=-1&linkid=20476 make sure remote server allows connection port 1433/tcp , e.g.: using telnet client (in windows 7 isn't installed default, install use turn windows features ): telnet 1.2.3.4 1433 or using nmap (port scanner) nmap -st -r -n -vv -p1433 1.2.3.4 if doesn't allow - check inbound firewall ru

svn - Problem with Subversion and Build event under Visual Studio 2008 -

i checked out http://code.google.com/p/flashdevelop/ in pre build there subwcrev "$(solutiondir)\" "$(solutiondir)flashdevelop\properties\assemblyinfo.cs.rev" "$(solutiondir)flashdevelop\properties\assemblyinfo.cs" i changed subwcrev "c:...\subwcrev.exe" because it's not in path env variable. got "subwcrev ... exited code 6." error code 6 means "svn error" seen in source code of subwcrev. that means status couldn't fetched reason. maybe 1 of files opened in app, folder read/write protected, ... or maybe version of subwcrev not same svn client checked out working copy - in case wc format may not same.

Convert php array_sum to java -

$a = array(2, 4, 6, 8); echo "sum(a) = " . array_sum($a) . "\n"; //==20 how can in java? long array_sum(int...array) { long sum = 0; for(int value : array) sum += value; return sum; } example: system.out.println(array_sum(1, 2, 3, -1)); system.out.println(array_sum(1, 2)); system.out.println(array_sum(new int[]{1,2,3,4,5})); 5 3 15

sharepoint - Document library folder transfer from one site collection to other -

i want transfer folder, under document library, 1 site collection other site collection. please me out! open document library in explorer mode copy 1 location open other library in explorer view paste on their.

MySQL custom storage path -

i'm working on server no free space on it, attached nfs volume it. mysql storing tables or, better, entire databases on shared volume. there way this? thanks lot! i don't think idea. have performance , consistency issues if storage on nfs . consider adding secondary local disk, mounting it, , hosting database files in it. having said that, change database location in mysql. it's pretty simple. have @ this web entry . mysql pretty flexible kind of things.

audio - Detecting sound in iphone -

can tell me how detect sound on iphone.... please help....please provide source code or link if possible you can use avaudiorecorder http://mobileorchard.com/tutorial-detecting-when-a-user-blows-into-the-mic/ that tutorial works sound really... goes through steps of creating high-pass filter try , detect blowing. can change values make more sensitive sound or less sensitive.

spring - Getting org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - Parent entry not found in the directory.]; -

hi using spring ldap adding user in ldap. i have specified context source of ldap in application context file.... <bean id="contextsource" class="org.springframework.ldap.core.support.ldapcontextsource"> <property name="url" value="ldap://brm-devoid-01.brocade.com:389"/> <property name="base" value="ou=users,dc=external,dc=brocade,dc=com"/> <property name="userdn" value="cn=oracladmin"/> <property name="password" value="mypassword"/> </bean> <bean id="ldaptemplate" class="org.springframework.ldap.core.ldaptemplate" > <constructor-arg ref="contextsource"/> </bean> <bean id="activation" class="com.brocade.webportal.registration.service.activationimpl"> <property name="ldaptemplate" ref="ldaptemplate"/> </bean> with these specification in

How to save the data into File in java? -

i have 1 problem, have 1 string of data , want save separate file every time. please give me suggestion. thanks, vara kumar.pjd use timestamp in de filename can sure unique. import java.io.*; class filewrite { public static void main(string args[]) { try{ // create file filewriter fstream = new filewriter(system.currenttimemillis() + "out.txt"); bufferedwriter out = new bufferedwriter(fstream); out.write("hello java"); //close output stream out.close(); }catch (exception e){//catch exception if system.err.println("error: " + e.getmessage()); } } } this easy google.

sharepoint wss 3.0 user domain -

i've inherited sharepoint wss 3.0 farm pulling users 2 different domains, domaina , domainb. if go add user , browse, , type smith, coming domaina\jsmith , domainb\jsmith. company has moved away domaina , uses domainb now. want remove domaina sharepoint configuration. don't need migrate existing sharepoint users, want domaina users stop showing when new users added. i've been through every page can find in central administration , don't see names of domain controller(s) specified. using windows auth / ntlm. you want @ peoplepicker-searchadcustomquery property. can setup ldap query allows specify users shown. http://technet.microsoft.com/en-us/library/cc262988.aspx to restrict search distribution list corp.fabrikam.com , ntdev.corp.fabrikam.com, use following syntax: stsadm -o setproperty -url http://contoso-370 -pn peoplepicker-distributionlistsearchdomains -pv corp.fabrikam.com;dev.corp.fabrikam.com the domain name should domain name service (dn

php - Where to store application constants in Zend? -

i have few constants i'll need define application, example, site_key contain random key salt passwords. i'm not sure should define those, though. thought of placing them in public/index.php seems bit messy. there specific place should go, according zend or something? thanks edit i'm trying way: in application.ini have this: siteglobal.sitekey = "test" and in bootstrap.php file: protected function _initglobals() { $config = $this->getoptions(); define('site_key', $config['siteglobal']['sitekey']); } still, isn't working, when try echo site_key in controller this: echo site_key; it doesn't show anything. ideas? in application, i'm combining both haim's , yeroon's approaches. i'm storing application constants in application.ini , parsing them in bootstrap , putting them zend_registry . so, in application.ini constants.site_key = my_site_key in bootstrap protected function

android - Alternatives to compiling in Eclipse? -

the following situation surely familiar android developer using eclipse , adt. i'm tired of endless cycle of switching build automatically on , off, running clean, building , running. i'm doing of these operations when i'm fine tuning ui (i.e., editing xml files , needing see results live), , time save, eclipse window telling me have these pending operations shows up. when happens, turn off build automatically. alterations , run. eclipse decides changes in xml file weren't enough, , won't reinstall app in emulator or device, force build , install. all of wasted time. i've done applescript build & run app emulators , devices have connected @ once, described in this question , workflow improved if found way save , build silently , fast. does have tips or alternatives? intellijidea community edition supports android

java - Is there a one-liner to create a Collection from an Enumeration object? -

i have enumeration object , want create collection object containing items of enumeration. is there java function without manually iterating on enumeration? reverse of collections.enumeration method? in fact, there collections.list(enumeration) (there enumerationutils.tolist(enumeration) commons-collections .)

jquery - How to validate the radio button and checkbox? -

for radio button: $(document).ready(function() { $('#select-number').click(function() { if ($('input:radio', this).is(':checked')) { return true; } else { alert('please select something!'); return false; } }); }); it working fine when no radio button selected. when select radio button , submit form giving me alert message 'please select something!' there tutorials available validation using jquery newbie . it looks you're attaching click event of submit button (there no inputs inside that element). instead, attach submit event of form: $(document).ready(function() { $('#formid').submit(function() { if ($('input:radio', this).is(':checked')) { return true; } else { alert('please select something!'); return fa

python - pygame - pixel collision map -

i'm creating game pygame , need map user can select country clicking on it. can me? unless find done, see no easy way of doing -- youhave ro start having world map, of course -- 1 in wikipedia seens nice starting point: http://upload.wikimedia.org/wikipedia/commons/0/03/blankmap-world6.svg --ah, see comments have map drawn -- yes ..if need color click, easier - pick click coordinates mouse event click: e = pygame.event.poll() if e == pygame.mousebuttondown: pos = e.pos # "screen" variable holding screen surface color = screen.get_at((pos))

c++ - How to get string with pattern from std::regex in VC++ 2010 -

can string regular expression std::regex ? or should save somewhere else if want use later? in boost can this: boost::regex reg("pattern"); string p = reg.str(); or use << operator cout << reg; print pattern . but in std::regex there no str() or operator<<. should save string somewhere else or can't find it? in debugger can see what's in std::regex . i looked in n3225, section 28.4 (header <regex> synopsis) , indeed, basic_regex template has no member function str , , there no operator<< provided. the paragraph 28.8/2 provides a little insight on : objects of type specialization of basic_regex responsible converting sequence of chart objects an internal representation . not specified form representation takes, nor how accessed algorithms operate on regular expressions. what understand standard mandates basic_regex can constructed const chart * not require implementation keep strin

javascript - Is there a .Net technology equivalent to scriptable Java applets? (for a specific use-case) -

one of core technology components @ company java applet digital signature. headless component, in sense presentation handled via html/css, , applet methods invoked javascript. applet not visible in page. now we've come situation have specific signature format (signature embedded in docx [officeopenxml] documents) more handled using .net classes, , have prototype implementation .net dll. in olden com years, active/x components used in web pages similar purpose, , scriptable too. know (if any) equivalent embedding .net classes , scripting them using javascript. what technology use? silverlight approach, or biased towards ria, i.e. apps visual appearance? if solution, appreciate pointers tutorials or code samples in direction. i've had 1 year exposure .net (c#) in past none silverlight. silverlight not technology use here. doesn't offer access user's system require. however there nothing stopping creating activex/com component using .net code. can c

css - adjust the child position to the center of the parent in jquery -

i'm prototyping navigation site sits on bottom of window. when hover on link div appears above naivigation sub-links, not position centrally above hovered link in navigation. i've tried using css position -50% left has had of effect [looks move 50% left of parents size], how do using jquery? note: i'm using hoverintent. position (fixed) 1 pixel wide container div instead, , offset inner element (your actual item) half of absolute width. trick has worked me. html: <style type="text/css"> #testnav-container { position:fixed; bottom:0; left:50%; width:1px; border:1px solid red; text-align:center; } #testnav { height:20px; width:100px; background:blue; margin-left:-50px; } </style> <div id="testnav-container"> <div id="testnav">test navigation bar</div> </div> the 1px border on container div show where

Is this a bug? Or is it a setting in ASP.NET 4 (or MVC 2)? -

i started trying out t4mvc , idea of eliminating magic strings. however, when trying use on master page stylesheets, this: <link href="<%: links.content.site_css %>" rel="stylesheet" type="text/css" /> rending this: <link href="&lt;%: links.content.site_css %>" rel="stylesheet" type="text/css" /> whereas these render correctly: <link href="<%: url.content("~/content/site.css") %>" rel="stylesheet" type="text/css" /> <link href="<%: links.content.site_css + "" %>" rel="stylesheet" type="text/css" /> it appears that, long have double quotes inside of code segment, works. when put else in there, escapes leading "less than". is can turn off? bug? edit: this not happen <script src="..." ... /> , nor happen <a href="..."> . edit 2: