Posts

Showing posts from March, 2014

sharepoint 2010 - Personalized web parts summary links -

i need have personalized summary links web part in given page. when user logs site, should see own links opposed system wide links inside links web part. is possible have personalized summary links web part? how work? thanks in advance. w here's can do: add user column standard links list. create new view shows links of current user (use [me] marker column value in filter). modify web part use new view.

imageview - How do I display this image in Android? -

how display image following configuration in android? retain original aspect ratio (the image can scaled, not stretched) fill width of parent aligned bottom of parent the following not work: <imageview android:layout_width="fill_parent" android:layout_height="wrap_content" android:scaletype="fitcenter" android:layout_alignparentbottom="true" android:src="@drawable/background" /> using above xml imageview takes width of parent, image inside imageview not. some points. if want manteint aspect ratio instead of fitcenter should try centerinside : scale image uniformly (maintain image's aspect ratio) both dimensions (width , height) of image equal or less corresponding dimension of view (minus padding). remember devices using application might have different screen sizes. if background image can stretched recommend try ninepatchdrawable

java - Why is access restricted to jre6/lib/rt.jar for OperatingSystemMxBean? -

i'm having little trouble java code i'm trying compile in eclipse. keep getting following warning... access restriction: type operatingsystemmxbean not accessible due restriction on required library c:\program files\java\jre6\lib\rt.jar from line of code... com.sun.management.operatingsystemmxbean bean = (com.sun.management.operatingsystemmxbean) java.lang.management.managementfactory.getoperatingsystemmxbean(); i've found ways around i'm worried restriction warning. code open source project ( cftracker ) , don't want work around restriction if i'm going breaking sort of license agreement. can me understand this? this not problem of license agreements. eclipse trying protect using classes not part of official jdk api (but rather, part of oracle/sun's jvm implementation). is there particular reason need class cast (rather using the "official" interface java.lang.management.operatingsystemmxbean )? if want make sure applic

c - How do I set a conditional breakpoint in gdb, when char* x points to a string whose value equals "hello"? -

can specify want gdb break @ line x when char* x points string value equals "hello" ? if yes, how? you can use strcmp : break x:20 if strcmp(y, "hello") == 0 20 line number, x can filename , y can variable.

asp.net mvc - Microsoft MVC Validation.js: watch/create event to run custom function on real form submit -

i use microsoftmvcvalidation.js validate form (client side / no ajax). when submit button clicked, form submitted. if there invalid form field error message shown instead of sending data server. i want know how add custom function when form submitted server. so example, can add simple js function disables submit button , shows 'loading' image, when submitted server. don't want disable button if validation message shows. i cant use onsubmit event because does't assure form submitted server. so how can it? thanks here's hack might use quite frankly consider jquery: window.onload = function () { document.getelementbyid('myform').onsubmit = function () { // determine if there validation errors var errors = sys.mvc.formcontext.getvalidationforform(this).validate('submit'); if (errors.length < 1) { // disable button if there no errors document.getelementbyid('btnsubmit

User Defined Types Passing to a Function is a Call By Value in C? -

i have struct , pass struct function. maybe function protype is: typedef struct { //bla bla } abc; void func(abc abc) { } this function calling call value or call referance? "c doesnt have copy constructor cant pass user defined types value". idea correct? call value. c always call value. (c doesn't have copy constructors structures can still copied creating second structure original structure initializer. function parameters initialized values pass arguments; it's same mechanism @ work.)

Triggers in SQL Server -

there 2 table table_trigger , table_trigger1 .i have created trigger on table_trigger1 . works perfectly.below trigger script - create trigger test_trigger on table_trigger1 instead of insert set nocount on insert table_trigger1(firstname) select firstname inserted i.firstname in (select firstname table_trigger) when condition true, message ( 1 row(s) affected ) , value save in table.but when condition false, time message ( 1 row(s) affected ) , value not save in table. my question - if condition false , value don't save in table why got ( 1 row(s) affected ) message. meaning of message. thanks in advance. in nutshell, "rows affected" original insert ignorant of what's going on behind scenes in trigger. passes 1 row through , considers row "affected." i tried find documentation up. closest come documentation on sqlcommand.executenonquery , states: for update, insert, , delete statements, return value number of rows affecte

asp.net - Regarding dropdownlist -

i've dropdownlist designed using html select tag. thing working fine in ie , not working in mozilla, opera , google chrome... can 1 help.. code used is <select name="select nav" size="1" style="background-color:#ffffff" onchange="location.href=options[selectedindex].value;"> <option value="locations_aberdeen.html">aberdeen <option value="locations_arendal.html" selected>arendal <option value="locations_athens.html">athens <option value="locations_bangkok.html">bangkok <option value="locations_beijing.html">beijing <option value="locations_capetown.html">capetown <option value="loca

java - Eclipse RCP and Iterate through Perspectives and Views -

i have eclipse rcp application many plug-ins. each plug in have own perspective new views or shared views. need create separate application based on original 1 plug-ins. application act permissions configurator each plug in/perspective. to need : -force initialization of plug -in @ start -get perspective objects in application , display ids -for each perspective views associated perspective , display ids -for each view object properties (each view in fact inherit special base 1 : specialview example) based on 1 special role (administator) configure permissions other roles (which perspective should displayed, in each perspective views displayed, on each view commands active, etc). i have 2 questions regarding above requirements : -how force initialization on plug ins @ startup (eclipse use lazy activation) ? -hot perspective objects (not iperspectivedescriptor ) , view objects ? thank florinp to force activation can set flag in plugin.xml edit

jndi - Spring fails to lookup jdbc configured Data Source -

i have deployed application on tomcat 5.5 , ide eclipse myeclipse plugin. when try start tomcat server following error: error - contextloader.initwebapplicationcontext(219) | context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource' defined in servletcontext resource [/web-inf/xaconfig/daojpaconfig.xml]: invocation of init method failed; nested exception javax.naming.namenotfoundexception: name java:comp not bound in context @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1412) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:519) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:456) @ org.springframework.beans.factory.support.abstractbeanfac

perforce implementation of clearcase like "views" -

i have read through documentation on perforce , "branching strategy" advice well. 1 thing thats left me baffled, how simple concern not seem adequtely adressed. when working on project touches many parts of our code base , cannot checkin code @ end of day without checking trunk. need branch in situation? want able have ability have history of changes in long , hard project, can go when i make wrong turn.. the problem branching see creating copies of entire codebase .. missing obvious solution here? thanks from standpoint of perforce server, branches aren't copies of files. perforce uses mechanism called "lazy copy" minimize disc consumption. their website , here definition of term: a method used perforce make internal copies of files without duplicating file content in depot. lazy copies minimize consumption of disk space storing references original file instead of copies of file.

fetching waveform for visualization in c on any music files format (mp3/ogg/etc..) -

i know how can fetch waveform music file format in order visualize using kind of gui. use written libraries instead of writing own. any ideas? thanks! and library ask, check out libsndfile .

c++ - Best Practise and Semantics of namespace nested functions and the use of extern "C" -

i creating c++ library c-abi interface. this how gcc treats extern "c" qualifier regards mangling: namespace x { extern "c" int monkey(int x) { return 1; } int chimpanzee(int x) { return 1; } } the relevant nm output: 00000000004005cd t _zn1x10chimpanzeeei 00000000004005bf t monkey question: want leave functions involved in c-abi inside namespace, maximum flexibility reuse. important note: once library has been compiled give linker map file (gcc) or module definition file (msvc). is mangling output standard behaviour -- other major compilers (msvc in specific) strip mangling ? are pitfalls or best-practises regarding placing functions in name-space when involved in external abi? will interfere c-abi export of de-mangled functions during link time ? this msvc. the namespace not name-mangled, name of namespace incorporated in function's (or object's) name when name mangling occurs. process un

help for writing to files in java -

hi have created class named 'human' each object of class has name , type can student or instructor. have created class main creates object of human , assign type , name objects , add objects linkedlist. want write linkedlist file,but dont know how. must write both objects , type linkedlist. have created following main class have problem in writing file parts. please guide me? public class testing { public static linkedlist<human> link =new linkedlist<human>(); static fileoutputstream fop; public static void main(string args[]) { file f=new file("textfile1.txt"); try { fop=new fileoutputstream(f); } catch (filenotfoundexception e) { // todo auto-generated catch block e.printstacktrace(); } human hm = new human(); human hum = new human(); hm.setname("anna"); hm.settype("student"); hum.setname("elvis&quo

java - Time stamp with milliseconds, calculating "delay" -

when create instance of object, say, message m want set field in it, time stamp. nothing databases. when object passed around have time stamp read , compared current time of recipient calculate delay = timenow - m.sent_at . both objects exist on same system , both entities use system's clock (actual time, nothing fancy, delay important), want in milliseconds. something this: class message { public final long sentat; public final string data; public message(string data) { this.sentat = system.currenttimemillis() this.data = data; } public long timesincesent() { return system.currenttimemillis() - sentat; } }

android - Resize views in a layout -

i have horizontal linear layout multiple image views. there way resize these views automatically, of them fit inside screen? code: <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/cinnamon"/> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_torightof="@+id/cinnamon"/> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ham"/> best regards with image views make sure set layout whatever best fits needs. try "fill_parent". width , height. provide code , better description of layout want appear user , can give better example of need. if helps, let know. solution set

environment variables - Microsoft Visual Studio 2008: devenv.exe ignores /useenv option -

in microsoft visual studio 2008, want set c++ directories (includes, libraries, etc.) solution (*.sln) command line. until visual studio 2003, i've relied upon /useenv option of devenv.exe, started command line. not seem work on visual studio 2008 professional edition. directories set environment variables include , lib being ignored. only reference i've found issue here . mentions "external dependencies" section in: tools -> options -> projects & solutions -> vc++ directories. cannot find such section. i've found think "external dependencies" (i'm not sure because i'm running vs2008 translated italian) section in: right click on solution ! properties ! shared properties? ! external dependencies?, such section empty. i'm running microsoft visual studio 2008 version 9.0.21022.8 rtm , here's batch set include=c:\programmi\microsoft platform sdk february 2003\include;c:\programmi\microsoft visual studio .net 2003\

.net - FCL utility to convert XML named entities to numeric equivalents? -

of fcl classes (or using external api) there utility assembly, class or members can plugged .net application convert named entities numeric equivalents? for example, &eacute; become &#201; . you may take @ htmldecode , htmlencode methods: class program { static void main() { var s = httputility.htmldecode("&eacute;"); s = httputility.htmlencode(s); console.writeline(s); // prints &#201; } }

unit testing - Test Method order: lower level tests first? -

case in point: 1) 1 particular test method tests low-level feature. let's tests instance factory. 2) lot of functions depend on 1 low-level thing. now, low-level thing broken, , test method fails. do want see buried under hundreds of other failed tests of functionality relies on it? or want see 1 primary failure? just instance of think you'd want have some ordering of test method execution, namely: lower levels before higher ones. note not imply dependency order of test methods execution. no test method needs result or state other test. personally i'd rather have error messages warn me of scope of problem - if run unit-tests frequently, you'll know changed break them.

c - Socket data length questions -

i have couple of questions related following code: char buffer[256]; memset(buffer,0,256); read(socket_fd,buffer,255); the questions: why read 255 not 256 ? let's want send word: "cool" client server. how many bytes should write "in client" , how many bytes should read "in server"? i'm confused. you have answers here, think there's concept should explain. when send data through streams (that is, writes number of bytes 1 end, , bytes can read in same order in other end), want know when stop reading. mandatory if you'll send more 1 thing: when first message stop, , second begin? in stream, things mixed up. so, how delimit messages? there 3 simple ways (and many other not simple ones, of course): 1 fixed-length messages : if know beforehand every message is, say, 10-bytes long, don't have problem. read 10 bytes, , 11th 1 part of message. extremely simple, extremely rigid. 2 delimiting characters, or strings

touchscreen - iPad: touchesBegan not being called when dragging finger from upper screen border -

i writing ipad application can drag around screen 1 or 2 fingers. use touchesbegan, touchesmoved , touchesended methods recognize touches. have multipletouches enabled view. now have recognized 1 strange behaviour. if place finger outside of upper screen border , drag down screen won't receive call touchesbegan or touchesmoved. can not reproduced other screen borders. the other case can reproduced when use landscape orientation home button left side. in case same behaviour upper screen border. has information or experience same if testing? edit: did additional testing. area statusbar receiving touchesbegan or touchesmoved fine if put down finger in region or slide upwards lower screen position. input not recognized if slide finger down position completly above screen edge. edit2: additional info: - app uses opengl view. - statusbar hidden. - touchesbegan called when touching (hidden) statusbar areas in orientations. i believe underlying issue touch-sensitive

C array dimension problem -

i have array 1653 lines this: #define num_polygon_object_vertex 1653 * 3 static const float vertices[num_polygon_object_vertex] = { {{2.4f, 0.5f, 0.0f}, {0.0f, 0.0f, 1.0f} }, ... }; which right value num_polygon_object_vertex ? thanks update don't have idea programming c , paid me -3 points. unbelievable second update i'm getting following error: warning: excess elements in scalar initializer at least imo, right thing leave num_polygon_object_vertex out entirely: static const float vertices[] = { {{2.4f, 0.5f, 0.0f}, {0.0f, 0.0f, 1.0f} }, ... }; the compiler compute size automatically based on initialization data. compute size afterward, can use like: #define elements(array) (sizeof(array)/sizeof(array[0])) note, however, have doesn't seem multi-dimensional array @ (nor c's closest equivalent, array of arrays). since have 1 set of brackets, have single-dimension array. if want create multi-dimension array, like: static

scripting - Any language: recycling Variables -

this seems simple question ask but, idea re-use variables in scripting language? i'm particularly interested in reasons why is/isn't practice i'm besides self if should or shouldn't doing it. for example, $i 1 of common variables used in loop iterate through things. e.g (in php): //this script iterate each entry in $array //and output comma if isn't last item. $i=0; //recycling $i foreach ($array $v) { $i++; if ($i<count($array)) { echo $v.', '; } else { echo $v; } } say had several loops in script, better re-use $i or use variable such $a , other loops go $b $z . obviously re-use $i , i'd have set $i=0; or null before loop, or else give weird behaviour later on in script. makes me wonder if reusing worth hassle.. would following take more space using variable? $i=0; //recycling $i of course simple example of use , know if script terribly more complicated, cause more trouble

ios - iPhone No volume control shows up on specific phone when using MPMoviePlayerController -

we've written app uses mpmovieplayercontroller play movies streamed server. works fine on bunch of devices own (2 ipads, 3 iphones) , few others @ our customer site 1 particular japanese fellow, gets no sound , no volume control? any suggestions? ps did ask him reboot phone , has vibrate switch off ok pay ask silly questions second time. did have vibrate switch on. question why youtube app doesn't remove volume controls when happens , our app need research now.

c# - Making my color set to a variable -

i trying set color in span style variable...anyone know why wrong? <span style="font-weight:bold; color:"<%= accountwarningstyle %>"; font-size:14px;"></span> accountwarningstyle c# variable you need remove quote marks around `<%= accountwarningstyle%>". render as: <span style="font-weight:bold; color:"red"; font-size:14px;"> where should be: <span style="font-weight:bold; color:red; font-size:14px;">

java - HashMap collisions: is my code correct? -

i want have 1 datewrapper - representing date (built hibernate persistance, story) - @ existing @ same time same date. i'm bit confused collisions , keys hashing. i'm writing factory datewrapper object, , thought use milliseconds of parsed date key i've seen others doing. but, happens if there collision? . milliseconds different 1 another, internal table may smaller long exist. , once hash map has collision, uses equals, how can distinguish 2 different object long? maybe, it's put method drop (overwrite) value i'd insert... so, code safe, or bugged?? package myproject.test; import java.util.hashmap; import java.util.map; import org.joda.time.datetime; import org.joda.time.format.datetimeformat; import org.joda.time.format.datetimeformatter; import myproject.utilities.datewrapper; public class datewrapperfactory { static map <long, datewrapper> cache = new hashmap<long, datewrapper>(); static datetimeformatter parser = dateti

ajax - Modify javascript to get TWO query strings -

i have javascript code sends value of entered in input bar php file fetches rows database according value of entered input field. need edit code javascript not sends value of being entered input bar php, javascript variable. the code follows: function showfriends(str) { var cake = document.getelementbyid("cake"); if(str.length == 0) { document.getelementbyid("livesearch1"). innerhtml = ""; document.getelementbyid("livesearch1"). style.border="0px"; return } xmlhttp=getxmlhttpobject() var url="petition_send.php" url=url+"?q="+str url=url+"&sid="+math.random() xmlhttp.onreadystatechange=statechanged xmlhttp.open("get",url,true) xmlhttp.send(null) } function statechanged() { if(xmlhttp.readystate == 4 || xmlhttp.readystate=="complete") { document.getelementbyid("li

language agnostic - Deployment of static content -

i have design decision deployment here requirement there web server , app-server(jboss 5.1) application dinamic content should there in app server web server should contain static content html, pdf, images etc. (as per client) my questions: first of correct approach ? we have app server why need webserver? if use web server hide app server why need put static content web server? thanks in advance amit at small enough scale, doesn't matter. if workload few dozen employees using internal web service doesn't require lot of resources per request, whatever can deploy quickly. might mean serving static content through handler in web-app, on single server. when start scale up, things didn't matter before become noticeable. the first thing becomes noticeable on above configuration (static content handled web-app) pages take lot longer load. that's because 1 part of page dynamic, html itself, images, javascript, css, , whatever other odds ,

java - Inheritance with generics + collection + method = question -

i have problem generics , collection. java support generics @ compilation level. can't use case b. { foo(new hashset<i>()); //case foo(new hashset<c>()); //case b: wrong } void foo(set<i> set){} class c implements i{} interface {} so how can use function foo set< c > parameter? thanks. by changing signature of foo: void foo(set<? extends i> set){} you won't able add values set within foo , you'll able iterate on them or check containment.

c# - How to use LINQ to determine if specific attribute value exists? -

i programming in c# , working xdocument. want add element tree if , if there no other elements have matching attribute value. for example, there linq expression can use @ element below , see if there exists foo element same name before add it? <people> <foo name="bob"> </foo> <foo name="larry"></foo> <foo name="tom"></foo> </people> i want this... while(myxdocument.element("people").elements("foo").attribute("name").contains(myname)) { // modify myname , try again... } this should work: xelement.any(element => element.attribute("name").value == myname) it return true if there's attribute name equals myname

iPhone Strange CoreData Caching Performance Issues -

i'm working on app uses core data , nsfetchedresultscontroller. major component of app filtering down items in indexed table view based on set of 15 or pre-defined switches correspond property or relationship of managed objects. in of situations, i'm searching through set of around 300-400 objects, caching/performance not issue. snappy no caching required. however, there part of app searches through objects in cd database (~15,000 items). here, i'm trying implement caching on nsfetchedresultscontroller improve performance. 'cachestring' property nsfetchedresultscontroller predicate's string value. whenever user toggles filter switch, create new predicate, create new nsfetchedresultscontroller, , set cache new predicate's string value. first hit items (unfiltered) takes ~7 seconds, subsequent hits taking less one. what's strange, though - , here's problem - once proceed 'next step' of table view (i push new view controller nav controll

with qualifying of any of the return sattement do the loop break groovy -

do loop terminates when qualifies return statement? when value null? your question vague answered kind of certainty. hazard guess, however, i'd bet you're referring control statements within '.each' loop? if so, short answer is: no, return (or break) not terminate loop. way via throwing exception within loop à la: try{ (1..10).each{ n-> println n if (n == 5) throw new exception() } } catch(exception){} but, total abomination. use or while loop instead. see also: returning closure if i'm off mark, perhaps post code exemplifying topic?

jQuery UI datepicker: getDate to prepend the selected date? -

i have ui datepicker, , tried onselect prepend date have chosen inside #viewcalender: $(function() { $('#rangea').daterangepicker({ arrows: true, onclose: function(event) { $('#calenderview').prepend('ok!'); }, onselect: function(){ var day1 = $("#rangea").datepicker('getdate').getdate(); var month1 = $("#rangea").datepicker('getdate').getmonth() + 1; var year1 = $("#rangea").datepicker('getdate').getfullyear(); var fulldate = year1 + "-" + month1 + "-" + day1; $('#calenderview').prepend(fulldate); } }); }); but nothing happens when select date. wrong here? onclose: function(){ var date = $(".range-start").datepicker('getdate'); var dateend = $(".range-

What's the best way to protect proprietary HTML/CSS/JavaScript? -

this question has answer here: what ways prevent people copying source code? 10 answers how encrypt html, css , javascript prevent theft [duplicate] 3 answers i writing robust, scalable, , complex website engine using html, css, , javascript. don't want ripped off, , i'm wondering if there's way protect source being viewed in client. i particularly concerned javascript, , i'm wondering if can protect hosting in seperate files cannot viewed directly. have full control of web server, , can alter settings accomodate. regardless of how obfuscate code, can replicate doing seeing it. might take little longer write scratch, there's not can that. your true options protection involve copyrighting code and, potentially, filing patent. if doing different

actionscript 3 - new GoogleAnalytics Asynchronous tracking and Flash ExternalInterface.call -

i'm implementing google analytics on current project. apparently code has been updated new asynchronous syntiax, old actionscript code doesn't work. http://code.google.com/apis/analytics/docs/tracking/asyncusageguide.html old code externalinterface.call("pagetracker._trackevent", category,action,label, value); can tell me how format above work new asynchronous style of tracking? try this: externalinterface.call("_gaq.push(['_trackevent', category,action, opt_label, opt_value])");

.net - How to maintain unique List Before Saving To Database? - C# -

a simplified scenario: i have list<foo> . foo has 2 properties description ( string ), isfoo ( bool ) e.g: var foos = new list<foo>(); user can "add new foo's" via textboxes, on form submit this: foos.add(new foo { description = txtone.text, isfoo = true }); foos.savetodb(); however, there multiple textboxes , , if example type "foobar" in textbox one, "foobar" in textbox two, do not want show error , not want add them collection. (don't worry reason behind this, simplified scenario). i don't need show ui, when submit form, before persisting database need remove duplicates (or prevent them being added list in first place). what's easiest/best way this? dictionary perhaps? i'm using c#4, linq, .net 4. you can use hashset<foo> . hashsets unique, unordered collections. adding element exists silently nothing. (and return false ) note must override equals , gethashcode on foo c

c# - Exploiting the BackGroundWorker for cross-thread invocation of GUI actions on Winforms controls? -

inspired own experience multithreaded winforms applications, questions such as avoiding woes of invoke/begininvoke in cross-thread winform event handling? avoid calling invoke when control disposed i've come simple pattern, soundness verify. basically i'm creating (and running throughout application's lifetime) bgw sole purpose synchronization of invoke requests. consider: public mainform() { initializecomponent(); initinvocationsyncworker(); } private void initinvocationsyncworker() { invocationsync_worker.runworkerasync(); } private void invocationsync_worker_dowork(object sender, doworkeventargs e) { thread.sleep(timeout.infinite); } void invokeviasyncworker(action guiaction) { invocationsync_worker.reportprogress(0, guiaction); } private void invocationsync_progresschanged(object sender, progresschangedeventargs e) { if (isdisposed) return; //we're in gui thread now, no race condition right? var action = (action) e.use

PHP using define for images -

does php allow use of define function images define("if", '<img src="image.jpg" width="50" height="50" />'); this doesn't define image, defines string html tag image. can php define constants string values? yes.

Trouble with keyboard using FBConnect iPhone SDK -

i'm having persistent though intermittent issue using facebook connect sdk iphone. login works fine, when i'm on fbdialog make post keyboard input fail go textfield on dialog. have dismiss keyboard , tap field (sometimes 3 or 4 times) before input go text field. ideas? thanks, geoff i ended going old version of fb connect sdk. seemed work well, didn't exhibit same problem keyboard. not ideal solution, works now.

Teaching a Neural Net: Bipolar XOR -

i'm trying to teach neural net of 2 inputs, 4 hidden nodes (all in same layer) , 1 output node. binary representation works fine, have problems bipolar. can't figure out why, total error converge same number around 2.xx. sigmoid 2/(1+ exp(-x)) - 1. perhaps i'm sigmoiding in wrong place. example calculate output error should comparing sigmoided output expected value or sigmoided expected value? i following website here: http://galaxy.agh.edu.pl/~vlsi/ai/backp_t_en/backprop.html , use different functions instructed use. when did try implement functions still ran same problem. either way stuck half time @ same number (a different number different implementations). please tell me if have made mistake in code somewhere or if normal (i don't see how be). momentum set 0. common 0 momentum problem? error functions supposed using are: if ui output unit error(i) = (ci - ui ) * f'(si ) if ui hidden unit error(i) = error(output) * weight(i output) *

checkbox - ExtJS: Preventing Checkboxes inheriting the hideLabel attribute of their parent CheckboxGroup -

i trying display checkboxes within checkboxgroups. keep them lined other fields in form, want disable group's fieldlabel , while keeping each checkbox's individual fieldlabel . however, if set hidelabel true checkboxgroup, field labels individual checkboxes disappear also, if explicitly set hidelabel false . is going possible? help. edit: requested, code: config = { xtype: 'checkboxgroup', hidelabel: true, columns: 1, items: [{ fieldlabel: 'item 1', hidelabel: false }, { fieldlabel: 'item 2', hidelabel: false }] }; are defining boxlabel on checkboxes? should define boxlabels on combos , set hidelabel true on checkboxgroup.

html - How come its not dynamcally resize based on content? -

i have page and can see text mini pos pc lenovo pos pc lenovo premium pos pc tablet pc, partner tech 10" touch all-in-one, posiflex 15" fanless all-in-one, lenovo thinkcentre 23" is on image....how can make dynamically dropping picture based on number of li 's tried , cant it the .dd div absolutely positioned, means , it's contents won't interact of other elements on page. solution remove following lines stylesheet: .printer-nav ul li .dd { position:absolute; } .printer-nav ul li { float:left; } there lot of other unnecessary styles can safely removed reduce amount of complexity in stylesheet.

c# - Jquery Message Box After Postback -

i want use this plugin in asp.net application i want show alert or etc after postback. wrote code not work. string = null; = "csscody.alert(&#39;&lt;h1&gt;information alert&lt;/h1&gt;&lt;em&gt;low level&lt;/em&gt;&lt;br/&gt;&lt;p&gt;&copy; rights reserved 2006-2010. &lt;/p&gt;&lt;p&gt; jquery examples site &lt;a href=\\&#39;http://www.csscody.com/\\&#39;&gt;www.csscody.com&lt;/a&gt; &lt;/p&gt;&#39;);return false;"; scriptmanager.registerstartupscript(page, gettype(), "script", a, true); this code works client side : <p> <strong>1.)</strong> <a href="http://www.csscody.com/#" onclick="csscody.alert(&#39;&lt;h1&gt;information alert&lt;/h1&gt;&lt;em&gt;low level&lt;/em&gt;&lt;br/&gt;&lt;p&gt;&copy; rights reserved 2006-2010. &lt;/p&gt;&a

Changing the font size in a PDF document? -

i'd change size of non-embedded font in pdf document not able find pdf's font spec on web. how done? note: doesn't matter if text overflows specified paper result. the pdf spec might not asking for. changing font resource won't change point size of font in question (barring strange alterations). font size set in content streams. change font's size without altering else on page can hard. things in pdf positioned absolutely, relatively... sorta. relative folks regularly save graphic state, stuff, restore blank slate. doing in existing pdf involve serious content stream parsing. non-trivial great deal of pdf experience, and... impractical novice. what's purpose of resizing text? perhaps can come more realistic if know more goal is.

How to make a Regex that specifies elements in any order? -

i want regex matches string contains - @ least 1 brace: } or { , - @ least 1 digit: \d , - @ least 1 instance of either: <p> or </p> but in order, following matched: <p>{123 2}</p> 2<p>}}} {}{}{}<p></p></p>234234}}} and none of these matched: <p>{ alphabet 123 {2} {{{}}} <p>1</p> here's have far, demands 1 of of components: (<\/p>|<p>|\d|\}|\{)+ my problem don't know how make more general without having specify order this: (<\/p>|<p>)+(\d)+(\}|\{)+ or making stupidly long enumerate every possible order... how can "needs @ least 1 of each of these components in order?" thanks. if regex flavor supports lookaheads, can use positive lookahead as: ^(?=.*(\{|\}))(?=.*\d)(?=.*(<p>|<\/p>)).*$ this regex uses positive lookahead assert string atleast 1 of either { or } , @ least 1 digit , atleast 1 of either <p> or &

how to print the exact date cell value in the excel sheet date format like mm/dd/yyyy using apache poi -

i using apache poi 3.5 extracting data excel sheet.i having date cell formatted in mm/dd/yyyy. if print using cell.getdatecellvalue() print date in other format.so, want print date in actual format of excel sheet cell. how it..please guide me way it.... saravanan just call method formatcellvalue(cell) , formatcellvalue(cell, formulaevaluator) in dataformatter class. print value in excel sheet. formatcellvalue(cell, formulaevalator) formula cells...

Accessing office component from iis giving com error, windows 7 -

retrieving com class factory component clsid {000209ff-0000-0000-c000-000000000046} failed due following error: 80070005 access denied. (exception hresult: 0x80070005 (e_accessdenied)). i getting error when trying access word application iis, not getting exception when running visual studio. thanks in advance. my best guess user iis running under don't have rights read registry key. try reading this thread (afaik office not intended called server side code) best adriano

Use of auto start feature of IIS 7.5 with .NET 3.5 WCF service -

i have been reading documentation new features iis 7.5 offers regarding auto start feature of wcf web services. as far have understood, feature available wcf web services developed under .net 4.0, wondering if there workaround or tweak in configuration of .net 3.5 wcf web service take advantage of auto start feature of iis. cannot afford upgrading our web service .net 4.0. thanks in advance help. jose antonio arroba this feature of asp.net 4.0 , not wcf, upgrade necessary. sorry disappoint you. 1 more argument management speed upgrade, because sure it's political , not technical. if technical happily running .net 4.0.

java - How to measure CPU and memory during load test -

we using jmeter in heterogeneous environment , measure cpu , memory while producing heavy load on server our service or web application running. recommend use? there software solution (open source or commercial) available records cpu , memory usage in file or database? thank you! from java perspective, can use jconsole or write own code monitor memory usage. measure cpu , memory consumption of java application javasysmon on github dstat linux , perfmon windows. read more

javascript - Only do an action if content has not changed in 500ms -

currently have $('document').ready(function(){ $('input').keyup(function(){ $('#output').text($(this).text()); }); }); what want is, when keypress registered wait 500ms, if key pressed again within 500ms, wait 500ms keypress. once 500ms has gone by, run $('#output').text($(this).text()); how go managing timeout? you can set , clear timer, this: $(function(){ $('input').keyup(function(){ cleartimeout($.data(this, 'timer')); var input = this; $.data(this, 'timer', settimeout(function() { $('#output').text($(input).text()); }, 500)); }); }); what on keyup sets 500ms delay before running $('#output').text($(input).text()) , if key pressed before happens, cancels timer , starts another...so won't run until 500ms of idle. using $.data() store timer on specific element, generic solution work number of elements on page. as aside, $('document').

asp.net - How can i hide/secure image path? -

how can hide/secure image path in asp.net? don't want user see image path directly. i have googled problem , found following url: http://www.codeproject.com/kb/web-security/imageobfuscation.aspx on page suggests changing image path this: <img id='imagecontrol' src='showimage.axd?path=<% encryptstring("c:\images\img.ext", page) %>' but if user copy image src , paste browser domain name show image. it depends on trying achieve. if you're trying stop people linking images site , best option extend handler mentioned in question return image if request.referrer own site. this means if did try , link image via handler, they'd see broken image/no image, wouldn't able request image directly in browsers, etc. you should include sort of time stamp in encrypted path, , reject requests come long ago - again limit validity of links: <img id='imagecontrol' src='showimage.axd?path=<% en

winforms - Event handling in C# -

i trying design windows form application. have written event handler button object handle button.click event. worked fine until wrote event handler button.mousedown capture both left , right mouse clicks, in case code worked 1 mouse.buttondown. understand can make previous code work copying code button.click section in mousebuttondown responds left click. question there event handlers take precedence on others , if yes, in order? thing intrigues me there more event handlers ambiguous? here got detailed list of mouse events , in windows forms.

C# to C++ static class -

i porting code c# c++. not sure how create class static class in c#. // in c# public static temperatureclass{ private static int offset = 50; private static context context; public static calculatetemperature(){ //use a; //use context; } public static context con{ set{ context = value; } } } int main() { context con1; temperatureclass.con = con1; //con1 temperatureclass.calculatetemperature(); } basically temperatureclass utility class perform calculation no instances created. have few questions: should c++ version of calculatetemperature remain static? how initialize int offset in c++ if keep static because used static calculatetempearture function? should keep con accessor static in c++ need set context? or more generally, way of implementing utility class in c++? the c++ version class containing static members the offset variable being of integral type, can initialized same way in c# if declared static (but might w

asp.net - Registering a .NET DLL for COM visibility in ASP Classic -

we're trying write couple of applications. 1 asp.net site uses .net assembly xxx.elements.dll, provides utility functions. the other, classic asp site, should use same dll in order use same utility functions. (it used encrypting data between 2 sites). despite many attemps , googling, cannot working. we have: applied comvisibility assembly.info , ensured there guid: [assembly: comvisible(true)] [assembly: guid("ab96fbc3-aa39-4fb6-8628-13778445e503")] we made sure our type ticks boxes on type visibility ensuring has default constructor, comvisible , has guid. we've created simplistic method testing: namespace xxx.elements { [guidattribute("d3be2c7d-7550-4da1-8f61-6871e193242f")] [comvisible(true)] public class urlutility : iurlutility { public urlutility() { } public string test() { return "hello"; } } } using interface: [guidattribute("d3be

php - How to parse SOAP XML? -

soap xml: <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <paymentnotification xmlns="http://apilistener.envoyservices.com"> <payment> <uniquereference>esdeur11039872</uniquereference> <epacsreference>74348dc0-cbf0-df11-b725-001ec9e61285</epacsreference> <postingdate>2010-11-15t15:19:45</postingdate> <bankcurrency>eur</bankcurrency> <bankamount>1.00</bankamount> <appliedcurrency>eur</appliedcurrency> <appliedamount>1.00</appliedamount> <countrycode>es</countrycode> <bankinformation>sean wood</bankinformation> <merchantrefe

c# - Fill Identity Of WinForms Into Textboxes -

i have 3 forms below: form1 form2 form3 the form1 , form3 communicating form2. want if form1 visited form2 form1 should leave it’s identity form2’s textbox1 . if form3 visited form2 form3 should leave it’s identity form2’s textbox2. is possible?. here visted means below. by form1 form2 f2= new form2(); f2.show(); by form3 form2 f2= new form2(); f2.show(); and identity "form1" , "form3" the best thing overload show method each of forms accept "previous form" parameter serve reference caller (you either form object, properties access, or string ). then, wherever show second form existing form, pass information existing form show method second form. second form's show method take care of updating textbox name of form displayed it. for example, each form contain overloaded show method: public void show(form previousform) { //set textbox on form contain name of calling form mytextbox.text = previous

database - Joomla! Quickstart package manual -

i made custom template , still struggling significant problem, how make quickstart? all information found, doesn't helped me, including ( http://www.youtube.com/watch?v=nqg6z8nhybu ), briefly: copy designed database delete configuration.php copied root copy default joomla! installation folder copied root export sql.file original database copied installation/sql/msql rename sample_data.sql upload whole content server install usual joomla! site all time getting: error: xml response returned server invalid. in reason have skip message) when select install sample data in joomla! pack installation. template not appears deafult , places of module postions these messages e.g: warning: db reports: db function failed error number 1146 table 'masolat.jos_sobi2_language' doesn't exist sql=select * jos_sobi2_language order sobi2lang in c:\wamp\www\masolat\components\com_sobi2\config.class.php on line 2534 ...and on..... so prorbaly whole process i've

Why doesn't a LISP defun require a quote before its parameter argument? -

take function: (defun sum-greater (x y z) (> (+ x y) z)) it's understanding in lisp first element in list represents function performed on subsequent atoms/lists. why doesn't lisp treat x in (x y z) function performed on y , z . not desirable behavior, expected behavior. presumably function defines defun somehow overrides standard lisp evaluation of list? if so, detail this? thanks iirc in common lisp @ least defun macro ( hyperspec ), meaning may define evaluation strategy whatsoever arguments.

Checking out svn repository without .svn files -

i have svn repository on dedicated server (centos 5.5) @ /var/svn/myrepository. want copy files production folder /var/www/mywebapp. as far understanding svn use svn export on local project folder has sourcecode , additional .svn files. on dedicated server have repository. how can sourcecodefiles, without .svn files out of repository /var/www/myweapp folder? no. don't need working copy svn export . just do: $ cd /var/www/mywebapp $ svn export url you should clean copy of head /var/www/mywebapp .

iis - Can I detect if SSL/https is enabled for an ASP.NET website from within the site's code? -

i'm working on cms can run either or without https enabled on webserver. i'd able detect whether https enabled or not, can act accordingly (for example, display https-related options administrator, , redirect https administrator logins). i'm not looking request.issecureconnection because tells me if current request via https. want tell me whether current bindings site in iis include binding https @ same domain current request on. so, example, if current request http://example.com/ , not secure, want know whether https://example.com/ work can (for example) redirect user if log in administrator. i've had no luck looking in system.web.configuration tell me bindings of current site, though. my current workaround require administrator set appsetting in web.config if https enabled, i'd prefer if make automatic. having set same thing twice - once in iis , once in web.config - confusing. the simplest way make https request site site , if succeeds know h