Posts

Showing posts from April, 2010

tomcat - What are all the possible tags that can be used inside the web.xml concerning a Java EE project? -

tomcat - What are all the possible tags that can be used inside the web.xml concerning a Java EE project? - concerning java ee tomcat know there web.xml file used , edited. know there tags <web-app> , <servlet> , <servlet-mapping> can written within web.xml file. want know there other tags can used ? can larn possible tags can set in web.xml file ? brief: http://docs.oracle.com/cd/e13222_01/wls/docs81/webapp/web_xml.html xsd: http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd java servlet 2.5 specification: http://jcp.org/aboutjava/communityprocess/mrel/jsr154/index.html java-ee tomcat servlets

function - Error in c programme conflicting types for xx and previous implicit declaration of xx was here -

function - Error in c programme conflicting types for xx and previous implicit declaration of xx was here - suppose have file insert.c in 2 functions defined: 1.insert_after 2.insert_before the definitions of these func this: insert_after(arg1) { if(condition 1) { ......... } else insert_before(arg1); } insert_before(arg) { if(condition 1) { ......... } else insert_after(arg); } now if file insert.c included in main.c , insert_after function called # include "insert.c" int main() { insert_after(arg); homecoming 0; } on compiling main.c using gcc,the next error encountered: conflicting types ‘insert_before’ note: previous implicit declaration of ‘insert_before’ here what wrong here , how avoid it? this because don't declare prototypes functions. function has no prototype, default, has unknown set of arguments , returns int. not case insert_before . create file insert.h in declare them: #ifn...

android - On second test getActivity() never returns -

android - On second test getActivity() never returns - i have couple of simple tests, assertnotnull(mactivity); (i'm reading m.d.torres "android application testing guide"). activity under test runs okay. every single test runs okay well. if run several tests @ 1 time on sec test getactivity() never returns. no errors in logcat (last line "starting intent ..."), no nothing. debugging doesn't help much either, if step getactivity() complains there no source code available. test project - activitytesting google runs okay several tests, eclipse configured right. did ever encounter that? i recreated test project 1 time more (like "clean room") , worked. compared 2 projects , found culprit. empty teardown: protected void teardown() throws exception { } if remove it, tests run green. if paste back, sec test hangs. read explanation , ready mark answer. edit: should calling super.teardown() @ end of teardown method. sorry bothe...

html5 - jQuery Mobile Dual Range slider -

html5 - jQuery Mobile Dual Range slider - i made dual range slider in jqm placing slider on top of each other. there way can stop min exceeding max value? i'm not sure slider using html5 range input type <style type="text/css"> .pricerangeinfo{ position: relative; height: 30px; margin-top: 60px; } .pricerangeinfo label{ position: absolute; top: -30px; left: 10px; } /* moves label field */ .pricerangeinfo #buying_slider_min{ top: -40px; position: absolute; left: 100px; } /* moves first input field */ .pricerangeinfo #buying_slider_max{ top: -40px; position: absolute; left: 170px; } /* move sec input field */ .pricerangeinf...

alignment - Jasper Reports image and text mix -

alignment - Jasper Reports image and text mix - i want write jasper reports application. has arrange image , text such appropriately placed. want. i images , texts web service, can fetch image size on runtime. if width bigger text should below, , vice versa. tried setting width alternative parameter, did not work. how can it? correct: cannot set image width using parameter. the quickest solution this: determine maximum width is. utilize 'print when expression' display either picture-next-to-text layout or picture-above-text layout. study have 2 image elements , 2 text elements, you'll take 1 display based on image size. an alternative investigate dynamic jasper. that's project designed dynamically generate .jrxml on fly, has ability modify width similar you're describing. jasper-reports alignment

php - Redirect if site is not shown in a frame -

php - Redirect if site is not shown in a frame - i have page want visible if shown in iframe. is possible in php, htaccess or something? how? i prefer solution in php thanks! frames client side can't check through php or .htaccess. can check in javascript. see thread: how identify if webpage beingness loaded within iframe or straight browser window? edit here's illustration redirect you. it's straight javascript if doing jquery write same function document.ready <script> function check_frame() { if( top === self ) { // not in frame location.href = "/link/to/some/url"; // either frameset or error. } } </script> <body onload="check_frame()"> ... normal code page here ... </body> note page can still php page, need output bit of javascript. php .htaccess redirect

javascript - How can I see the output of document.write while debugging? -

javascript - How can I see the output of document.write while debugging? - i need step thought js scripts in firebug debugging purposes. script utilize document.write() generate new html content , while can see code lines generate code, much see the generated contents while debugging. in other words, can see the output document.write while debugging? update: to avoid misunderstandings, need clarify mean debugging , scrutinizing other people's scripts banner scripts utilize document.write generate content. have no command on utilize of document.write, need explore output. i not utilize document.write myself. the easiest way write firebug console looks this: console.log("hello world") you can pass many arguments want , joined in row, console.log(2,4,6,8,"foo",bar). intro: firebug , logging api doc javascript firebug

Remove (network) path from string in VBScript -

Remove (network) path from string in VBScript - at moment writing script has creating list of files. want remove root-path output. works local path (c:\programdata) not work network path (\192.168.0.1). example of code: set objfso = createobject("scripting.filesystemobject") objstartfolder = "c:\programdata" set objfolder = objfso.getfolder(objstartfolder) wscript.echo replace(objfolder.path,objstartfolder,"") in output want c:\programdata\xyz , \192.168.0.1\xyz. since didn't utilize vbscript before hope can help me here. objfolder.parentfolder should homecoming part wish remove, is, lastly \. (community wiki, reply sake of it) string vbscript

android - Application closing once started -

android - Application closing once started - i got code compile, gets closed every time start it. can advise me wrong? below manifest , logcat , top half of code in activity. this application project done 1 coder. using native library. had compiled native library using cygwin. able compiled successfully. error "could not load needed library 'libiconv.so' 'libexif2.so' (load_library[1108]: library 'libiconv.so' not found) 01-20 14:08:19.791", had checked, these 2 files has been generated. there place else need place library file to? <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.kos.agphoto2" android:versionname="0.1" android:versioncode="1"> <uses-feature android:required="true" android:name="android.hardware.usb.host"></uses-feature...

Multiple routers with backbone.js -

Multiple routers with backbone.js - can utilize multiple routers in backbone.js , don't interfere each other route-wise, without issues? or there should concerned about? code sample: myapp.routers.main = backbone.router.extend({ routes : { "": "index" }, index : function() { console.log("routed main router");} }); myapp.routers.another = backbone.router.extend({ routes : { "notmain": "index" }, index : function() { console.log("routed router");} }); mainrouter = new vaikava.routers.main; notmainrouter = new vaikava.routers.another; backbone.history.start(); yes, works fine; time you'd have problem if have conflicting routes. there workaround makes work way well, it's bit of hack. as long avoid having multiple routers trying handle same route should fine. backbone.js router

mysql - How to resolve primary key collision while merging one db with other -

mysql - How to resolve primary key collision while merging one db with other - i having application deployed on 2 separate regions us-west , eu, both application has own db. , want move european union part db us-west. this lead primary key collision since both db has tables same primary auto increment id, can give me suggestion solve this. scenario: user table db1(say us-west) has next entries id name 1 rob 2 san 3 tulip user table db2(say eu) has next entries id name 1 john 2 michael 3 natasha for every 1 of 2 original databases (say db0 , db1 ): back db. lock database utilize script only. for tables in database have foreign keys defined without on update cascade , alter these foreign keys constraints option. for every table auto_increment (or simple integer) primary key, run (the cascading updates create rest): . update tablex set pk = 2 * pk - 0 --- db0 order pk desc update ...

Auto-Generate Visual Studio VsDoc for JavaScript library -

Auto-Generate Visual Studio VsDoc for JavaScript library - i'm in process of refactoring javascript library utilize single namespace. have ~200 modules, registered jquery plugins or on global object (bad). in past dispensation, intellisense working, added module references each module (from wanted intellisense) /// <reference path="" /> to top of every module file. everything previous dispensation flawed, fragile , inelegant. i hope prepare in new dispensation. 1 of primary goals of refactoring create easy new developers started working in library, , intellisense of great benefit. currently, i'm concatenating of *.js files single namespace-vsdoc.js file. every method of every class documented using vsdoc syntax. every module uses that, single vsdoc reference. works ok, it's clumsy. intellisense works 300% improve before, it's still not accurate enough. misses lots of xml documentation , doesn't recurse methods/classes homecoming ...

iphone - Adding multiple views (& nibs) to a single view controller -

iphone - Adding multiple views (& nibs) to a single view controller - i need implement several views on single ipad screen. creating several classes , corresponding xib files. have 1 main (root) view controller manage views screen. not sure how accomplish this. using ib nib files instead of creating views programmatically.is approach? how set views on particular position? can 1 guide me or improve approach. im not sure how right use uinib *nib = [uinib nibwithnibname:nibname bundle:nil]; nsarray *views = [nib instantiatewithowner:owner options:nil]; uiview *view = [views objectatindex:0]; when want view nib , utilize uiview , move frame around etc. hope helps iphone objective-c ipad uiviewcontroller multiple-views

.net - How can you obtain the items within a group inside a PagedCollectionView? -

.net - How can you obtain the items within a group inside a PagedCollectionView? - i have pagedcollectionview, groups property on doesn't expose info each group, such of items in pagedcollectionview within group, info need know.. i'd this: (system.windows.data.collectionviewgroupinternal)pcv.groups[0].items; it seems held within internal class, , not obtainable client code. there way information? it turns out simple feature impossible using public interfaces of datagrid. amazing basic feature has been missing years in grid. .net wpf silverlight silverlight-4.0

flash - Google map api in as3, StyledMapType -

flash - Google map api in as3, StyledMapType - i having null reference exception when instantiating styledmaptype var styles:array = [ new maptypestyle( maptypestylefeaturetype.all, maptypestyleelementtype.all, [ maptypestylerule.visibility( "on" ), maptypestylerule.hue( 0xff0000 ), maptypestylerule.saturation( 100 ), maptypestylerule.lightness( -50 ), maptypestylerule.gamma( 1.0 ) ] ) ]; var options:styledmaptypeoptions = new styledmaptypeoptions( { name: 'styled map', alt: 'style', minresolution: 2, maxresolution: 12 }); var styledmaptype:styledmaptype = new styledmaptype(styles, options); i getting error: typeerror: error #1009: cannot access property or method of null object reference. @ com.google.maps::styledmaptype() @ com::main/init() @ com::main() but when omit line: var styledmaptype:styledmaptype = new styledmaptype(styles, options); program runs. please help me out. have been trying find solution , problem hou...

java - Android - Few more memory related issues -

java - Android - Few more memory related issues - i have application has (mostly) images in layouts. understand, android supposed free memory when activity not needed anymore. thus, not releasing drawables used app's layouts when activity goes onpause() manually. understand android should this. then, utilize code check memory status: { activitymanager activitymanager = (activitymanager) context.getsystemservice(context.activity_service); android.app.activitymanager.memoryinfo memoryinfo = new activitymanager.memoryinfo(); activitymanager.getmemoryinfo(memoryinfo); log.i("memcheck", " memoryinfo.availmem " + memoryinfo.availmem + "\n" ); log.i("memcheck", " memoryinfo.lowmemory " + memoryinfo.lowmemory + "\n" ); log.i("memcheck", " memoryinfo.threshold " + memoryinfo.threshold + "\n" ); android.os.debug.memoryinfo[] memoryinfoarray = activitymanager.getp...

javascript - jQuery: sharing function between page code and document.ready code -

javascript - jQuery: sharing function between page code and document.ready code - i have nice dialogues defined such in jquery: <script type="text/javascript"> $(document).ready(function() { $( "#somedialog" ).dialog({ autoopen: false, model: true, buttons: { "do something": function() { var cleaninput = sanitizeinput(input); // clean input }, cancel: function() { $( ).dialog( "close" ); } }, close: function() { } }); function sanitizeinput(input) { // magic here homecoming input; } }); </script> somewhere in page, unrelated dialog, have element calls function parameter: <a href="#" onclick="dosomething('wendy');">wendy's stats</a> and associated javascript: <script type="text/javascript...

php - ImageMagick Reize canvas to specifications and scale image? -

php - ImageMagick Reize canvas to specifications and scale image? - i have specific sized canvas (let's 400x300 pixels) , have image amount, want scale downwards (paying attending ratios proper ratio) , fit within canvas, part know how do. want create canvas 400x300. so image let's 300x600. scaled 150x300 (so fits within 400x300) , centered , image "applied" white canvas of 400x300. , size image. i don't know how lastly part. update: noticed comment on post want php bindings. reply supplied applies command line, not php. can't help that. leaving reply in case helps. to center smaller image on big canvas, utilize extent operator gravity. so, example, if img.gif resized 150x300 image, center image on 400x300 white canvas: -gravity center -extent 400x300 img.gif [note can set "-background " if want canvas other white, defaults white.] php imagemagick

c# - Understand the flow of control when calling a blocking code from non-blocking block? -

c# - Understand the flow of control when calling a blocking code from non-blocking block? - i have next code static void main(string[] args) { //var source = blockingmethod(); var source2 = nonblocking(); source2.subscribe(console.writeline); //source.subscribe(console.writeline); console.readline(); } private static iobservable<string> blockingmethod() { var subject = new replaysubject<string>(); subject.onnext("a"); subject.onnext("b"); subject.oncompleted(); thread.sleep(1000); homecoming subject; } private static iobservable<string> nonblocking() { homecoming observable.create<string>( observable => { observable.onnext(...

javascript - prettyphoto wont load when writing href using document.write -

javascript - prettyphoto wont load when writing href using document.write - i have codes this <span id="$rsc" class="menu" title="action menu" onclick="menu(\''.$rsc.'\')">click</span> function menu(id){ var d = document.getelementbyid(id); d.innerhtml ='<a href="somthing;iframe=true&amp;width=400&amp;height=170" rel="prettyphoto[iframe]" >doesnt work</a>'; } <script type="text/javascript" charset="utf-8"> jquery.noconflict(); jquery(document).ready(function($) { $(".pp_pic_holder").remove(); $(".pp_overlay").remove(); $(".ppt").remove(); $(".gallery a[rel^='prettyphoto']").prettyphoto({theme:'h0mayun'}); }); </script> the problem after clicking on "click" , writing html link prettyphoto plugin doesn't load any help appreciated. edit-----------------...

wpf - Using StaticResource to set ListView's Height property throws exception -

wpf - Using StaticResource to set ListView's Height property throws exception - i define "displayheight" in app.xaml file here: <application.resources> <sys:int32 x:key="displayheight">534</sys:int32> </application.resources> i seek set listview height here: <grid> <listview x:name="mylistview" height="{staticresource displayheight}"/> </grid> this results in next exception: {"'534' not valid value property 'height'."} i don't understand why wouldn't work. can manually set height 534 , works. also, read controls "height" "int32" shouldn't type problem... height double , need declare such if want utilize staticresource directly. alternatively wrap in binding uses type converters: class="lang-xml prettyprint-override"> height="{binding source={staticresource displayheight}}"...

java - define authentication-failure-url to be `{currentpage}?login_error=1`? -

java - define authentication-failure-url to be `{currentpage}?login_error=1`? - i using spring mvc, spring security , apache tiles. have login div appears in every page (in case user not authenticated yet). configuration: <http use-expressions="true"> <intercept-url pattern="/index.jsp" access="permitall" /> <intercept-url pattern="/registration.html" access="permitall" /> <intercept-url pattern="/about.html" access="permitall" /> <intercept-url pattern="/search.html" access="permitall" /> <intercept-url pattern="/login.html" access="permitall" /> <intercept-url pattern="/logout.html" access="permitall" /> <intercept-url pattern="/post.html" access="hasanyrole('user')" /> <intercept-url pattern="/**" access="denyall" /...

c - Can't seem find the largest float in an array, using inline assembly -

c - Can't seem find the largest float in an array, using inline assembly - i have been tasked doing assembly work. going good, until had convert programme using int floats. i'm missing simple in attempts, have suggestion? i'll provide int version works. #include <stdio.h> int n; int i; int arr[50]; int output; int main(void) { scanf("%d", &n); (i = 0; < n; i++) { scanf("%d", &arr[i]); } __asm { jmp start switching: mov eax, ebx jmp looping looping: mov ebx, arr[ecx*4] inc ecx cmp ebx, eax jg switching cmp ecx, n jl looping ret start: mov ecx, 0 mov eax, 0 phone call looping mov output, eax } printf("%d", output); scanf("%d", &n); } you need rewrite of solut...

ruby on rails - SQLite3::SQLException while trying to set foreign keys? -

ruby on rails - SQLite3::SQLException while trying to set foreign keys? - i have 3 models: user, micropost, , comment. i'm trying set foreign keys follows: class createcomments < activerecord::migration def alter create_table :comments |t| t.text :content t.timestamps end add_index :comments, :micropost_id, :user_id end end but error: an error has occurred, , later migrations canceled: sqlite3::sqlexception: near "user_id": syntax error: create user_id index "index_comments_on_micropost_id" on "comments" ("micropost_id") i understand rails insert foreign keys based on belongs_to , has_many declarations in models. have set: comment.rb: class comment < activerecord::base belongs_to :micropost belongs_to :user end micropost.rb: class micropost < activerecord::base attr_accessible :title, :content belongs_to :user has_many :comments end user.rb: class...

c# - Making a conditional regular expression -

c# - Making a conditional regular expression - i have troubles making regexp: i want regexp test fail if input contains symbol "<" straight followed letter, i.e like: <[^a-za-z] but want work if "<" not found. how can that? edit: examples <wrong illustration wrong <example illustration < illustration < illustration good< illustration example< edit 2: when working asp.net, can't send form text in input example: <previous edit 3: regular look passed in command cannot change, , works validating input regular expression. hence cannot match bad input a negative lookahead regex on own like ^(?!.*<[a-za-z]) would check letter never followed left angle bracket, empty string match criteria. need create sure contains @ to the lowest degree 1 alpha, this? ^(?!.*<[a-za-z]).*[a-za-z] in perl: while (<data>) { print if /^(?!.*<[a-za-z])/; } __data__ <wrong illustrat...

DELETE CASCADE in mySQL -

DELETE CASCADE in mySQL - i have next 2 mysql tables 'child' table having delete cascade action set 'parent': parent table create table `userdetails` ( `userid` int(6) not null auto_increment, `forename` varchar(20) not null, `surname` varchar(30) not null, `emailaddress` varchar(150) not null, `password` varchar(200) not null, `passwordhint` varchar(20) not null, `subscriptionexpiration` date not null, `salt` varchar(200) not null, primary key (`userid`) ) engine=innodb auto_increment=2 default charset=utf8 auto_increment=2 ; child table create table `locations` ( `userid` int(6) not null, `locationid` int(6) not null auto_increment, `locationname` varchar(80) not null, primary key (`locationid`), key `userid` (`userid`) ) engine=innodb default charset=utf8 auto_increment=1 ; -- -- constraints dumped tables -- -- -- constraints table `locations` -- alter table `locations` add together constraint `locations_ibfk_1`...

r - cchart.p {IQCC} change titile -

r - cchart.p {IQCC} change titile - i using cchart.p {iqcc} function generate p chart title appears "standardized p-chart (phase ii)" want alter title,x label , y label. tried code: library(iqcc) #get arguments args <- commandargs(true) pdfname <- args[1] datafile <- args[2] pdf(pdfname) tasks <- read.csv(datafile , header = t,sep=",") p <- cchart.p(x1 = tasks$x, n1 = tasks$y,phat = 0.02) print(p) dev.off() any function or bundle can utilize it? how can utilize ggplot2 package? r title

Convert value/pair list (simple array) into JSON with properties using PHP -

Convert value/pair list (simple array) into JSON with properties using PHP - i have simple value pair array : array(4) ( [4] => (string) barcelona [3] => (string) cordoba [1] => (string) granada [2] => (string) jaen ) i need encode json respond ajax request in next format : [{"pk": 4, "name": "barcelona"}, {"pk": 3, "name": "cordoba"}, {"pk": 1, "name": "granada"}, {"pk": 2, "name": "jaen"}] if utilize : json_encode($a) i next : {"4":"barcelona","3":"cordoba","1":"granada","2":"jaen","0":"select province"} how php format simple array include properties in json? just create new array: $data = array(); foreach($array $key => $value) { $data[] = array('pk' => $key, 'name' => $value)...

c# - MVC3 Base Contoller Crashes, Same Code Works in Inherited Controller -

c# - MVC3 Base Contoller Crashes, Same Code Works in Inherited Controller - background .net 4, c#, mvc3, using jsonfx serialize , deserialize data. base of operations controller has been extended intercept requests , following: get json remote server. run linq query based on passed in keys (hero, body, footer). return generic model view. this code works fine when running in controller inheriting base of operations controller, when placed in base of operations controller , called inherited controller, next error: unable cast object of type 'system.linq.expressions.constantexpression' type 'system.linq.expressions.parameterexpression'. this offending line: var queryhero = heromodel.arrayitems().where(o => o.displayname == keyhero); question how avoid getting type error when in base of operations controller? it's same code runs fine in inherited controller. thanks time. full code public models.genericpagemodel getgenericpagec...

events - GWT CellTree with an optional pop-up menu triggered on click of a TreeNode -

events - GWT CellTree with an optional pop-up menu triggered on click of a TreeNode - i craft gwt celltree optional pop-up menu triggered on click of treenode. so i've crafted customtreemodel. here is: public class customtreemodel implements treeviewmodel { /** * save visited url. we'll utilize later determine if tree node needs opened. * decode query string in url token has chance of matching (e.g., convert %20 space). */ private final string url = url.decodequerystring(window.location.gethref()); private final navnode navnode; private final tokenservice<maineventbus> tokenservice; /** * selection model shared across nodes in tree. */ private final singleselectionmodel<navnode> selectionmodel = new singleselectionmodel<navnode>(); public customtreemodel(navnode navnode, tokenservice tokenservice) { this.navnode = navnode; this.tokenservice = tokenservice; } @override public <t> nodeinfo<?> getnodeinfo(t value) { ...

Java upload picture on a server -

Java upload picture on a server - i writing java desktop application , need script upload pictures on ftp server. there existing source code check dimension,the mime type , size of image , job ? thank you java upload ftp image

Reference jQuery plugin options -

Reference jQuery plugin options - i'm using inifitescroll jquery plugin, , want reference options variable version of locading.start function: var rdealbone = this; ($('.deals-list'), this.el).infinitescroll({ navselector : "div.navigation", nextselector : "div.navigation a", itemselector : ".deal", debug: true, loading: { finished: undefined, finishedmsg: "<em>congratulations, you've reached end of internet.</em>", img: "http://www.infinite-scroll.com/loading.gif", msg: null, msgtext: "<em>loading next set of posts...</em>", selector: null, speed: 'fast', start: function(){ // code default start function of plugin, // opts refers...

vb.net datagridview with dataset as datasource -

vb.net datagridview with dataset as datasource - my question is, there way filter records in dataset , utilize records fill in datagridview? example, datatable (with 3 columns: id , studentname , gender ) filled list of students. have 2 datagrids in form namely datagridview1 , datagridview2 . datagridview1 the list of pupil gender equal m , datagridview2 the list of pupil gender equal f . in current solution, using loop. for each istud datarow in idataset.tables(0).rows if istud.item("gender").tostring = "m" 'add record datagridview1 else 'add record datagridview2 end if next is there way without using loop? yes, there is. need filter dataset using select . for example, datagridview1.datasource = xset.tables("studentlist").select("gender = 'm'") datagridview2.datasource = xset.tables("studentlist").select("gender = 'f'") brie...

sql - python - does cx_Oracle allow you to force all columns to be cx_Oracle.STRING? -

sql - python - does cx_Oracle allow you to force all columns to be cx_Oracle.STRING? - this little snippet of python code (not entire thing) write results file. because table i'm querying has timestamp(6) local time zone datatypes, file storing values in different format ie '2000-5-15 0.59.8.843679000' instead of '15-may-00 10.59.08.843679000 am'. there way forcefulness write file if datatype varchar (ie cx_oracle.string or otherwise file has same content querying through client tool)? db = cx_oracle.connect(..<my connect string>.) cursor = db.cursor() file = open('c:/blah.csv', "w") r = cursor.execute(<my sql>) row in cursor: writer.writerow(row) could utilize to_char within query? way forced string type. r = cursor.execute("select to_char( thetime, 'dd-mon-rr hh24.mi.ssxff' ) my_table") python sql database oracle scripting

vb.net - Can we use Nullable(of T) for property using List? -

vb.net - Can we use Nullable(of T) for property using List<of T>? - in below sample code, have tried utilize nullable(of t) datetime , want utilize same of dimensions property list(of dimension). private _duedate nullable(of datetime) public property duedate() nullable(of datetime) homecoming _duedate end set(byval value nullable(of datetime)) _duedate = value end set end property private _dimensions list(of dimension) public property dimensions() list(of dimension) homecoming _dimensions end set(byval value list(of dimension)) _dimensions = value end set end property if can please help on how can appreciated. thanks. there no need utilize nullable(of t) list(of t) . utilize list(of t) straight , utilize nothing no value st...

How to connect private network through android device -

How to connect private network through android device - i want access private network(like office domain) android device.what necessary things this.an how this?i need ideas regarding this. android device connect via wi-fi so there few things set go settings->wi-di in menu select advance alternative , set next details 1) ip address 2) gateway 3) netmask 4) dns1 set these values on android phone private network android

iphone - How to use UIWebview as RichTextLable? -

iphone - How to use UIWebview as RichTextLable? - i came know uiwebview can used richtextlable ,but don't know how implement it.can 1 help me out! check out might help you you need includejava-script code can create richtextbox iphone uiwebview

c - good hash function -

c - good hash function - i have been failing understand design of hash functions. going through example. can see in function comments, why should take 31 number multiplied. how decide? random or mean something? unsigned int hash(hash_table_t *hashtable, char *str) { unsigned int hashval; /* start our hash out @ 0 */ hashval = 0; /* each character, multiply old hash 31 , add together current * character. remember shifting number left equivalent * multiplying 2 raised number of places shifted. * in effect multiplying hashval 32 , subtracting hashval. * why this? because shifting , subtraction much more * efficient operations multiplication. */ for(; *str != '\0'; str++) hashval = *str + (hashval << 5) - hashval; /* homecoming hash value mod hashtable size * fit necessary range */ homecoming hashval % hashtable->size; } the hash in question known bernstein hash, torek hash,...

c# - File transfer succeeds only the first time, fails consuquently -

c# - File transfer succeeds only the first time, fails consuquently - this file transfer send/receive programme using sockets tcp. code included in both client , server application , works fine first time. the sec time, side going receive gets 0 , transfer finishes. how can prepare can used many times? public static void sendfile(string filepath) { filestream fs = new filestream(filepath, filemode.open, fileaccess.read); string filename = path.getfilename(filepath); byte[] filedata; seek { //sending file name , file size server busy = true; filesize = fs.length; byte[] filedetial = null; string detail = filename + "," + filesize.tostring(); filedetial = encoding.ascii.getbytes(detail); client.send(filedetial); //sending file info server filedata = new byte[packetsize]; count = 0; sum = 0; program.thfp.start(); // run...

settings - Change Eclipse Indigo Debug Appereance -

settings - Change Eclipse Indigo Debug Appereance - i have problem eclipse preference. cannot see in debug-layout pops when hover on variable, pictures can more words: how can adjust colors (especially background color), appears in eclipses menus well. edit: according first answer i tried set default no result. cannot follow provided guide find debug_background option. here output eclipse if type appearance inside: i don't think have reply you, have own experience. based on see in illustration, you're not running ubuntu/gnome, reply may not satisfy you. this sort of thing balance between underlying os , application. example, on ubuntu (gnome, pre-unity), nil satisfactory in sentiment possible short of changing overall (gnome) theme. in case, while default ubuntu theme, find can't see (the same stuff you're showing) adequately unless resort clearlooks. , gave trying prepare long ago eclipse preferences , go theme. maybe help or else. ...

wpf - Using UserControl.Resources -

wpf - Using UserControl.Resources - i've got problem while using usercontrol.resources. maintain encounter error message "the file 'resources\resource.xaml' not part of project or 'build action' property not set 'resource'. i've search through forums looks i've done has been stated in sample. somehow error still there , style embedded in resource failed applied controls. below codes : <usercontrol x:class="client.navigationcontrol" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:client" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" horizontalalignment="left" verticalalignment="top"...

javascript - each loop fail in jquery plugin? -

javascript - each loop fail in jquery plugin? - can explain me happen here?? i have html code: <div class="calculadora"> <div class="clear campos"> <label>amount</label> <input class="fi" id="amount" type="text" name="amount" value=""/> </div> <div class="clear campos"> <label>down payment</label> <input class="fi" id="downpay" type="text" name="downpay" value=""/> </div> <div class="clear campos"> <label>years</label> <input class="fi" id="years" type="text" name="years" value=""/> </div> <div class="clear campos"> <label>rate</label> <input class="fi...

centos - Building Linux Kernel from source. Nothing appears in ~/rpmbuild/BUILD -

centos - Building Linux Kernel from source. Nothing appears in ~/rpmbuild/BUILD - i'm next directions here. in lastly step says the kernel source tree found under ~/rpmbuild/build/ directory. " however, when go directory, see nothing. ideas? i've done else page says. you may running old version of rpmbuild, used /usr/src/packages/ instead of ~/rpmbuild . linux-kernel centos

How to automatically modify variable names in ruby and javascript? -

How to automatically modify variable names in ruby and javascript? - i want like: for(var i=0; < 3, i++) { var file_i = i; } and got local variables: file_0 = 0,file_1 = 1, file_2 =2 i'm want know how create happen in ruby. if don't mind new variables beingness global: for(var i=0; < 3, i++) { window["file_" + i] = i; } but comments have noted, bad idea. create these properties of object: var files = { }; for(var i=0; < 3; i++) { // <-------- typo there. should ; after < 3 files["file_" + i] = i; } and can read these properties with: for (var key in files) { if ({}.hasownproperty.call(files, key)) alert(key + " " + files[key]); } i'm afraid don't know how ruby. javascript ruby

java - How to watch exception when there is no catch in Eclipse? -

java - How to watch exception when there is no catch in Eclipse? - is possible determine exception occurred when catched finally only? below excerpt standard threadpoolexecutor code: public void run() { seek { runnable task = firsttask; firsttask = null; while (task != null || (task = gettask()) != null) { runtask(task); task = null; } } { workerdone(this); } } i.e. here no catch . debugger stops on workerdone() phone call indicating runtimeexception occurred, since here no exception variable see no way know error message or something. you should able add together "exception breakpoint" in debugger uncaught exceptions. typically, tab right next "variables" tab in debug perspective. java eclipse debugging exception uncaught-exception

c# - How to initialize MEF ServiceLocator.Current? -

c# - How to initialize MEF ServiceLocator.Current? - in app.xaml.cs have private void initializecontainer() { var catalogs = new aggregatecatalog(); var catalog = new assemblycatalog(assembly.getexecutingassembly()); catalogs.catalogs.add(catalog); // adding interactions project catalog = new assemblycatalog(typeof(interactionsservice).assembly); catalogs.catalogs.add(catalog); // initialize main application composition host (container) compositionhost.initialize(catalogs); } however, when seek object initialized downwards line so: this.interactionsservice = servicelocator.current.getinstance<iinteractionsservice>(); i exception servicelocator.current null. how create work? i think you're missing phone call composeparts or compose in set of compositioncontainer . before start resolve instances via getinstance . there's msd...

sql - How to take daily snapshots of a table -

sql - How to take daily snapshots of a table - i building sales database. 1 of tables has hierarchy of sales reps , assigned territories. ohese reps , territories alter every day, , need maintain track of table looks every day. need take snapshots of table daily. i know have or how have store info in table, able know info in table @ point in time. is possible? please maintain in mind table not more 1 megabyte or so. i suggest using paul nielsen's autoaudit: autoaudit sql server (2005, 2008) code-gen utility creates audit trail triggers with: created, createdby, modified, modifiedby, , rowversion (incrementing int) columns table insert event logged audit table updates old , new values logged audit table delete logs final values audit table view reconstruct deleted rows udf reconstruct row history schema audit trigger track schema changes re-code-gens triggers when alter table changes table his original blog post: cod...