Posts

Showing posts from May, 2011

C# Selenium WebDriver: Get HTTP Status Code -

i'm using selenium, c#, nunit write automated tests. is possible http status code webdriver tests fail due http requests can alerted user? not without external tool no. you see, has been brought number of times in past , 1 of largest "issues" within selenium's official issue tracker . particular issue has been bounced around , decided it's outside scope of selenium. this however, not mean not possible. thankfully, using c#, it's little easier may think. recently, 1 of selenium developers wrote blog post outlining exactly how in c# . 3 part blog post explain each step , uses external tool, called fiddler (which, way, 1 awesome tool). fiddler proxy , has c# api allows intercept requests. therefore means can "point" selenium use proxy, , hook fiddler's api check status code request has. i merely linking blog post rather giving code since it's pretty thoroughly explained in posts. perhaps try it, , come if issues impl...

ibm mobilefirst - IBM Worklight 6.0 - Custom authentication - custom java code doesn't seem to be found -

environment config : windows server 2008 r2 entreprise websphere application server v7 worklight server v6 database derby (default install trough worklight server install) my application contains in server/conf/authenticationconfig.xml customlogin module use 2 java class located in server/java/com/authentication/ after deploying , starting application on worklight server, when try reach using following url : http://ip_address:9080/context_root/console i have error in websphere systemout.log : com.ibm.ws.webcontainer.webapp.webapp logerror srve0293e: [servlet error]-[worklight project not initialized]: javax.servlet.servletexception: worklight project not initialized @ com.worklight.core.auth.impl.authenticationfilter.dofilter(authenticationfilter.java:110) @ com.ibm.ws.webcontainer.filter.filterinstancewrapper.dofilter(filterinstancewrapper.java:188) @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:116) @ c...

mysql - PHP: how to save result of recursive function in array? -

i have changed version of recursive function... http://www.phpbuilder.com/articles/databases/mysql/handling-hierarchical-data-in-mysql-and-php.html what need way save returned value of function in array can reverse order of array elements. function works me, need way save values. here code... function display_children($category_id, $level) { global $database; $result = mysql_query("select * parents id_roditelja='$category_id'") or die(mysql_error()); $niz = array(); while ($row = mysql_fetch_array($result)) { echo str_repeat(' ', $level) . $row['naziv'] . "<br/>"; array_push($niz, display_children($row['parent_id'], $level + 1)); //this 1 way tried, , $niz exact number of elements each null //in $niz array need store values of recursion var_dump($niz); } } i think want this: function display_children/* <- must same */($category_id, $level) { global $database; $result = mysql_query...

javascript - JQuery DatePicker Multiple Input -

using jquery , asp.net c#3.0. i have following script: <script> $(document).ready(function () { $("[id$=txthiddendate]").datepicker({ showon: "button", buttonimage: "../../images/calendar-icon.gif", buttonimageonly: true }); }); </script> there 3 separate fields day month , year.(txtday, txtmonth, txtyear) how return date these 3 separate fields? many thanks! edit: want keep hidden field aswell html setups other inputs hold pieces of date. may want make these hidden. <input id="picker"/><br> day: <input id="day"/><br> month: <input id="month"/><br> year: <input id="year"/> javascript specifies onselect function parses different pieces of date , assigns them respective inputs. $(document).ready(function () { $("#picker").datepicker({ showon: "button...

azure - Is Local Cache works with Co-Located Cache -

i using azure co-located cache.can enable local cache co-located cache , if enable how works. co-located cache not remove distributed nature, yes should able enable local cache on co-located cluster. on single node colo cache, wouldn't make sense local cache no network hop saved. in local cache client maintains local copy of cached objects. cache solution, need see degree of staleness of data can swallow , how invalidate data. (use notifications etc.)

xml - Where can I find the xsi schema for namespace = http://www.w3.org/1999/XSL/Format -

i working xmlns:fo="http://www.w3.org/1999/xsl/format" . trying find xsd or dtd file namespace can work easier using ide . how find schema it? here 2 links have looked @ in past, besides w3c documentation. hope these help. schema central oxygenxml

ruby 2.0 - Can not require mysql2 with ruby2 -

i have updated ruby version 2.0.0 rvm. installed mysql2 gem -> % gem install mysql2 building native extensions. take while... installed mysql2-0.3.13 1 gem installed installing ri documentation mysql2-0.3.13... building yard (yri) index mysql2-0.3.13... installing rdoc documentation mysql2-0.3.13... after tried require mysql2 in irb. results in below error! -> % irb 2.0.0p247 :001 > require 'mysql2' loaderror: cannot load such file -- mysql2/mysql2 /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require' /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require' /home/sayuj/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `<top (required)>' /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:60:in `require' /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_rub...

angularjs - How do I broadcast from the http interceptor? -

using angularjs 1.2 my interceptor looks this: $httpprovider.interceptors.push(['$q', '$log', '$rootscope', function ($q, $log, $rootscope) { return { 'request': function(config) { $rootscope.$broadcast('spin'); console.info('request!'); return config || $q.when(config); }, ... in nav controller (which handles , binds loader/spinner view): $rootscope.$watch('spin', function(event) { console.info('spin'); $scope.spinner++; }); the broadcast seems happen once @ end of responses received, though can see many request! in console log. how must manage global spinner/loader? edit wish show loader/spinner in navbar whenever data being loaded. the $watch function doesn't listen broadcast messages. watches changes on scope. in case, calling function whenever $rootscope.spin chan...

visual studio 2010 - Partial functionality of Addin with Windows Installer -

i have had trouble excel addin , windows installer. tried following steps set out in demo (shown on pluralsight) on test project , works fine. for custom addin, used vs2010 , addin targets excel 2007. there more projects in solution addin project , setup project. after have run msi file created setup project, if have message box in thisaddin_startup method of thisaddin.cs class, shows messagebox, not display ribbon tab created in same project. have tried see whether errors show creating vsto_suppressdisplayalerts , vsto_logalerts variables, don't see logfiles. after build projects , create msi , setup.exe files, clean solution in visual studio, , try installation external msi file, since i'm testing on development computer now. perhaps should add, if run setup.exe file, don't messagebox. my addin not disabled, , ticked in com-addins dialog. have registry set hkey_current_user. why see messagebox, not tab on ribbon? i found there exception when ribbon load...

tfs2012 - TFS 2012 continuous integration deployment fails - Directory not empty -

sporadically error an error encountered when processing operation 'delete directory' on 'd:\xxx'. error code 0x80070091. directory not empty. i'm using web deploy wmsvc , user has full access root of site (set through iis > configure web deploy publishing edit or less frequently: c:\program files (x86)\msbuild\microsoft\visualstudio\v11.0\web\microsoft.web.publishing.targets (4377): web deployment task failed. (unable perform operation ("delete file") specified directory ("d:\xxx\bin\microsoft.practices.servicelocation.dll"). can occur if server administrator has not authorized operation user credentials using. learn more at: http://go.microsoft.com/fwlink/?linkid=221672#error_insufficient_access_to_site_folder .) i follow instructions user (a domain user) makes no difference. publish settings saved have publishmethod="msdeploy" instead of wmsvc. note, deploys correctly 95% of time. ...

c++ - linked lists and function pointers -

i trying learn function pointers , linked lists. in class(as private) have int (*m_pointertofunction)(int); and void list::apply_all( int (*pointertofunction) (int)){ m_pointertofunction = pointertofunction; } and int triple(int i) { return 3*i; } which called list l2 with l2.apply_all(triple); what part missing in here? doesn't seem nodes in list. edit: problem solved! comments , answer, never did nodes. iterates through list , works fine, :) void list::apply_all( int (*pointertofunction) (int)){ node *temp = head; while(temp){ temp->value = pointertofunction(temp->value); temp = temp->next; } } there's no need store function pointer in apply_all() method. rather, need setup loop iterates on each element in list, , calls function pointer each one. judging triple() function, want store result in list too, or else won't anything. it's hard give example code without knowing how rest of lis...

java - Unrecoverable exception while generating token using GoogleAuthUtil -

i want use google authentication login in application .for have followed link followed link my code : package com.android.mytokengenerator; import java.io.ioexception; import com.google.android.gms.auth.googleauthexception; import com.google.android.gms.auth.googleauthutil; import com.google.android.gms.auth.googleplayservicesavailabilityexception; import com.google.android.gms.auth.userrecoverableauthexception; import com.google.android.gms.common.googleplayservicesutil; import com.google.android.gms.common.scopes; import android.os.asynctask; import android.os.bundle; import android.accounts.account; import android.accounts.accountmanager; import android.app.activity; import android.app.dialog; import android.content.intent; import android.util.log; import android.view.menu; public class mainactivity extends activity { string scope = "audience:server:client_id:server client key"; int my_activitys_auth_request_code = 200;@ override protected voi...

plone - How to render a template page by calling its method from TAL portlet(@@manage-portlets) -

how call method in filesystem tal portlet (made available collective.portlet.tal )? this how did it: defined new browserview ( createpictmenu.py in case) , registered renderer new portlet component: class addresstal(browserview) def my_address() address_bar = viewtemplatepagefile('templates/address_left.pt') # page template want new portlet. and in configure.zcml : <plone:portlet name="collective.portlet.tal.talportlet" interface="collective.portlet.tal.talportlet.italportlet" assignment="collective.portlet.tal.talportlet.assignment" view_permission="zope2.view" edit_permission="cmf.manageportal" renderer=".browser.createpictmenu.addresstal" addview="collective.portlet.tal.talportlet.addform" editview="collective.portlet.tal.talportlet.editform" /> then went localhost:8080/myproject/@@manage-portlets , selected tal portl...

php - Magento 1.7 show products from 2 categories in block -

i wanted create block display products 2 (or more) categories. i've tried in several ways don't work. how tried: /app/code/local/mage/catalog/block/product/fulllist.php (same list.php changed _getproductcollection() function:) protected function _getproductcollection() { $_productcollection = mage::getmodel('catalog/product') ->getcollection() ->joinfield('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left') ->addattributetoselect('*') ->addattributetofilter('category_id', array( array('finset' => '30'), array('finset' => '32')) ) ->addattributetosort('created_at', 'desc'); return $_productcollection; } then, @ 1 of cms pages tried use: {{block type="catalog/product_fulllist" template="catalog/product/list.phtml"}} ...

asp.net - c# - How to store ArrayList in ViewState? -

i want store arraylist value in viewstate but getting error: "type 'system.data.datarow' in assembly 'system.data, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089' not marked serializable" code: private void bindgridview() { dbconnection.open(); oledbcommand dbcommand = new oledbcommand("select emp_id,emp_name,father_name,gender,designation,department,location emp_master", dbconnection); oledbdataadapter dbreader1 = new oledbdataadapter(dbcommand); dataset dsemer = new dataset(); dbreader1.fill(dsemer); arraylist arrlist = new arraylist(); foreach (datarow dtrow in dsemer.tables[0].rows) { arrlist.add(dtrow); } //here getting error viewstate["ds"] = arrlist; empmastergrid.datasource = dsemer; empmastergrid.databind(); dbconnection.close(); } why need store arraylist in views...

javascript - ClearInterval undefined when button clicked -

suppose have few buttons , when clicked trigger setinterval, when clicked on different button previous setinterval doesn't clear or undefined. example: $("#button1").click(function () { var url = "xxx"; var min = "yyy"; getgraphcredentials3(min,url); var onehour = setinterval(function () { getgraphcredentials3(min,url); }, 5000); clearinterval(twohour); }); $("#button2").click(function () { var url = "zzz"; var min = "uuu"; getgraphcredentials3(min,url); var twohour = setinterval(function () { getgraphcredentials3(min,url); }, 5000); clearinterval(onehour); }); can please? much appreciated the scope of onehour , twohour functions function in they're declared, they're not visible other callback. you must declare variables in common scope. : var ...

java - JComponents changing positions for a frame if swing calls validate() in a Jpanel -

i have jpanel have components moveable. my problem if use action in panel locations of components in whole panel changing theire position top mid frame changing theire positions. debugged , know coming validate(). if use validate() manually happens without actions, too. so here code components used in panel: import java.awt.color; import java.awt.component; import java.awt.cursor; import java.awt.dimension; import java.awt.font; import java.awt.graphics; import java.awt.point; import java.awt.systemcolor; import java.awt.event.actionevent; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import java.util.arraylist; import javax.swing.abstractaction; import javax.swing.imageicon; import javax.swing.jbutton; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.jpopupmenu; import javax.swing.swingconstants; import javax.swing.uimanager; import org.pentaho.reporting.engine.classic.core.datafactory; import org.pentaho.reporting.engine.cla...

javascript - Chrome extension schedule eventPage to get data from server -

i developed chrome extension get's data server (like rss reader) , because data updatable want data periodically set files below: manifest.json: "permissions": [ "alarms", , , , ], "background": { "scripts": ["scripts/lib/jquery-1.9.1.min.js", "scripts/app/eventpage.js"], "persistent": false }, eventpage.js : var url = ".....=?"; function getjsondata() { $.getjson(this.url, function (data) { var newitems = []; newitems = data.query.results.item; localstorage.setitem("savedjsondata", json.stringify(newitems)); }); } chrome.alarms.onalarm.addlistener(function (alarm) { if (alarm.name == 'getnewjobs') { getjsondata(); } }); // create alarm: chrome.alarms.create('getnewjobs', { periodinminutes: 30 }); after new data server store them in loc...

scala - How to pass arguments to a function of arbitrary number of parameters via macro? -

i have deconstructed function , got vparams , , able call: case class action(f: function, ts: list[typename]) { def render(rulename: string): expr[unit] = c.expr[unit](q""" val p = ${c.prefix} val value1 = p.valuestack.pop().asinstanceof[${ts(0)}] val value2 = p.valuestack.pop().asinstanceof[${ts(1)}] p.valuestack.push($f(value1, value2)) """) } f of arbitrary number of parameters known @ compile time. how pass ts.count parameters p.valuestack function f ? how this: case class action(f: function, ts: list[typename]) { def render(rulename: string): expr[unit] = { val argnames = (1 ts.size).map(i => newtermname(s"value$i")) val args = argnames.map(name => ident(name)) val valdefs = (ts zip argnames).map { case (tn, argname) => q"val $argname = p.valuestack.pop().asinstanceof[$tn]" } c.expr[unit]( q""" val p = ${c....

dns - facebook like button is not working is not working with cyrylic domain -

facebook button not working cyrilic domains. i've tried diffrent methods, still cannot see it. can resolve it. did try punnycode (fore reference see http://en.wikipedia.org/wiki/punycode )? might want check punycode converter on http://mct.verisign-grs.com/ (first google result had) you try using punnycode converter cyrillic idn (internationalized domain name) unicode ascii (format readable browsers), like: unicode пример.ru ascii xn--e1afmkfd.ru im not sure if help, try use ascii version of cyrillic url in facebook code.

google app engine - GAE get user age -

my app requires know user's age. better fetch user's google account prompt user. i using users api google accounts userservice userservice = userservicefactory.getuserservice(); user user = userservice.getcurrentuser(); string email = user.getemail(); is there similar way can user's date of birth? no because user not contain information. see https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/users/user

com - why to put 32 behind thr regsvr32 while registering component object model? -

i excited know specific purpose put 32 behind regsvr. why not regsvr64 ? in explain significance of 32 here ? it's same historical name, have 2 versions of regsvr32.exe on 64-bit system: c:\windows\system32\regsvr32.exe - can register both 32 , 64 bit com dlls c:\windows\syswow64\regsvr32.exe - can register 32 bit com dlls

php - Replace all non-printable UTF-8 characters with spaces -

i need sanitaze user input , need remove characters can cause problems such null byte or useless ones(such \n or \t), because inputs or strings or html code. @ moment i'm using remove tab, break-line, etc: preg_replace('/\s+/','',$_post['id']) but isn't sufficent, have found this: preg_replace( '/[^[:print:]]/',' ',$_post['val']) but don't understand if strips characters shouldn't deleted, such german or arabic chars or punctation or symbols according php regex character classes [:print:] includes " printing characters, including space ". that means " visible characters , spaces (i.e. except control characters, etc.) " (see http://www.regular-expressions.info/posixbrackets.html ) ascii characters: [\x20-\x7e] unicode: \p{c}

rabbitmq - how to set queue/message durability to false in Spring AMQP using annotations? -

i wrote sample spring amqp producer running on rabbitmq server sends messages , consuming messages uisng messagelistener using spring amqp. here, want set queue , message durability false. please 1 me on how set "durable" flag false using annotations. here sample code @configuration public class producerconfiguration { protected final string queuename = "hello.queue"; @bean public rabbittemplate rabbittemplate() { rabbittemplate template = new rabbittemplate(connectionfactory()); template.setroutingkey(this.queuename); template.setqueue(this.queuename); return template; } @bean public connectionfactory connectionfactory() { cachingconnectionfactory connectionfactory = new cachingconnectionfactory("localhost"); connectionfactory.setusername("guest"); connectionfactory.setpassword("guest"); return connectionfactory; } } public class producer { public static void main(string[] args) throws...

PHP how to create JSON with localization arguments for APNS -

i want send json in apns following: { "aps" : { "alert" : { "loc-key" : "game_play_request_format", "loc-args" : [ "jenna", "frank"] }, "sound" : "default" }, } can explaine how can create in php? i have following json without key/args: $body['aps'] = array( 'alert ' => 'this messsage', 'sound' => 'default' ); $payload = json_encode($body); i have tried replace 'this message' array loc-key , loc-args not work. jus putting in data string not work.. hope can me. have tried multiple options , variations nothing works.. $body = array( "aps" => array( "alert" => array( "loc-key" => "game_play_request_format", "loc-args" => array( "jenna", "frank...

c++ - GLSL: no active uniforms/attributes after link -

after linking program both vertex , fragment shaders attached , feeding values, noticed nothing happens @ all, i.e. nothing rendered. after logging, found out program cannot find of uniforms. after more logging, found out there no active uniforms or attributes in program. double checked shader sources well, , variables used fo'sho (thus eliminating "optimalisations"). checked source parsing , it's fine too. i, therefore, have no idea may causing this. this parsing/compiling function: int _loadprogramfromsource(gluint shader,const char* filename) { std::ifstream file; file.open(filename, std::ios::in); //check if file valid if (!file) { g_log.printerror("creating shader %s - file not found",filename); return -1; } const glint len = _getfilelenght(file); if(len == 0) return 0; std::vector<std::string> lines; lines.push_back("#version 140"); // glsl version control while(!fi...

jquery - Get CSS property of element in transition / Pause CSS3 transition -

i'm trying pause css3 transition, element in question maintains it's exact css properties when pause button clicked. way think going getting css properties of element during transition , setting them .css(), work? how css properties of element during transition. html <div id="productimage"> </div> <a href="#" id="pause">pause</a> css #productimage { position:absolute; height: 550px; width: 393px; background-image: url("../img/blusen.jpg"); background-repeat:no-repeat; background-position:50% 50%; background-color: #fff; background-size:396px 600px; top:191px; left:10px; } #productimage.step1 { background-size:1500px 2275px; -webkit-transition: 2.5s ease-in-out; -moz-transition: 2.5s ease-in-out; -o-transition: 2.5s ease-in-out; } jquery $("#pause").click(function(e) { e.pr...

c - Understanding recursive solution to Towers of Hanoi -

this question has answer here: tower of hanoi: recursive algorithm 22 answers can please explain program? want know how parameters passed function tower , how recursion works. here code: #include<stdio.h> #include<conio.h> void main() { int n; clrscr(); printf("enter no. of disks"); scanf("%d",&n); tower(n,'s','d','t'); getch(); } tower(int n,char source,char dest,char temp) { if(n>0) { tower(n-1,source,temp,dest); printf("\nmove disk %d %c %c",n,source,dest); tower(n-1,temp,dest,source); } return; } this program illustrates solution tower of hanoi problem. so have pile 1 n disks , 2 other empty pile 2 , 3. need move n disks pile 1 pile 3(or 1 2, not matter). if imagine n disks (n-1 disks) , 1 disk, problem becomes simple: move (n-1) pile 2 , l...

windows - Query SQL for record then send email if none exists -

i've been tasked write application test whether our morning checks have been submitted our database. if not app should email us. needs query database (sql server 2012) entry today's date. the database small table 8 columns in it: id , username(varchar) , datetime(datetime) , , more varchar fields comments. i have not done before i'm assuming i'll have use windows scheduled task? know language should write in? stack overflow encourages questions specific . sounds may want break project several steps: 1. how query database entry today's date? in sql server 2012 try this: select id table t datetime = convert(date,getdate()) you can check see if query returned data. 2. scripting language can run query part 1, parse results , send email? i'm going suggest python - it's easy set up, clean work with, , fun use. stack overflow has many questions , answers python , or feel free ask question if can't find answer already. here answer...

apache - 503 Service Temporarily Unavailable MyISAM MySQL -

i making website, hosted on bigrock.in ( cpanel v11.36.1 (build 8), apache version 2.2.24, php version 5.2.17, mysql version 5.0.84-percona-highperf-b18-log), insert lot of entries in myisam table .i.e. 200-500 entries. makes mysql database create following error **503 service temporarily unavailable** **service temporarily unavailable** server temporarily unable service request due maintenance downtime or capacity problems. please try again later. additionally, 404 not found error encountered while trying use errordocument handle request. thus of data inserted table. steps should take solve problem.

CSS Variable assign -

is possible use variables within css document, possibly using javascript? for example if have overall variable "colorone" assigned "#ffffff". is possible to call "colorone" later? e.g. "color: colorone;"? i use find , replace replace instances becomes tedious, there alternative? you can use preprocessor, instance: http://lesscss.org/ what enables write css this @colorone: #ffffff; .main_links { color: @colorone; } h2 { color: @colorone; } and output once it's compiled be .main_links { color: #ffffff; } h2 { color: #ffffff; } there more reasons use less assigning variables, it's powerful , allows lot more, nested styles, have @ documentation: http://lesscss.org/#synopsis

javascript - How can I get the title attribute of the current anchor being hovered? -

have ~500 anchor tags in grid have title attributes, title element user hovering, , display @ top of grid can tell hovering over. or, there alternative? <a class="color" title="#wicked" style="height: 30px; width: 30px; background-color: rgb(70, 60, 65); display: block;"></a> <a class="color" title="#tallulah" style="height: 30px; width: 30px; background-color: rgb(95, 58, 61); display: block;"></a> <a class="color" title="#merlot" style="height: 30px; width: 30px; background-color: rgb(79, 56, 57); display: block;"></a> <a class="color" title="#speakeasy" style="height: 30px; width: 30px; background-color: rgb(87, 50, 65); display: block;"></a> <a class="color" title="#tamarind" style="height: 30px; width: 30px; background-color: rgb(95, 68, 74); display: block;"></a> <...

jquery - Spring MVC Ajax Form POST -

friends im trying understand best way post data using sring mvc form , ajax in code <form:form modelattribute="configform" accept-charset="utf-8" action="/channelconfig/voice/save" cssclass="form-horizontal" method="post"> <div style="text-align: left;" class="span3 row-fluid"> <label><spring:message code="alert.channels.outbound.lines"></spring:message>:&nbsp; </label> </div> <div class = "span3"> <div class="input-mini"> <div class="textval">${alertstatusform.outboundlines}</div> <div class="pencil span3 "> <i class="icon-edit icon-large"></i> </div> ...

android - How to make a screenshot of an Activity? -

i have nice question :). create checkbox if activated phone makes screenshot of specific activity of application in specific hour. mean: click on checkbox, , @ 12.00 automatically i'll have screenshot of main activity example. possible? root required? there's no root needed. check this: http://code.google.com/p/android-screenshot-library/ next check alarmmanager : http://developer.android.com/reference/android/app/alarmmanager.html

JavaScript: Defining function inside function -

in w3schools example , not getting how changename works: function person(firstname, lastname, age, eyecolor) { this.firstname = firstname; this.lastname = lastname; this.age = age; this.eyecolor = eyecolor; this.changename = changename; function changename(name) { this.lastname = name; } } mymother = new person("sally", "rally", 48, "green"); mymother.changename("doe"); document.write(mymother.lastname); http://jsfiddle.net/mrge4/ why have this.changename=changename , , function definition changename ? it defining method changename person objects - in sort of round-about way, equivalent (and better) way is: this.changename = function(name) { this.lastname = name; } (hence 'please not use w3school')

c# - Search using Linq from the view -

i trying make textbox in view, can search using linq statements. when try implement search view, compiler cant find prods list. when try implement controller, cant find searchbox, in both case understand , dont understand how fix problem. or if best implement search in controller or in view ?? i have made comment in code, tried search function. using system; using system.collections.generic; using system.linq; using system.web; using system.web.mvc; using uppgift_1.models; namespace uppgift_1.controllers { public class productcontroller : controller { public actionresult index() { list<myproduct> prods = new list<myproduct>() { .....add products...... }; // linq search var searchresults = (from s in prods where(s.productname == searchbox || s.productid == searchbox) select s).tolist(); return view(prods); } } } @model ienumerable...

java ee - Error after deploying to hosting -

i'm using eclipse ide. i'm using jboss. project java ee. chose dynamic web project when creating project. project runs on local. didn't use maven on project. exported project root.war file. created application jboss on openshift , clone it. put root.war file in subfolder /deployments. using git git commit -a -m 'message' git push root.war deployed. few .xhtml files runs (that static xhtml files). files use cdi error: javax.el.propertynotfoundexception: /tailieu/danhmuc.xhtml @13,53 value="#{docucat.cat}": target unreachable, identifier 'docucat' resolved null can guess reasons cause error. check?