Posts

Showing posts from July, 2010

Software architecture versus Enterprise architecture, when is each used? -

Image
what type of architecture discipline used specify software systems , ther interaction whole organization (not company- or coporation-wide, organization wide, of 6 sw engineers working on 4 software products). i'm trying create document (assuming role of architect) specifies overall architecture move new data/hosting center. is enterprise architecture or software architecture used kind of planing? difference? thanks, what type of architecture discipline used specify software systems , interaction whole organization? enterprise architect: via enterprise architectural framework togaf or zachman . this work might include involvement of other architects specific disciplines - such data architects. ... overall architecture move new data/hosting center ... enterprise architecture or software architecture used kind of planing? not enterprise architect. actual role might depend on company i'd expect either solution architect or infrastr...

javascript - regex: read character behind number -

i have regex code: <script type="text/javascript"> var str = "kw-xr55und"; var patt1 = /[t|ee|eju].*d/i; document.write(str.match(patt1)); </script> it can read: str= "kd-r55und" -> und but if type: str= "kw-tc800h2und -> result tc-800h2und. //it makes script read t in front of 800 want result und how make code check @ character behind 800? edit after code can work: <script type="text/javascript"> var str = "kw-tc800h2und"; var patt1 = /[ejtug|]\d*d/i; document.write(str.match(patt1)); </script> but show next problem, can show result if: str= "kw-tc800un2d" want result -> un2d try this: var patt1 = /(t|ee|eju)\d*$/i; it match sequence of non-digit characters starting t , ee or eju , , finishing @ end of string. if string has end d in examples, can add in: var patt1 = /(t|ee|eju)\d*d$/i; if want match anywhere, not @ end o...

PHP REST webservices Curl help -

i have used following script consume rest webservices provided commission junction. i'm able response response not in xml format. <?php $targeturl="https://support-services.api.cj.com/v2/countries"; $cj_devkey= "xxxxxxxxx"; // return xml feed cj $ch = curl_init($targeturl); curl_setopt($ch, curlopt_post, false); curl_setopt($ch, curlopt_httpheader, array('authorization: '.$cj_devkey)); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_returntransfer, true); $response = curl_exec($ch); curl_close($ch); echo $response; // print in browser country codes in xml format /* add own code here want response. maybe save results file or parse results database? */ ?> i'm confused. isn't response when using rest webservices in xml format. please correct me if i'm wrong. would please have @ script , suggest me need in order response in xml ? want save response in xml file , process later. from can ...

Initializing 2D Array In Class Constructor in C++ -

i define 2d array in header file char map[3][3]; how can initialize values in class constructor this map = {{'x', 'x', 'o'}, {'o', 'o', 'x'}, {'x', 'o', 'x'}}; firstly, there difference between assignment , initialization. op title initialization. secondly, have not told if 2d array class member(static/non static) or namespace variable. -since mentioned initializing in class constructor, assuming class non static member, because: $12.6.2/2 - "unless mem-initializer-id names constructor’s class, non-static data member of constructor’s class, or direct or virtual base of class, mem-initializer ill-formed." further, of c++03 member array cannot initialized in constructor initializer list case in op(not sure c++0x) though. -if 2d array static member of class, should initialize did (with slight change), not in constructor. should done in enclosing nam...

objective c - How to pass method arguments to a selector -

if have method this: - (void) foo { } then can access through selector this: @selector(foo) but if have method this: - (void) bar:(nsstring *)str arg2:(nsstring *)str2 { } then how access through selector? to handle arbitrary number of selectors should use nsinvocation , can handle 2 objects using standard performwithselector stuff [foo performselector:@selector(bar:arg2:) withobject:obj1 withobject:obj2]

c# 4.0 - What is the best practise of declaring the Variables in Asp.Net Programming? -

i want know declaration of variables in separate class file or declaring in same aspx.cs file.please tell me best practise of declaring variables. thanks in advance its practice separate business logic presentation. if variables talking related presentation only, can: declare page level variables @ beginning of class , surround them region tag(as rightly mentioned slugster) declare local variables close place first used possible(this cover chaospandion's point. all other variables should fall category of business logic , should declared in class file containing business logic.

java - Is it true that you must not use any plain HTML in RichFaces? Why? -

can point me or explain if true, must not use plain plain html tags in jsf or jsf libraries richfaces? we're using jsf 1.2, richfaces 3.3.3 , facelets on jboss server. someone said me must use <rich:> or <f:> or <a4j:> , components offer. reason being jsf component tree break , may have unwanted behaviour. or lose jsf tree structure @ point , functionality associated it. i trying use plain <h1> tag , told not use , use <a4j:outputpanel> instead (which renders <div> ) , style heading. i'm having hard time believing this. you right not believe this. there absolutely no problem in using plain html tags. facelets creates uicomponent s static markup (i.e. non-jsf). should valid.

android - Custom menu as the photo -

Image
hello, second time ask question this:( think photo may better explain want. since last time asked question, have tried several tutorials, didn't manage set menu photo shows. in fact, don't understand use of getview(). 1 guy told me rewrite method, can't figure out. appreciate help! lot! for doing this, have @ preferenceactivity. here clear tutorial :http://www.kaloer.com/android-preferences

multithreading - C# Process - Pause or sleep before completion -

i have process: process pr = new process(); pr.startinfo.filename = @"wput.exe"; pr.startinfo.arguments = @"c:\downloads\ ftp://user:dvm@172.29.200.158/transfer/updates/"; pr.startinfo.redirectstandardoutput = true; pr.startinfo.useshellexecute = false; pr.startinfo. pr.start(); string output = pr.standardoutput.readtoend(); console.writeline("output:"); console.writeline(output); wput ftp upload client. at moment when run process , begin upload, app freezes , console output won't show until end. guess first problem solvable using thread. what want start upload, have pause every often, read whatever output has been generated (use data make progress bar etc), , begin again. what classes/methods should looking into? you can use outputdatareceived event print output asynchronously. there few requirements work: the event enabled during asynchronous read operations on standardoutput. start asynchronous read operations, must ...

c# - No Default.aspx.designer.cs files in my ASP.NET project -

Image
my current web site not have designer.cs files. (yes not web application) the site complete added 2 clases site , when want make use of gridview tells me this: this because wrapped code same namespace in classes so.... namespace samraswebportalsql { public partial class gridview : system.web.ui.page { protected void page_load(object sender, eventargs e) { functions.removecaching(this); loadgrid(); } private void loadgrid() { dataset dataset = sqlhelper.getdataset("select * company"); functions.bindgridview(gridview1, dataset); } } } i know need following code in .designer.cs file since dont have 1 cant place anywhere ells? protected global::system.web.ui.webcontrols.gridview gridview1; in "web site", can add new aspx page (web form). , in web form can drag gridview onto page. once you've given id this: <div> <asp:gridview id="grid1" runat=...

ruby on rails - MYSQL wrong time.now -

we got rails 3 server based on ruby 1.9.2 running on mysql db , problems time.now , time.zone.now setting. for better explaination assuse 13:00 utc right now. ubuntu systemtime set 15:00 utc +02:00 (thats cest (central european summertime) , correct our timezone). the rails time (time.now) set 13:00 +0200 the time.zone.now set cest mysql global time , session time both set system now create new entry in mysql db (via activerecord) has timestamp. but when @ timestemp -2 hours offset current server time (in our example 11:00) we tried setting time.zone different 1 testing propose, had absolutly no effect on new mysql entry. tried set mysql global time , session time utc, no effect. the thing can imagene right problem time.now taking effect on mysql entry , set wrong. problem here: we're unable set time.now setting. if possible somehow (is it?), dunno if fixes problem. did ever have such problem or ideas cause it? there 2 things configure rails. the ...

Picasa in iPhone using GData -

i have implement picasa client iphone. have few queries in regards. api deprecated now? if still implement them now? can find tutorial on same. don't know implementing google data. newbie iphone development. came across few pages said there in not enough documentation on same. have implement picasa scratch plz guide me. thanx , regards start learning general iphone programming; there numerous books that, such conway & hillegass . once comfortable cocoa touch development on iphone, can use gdata objective-c library access albums , photos on picasa web albums. library includes sample photos application showing how use picasa web albums api browse, download, , upload photos , videos.

sql server - how to create a table from an excel sheet? -

is there easy tutorial? i'd create table matches excel table, possible "create table excel sheet"? you can use import , export wizard if you're importing small number of sheets. in sql server management studio, right click on database name, tasks -> import data. follow wizard.

ipython showing gibberish when debugging Django with Netbeans -

i'm using netbeans coding django. when insert: import ipdb; ipdb.set_trace() flow execution gets stopped shows gibberish, such as: [1;32m/path/to/file/models.py[0m(344)[0;36macceptbid[1;34m()[0m [1;32m 343 [1;33m [1;32mimport[0m [1;37mipdb[0m[1;33m;[0m [1;37mipdb[0m[1;33m.[0m[1;37mset_trace[0m[1;33m([0m[1;33m)[0m[1;33m[0m[0m [0m[1;32m--> 344 [1;33m [1;32mreturn[0m [1;37mself[0m[1;33m.[0m[1;37msenderid[0m[1;33m([0m[1;33m)[0m [1;33m==[0m [1;37muser_obj[0m[1;33m.[0m[1;37mid[0m[1;33m[0m[0m [0m[1;32m 345 [1;33m[1;33m[0m[0m [0m i can use next, skip , pdb. can not see i'm in code, forces me use pdb instead of ipdb. these ansi escape codes , used text colours in ipdb's output. reason, terminal you're debugging in not accepting codes , printing them text. may able find setting in netbeans either change terminal reporting as, or accepts.

iphone - How to jump among UIViewControllers? -

a upcoming iphone app comes 20 uiviewcontroller s not have hierarchical relationship among them. potentially uiviewcontroller can/will jump uiviewcontroller . best way handle switching among uiviewcontroller s app? thanks! you'll need object manage view controllers. can app delegate, or can object dedicated managing views. depending on how app works, may want create managing viewcontroller present specific views in manner similar uitabbarcontroller or uinavigationcontroller. in case, each of 20 uiviewcontrollers have views presented subview of managing viewcontroller.

Batch File Console -

how can hide console of running batch file batch running cmd or start>run you can try couple of things: schedule user other you. or cmd /c start /min your.cmd or this wsh/vbscript run batch file in hidden window: 'mycmd.vbs set wshshell = wscript.createobject("wscript.shell") cmd = "c:\bin\scripts\mycmd.cmd" return = wshshell.run(cmd, 0, true) set wshshell = nothing

javascript - Stacking notification bars -

i notification bars used in stackoverflow. have found jquery plugin makes notification bar possible few lines, plugin not seem stack multiple notifications bars when required. does know of better plugin or how plugin below stack bars more notifications become available? http://www.dmitri.me/blog/notify-bar/ ... <body> <div id="notificationarea"></div> <!-- rest of website --> </body> </html> then create notifications in jquery: $('#notificationarea').prepend('<div class="notification">this notification</div>'); its bit basic, should trick, , because "prepending" stacking looking for. can use append() too, assuming you'd want recent notifications on top. to "x" (close) button have link in notification class of notifcationclose , do: $('.notificationclose').click(function(){ $('this').parents('.notification').remove(); })...

javascript - hot to date indide parameter in xml -

i made code inserting data system mail know work xml file. problem try create javascript code getting current date of day, , put inside filed date, without success. i know hot create date in javascript, problem in thx xml file, mean how can impplemt date inside filed date in xml file. the code(xml side): 123456 now complete english 1274 liran ** 413 3280 86308 ; unix email;dateofday liroy7@gmail.com;(i want here return date javascript) thanks, i'm not sure understand, can use gettime() on date objec insert xml file milliseconds, , if need convert javascript object can parse directly. function putinxmlfile(d) { writetoxml(d.gettime()); } function getfromxmlfile() { var date = new date(getfromxml()); } it works because javascript date object can parse milliseconds epoch (which returned gettime).

php - getting a variable from a public scope to connect database -

<?php $settings['hostname'] = '127.0.0.1'; $settings['username'] = 'root'; $settings['password'] = 'root'; $settings['database'] = 'band'; $settings['dbdriver'] = 'mysql'; /** * database */ class database { protected $settings; function __construct() { } function connect() { $this->start = new pdo( $this->settings['dbdriver'] . ':host='. $this->settings['hostname'] . ';dbname='. $this->settings['database'], $this->settings['username'], $this->settings['password'], array(pdo::attr_persistent => true)); $this->start->setattribute( pdo::attr_errmode, pdo::errmode_warning ); } } ?> ok im still student today im learning scope , connections database question how can put $settings out of class in protected $settings in class ? you on right path in code show: don't use pu...

ASP.NET: Cookies, value not being reset, cookie not being removed -

i have cookie called "g" values "y" or "n" i set this: response.cookies("g").value = "y" response.cookies("g").expires = datetime.now.addhours(1) i change this: request.cookies("g").value = "n" and try destroy this response.cookies("g").expires = datetime.now.addhours(-1) the cookie gets set fine, cannot change value or destroy it thanks! try deleting way: if (request.cookies["g"] != null) { httpcookie mycookie = new httpcookie("g"); mycookie.expires = datetime.now.adddays(-1); response.cookies.add(mycookie); } i think if try creating cookie , adding response should work. you want add in new cookie response has same name. recommend going day , not hour. to change value of cookie this: if (request.cookies["g"] != null) { httpcookie mycookie = new httpcookie("g"); mycookie.expires = datetime.now.addhou...

c# - How to resize the windows form dynamically in mobile application? -

i developing mobile application in c#. using keyboard launch functionality launch keyboard on mobile device when 1 of textbox gets focused. using following code. private void inputpanel1_enabledchanged(object sender, eventargs e) { inputenabled(); } private void inputenabled() { int y; if (inputpanel1.enabled) // sip visible - position label above area covered input panel y = height - inputpanel1.bounds.height; else // sip not visible - position label above bottom of form y = height; // calculate position of top of label //y = y - mainpanel.height; //this.dock = dockstyle.top; //mainpanel.location = new point(0, y); this.size = new size(this.size.width, y); this.autoscroll = true; //this.autoscrollposition = new point(this.autoscrollposition.x, descr...

delphi - MSXML - Namespaces info not persisting -

i using msxml 6.0 perform transform of own xml xml format. not sure if maybe don't understand how msxml works, believe have noticed strange behaviour it.... i adding in namespaces xml doc using setproperty method e.g. xmldocument.setproperty('selectionnamespaces', ' xmlns:ms=''http://mydomain.com/2010/myschema'''); then building xml using own custom serializer in memory (not saving disk). once serialized load in xslt file , perform transformation using transformnodetoobject e.g. appxmldoc.transformnodetoobject(xslxmldoc, astreamfortransformedxml); the problem transform working none of specific template matching xpath have in is. eliminated problems xslt file running test data through visual studio , worked expected. assumed must have been encoding issue made sure documents involved being read/written out utf-8....still no luck. here example of transform looks like: <?xml version="1.0" encoding="utf-8"?> ...

shell - removing trailing whitespace for all files in ediff-trees session -

i using handy ediff-trees.el http://www.emacswiki.org/emacs/ediff-trees.el compare 2 versions of pile of python code provided 1 of project partners. unfortunately, these guys checkin in code trailing whitespace (extra tabs here , there...) creating ton of false positive diffs, makes identifying changes , patching them on one-by-one unworkable. does know of neat way of making emacs strip trailing whitespace lines automatically visits each of files in 2 directories comparing during execution of m-x ediff-trees. if cannot achieved auto-magically in emacs, shell script traverses directory structure , removes trailing whitespace python source files (*.py) suffice. can run on both directories before performing diff. apparently these options mitigate whitespace issue. (setq ediff-diff-options "-w") (setq-default ediff-ignore-similar-regions t) but, after testing not appear solve problem. also, following enabled in .emacs configuration: ;; strip trailing white...

javascript - question regarding serializeArray and passing into url -

i not totally familiar javascript, jquery. i trying following. note a-f names dropdown menus. can clarify? thanks var a_params = $("#a").serializearray(); var b_params = $("#b").serializearray(); var c_params = $("#c").serializearray(); var d_params = $("#d").serializearray(); var e_params = $("#e").serializearray(); var f_params = $("#f").serializearray(); params.push({ name: 'menu_mode', value: '2-1' }); $.get("./scripts/model.cgi", a_params,b_params,c_params,d_params,e_params,f_params, function(data){ $("#grapharea").html(data); $("#prog").html(" "); }); more comments: in cgi script dumping inputs see if receiving values a-f_params isn't case. ideas why? you have create 1 array(or jquery-object in case) object's, , serialize array. $('#a,#b,#c,#d,#e,#f').serializearray();...

javascript - Looping in jQuery -

i tring loop loop jquery command 5 times. here code: for(var = 0; < 5; i++) { $("#droppable_"+i).droppable({ activeclass: 'ui-state-hover', hoverclass: 'ui-state-active', drop: function(event, ui) { $(this).addclass('ui-state-highlight').find('p').html('dropped!'); } }); } for reason can't work. can me please? your updated code works fine. remember need set draggable. working example (using loop) http://jsfiddle.net/t56te/ $("#draggable").draggable(); for(var = 0; < 5; i++) { $("#droppable_"+i).droppable({ activeclass: 'ui-state-hover', hoverclass: 'ui-state-active', drop: function(event, ui) { $(this).addclass('ui-state-highlight').find('p').html('dropped!'); } }); } ​ html: <div id="draggable" class="ui-widget-content"> ...

c# - Timeout updating blob field using Entity Framework 4 -

i'm using ef4 update table blob field. code snippet below: public void savepolicydocument(int policyid, int batchid, byte[] file) { policydocument policydocument = getpolicydocument(policyid, batchid); policydocument.documentimage = file; myentities.policydocuments.applycurrentvalues(policydocument); myentities.objectstatemanager.changeobjectstate(policydocument, entitystate.modified); myentities.savechanges(); } if blob field of policydocument null, updating blob field works fine. if there's value in blob field, timeout error in updating record. thanks ideas.

Silverlight dynamic loading: Xap or Dll? -

what advantages , disadvantages of creating external silverlight modules dynamic loading using: 1 - silverlight class library (dll on clientbin) 2 - silverlight application (xap on clientbin) 1) easier work with. fewer ways things. 2) harder handle, able have more stuff packed in it. it's ability pack things em makes them different. while xap takes bit more deal with, neither 1 big deal once you're set download them. setting download , uniqueness of loading them might harder part of loading them. of course there fact default xap application. (example of dynamically loading xap @ silverlight 4, dynamically loading xap modules )

groovy - unable to find com.sun.grizzly.tcp.http11.GrizzlyAdapter.setResourcesContextPath(String) -

i trying expose groovy service jersey , girzzly. got wierd error when i'm launching servlet container. here snippet lauch it: servletadapter adapter = new servletadapter(); injector injector = guice.createinjector(new gmediamodule()); guicecontainer container = new guicecontainer(injector); adapter.setservletinstance(container); adapter.setcontextpath("gmedia") adapter.addinitparameter("com.sun.jersey.config.property.packages", "gmedia.api.music.resources"); threadselector = grizzlyserverfactory.create(base_uri, adapter); here error: java.lang.nosuchmethoderror: com.sun.grizzly.tcp.http11.grizzlyadapter.setresourcescontextpath(ljava/lang/string;)v the error occurs @ grizzlyserveletfactory.create. i'm wordering why error occurs since metod exist on oject? sorry idiot. here i'm using grizzlywebserver ws = new grizzlywebserver(9999); servletadapter adapter = new servletadapter(); injector injector ...

xml - What is the preferred way to implement serializable classes in C# -

i've seen many different ways serialize objects in c# i'm not sure 1 use , when. in current situation i'm serializing exposure through wcf i'm guessing [datacontract] attribute way go. currently i'm reading in xml, exposing resulting object through wcf. deserializing xml have no access original classes (therefore i'm rebuilding class , can implement serialization whichever way want). has serializable wcf. but if [datacontract] case, why wouldn't use time instead of iserializable, or [serializable] attribute? so bit of 2 questions in one, use problem, , why there different ways serialize. datacontract place start basic serializing. if want control how object serialized use iserializable interface. also, data contract attribute not inherited, iserializable will iserializable has been around since .net 1.1. datacontract introduced in .net 3.0 simplify serializing cases.

java - How do I use patterns with convertNumber? -

i trying use f:convertnumber tag. want use multiple patterns. see can date tag , color tag. there way convertnumber tag without creating custom tag. my problem want able accept $ signs or no $ sign input. thanks in advance. for dollar sign (if number currencty), can try: <f:convertnumber currencysymbol="$" type="currency" /> and pattern can: <f:convertnumber pattern=".." />

php - Allow users to download files outside webroot -

hello using php allow users upload files , have them sitting in folder outside webroot (/var/www) folder security reasons. in folder /var/uploads. user uploads files specific records. once the uploaded files moved uploads folder, address of attachment stored in database. whenever user checks record, attachments specific record going displayed downloads. since out of webroot, unable them downloaded have url of http://localhost/var/uploads/attachment.txt do have solution or should downloadable folders child directories of webroot? <?php $con = mysql_connect("localhost","id","pass"); if (!$con) { die('could not connect: ' . mysql_error()); } mysql_select_db("db", $con); $result = mysql_query("select * attachments"); while($row = mysql_fetch_array($result)) { echo '<a href="'.$row[2].'" target="_blank">download</a>--'.$row[3].'<br>'; } mysql_c...

sql server 2005 - Are there more efficient alternatives to ASP.NET 2.0 anonymous Profiles? -

i discovered asp.net profiles few years , found quick , easy implement powerful functionality in web site. ended exclusively using "anonymous" profile properties because not using asp.net membership , wanted track information , provide personalization site's users though weren't logged in. fast forward 3 years , struggling keeping size of aspnetdb database within 3 gb limit of hosting provider. decided year ago keep 6 months of profile data , every month have run aspnet_profile_deleteinactiveprofiles procedure followed support request host truncate database file. the real downside have functionality implemented, web site relies on database , there downtime every time need truncate. today took cake - site down more 12 hours while doing maintenance on aspnetdb , ended creating failover copy of aspnetdb database web site online again (the original aspnetdb database still down write this). last year rewrote of functionality because storing small collection of bi...

Sharing variables - objective-c -

here code: ptyview *v = [[ptyview alloc] init]; [v senddata([charlieimputtext stringvalue])]; in ptyview.m file have this: void senddata(nsstring *data) { nsrunalertpanel(@"",data,@"",@"",@""); //used testing } but reason, code errors: saying ptyview may not respond senddata, , know code incorrect. how accomplish this? thanks! senddata not written in objective-c; c primitive function. should write method in obj-c like: - (void) senddata: (nsstring *)data { nsrunalertpanel(@"",data,@"",@"",@""); }

ide - Code hinting on protected properties in phpDesigner -

i'm using phpdesigner (7) ide, seems have 1 particular thing doens't support, or @ least can't find solution it. in framework model classes extend system_core class handles getting , setting on toplevel. therefore properties in model classes defined protected . what see in intellisense combo, shows when type code, properties of class. in order have make properties public , don't want. but intellisense shouldn't make difference (my logical opinion). there way show class properties in intellisense?

asp.net - Two asp:content in web content form -

whenever create new web content form in asp.net , select master page. 2 asp:content controls. if delete first 1 page still works fine. is bug or functionality the master page has 2 placeholder controls. when select master page give template both, not required use them both. if wanted delete one, same leaving content control empty.

printing - Cancel documents in the printer queue from java in windows -

is possible cancel print job once has been put document queue in windows java code? it looks you're looking (note haven't tested example myself) http://docs.oracle.com/javase/7/docs/api/javax/print/cancelableprintjob.html

asp.net mvc - Required Field Doesn't work for one field but does for other -

i using standard validation mvc, acrossed fluent nhibernate [displayname("product name")] [required(errormessage = "product name required")] public virtual string productname { get; set; } [datatype(datatype.multilinetext)] public virtual string description { get; set; } [datatype(datatype.currency)] [required(errormessage = "price required")] public virtual decimal price { get; set; } [required(errormessage = "quantity required")] [range(0, 100000, errormessage = "must postive number less 100000")] public virtual int quantity { get; set; } public virtual bool live { get; set; } public virtual icollection<attribute> attribute { get; set; } public virtual icollection<images> images { get; set; } this makes "product" class... reason name doesnt validate required field things quantity , price do. view has these in it <tr> ...

Use Glassfish embedded with MySQL -

well, title says everything, how can define jdbc-connection in embedded glassfish able use mysql database jdbc resource?? thanks replies! i got working, simpler thought! i've used jdbc had configured installed glassfish , copied configuration domain.xml. for embedded glassfish able use mysql driver, put dependency in maven...

iis - Hosting Student Projects on IIS7 in cloud -

i planning teach asp.net mvc course time. host students project's on web server accessible via internet. effect planning rent windows machine on amazon ec2. students uploading asp.net websites can see projects online , allow other students access them well. question how set windows 2008 server iis 7.x support functionality. should create virtual directory/application each student under iis site , expose virtual directory/application through interface students can access publish content. should use sftp or webdav. don't want create windows user accounts on machine each student. if has experience regard this, hear them. suggestions/links appreciated well. you can have students use appharbor . deploying done pushing code git, on heroku . think more elegant using sftp og webdav. pledge offer free plan should work students purposes.

eclipse - Android App began crashing, I can't explain it -

i putting finishing touches on app today. created layout-large main.xml, , drawable-hdpi few of app's images. working fine, on both wvga , hvga emulators. added "help" button, no associated code, menu-key menu. working. can't remember changing else, when attempting load main activity of app force close error, , in logcat: 10-07 18:17:08.812: error/androidruntime(325): java.lang.runtimeexception: unable start activity componentinfo{com.nickavv.quickchange/com.nickavv.quickchange.quickchange}: java.lang.nullpointerexception 10-07 18:17:08.812: error/androidruntime(325): @ android.app.activitythread.performlaunchactivity(activitythread.java:2663) 10-07 18:17:08.812: error/androidruntime(325): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2679) 10-07 18:17:08.812: error/androidruntime(325): @ android.app.activitythread.access$2300(activitythread.java:125) 10-07 18:17:08.812: error/androidruntime(325): @ android.app....

c# - Html.TextboxFor default value for Integer/Decimal to be Empty instead of 0 -

i using default asp.net mvc 2 syntax construct textbox's integer or decimal asp.net mvc web app: <%: html.textboxfor(model => model.loan.interestrate) %> pretty straight forward, problem inherently of fact binding model objects decimal or int , non-nullable, print value 0 (0) on page load if model empty (such in add mode crud template) , 0 incorrect value , invalid page validation also. how have textboxes have no starting value, empty textbox, understand 0 potential value, accept values greater 0 anyway, not problem me. i tried casting nullable decimal , non-for helper (which not ideal), alas, still receiving default '0' value. ideas?? <%: html.textbox("loan.interestrate", model.loan.interestrate == 0 ? (decimal?)null : model.loan.interestrate) %> thanks. you can override default template putting custom template in /shared/editortemplates or controller in /controllername/editortemplates. i use 1 int's. named int3...

How to call the Route Name in Html.ActionLink asp.net MVC? -

i have route routes.maproute( "viewgames", // route name "psp/{controller}/{action}", // url parameters new { controller = "games"} // parameter defaults ); and used <%= html.actionlink("god of war", "godofwar", "games")%> though gives me link somesite.com/psp/games/godofwar/ other link became example homecontroller became somesite.com/psp/home/about/ ? how can call routename other won't have viewgames route? i dont want try <a href="/psp/games/godofwar/"> not good.. . you explicitly call route using <%: html.routelink("link_text", "route_name", route_parameters) %> all overloads html.routelink here

how to display the name of wifi AP using reachability wifi example on iphone -

i want display infomation of wifi ap connected , how ??? + (reachability*) reachabilityforlocalwifi; {//nslog(@"cheking addresss "); struct sockaddr_in localwifiaddress; bzero(&localwifiaddress, sizeof(localwifiaddress)); localwifiaddress.sin_len = sizeof(localwifiaddress); localwifiaddress.sin_family = af_inet; //nslog(@"destination%@",localwifiaddress.sin_len); // in_linklocalnetnum defined in <netinet/in.h> 169.254.0.0 localwifiaddress.sin_addr.s_addr = htonl(in_linklocalnetnum); reachability* retval = [self reachabilitywithaddress: &localwifiaddress]; if(retval!= null) { retval->localwifiref = yes; //printf("%i",localwifiaddress); } return retval; }

javascript - How to work with with Google playground code in offline? -

<script type="text/javascript" src="http://www.google.com/jsapi"></script> this script need call net.is possible download code no, not really, don't see benefits of having downloaded. reason google provides these apis benefit sharing cached resources across web. instance it's letting user's browser use same cached copy of jquery script across different websites. can check here apart allowing access shared library, other scripts can load here google apis in cases have google resources available on web.

How to store and index a typical TEXT field in MySQL? -

how store , index typical text field in mysql. in case text field have max length of 500 characters, understand beyond 255 chars varchar behave text field, need data indexed well. having clauses count type of string appearances in field. store text , use fulltext on or store varchar(500) , index it? native full text indexing on mysql requires engine myisam. beyond that, i'd recommend using varchar(500) rather text because: text allow more 500 characters searching against varchar faster text, indexed or otherwise

php - Python: how to make HTTP request internally/localhost -

i want send parameters python script on server php script on server using http. suggestions? this pretty easy using urllib : import urllib myurl = 'http://localhost/script.php?var1=foo&var2=bar' # default action response = urllib.urlopen(myurl) # output assuming response code 200 data = response.read()

php - php_excel07- how to replicate the properties of one row to next row -

my application needs export xlsx, using php_excel07. working fine facing small issue, lik this: "i want replicate properties of row next row". ex if have row num 1 predefined height, width, color , borders,etc..then these same properties of row1 have replicated next row i.e, row2..is there anyway this. without knowing details of styling: manually read appropriate properties first row/the cells of first row, , set them in second. there no explicit method provided clone styles 1 row another. however, if cells in first row identical, can apply style range of cells rather having individually. personally, build style arrays can replicate need them. the worksheet methods: duplicatestyle() duplicatestylearray() and style method: applyfromarray() can of use.

c# - Populate DataTable with records from database? -

this method data datatable private function getdata() pageddatasource ' declarations dim dt new datatable dim dr datarow dim pg new pageddatasource ' add columns dt.columns.add("column1") dt.columns.add("column2") ' add test data integer = 0 10 dr = dt.newrow dr("column1") = dr("column2") = "some text " & (i * 5) dt.rows.add(dr) next ' add dataview datatable pageddatasource pg.datasource = dt.defaultview ' return datatable return pg end function it returns datatable "pg" what changes must make method records table in database? c# examples great see reply code , changes.... if linq sql not option can fall ado.net. need create connection database , create , run command retrieve data require , populate datatable. here example if c#: // create connection database sqlconnection conn = new sqlconnection("data source=mydbserver;initia...

php - Amending a join query to add a new value to a query -

the query below works well. pulls information 3 mysql tables: login, submission, , comment. it creates value called totalscore2 based on calculation of values pulled these 3 tables. the mysql tables "comment" , "submission" both have following fields: loginid submissionid in table "submission," each "submissionid" has 1 entry/row, , 1 "loginid" associated it. in table "comment," field "submissionid" have several entries/rows, , associated multiple "loginid"s. each time 1 of "submissionid"s in "comment" associated same "loginid" has in table "submission," add factor equation below. multiple instances times (-10). how this? thanks in advance, john $sqlstr2 = "select l.loginid, l.username, l.created, datediff(now(), l.created) + coalesce(s.total, 0) * 5 + coalesce(scs.total, 0) * 10 + coalesce(c.total, 0) totalscore2 login ...

extension method for a method C# -

is there way have extension method on method? example method takes user object parameter , need security check if user can use method @ beginning of method. can method have extension method "check can user use me" , return bool. thanks. you can use aspect oriented programming (aop) implement cross-cutting security checks in code. in .net have choice of several aop frameworks, example: spring.net postsharp in particular postsharp documentation has some nice examples on how implement security using aop .

history - git mv records move? -

when invoking git mv file1 file2 record move internally (for history tracking in log) or same invoking mv file1 file2 , git rm file1 , git add file2 ? git mv same 3 operations listed. although git not explicitly record move in repository, move detected later whenever ask history. example, adding --follow switch git log automatically finds files have been renamed.

c# - How to add a jscript or html item template via an add-in in visual studio -

i'm currenlty working on add-in , require functionality add custom item templates project programatically. i'm installing templates (which of .zip format) in ..\visual studio 2010\templates\itemtemplates\. from within add-in call following code: string templatelocation = (solution solution2).getprojectitemtemplate(templatename, language); projecttoaddto.projectitems.addfromtemplate(templatelocation, nameofnewitem); if item template c# file if use "csharp" language variable , place template in language folder "visual c#" or "visual web developer\visual c#" works fine; template discovered , implemented correctly within visual studio. if create jscript or html template, getprojectitemtemplate method throws exception if supply language "jscript" or "html". i've tried placing templates in both "itemtemplates\jscript(html)" , "itemtemplates\visual web develerop\jscript(html)" no luck. anyone ha...

java - how can i increase/decrease size of window on click event? -

i developing simple swing app in have main window 3 buttons. when click on first button opens new window of (200,200) dimension. when click on second button, newly opened window's height should increased , when click on third button height should decreased. can me code.... thanks in advance. you following on newly opened windows want resize: jframe fr=getnewlyopenendwindowreference(); // reference jframe fr.setsize(fr.getsize().getwidth() + 10,fr.getsize().getheight() + 10); fr.repaint(); this should increase size of jframe length , widthwise 10 pixels per call.

php - Display MYSQL query result in horizontal view -

we have employee attendance system in mysql database dont have reporting capability, trying generate reports using php. let me explain : employee punch in , punch out daily. these punch ins , outs stored in mysql database table ( attendance). table contain 5 fields punch in, punchout, employeeid, note, attendanceid. our employee names , other details stored in other table ( employee). my query want generate report using these 2 tables in horizontal view. example : column1 : employee name column2 : punchin column3 : punchout column4 : punchin column : punchout i able generate daily report employees looking generate weekly/monthly report. pls help. thanks, raj it sounds trying pivot query (switch rows , columns). mysql has no support this, can simulated. easier data need , parse php, however. it sounds (and guess) want employee first column , punch ins/outs in same row employee. here's crack @ want do: $data = select_all_relevant_data_with_mysql...

Salesforce Lead Tracking integration with Contact forms on Wordpress -

i have raised question on wp answers well. since uses salesforce too, wasn't sure if i'd response there. i using contact form 7 on website , integrate salesforce lead tracking it. i able add hidden field oid suggested on site but when submit contact form after adding this, gets stuck , never returns. remove hidden field, starts working fine. has been able integrate lead tracking system wordpress contact form plugins? i tried using cform instructions provided here . gives warning fopen failed. assume thats because fopen not allow write operations http wrappers. not sure how author managed working! would appreciate on this! not want use salesforce web-to-lead form. thanks. from research integrating salesforce cforms basic principal need post info needs correspond cform post info. when writing post liked research process using example form them - embedded code provided - found way make cforms submit data, formatted way specified https://www.salesforce.c...

download - android: Detect if App was downloaded from market -

i've got app distribute through market place , own site. how i, using 1 build , 1 key, check see if app downloaded market place or not? this question answered having code signed different keys, ideally want single build. packagemanager.getinstallerpackagename(context).equals("com.google.android.feedback") http://developer.android.com/reference/android/content/pm/packagemanager.html#getinstallerpackagename(java.lang.string )

winforms - Color datagridview rows without freezing C# -

i have datagridview 5000 entries. , want color rows based on values. here's how it: foreach (datagridviewrow row in rows) { var handlingstage = (esourcehandlingstage)row.cells["handlingstage"].value; switch (handlingstage) { case esourcehandlingstage.notstarted: row.defaultcellstyle.backcolor = unhandledcolor; row.defaultcellstyle.selectionbackcolor = color.blue; break; case esourcehandlingstage.given: row.defaultcellstyle.backcolor = givencolor; row.defaultcellstyle.selectionbackcolor = color.blue; break; case esourcehandlingstage.taken: row.defaultcellstyle.backcolor = takencolor; row.defaultcellstyle.selectionbackcolor = color.blue; break; case esourcehandlingstage.handled: row.defaultcellstyle.backcolor = handledcolor; ...

html - how to use auto with a height in css -

how use auto height? need hight 250px default auto working cant default hight. perhaps min-height looking ?

copy - Bash copying files with variables -

new bash scripting, i'm writing script copy tv shows accross download folder archive folder. so far have this: find `*`show1`*`.avi | cp \"" $0 "\" "/mnt/main/data/tv/show1" find `*`show2`*`.avi | cp \"" $0 "\" "/mnt/main/data/tv/show2" i understand not best method, skills of bash quite limited. i need know how can copy found file, or nothing if doesnt find matching (this cron script). eg. find `*`show1`*`.avi | cp "show1.hello.world.xvid.avi" "/mnt/main/data/tv/show1" find `*`show2`*`.avi | cp "show2.foo.bar.xvid.avi" "/mnt/main/data/tv/show2" find `*`show3`*`.avi | cp "null (nothing found)" "/mnt/main/data/tv/show3" thanks! edit : solved http://pastebin.com/anlihr86 find . -name "*show1*" -exec cp {} /mnt/main/data/tv/show1 \; (replace . directory want files into)

php - validation on dropdown in javascript -

i have dropdown named po_no same id coming ajax file in po_no getting 2 values in format of 1025*3 when put validation on dropdown in javascript write code if(document.getelementbyid('po_no').value=="") { alert("choose purchase order number"); return false; } but code not work plz give me ideas does javascript run after "po_no" added dom? if runs before, "document.getelementbyid('po_no')" return null.

javascript - Imagemap Rollover and Tooltip -

<img src="http://www.w3schools.com/tags/planets.gif" width="145" height="126" alt="planets" usemap="#planetmap" /> <map name="planetmap"> <area shape="rect" coords="0,0,82,126" href="sun.htm" alt="sun" /> <area shape="circle" coords="90,58,3" href="mercur.htm" alt="mercury" /> <area shape="circle" coords="124,58,8" href="venus.htm" alt="venus" /> </map> i need 1) change opacity on mouseover highlight hovered area , 2) add simple tooltip show details of hovered area. is possible? there jquery plugin let me both. many help! http://www.frankmanno.com/ideas/css-imagemap/ http://frankmanno.com/ideas/css-imagemap-redux/

javascript - How to get image id using jQuery? -

i have written code this. <img id='test_img' src='../../..' /> i want id of image on image load like, $(img).load(function() { // here want image id i.e. test_img }); can please me? thanks. $(img).load(function() { var id = $(this).attr("id"); //etc }); good luck!! edit: //suggested others (most efficient) var id = this.id; //or if want keep using object var $img = $(this); var id = $img.attr("id")

sql - How to document database efficiently (tables, attributes with definition)? -

we have large database (in sql server 2008) many tables. have bought red gate's sql doc documentation purposes. document database in detailed way. best practice in documenting database? how document attributes definitions? sql doc documents database nicely how add attribute definitions document (is there automagigal way)? we use extended properties "tag" constraints, tables, indexes, viws, procs, lot. (we use sql doc) it's mentioned on interweb quite lot too

javascript - How to use jQuery to select this parent? -

i have recursive menu need children items effect parent. in example below, how add "selected" class if of children have "selected" class? <ul> <li class="administration first"> <a href="/administration.aspx"><span>administration</span></a> <ul> <li class="users first selected"><a href="/administration/users.aspx"><span>users</span></a></li> <li class="forms last"><a href="/administration/forms.aspx"><span>forms</span></a></li> </ul> <div style="clear: both;"></div> </li> <li class="analytics"><a href="/analytics.aspx"><span>analytics</span></a></li> <li class="options"><a href="/options.aspx"><sp...

How to detect opened sockets in Windows? -

in windows xp (sp2 if necessary), there way detect, userspace application, tcp/udp socket (from any process) has opened? know of getextendedtcptable() , getextendedudptable() functions, detect currently opened sockets. sockets close after they're opened way i'd able detect existence being notified when open. if no such mechanism exists in userspace, i'm willing go kernel space functionality. there documented/undocumented features this? you need write winsock lsp or spi driver in order detect without having hook every running process directly.

Using part of a composite primary key in a composite foreign key in NHibernate -

we have big db (~200 tables) entirely uses composite primary keys , composite foreign keys, using single "base table" every other table inherits part of primary key: parent has single column primary key parentid child has composite primary key (parentid, childid) , foreign key parentid nephew has composite primary key (parentid, nephewid), foreign key parentid , foreign key (parentid, childid) and on. until managed whole shebang orm framework of our own, we're considering using nhibernate, i've been assigned learn (i've downloaded v2.1.2). the mappings: child <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="assembly" namespace="namespace"> <class name="child" table="child"> <composite-id name="idchild" class="childid"> <key-many-to-one name="parent" column="parentid" class="parentid"></key-many-to...