Posts

Showing posts from June, 2014

java - Don't understand some behaviour of @async -

i'm having difficulty understanding aspect of @async annotation, , possibly workings of threads , threadpooling whole. when set in spring configuration file: <task:executor id="whifexecutor" pool-size="10"/> <task:annotation-driven executor="whifexecutor" /> wouldn't mean 10 threads started? yet when run function has @async 1000 times continues rest of code after call (a simple message shown in console show number of times function has been called). after while pooled functions start return values, strangely enough 1 pool , 10 distinct threads. going on here? how can call 1000 functions yet use 10 threads? maybe put of them on stack before starting threads? tried reading documentation on couldn't find phenomenon. also, there way make wait threads start running don't make call couple thousand functions @ once? does maybe put of them on stack before starting threads? not stack, queue. the executor alloca

visual studio 2008 - How to profile unit tests with MSTest using dotTrace 4.0, ReSharper 5.1 and VS2008? -

i trying profile single unit test (the test passes) using dottrace 4.0. seems dottrace profiles resharper's test runner instead of profiling test itself. i find answer jetbrains dev team regarding issue dottrace 3.1: seems mstest creates new process running tests, , known limitation of dottrace 3.1 not handle behaviour. this behaviour of mstest can inhibited using /noisolation option in command line, cannot done within ide. this page here: http://confluence.jetbrains.net/display/netprof/profiling+unit+tests+with+dottrace+4.0 tells me using dottrace 4.0 , resharper 5.0, should work out-of-the box. which not. so tried run test standalone ui of dottrace explained in above link, trick limitations: the described method runs tests within specified dll. arguments used launch test maybe tuned run 1 specific test, seems lot of trouble running 1 tiny ut. it seems source code not attached session, takes more time correct. i went through vs options, resharper options, .te

java - What is the difference between getDefaultInstance() and getInstance() in Session class? -

what difference between session.getdefaultinstance(props, authenticator) , getinstance(props, authenticator) ? in general, when choose 1 on other? i read java doc on getdefaultinstance(props, authenticator) , still couldn't able make out difference distinctly/clearly. hope experts can me in understanding better. update: actual reason triggered ask question is: we've used session.getdefaultinstance() method in places within our web-based application. sometimes, throws java.lang.securityexception: access default session denied , on quick googling, suggested use session.getinstance() method instead. hence, when 1 choose 1 on other? if read documentation, see that getdefaultinstance default session object. if default has not yet been setup, new session object created , installed default. therefore, if 1 not exist, call getinstance() getinstance new session object. so, new session object created, regardless of whether 1 exists.

c - Are the gcc memory hooks sometimes bypassed? -

for c++ arm application need trace memory allocations. using gcc memory hooks. printing allocations , deallocations, see code below. however, malloc 's , free 's don't add up. see free on memory block pass through didn't malloc hook before. or memory freed twice. of course bug in code,although don't segfault. see malloc returns pointer has returned before , there has been no free in meantime (at least free hook wasn't called). so guess malloc 's , free' s not passed through hooks. note when trace c++ allocations things add nicely. does have ideas? #include <stdlib.h> #include <stdio.h> #include <pthread.h> #include <new> #include <unistd.h> #include <string.h> #include <malloc.h> pthread_mutex_t lock = pthread_recursive_mutex_initializer_np; static void push_memhooks(); static void pop_memhooks(); static void *malloc_hook(size_t size, const void *ret) { pthread_mutex_lock(&lock); p

c++ - how to resolve th "C4653" warning in vs2010? -

i converting c++ project 2008 2010, warning level 4 "warning c4653: compiler option 'optimizations (one or more of /oawp[y])' inconsistent precompiled header; current command-line option ignored" warning has been thrown. if there no special .cpp files in project require special optimization options files should have same options. reset options set on specific files projets defaults, , change options whole project. if need .cpp files have special optimization options turn off precompiled header files. situation not common in normal projects. edit: set project properties: right-click on project (not on solution) in solution explorer > select properties. can same thing single .cpp files too: right-click on .cpp file in solution explorer > properties. can several files well, first select them (ctrl+click, or shift+click, files in win explorer), properties. don't have close properties window, rather select other item while window open. so, rig

Changing the View Engine in Asp.NET MVC -

i trying learn asp.net mvc porting current app written in asp.net webforms mvc. starters, planning use default view engine (webformsviewengine) tutorials/examples , book have use default. however, know sure not want use webformviewengine in future , once have grasp of mvc, switch different viewengine (spark seems interesting) would simple change or take lot of effort in terms of coding new views? want know involve more effort? learning alternate viewengine or switching later? ok - firstly you've got decent sized investment in webforms i'm assuming, , virtue of that, you'll have fair amount of user controls on existing forms etc. i'm sure know in going work in process, , has nothing view engine choose because webforms mvc view engine doesn't support user controls directly. part of work still need done regardless... secondly, looking view engine can take most of other view built in logic , code (i.e not user controls), , mean stuff between bee-sti

spam prevention - Is it still worth obfuscating email-addresses to prevent harvesting? -

i wondering, worth trouble implement email-obfuscation techniques in order prevent emails being harvested these days? initial thought no might wrong. (possibly inaccurate) arguments: spam filtering , detection superior these days (when looking @ gmail spambox on 90% of mail receive spam none ends in inbox). safe assume same other email services? most techniques aren't 100% proof against advanced harvesting scripts effort in vain. you might argue it's no trouble obfuscate e-mail address notice lot of our clients enter e-mail addresses through our cms requires me filter out e-mail adresses text , replace obfuscated version little more trouble. i'd hear other people wondering same or proving me wrong :) if it's your address, can whatever see fit. if it's not address, might want ask owners. (or check dns see if it's hosted on google apps) as described here , possible block advanced harvesters. (unless target site , work script)

ssl - Ruby Mechanize crashes during authentication redirection; sslv3 alert illegal parameter -

This summary is not available. Please click here to view the post.

python - Creating an empty list to have data assigned afterwards -

lets want create list of names listofnames = [] then have while loop such as count = 0 while listofnames[count] < 10: namelist[count] = raw_input("enter name: ") count += 1 python says list index out of range, list index should @ 0, correct? how add list each time while loop ran? i'm assuming wrong list assignment. an empty list doesn't have index yet, it's empty list! if want fill it, have : while count < 10: namelist.append(raw_input("enter name: ")) count += 1 this way, condition evaluated , append method, able add new items in list. there few advanced tricks easily, considering level, think it's better understand code before moving on.

c# resizing controls in splitcontainer -

i have splitcontainer 2 panels. in first panel treeview , datagridview in other. when move splitter, able see more of treeview, datagridview gets 'pushed' out of wind you need set dock property of control in each pane full . if have multiple controls in pane, you'll need set dock or anchor properties achieve behavior want.

unix - Shell read from cat line by line into array -

i have command outputs that: lucid32 lucid64 i need read array. in particular case need equivalent of: boxes =(lucid32 lucid64) i tried read that: boxes=(`mycommand list | tr '\n' ' '`) but returns $'\033'[0klucid how can fix that? updated: it looks didn't work because command outputs bunch of junk: \r\e[0klucid32\n\r\e[0klucid64\n what shell? don't support arrays. the "junk" see terminal control codes cursor movement or text coloring, etc. it's code clear end of line. what command outputting characters? commands automatically disable codes when output going somewhere other tty. others have command-line options turn off. there utilities strip codes you.

xml - Initial number part or integer portion of a string in xsl -

by using xsl template, can 1 tell me way first number portion of string field for example: '12' -> should result in -> 12 '5 asdf' -> should result in -> 5 '34sdf56' -> should result in -> 34 here one-liner xpath solution : :) <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="text"/> <xsl:template match="text()"> <xsl:variable name="vs" select="concat(.,'z')"/> <xsl:value-of select= "substring-before(translate($vs,translate($vs,'0123456789',''),'z'),'z')"/> <xsl:text>&#xa;</xsl:text> </xsl:template> </xsl:stylesheet> when transformation applied on following xml document : <t> <x>12</x> <x>5 asdf</x> <x>34sdf56</x> </t> the wante

How to POST data from a Android Java button then load it in a web browser? -

possible duplicate: how can open android browser specified post parameters? i have set button link google checkout, however, need post whole lot of required data (not get) can't use usual intent method. //open browser uri u = uri.parse(uri.tostring()); intent = new intent(intent.action_view, u); startactivity(i); how post data url pressing button , load result web browser? in case google checkout webpage. please see following link details android webview post . have use webview in layout, submit details load results webview. another maybe of use - although not webview: android json httpclient send data php server httpresponse

asp.net - Dropdown in .net usercontrol not maintaining state -

this fundamental , stupid i've missed, various workarounds causing me such huge headaches really, need understand basic problem here in order find best solution. i have usercontrol contains drop-down list. <asp:dropdownlist id="ddlorderstatus" autopostback="true" runat="server" cssclass="textbox"> <asp:listitem value="8">pending</asp:listitem> <asp:listitem value="9">on hold</asp:listitem> <asp:listitem value="11">complete</asp:listitem> <asp:listitem value="12">cancelled</asp:listitem> </asp:dropdownlist> it nothing in page_load event. this in turn contained in page which, in it's page_load event databinding on repeater controls on page doesn't touch control containing ddl. there no ajax on page. the dropdownlist - - set autopostback = true. postback code looks this: private sub ddlorderstatus_

asp.net - WCF Error - unexpected response: (400) Bad Request -

i'm having trouble finding answer problem. similar posts lean seem fixed adjusting of maximum size settings in web.config file. however, none of suggestions have fixed issue. to give little more background, i'm porting asmx web service, wcf web service hosted in windows azure. problem came during testing. if pass small number of transactions webservice in single call, tends work fine. error come though when transaction size gets around 50-60 (transactions). serialized xml, file size around 300k, it's nothing insanely large. tend lean towards size issue. also, turning on wcf tracing, found following exception occuring: system.servicemodel.protocolexception: maximum message size quota incoming messages (65536) has been exceeded. increase quota, use maxreceivedmessagesize property on appropriate binding element. at system.servicemodel.channels.httpinput.throwhttpprotocolexception(string message, httpstatuscode statuscode, string statusdescription)

MSTest unit tests and database access without touching the actual database -

in code interact database (not part of solution file). database owned separate team of dba's, , code developers write allowed access stored procs. have full view of database's procs, tables, , columns (it's definition). code dependent upon data, write unit tests dumb-up data in tables (and tear down/remove rows after unit test done), can run unit tests exercise code interacts db. of code in test file (especially in classinitialize() , classcleanup() functions). i've been given amount of grief new coworkers call style of unit tests "destructive" because read/write dev database inserting , removing rows. @ time code unit tests, database design not stable, many times can find issues in stored proc code before unleash qa department on our programs (saves resources). tell me there's way clone database memory @ time mstest unit tests run, don't know how it. i've researched around web , cannot find way coworkers need me do. can tell me sure whet

printf - MATLAB: Printing comparative columns for elements from different vectors -

i´m trying printing comparative columns compare elements same index of 2 or 3 differents vector. illustrate question next example >> = [5.47758 7.46578 3.45323] = 5.4776 7.4658 3.4532 >> b = [5.65432 4.45678 2.34789] b = 5.6543 4.4568 2.3479 now if write >> sprintf('%.2f %.2f\n',a, b) i following response matlab ans = 5.48 7.47 3.45 5.65 4.46 2.35` but way see presentation of values this ans = 5.48 5.65 7.47 4.46 3.45 2.35 how can use function sprintf (or other function or way) above representation? thank you. you can fix problem concatenating a , b 1 2-by-3 matrix input argument: >> sprintf('%.2f %.2f\n',[a; b]) ans = 5.48 5.65 7.47 4.46 3.45 2.35 the sprintf function works reusing formatting string on , on traverses (in column order) elements of each of input arguments in order entered . that's why in example values of a printed, then values of b , instead of interleaving values of

osx - Link scrolling of two tables -

how can link (synchronize) scrolling of 2 nstableviews (or underlying nsscrollviews) in cocoa appkit? i tried setting scroller of 1 scroller of other, results in second table losing control of scroller (i.e. no longer appears beside table). an earlier question addressed uikit, appkit nsscroller not appear provide equivalent interface. any appreciated! see scrollview programming guide's section on synchronizing scroll views .

PHP - Check if a file exists in a folder -

i wanna check if there image on folder server. have little function in php not working , don't know why: $path = 'folder/'.$id; function check($path) { if ($handle = opendir($path)) { $array = array(); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && count > 2) { echo "folder not empty"; } else { echo "folder empty"; } } } closedir($handle); } any appreciated, in advance. it not work because count coming nowhere. try instead: $path = 'folder/'.$id; function check($path) { $files = glob($path.'/*'); echo empty($files) ? "$path empty" : "$path not empty"; }

IntelliJ Grails app installed plugin not visible -

got small question ruins day. i've got grails application want import intellij. problem intellij can't find springsecurity plugin, , doesn't see @secured annotation. plugin is present in "tools->grails plugins" window. i'm using idea 9.0 , grails 1.3.5. i try idea x , lot has happened in field since 9.0. i'm using idea x build 98.311, , i'm able see springsecurity plugin , @secured annotation

math - Programming mathemathics: how to expand a function -

Image
lets have math function defined recursively. so: t(1)(x) = 1 t(n)(x) = 2x*t(n-1)(x)-1 so: t(1)(x) = 1 t(2)(x) = 2x*1-1 = 2x-1 t(3)(x) = 2x*(2x-1)-1 = 4x^2 - 2x - 1 /* , on... */ basically, know how write program count t(15)(x) if x given. thats not problem. wonder, - how write program give me polynomial t(10)(x) (one looking like: 16x^4 + 3x^3 ... ). in nutshell: how can recursively count math expression, using x variable (not set). any appreciated, paul based upon comments, believe there 4 options, in order of complexity. first, implement explicit formula given polynomial looking for, if exist. in case of chebyshev polynomials, explicit formula (3 rd sum top) fitting needs exist. if, however, looking more general, i.e. more 1 type of polynomial, create explicit list of polynomials absurd order , string replace using user supplied variable name. in systems, won't take lot of memory. thirdly, if wish remain general , still recursively produce

html - CSS dropdown navigation -

i have css dropdown menu. want homepage start on left side of page, not on center. herein style sheet , div tags dropdown navigation bar: ul, li, html, { margin:0; padding: 0; } body { text-align: center; margin: 0 auto; padding: 0; font: 65% arial, sans-serif; } li { list-style-type: none; } { text-decoration: none; color: #034af3; } ul#nav { width: 22.5em; height:2.5em; margin: 2em auto 0; font-size: 1.5em; } ul#nav li { position: relative; float: left; width: 5em; height: 2em; line-height: 2em; background-color: #465c71; display: block; padding: 4px 0px; border-right: 1px #4e667d solid; color: #dde4ec; } ul#nav li.noborder { border-right: none; } ul#nav li:hover { background-color: silver; } ul#nav li { display: block; float: left; width: 100%; } ul#nav li ul { display: none; } ul#nav li:hover ul { display: inline; float: left;

sql - Firebird - select rows with date field having values within this week -

the title pretty explains it, trying select rows table date field has values within current week. want rows current week's monday until current day. example: id adate --------------- 1 11-11-2010 2 12-11-2010 3 13-11-2010 4 14-11-2010 5 15-11-2010 the rows want in case are: id adate --------------- 4 14-11-2010 //this week's monday 5 15-11-2010 //till today any please? this work on week sunday saturday. shall adapt if want weeks monday sunday: select * mytable adate between cast('now' date) - extract(weekday cast('now' date)) --prev sunday , cast('now' date) - extract(weekday cast('now' date)) + 6 --next saturday ;

php - How to override var_export in PHPUnit? -

in phpunit, there times when assertion fails, , when reporting assertion, phpunit automatically calls var_export() on variable. let's called chunk of code: $foo = new stdclass(); $foo->bar = 123; $foo->baz = "hi there"; $this->asserttrue($foo); the output of is: failed asserting stdclass object ( [bar] => 123 [baz] => hi there ) true. if variable exception object, can cause unit test print out megabytes of text when walking object tree, including stack traces , other info. phpunit dies 'cause runs out of memory trying output all. i know 1 solution add additional test, checking if variable object before doing asserttrue, or assertequals. team has lot of unit tests. so wondering if there's way override phpunit's default behavior of calling var_export on variable when generating error report. thanks in advance. after digging around didn't find flag or achieve tried work backwards code: the code in question

jquery - How to make the Select Box Value selected to specific value "ABC" when new row is being added to table -

i have new row added table buttton click , have select element each row , name "code[]".i have make value "abc" selected when new row being added table alert($('#mytabl tr:last :input').find('input[name="code[]"]').children($('option[value=abc]')).attr('selected','selected')); above statement no effect being done it seems selector overly complicated, , not selecting <select> element, looking <input> inside :input currently, try instead: $('#mytabl tr:last select[name="code[]"]').val('abc');

bash - MySQL statistics output -

i have sql file temporary tables creation, load data infile, selects , updates. i know time spent on each statement, through cli on shell. if file contains: select "step 1" ''; select col1, col2 t1 order col3; and run: mysql -h host db < file the output is: step 1 1 row in set (0.00 sec) col1 col2 20073 0724081 20073 0724685 20073 0726347 20073 0726932 20073 0733623 5 rows in set (0.00 sec) tne 1 row in set (0.00 sec) , 5 rows in set (0.00 sec) information i'm looking for, not un*x time process. i've tryied different mysql options, --show-warnings --i-am-a-dummy no avail. there way requested info? thanks, edit: added missing time first select. try mysql profiler - http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html

mysql - how do I use cygwin to rsync files? -

how do that? instructions :) well, download cygwin, install packages. download unison. c:\cygwin\bin\unison-2.32.exe -sshcmd=c:\cygwin\bin\ssh.exe /cygdrive/c/users/yourlogin/desktop/somefolder/ ssh://server.domain.com///dir1/dir2/ -ignore 'path */someotherdir' -ignore 'name somefile' -owner -group -terse -batch

Temporarily Lock or Disable iphone home button -

i know iphone home button extremely crucial functioning of iphone. have idea need application running , home button disabled. tried googling, haven't been able find solution. temporary or timed locking (lock 5/10 mins.) do. the app. should work on non-jailbroken phones, hence going around apple won't work. appreciate ideas. note, 2014 onwards: clear, this built in ios... click accessibility, click "guided access" . conrats "inventing" it, planetunknonw! :-) the answer below of historic value... for record, it's silly people saying "why want this?" it's great idea example apps small children (which indeed large market on iphone). if you've ever marketed app small children, you'll know instantly parents write in abusing because "did not stop stupid home button working, child turns off game , makes phone calls" to have reply it's of course not possible because of way iphone

asp.net mvc - Using MVC2 as RESTful service deciding upon URL paths -

i creating application client-side functionality calls various services return results/content etc. @ moment, have 3 controllers, actions working fine. i'm trying decide how manage list content, i.e. in 2 instances, there json lists of drop-down data outlined below: in 1 page, there dropdown needs call list of e.g. car makes. once selected make, call return 2 additional arrays of e.g. car products etc. in page, there 1 call return 2 arrays of products. common theme is list management. at moment, have controllers setup as: existingmember switcher newmember switcher requires list of carmakes, , associated call products. existingmember requires list of products. what best way setup controller/action/id? i have toyed various options: /switcher/carmakes /switcher/carproducts/7 /existingmember/products also modifying routes brevity: /{controller}/list/{action}/{id} /switcher/list/carmakes /switcher/list/carproducts/7 or moving dedicated list controller /l

iphone - Dismissing keyboard from UISearchBar when the X button is tapped -

i'm using uisearchbar (but not searchdisplaycontroller that's typically used in conjunction) , i'd dismiss keyboard when hit 'x' button. i've followed tomswift's suggestion on getting called when 'x' tapped , works great. resigning first responder text field , invoking in uisearchbar instance, both resignfirstresponder , won't make keyboard go away. is there way rid of keyboard when user has tapped x button? here's did 'clear' notify: - (void)viewdidload: { (uiview* v in searchbar.subviews) { if ( [v iskindofclass: [uitextfield class]] ) { uitextfield *tf = (uitextfield *)v; tf.delegate = self; break; } } } then have class setup implement both uisearchbardelegate , uitextfielddelegate. having class serve textfield delegate allows me call: - (bool)textfieldshouldclear:(uitextfield *)textfield { [textfield resignfirstresponder]; [sel

graphics - OpenGL: 2D Vertex coordinates to 2D viewing coordinates? -

i'm implementing rasterizer class project, , im stuck on method/how should convert vertex coordinates viewing pane coordinates. i'm given list of verticies of 2d coordinates triangle, like 0 0 1 2 0 1 0 1 1 and im drawing in viewing pane (using opengl , glut) of size 400x400 pixels, example. my question how decide in viewing pane put these verticies, assuming 1) want coordinate's centered around 0,0 @ center of screen 2) want fill of screen (lets example, screen maximum x coordinate + 1 lengths wide, etc) 3) have , of opengl's , glut's standard library functions @ disposal. thanks! http://www.opengl.org/sdk/docs/man/xhtml/glortho.xml to center around 0 use symmetric left/right , bottom/top. beware near/far arbitrary chosen (in examples) -1..+1 might problem triangles @ z=1. if care aspect ratio make sure right-left , bottom-top proportional window's width/height.

MySql Connector (python) and SQLAlchemy Unicode problem -

i using mysql connector (https://launchpad.net/myconnpy) sqlalchemy and, though table utf8, string columns returned normal strings not unicode. documentation doesn't list specific parameters utf8/unicode support mysql connector driver borrowed mysqldb driver. here connect string: mysql+mysqlconnector://user:pass@myserver.com/mydbname?charset=utf8&use_unicode=0 i'd prefer keep using all-python mysql driver. suggestions? to work unicode python objects should set optional parameter convert_unicode true when specifying character column type: users = table('users', metadata, column('id', integer, primary_key=true) column('name', string(100, convert_unicode=true)) you use unicode type. check documentation details: string , unicode .

android - What is the command to return to your main screen in an app? -

how have app return 'home' screen when user on different class , click back/return button on phone? right now, when access different class , hit button, goes home screen on droid rather home screen on app - how go home screen on app? thanks! use onbackpressed() method of activity class. make conditions : public void onbackpressed(){ if(conditon) { detailinfolist.setvisibility(view.visible);//or want show } }

Dropdownlist in ASP.net C# -

i have 2 dropdownlist's.dropdownlist2(not bound datasource) , dropdownlist3(bound datasource) on change on input in 1 dropdownlist content in other dropdownlist should change. had used logic as. autopostback enabled both controls. protected void dropdownlist2_selectedindexchanged(object sender, eventargs e) { if (dropdownlist2.selecteditem.text == "stamp") { dropdownlist3.items.remove(dropdownlist3.items.findbytext("sta")); dropdownlist3.items.remove(dropdownlist3.items.findbytext("stm")); } <asp:dropdownlist id="dropdownlist3" runat="server" datasourceid="sqldatasource1" datatextfield="skey" datavaluefield="casecode" appenddatabounditems="true" autopostback="true"> <asp:listitem selected="true" value="s">select</asp:listitem> </asp

ffmpeg - Is there a MS-DRM client library for linux? -

i have used libraries (libavformat , libavcodec) decode mms streaming urls. of them protected drm . when try decode them, library warn in libavformat/asfdec.c: if (!s->keylen) { if (!guidcmp(&g, &ff_asf_content_encryption)) { av_log(s, av_log_warning, "drm protected stream detected, decoding fail!\n"); } else if (!guidcmp(&g, &ff_asf_ext_content_encryption)) { av_log(s, av_log_warning, "ext drm protected stream detected, decoding fail!\n"); } else if (!guidcmp(&g, &ff_asf_digital_signature)) { av_log(s, av_log_warning, "digital signature detected, decoding fail!\n"); } } the variable s struct avformatcontext. question key? seems decode drm key. i asf spec, , try patch asfdec.c . now, have acquiring license url , key id. problem can rewrite 'is there ms-drm client library linux?' (old: how decode mms streaming url drm ffmpeg?) is possible use license url , key id cont

jquery - Scroll to item in overflow:auto div -

i have overflow:auto div specific max-height. div contains many items list. try make scroll script seem missing something. here code: http://jsfiddle.net/ux5cd/6/ try resetting div's scrolltop 0 before read chosen item's offset

Drupal: How to automatically send (cck) node content + file attachment via email -

i still quite new drupal , have limited programming skills. i trying build job board site using cck + views. have created 2 related content types: "job post" , "job application" - both related using nodereference field. the job application node has 4 fields: id of job post person applying, email of applicant, cover letter (body field) , attached cv (cck field allows users attach/upload document). question: once job application created content of node (including attached file) automatically sent via email person posted job (destination email address in cck field in related "job post" node). thus requirements are: (1) automtically "transfer" destination email address "job post" content type "job application" content type; , (2) automatically send "job application" node contents + file attachment destination email. is there module can me achieve this? thank support. my email address is: wedge.paul@gmai

r - inverse of 'predict' function -

using predict() 1 can obtain predicted value of dependent variable ( y ) value of independent variable ( x ) given model. there function predicts x given y ? for example: kalythos <- data.frame(x = c(20,35,45,55,70), n = rep(50,5), y = c(6,17,26,37,44)) kalythos$ymat <- cbind(kalythos$y, kalythos$n - kalythos$y) model <- glm(ymat ~ x, family = binomial, data = kalythos) if want know predicted value of model x=50 : predict(model, data.frame(x=50), type = "response") i want know x makes y=30 , example. saw previous answer deleted. in case, given n=50 , model binomial, calculate x given y using: f <- function (y,m) { (logit(y/50) - coef(m)[["(intercept)"]]) / coef(m)[["x"]] } > f(30,model) [1] 48.59833 but when doing so, better consult statistician show how calculate inverse prediction interval. , please, take vitoshka's considerations account.

licensing - How to detect a system date roll back? -

how detect when user has rolled system date? usage situation prevent circumventing licensing , program need detect roll made happened when not running. well, can use embedded database in program encrypted system date gets inserted in every once in while. if see "newer" date before previous date, can see changed system date. it's idea.

iphone - how to add normal text to settings bundle -

i've 3 groups created in iphone settings bundle root.plist file. showing fine. but every group, want add description. follows: groupname description settings in group. is possible. how add description? if description color different identify group name , settings in group, good. you can add text @ bottom of groups, commonly used hint preferences in group. add new item group (yes!, additionally default title , type keys). replace text under key column reads "new item" footertext . under type column set type new key string . write whatever want on field under value column new key. and... voilà! next time build , launch app go settings , app's preferences see text under group placed it.

java - How can I clean a gwt CellList? -

how can clean gwt celllist ? assuming "clean" mean "clear". believe, can done providing empty list replaceallchildren() method.

how to show android Keyboard automatically while Screen Opens? -

can tell me how show soft input keyboard while activity opens. in normal case keyboard pops when tap inside edit text want open automatically when screen loads. here xml layout file and here main.xml layout file <textview android:id="@+id/textview01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="this sample app of android" android:textcolor="#000000" android:textsize="20dip"> </textview> <edittext android:id="@+id/edittext01" android:layout_height="wrap_content" android:layout_width="fill_parent"></edittext> <button android:id="@+id/button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="say hello"></button> check android:windowsoftinputmode attribute activity eleme

css - External font doesn't load in Android 2.1 -

i'm using external truetype font in embedded html resource. font located in assets, @ same level html resource. the font loaded css: @font-face { font-family: myexternalfont; src: url('myexternalfont.ttf'); } body { font-family:myexternalfont; } and html resource loaded follows: webview w = (webview) findviewbyid(r.id.webview); w.loadurl("file:///android_asset/index.htm"); this works fine in android 1.5 , android 1.6 , android 2.2 . doesn't work in android 2.1 . however, when load font , use in textview , works on android versions. this: final typeface t = typeface.createfromasset(getcontext().getassets(), "myexternalfont.ttf"); textview.settypeface(t); what might problem? (unfortunately can't upload font because it's paid font) that's known bug android 2.0 , 2.1. can't use external fonts in webview on platforms, sorry.

Catch an Error on html with php -

currently i'm developing website in class in university. i'm using php , mysql. i have signup page when submitted goes auxiliary php page goes through number of conditions , i'f form failed in 1 of conditions wanted return signup page appeared line detailing error. i wanted know if need use php or php+javascript. thanks in advance. to points use both! add jquery validate plugin form. display real time errors user. can't totally rely on method though because if user switches off js validation wornt work ;) in php run through validation checks , if 1 fails use header (as phpnutt mention above) wouldn't recommend passing error message in url can unprofessional. instead number, check number on signup page. if it's there then display error. // auxiliary php page if (conditon met) { } else { header("location: /signup_page.php?error=1"); exit; } // signup page if(isset($_get['error']) && $_get['er

winforms - c# resize datagridview columns to fit control -

i have datagridview docked , anchored panel on winform. when resize form, datagridview resizes expected, columns not resize fit datagridview. instead, left background colour of datagridview. how can columns grow control? thanks. private void datagrid_sizechanged(object sender, eventargs e) { resizegridcolumns(); } private void resizegridcolumns() { //get sum of non-resizable columns width int diffwidth = 0; foreach (datagridviewcolumn col in this.datagrid.columns) { if (col.resizable == datagridviewtristate.false && col.visible) diffwidth += col.width; } //calculate available width int totalresizablewith = this.datagrid.width - diffwidth; //resize column width based on previous proportions this.datagrid.columnwidthchanged -= new datagridviewcolumneventhandler(datagrid_columnwidthchanged); (int = 0; < this.colwidthraport.count; i++) { try { if (this.datagrid.columns[i].re

asp.net mvc 2 - NHibernate ISet of Value Objects error in production NULL values in DELETE Statement on fields that have value -

i have error in production built 2 web servers against common sql-server database. i have 1 root entity iset of value objects. the mapping looks this. mapping.hasmany(x => x.dayinfos) .access.camelcasefield(prefix.underscore) .table("weeklymaildayinfo") .component(c => { c.map(x => x.dayofweek); c.map(x => x.imagetext); c.map(x => x.imageurl); }); when user changes imageurl code removes , adds new dayinfo iset. the problem see in production logfiles generated nhibernate. log indicates delete weeklymaildayinfo weeklymailfk = @p0 , dayofweek = @p1 , imagetext = @p2 , imageurl = @p3;@p0 = 3003, @p1 = 'tuesday', @p2 = null, @p3 = null note 2 nulls though there value in imageurl , imagetext already. i'm unable reproduce in unittest or in development

excel - How to copy values only using Sheets(Array()).Copy -

i have following code copies worksheets new workbook. copies sheets formulae etc. after loop though each worksheet in resultant workbook copy , paste values. there way create worksheets values first time round? sheets(array("eq spot moves valuation", _ "zari swap prll", _ "zari bond prll", _ "zar swap pdh", _ "zar bond pdh", _ "grid report eq", _ "valuations", _ "zar bond prll pdh", _ "grid report fx")).copy ' ...snip each ws in exposureoutputwb.sheets ' copy , past values on each sheet next ws there difference copy method if applied worksheets or ranges. ranges can use pastespecial [format] later on, must copy ranges beginning, in sub copyallasvalues() dim wo workbook, worksheet ' old dim wn workbook, sn wor

iphone - UIALertView customization -

i developing iphone application, in want use customized alert sheet. customization required since want set image alert-sheet buttons, change size of these button etc. i have done following things: created uiview customized controls wanted. created , displayed uialertview in delegate method of uialertview (uialertviewdelegate) i.e - (void)willpresentalertview:(uialertview *)alertview i removing subviews of uialertview , adding customized view subview. everything works fine till here. since have used customized buttons, need remove alert sheet explicitly in action method of button calling dismisswithclickedbuttonindex:animated: on uialertview. though uialertview gets dismissed, takes around 0.5 second dismissed. can me out solve problem of delay in dismissing or other way of customization of alert view buttons. thanks , regards, deepa i worked passing yes dismisswithclickedbuttonindex:animated : call i.e [alertview dismisswithclickedbuttonindex: 0 animated:

Getting exception - "The property value is larger than allowed by the Table Service", what is the max size of a row in azure storage table -

getting exception "the property value larger allowed table service" while trying insert record in azure table storage. follwing table structure, string partitionkey,string rowkey,string id , string site, string name , byte[ ] content, public datetime createdtime and trying save 83755 bytes array ( 82kb ) in content field , other fields max of 35 chars. can please tell me max size of row azure storage table? following url referred.. there mentioned row can have 1mb max. mine doesn't exceed 100 kb. http://blogs.msdn.com/b/jnak/archive/2010/01/06/walkthrough-windows-azure-table-storage-nov-2009-and-later.aspx thanks, gopinath yes, each row may have 1mb. however, each byte array property or string property limited 64k. see this msdn reference specifics on each data type.

c# - How to build base knowlage of sharepoint 2007 -

i looking sharepoint 2007 guide build base knowlage. love direction guys can provide. what ways or guides build solid base knowlage of sharepoint 2007? they have knowledge base template sharepoint can download: http://technet.microsoft.com/en-us/windowsserver/sharepoint/bb407286.aspx once have site created, rest should fall place. add knowledge.

c# - Dynamic Lambda with all properties of a property of an object -

i had asked question on how dynamically compile linq query properties of object , houlgap had been kind enough give me following code private static func<myentity, bool> generatelambda(myentity _myentity, propertyinfo propertyinfo) { var instance = expression.parameter(propertyinfo.declaringtype, "i"); var property = expression.property(instance, propertyinfo); var propertyvalue = expression.constant(propertyinfo.getvalue(_myentity, null)); var equalitycheck = expression.equal(property, propertyvalue); return expression.lambda<func<myentity, bool>>(equalitycheck, instance).compile(); } this works great if property queried directly member of object me there intermediate property in between. e.g. func delegate type e.g. func <abcmyentity,bool> while myentity member of object (abcmyentity.myentity). propertyinfo object passed member of myentity. i know sounds terribly confusing not able better explain it. (maybe because

Developing for Android in Java or Adobe AIR or Titanium or PhoneGap? -

i have been developing android since time , found java proper way of doing development in it. but, there number of options available developing in android such titanium, phonegap , adobe air. the question come winner android development. have read lot of comparisons between titanium, phonegap , native android development. now, adobe entering too, future of android developers develop java programming language. since, if 1 can develop iphone , android titanium , adobe air why 1 want waste time , money separate development. the biggest reason can think of using native language/libraries of platform (in case iphone or android) allow provide user interface/experience more in line system designers intended on possible adobe air. that doesn't mean air bad, or might not able develop application, since you'd targeting multiple platforms same application code, , each platform has it's own subtle (or major) differences can't account for, inevitably forced take

javascript - Anyone knows a ruby library that works like Readability? -

readability javascript program transform html page in more readable one. i'm looking ruby implementation, or similar, knows library characteristics? you can find ruby port arc90 readability @ following url https://github.com/cantino/ruby-readability

Practical uses for silverlight against ajax/javascript -

hi please give clear practical uses silverlight must used, practical example, must go silverlight. i, personally, think, @ least right now, main reason shift silverlight visuals. lots of visual stuff lot easier on silverlight. have think not has silverlight right now, may better stick ajax/javascript now. but news can use ajax in silverlight developers choice , comfortable with. silverlight more of flash competitor ajax one. info1 info2

License file directory on .NET Reactor -

i'm using integrated build environment on visual studio , using post build action call .net reactor cmd. everything working fine until tried change license directory. if use following option on cmd: "-staticfilename c:\license.license" application won't find license file. knows if it's possible place license file on directory , how so? i wanting change license directory users / apps can write without admin privileges. i've tried using staticfilename option, doesn't let that, define suffix license file (to confuse hackers). i've sent mail eziriz still waiting answers.

html - Is the 'type' attribute necessary for <script> tags? -

i've seen both this: <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script> and this: <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script> does type attribute matter in way? for html 4.x , type attribute required . ( w3 ): this attribute specifies scripting language of element's contents , overrides default scripting language. scripting language specified content type (e.g., "text/javascript"). authors must supply value attribute. there no default value attribute. for html 5 , optional . if not specified, defaults text/javascript . ( w3 ): the type attribute gives language of script or format of data. if attribute present, value must valid mime type. charset parameter must not specified. default, used if attribute absent, "text/javascript".

c# - Binding one class to several interfaces as singleton -

i have instance 2 interfases iinterface1 , iinterface2 , public interface iinterface1 {...} public interface iinterface2 {...} and 1 implementation of these interfaces implclass . public class implclass : iinterface1, iinterface2 {...} i have sure application has 1 instance of implclass, used iinterface1 , iinterface2. i'm using ninject dependency injection. qustion is: code below meet requirements? ... bind<iinterface1>().to<implclass>().using<singletonbehavior>(); bind<iinterface2>().to<implclass>().using<singletonbehavior>(); ... or code create 2 instances of implclass, eash interface? with ninject can this: var impl = new impl(); container.bind<iint1>().tomethod(c => impl); container.bind<iint2>().tomethod(c => impl); when impl class has dependencies can't ninject inject, can this: container.bind<impl>().toself().insingletonscope(); container.bind<iint1>().tomethod(c => c.

"create" event using jquery's "live" -

is there way run code on new objects? this: $('.some_class').live('create', function() { $(this).append('something'); } so something appended elements class some_class (existing , future ones). there jquery plugin called livequery covers requirements. i think of plugin jquery .live() without need event ('click') etc. (it listens dom events) you can find more info here// jquery - live query plugin your example follows $('.some_class').livequery(function() { $(this).append('something');});

.net - FluentMigrator migration succeeds, but no changes to DB -

i must missing pretty basic. i'm working on legacy project, , i'm trying bring fluentmigrator mix cause i've got interesting database changes , data migrations coming think made easier using tool. for initial migration, want bring database current production version, as-is. simplify initial migration, scripted out sql server 2008 database, , migration executes scripted commands series of sql commands. to test out, create entirely empty database, , try run command line using this: > migrate -a "c:\my\project\path\bin\debug\rds.myprojname.dbmigrations.dll" -db sqlserver2008 -conn "data source=.\sqlexpress2008;initial catalog=mynewdbname; integrated security=sspi" -version=20100901000000 the version specified timestamp on first migration class's migration attribute. at command line, appears run fine - the entire script zooms by, , ends with: -- createproductiondbcircasep2010: migrated however, when take @ database, still empty.

html - What language should I use for editing documents? -

document editors nice have limitations. alternative them? know html , css , while can job, ill-suited printed documents. thinking in learning latex , because many scholars use it. wonder if recommend language such postscript . i got chance write entire paper in latex final semester of college , found easier thought be. couple of nice things found were a lightweight syntax things (tables being real offender, no 1 can text tables right). an extremely wide array of syntax doing automatically marking chemical formula writing inline lists. beautiful output automatically. extremely easy write modular documents might store chapter in file , \include{} in another. 1 particularly nice use found include code had written in document referencing files. wonderful support footnotes , bibliographic references. libraries can imagine. the major drawbacks are, imho: a lack of real direction or life in language. feels dead, , not because it's done. a frustrating bu