Posts

Showing posts from March, 2015

razor - get related products on product category page Magento -

i working on magento project, in need show related products of each product on product category page along main product. can please suggest how can , related products on list page. have follow this link , cant work. hello think create custom template file & call list page catalog/product/list/related.phtml

jsp - Passing value and iterating an arraylist in javascript -

i need pass arraylist javascript jsp , iterate through list in javascript. can me jsp synatax javascript iteration code? tia try code: arraylist list = new arraylist(); list.add("aaa"); list.add("bbbb"); list.add("cccc"); iterator individualitems = list.iterator(); int = 0; string script = "<script type=\"text/javascript\">var list = new array();"; while(individualitems.hasnext()) { script += "list["+i+"] = \""+individualitems.next()+"\";"; i++; } script += "for(i=0;i<list.length;i++){document.writeln(list[i]);}"; script += "</script>"; //now whatever want printwriter output = response.getwriter(); output.println(script);

sql server - Getting corresponding auto-generated ID's in SQL to match XML passed values -

i new sql, , xml please bear me. have query gets values entered multi-line textbox, passes them xml @data xml parameter declared , writes them history , diary tables respectively. along other parameters declared. so, problem is, first written diary table id's in table auto-generated, 551 , 552 respectively below matters, information inserted history table. should not happen. i want information written history table first, "auto-generated" id in history respective matters should passed foreign key diary table , inserted column (dy_h_id). @ moment, column not being populated data added later. please see code below: declare @u_id varchar(50) declare @add_u_id varchar(50) declare @subject varchar(50) declare @ipriority int declare @data xml declare @un varchar(500) declare @date varchar(50) declare @sdesc varchar(500) set @u_id = 18185 set @add_u_id = 18185 --'liihvcvbbbr43v5...

android - How to change action bar tab view height -

Image
how customize action bar tab view have desired height..? i want output action bar tabs but getting output this i using custom view on tabview setting custom view how change height of tab view manually? you can use actionbar.getheight() height. and set specific height can do: first create new theme <?xml version="1.0" encoding="utf-8"?> <resources> <style name="theme.fixedsize" parent="theme.sherlock.light.darkactionbar"> <item name="actionbarsize">48dip</item> <item name="android:actionbarsize">48dip</item> </style> </resources> then set theme activity android:theme="@style/theme.fixedsize" update: <style name="yourtheme" parent="@android:style/theme.holo"> <item name="android:actionbartabstyle">@style/tab_nav</item> <item name="...

Populating a buffer from the return of a method fails... ANSI C -

the code have quite simple in 1 method have this: // line has intellisense error: initialization {...} expected aggregate object char str[] = getbuffer(); // x 64 give 512 (sector sized buffer) ; the getbuffer metod this: char * getbuffer(void) { int idx = 0; int offset = 0; char *buffer[512]; for(idx =0; idx < 64; idx ++) { // line has itellisense error: "expected expression" buffer[offset + idx] = {"e","r","a","s","e","d"," ", " "}; offset += 8; } return *buffer; } any ideas what's wrong this? trying - populate buffer 512 bytes contain following string repeated: "erased " ansi c (not c++) , has been long since coded in ansi c - please , kind! using visual studio 2012 edit 1 ok lots of things have been fixed guys - no full answer yet. str buffer holds 528 characters , not 512 , contains lot of erased expected ends ýýýý««««««««Ã®Ã¾Ã®Ã¾ ...

zrangebyscore redis in perl -

i'm using redis.pm in perl scrpit , try execute next command: zrevrangebyscore <key> <highscore> 0 withscores limit 0 1 in appliance redis documentation write next , it's working fine my $data = { $redis->zrevrangebyscore($rkey, $ipl, 0, 'withscores') }; but when try subst 'limit...' in perl command: my $data = { $redis->zrevrangebyscore($rkey, $ipl, 0, 'withscores','limit 0 1') }; i got error [zrevrangebyscore] err syntax error, @ /usr/local/lib/perl5/site_perl/5.14/redis.pm line 163 redis::__anon__(undef, 'err syntax error') called @ /usr/local/lib/perl5/site_perl/5.14/redis.pm line 195 redis::wait_one_response('redis=hash(0x801075300)') called @ /usr/local/lib/perl5/site_perl/5.14/redis.pm line 183 redis::wait_all_responses('redis=hash(0x801075300)') called @ /usr/local/lib/perl5/site_perl/5.14/redis.pm line 172 how can pass arg 'limit 0 1' in redis.pm ? ...

vb.net - NullReferenceException thrown even though checking for Nothing -

i have rather straightforward code compare function public overridable function comparer(thisvalue object, othervalue object) integer try if thisvalue nothing if othervalue nothing return 0 else return -1 end if else if othervalue nothing return 1 else return thisvalue.tostring.compareto(othervalue.tostring) end if end if catch ex exception return 0 end try end function the reason try-catch block is: nullreferenceexception @ actual comparision line if thisvalue nothing. debugger shows me thisvalue "nothing" lands in else branch anyway. can tell me why? update: have tried amend situation inserting yet check nothing. in scenario boils down few hundred exceptions , execution speed bearable. don't want imagine trying sort empty column though. http://i.stack.imgur.com/8dnxd.png ho...

installshield - SQL Server 2012 Express checking and silent installation -

we need perform following using installshield 2013, can please guide me: check if sql server express installed in user's machine or not. if present, version present. if version not 2012, need install sql server express 2012 silently in background. give write access on folder particular login (sql service) after installation of sql express 2012, need restore database .bak file. after restoring db, how run sql scripts? please provide me link or guidance on how acheive above objectives. parallely trying read documentation , blogs, vast. thanks in advance, pavan there different ways achieve it. can check using prerequisite , installed. can use custom action or install script silent install of sql server after doing registry check. once installed, using script can restore database, , installshiled basic msi provides options include sql scripts , run or using installscript can run sql scripts .

ios - NSTimer with error message? -

i trying implement nstimer counting down 5 seconds. getting message "no known class method selector scheduledtimerwithtimeinterval:target:selector:userinfo:repeats....." missing? if @ bottom of mtpopupwindow.m in method -void(showinview) find code error emerges. regards mtpopupwindow.h @class mtpopupwindow; @protocol mtpopupwindowdelegate <nsobject> @optional - (void) willshowmtpopupwindow:(mtpopupwindow*)sender; - (void) didshowmtpopupwindow:(mtpopupwindow*)sender; - (void) willclosemtpopupwindow:(mtpopupwindow*)sender; - (void) didclosemtpopupwindow:(mtpopupwindow*)sender; @end @interface mtpopupwindow : uiview +(mtpopupwindow*)showwindowwithhtmlfile:(nsstring*)filename; +(mtpopupwindow*)showwindowwithhtmlfile:(nsstring*)filename insideview:(uiview*)view; - (void)timerfiremethod; -(void)showinview:(uiview*)v; +(void)setwindowmargin:(cgsize)margin; @property (strong, nonatomic) nsstring* filename; @property (strong, nonatomic) uiwebview* webview; @proper...

html - JavaScript Add to Bookmark not working in FF >= 23.0 -

my javascript code bookmark search, works fine chrome, ie , ff versions less 23.0, not versions greater 23.0. can me this? read http://www.mozilla.org/en-us/firefox/23.0beta/releasenotes/ changes in firefox versions > 23.0. current code: function bookmarkurl(title, url){ if ( window.sidebar ) window.sidebar.addpanel(title, url, ''); } function bookmarktip(tiptext){ document.getelementbyid('bookmark_tip').style.display = 'block'; document.getelementbyid('bookmark_tip_text').innerhtml = tiptext; } function firefox_bookmark(title, url) { jquery('#bookmark_tip').show(); settimeout(function() { jquery('#bookmark_tip').fadeout(500); }, 30000); bookmarkurl(title, url); } html: <a class="bookmark" onclick="firefox_bookmark('cricket', 'url');">bookmark link</a> as @poonamthapar states, firefox have removed proprietary function window.si...

javascript - Getting key and value of object -

while i'm trying access key , value of object, it's giving undefined . below code <script type="text/javascript"> var data; var xaxisname; var yaxisname; var jso; function getx(d) { return d[xaxisname]; } function gety(d) { return d[yaxisname]; } d3.json("response.json", function (json) { console.log("hi"); console.log(json); //getting values console.log("this " +json.users); //getting values xaxisname = json.attribute1.; console.log("xaxisname=" + xaxisname); //not getting values yaxisname = json.attribute2; console.log("yaxisname=" + yaxisname); //not getting values data = json.users; alert(data); data.map(function(d) { console.log(getx(d));}); data.map(function(i) {console.log(i);}); visualize(data); //then start visualization }); function visualize (data) { var padding = 40; var margin = {top:30, right: 30, bottom: 30, left:100}; var w = 700 - mar...

encryption - phpmyadmin md5 decryption issue after importing database -

i have database on cpanel server, contains user field called 'password'. when @ field through phpmyadmin, passwords appear md5 encrypted. so example, password thats '12345' encrypted , appearing in database "e10adc3949ba59abbe56e057f20f883e". now, on original server, thats ok, because if password encrypted in database, when enter password on related website '12345' recognizes , gives access. the problem when export , import database. after importing same database server, naturally password values still encrypted in database. but, when try logging in related website, decrypted password, tht is, '12345' not work anymore. have enter password "e10adc3949ba59abbe56e057f20f883e" , can login. i'm guessing problem data in password column not getting decrypted after importing database, hence when enter '12345' instead of extended md5 value, not match , gives me wrong password error. so can me solve issue? supposed migrate...

angularjs - Difference between onLoad and ng-init in angular -

i learning angular. don't understand difference between onload , ng-init initialization of varibale. in scope creates variable. for example <ng-include onload="selectedreq=reqselected" src="'partials/abc.html'"></ng-include> or <ng-include ng-init="selectedreq=reqselected" src="partials/abc.html"></ng-include> please give me idea isolated scope. ng-init directive can placed inside div 's, span 's, whatever, whereas onload attribute specific ng-include directive functions ng-init . see mean try like: <span onload="a = 1">{{ }}</span> <span ng-init="b = 2">{{ b }}</span> you'll see second 1 shows up. an isolated scope scope not prototypically inherit parent scope. in laymen's terms if have widget doesn't need read , write parent scope arbitrarily use isolate scope on widget widget , widget container can freely use s...

eclipse - Git push - git wants to merge but there are no changes in remote -

i have problem git. makes me merge push, recent changes mine. problem have conflicts because files i've modified same. has have had problem , know how fix it? details: have ubuntu 12.04 + eclipse kepler + egit 3.0 + git 1.7.9.5 .

java - Keep d-pad focus changes within current fragment -

i have android app primary receives input using d-pad (up, down, left, right, ok, back) the app runs on tv uses fragments separate sections. i keep directional buttons focusing views in other fragments. , handle directional buttons differently depending on fragment set "current" what elegant solution this? also, fragments dynamically changed @ runtime. when d-pad means of navigation user, such on google tv's, it's not idea stop navigation @ edge of fragment. how solved this, allowing cross-border navigation , laying out elements navigation not awkward , works finding path automatically (after all, there not seem way statically provide next element focus on in each direction, when in fragment). like i'm looking reference advice on how deal fragments , navigation on google tv.

python - Django filter ManyToMany relationship from a single object -

i've got object in django, , 1 of it's properties manytomany relationship. ok, i've got object, , want know if there's data related, how can it? here's code: u = request.user ide = request.post['id'] defob = defobjc.objects.get(id=ide) if defob.filter(student_def=u).exists(): #do things and here's object class: class defobjc(models.model): name = models.charfield(max_length=100, blank=true, null=true) date = models.datetimefield(blank=true, null=true) student_def = models.manytomanyfield(user, related_name='defobjc_relation', blank=true, null=true) how can that? the result of get() model instance, not queryset , can't filter on it. instead: if defob.student_def.filter(id=u.id).exists(): # things

Issue in Stored Proc : db2 -

i have written following stored proc in db2. create or replace procedure rtimd.ialert_proc ( in usr_name varchar(20) default '', in in_rtim_id varchar(25) default '', in api_method varchar(25) default '', in params varchar(500) default '', in application_name varchar(20) default '', out tickt_id varchar(20), out rtimid_var varchar(25)) language sql begin declare rtim_id_out varchar(25); if api_method = 'getincident' set tickt_id = execute immediate ( 'select distinct ticket_id rtimd.v3_ticket_log rtim_id = in_rtim_id' ); set rtim_id_out = in_rtim_id; elseif api_method = 'createincident' set rtimid_var = execute immediate ( "select 'rtim_' concat usr_name concat varchar(bigint(days(current date) - days('1970-01-01'))*bigint(86400) + midnight_seconds(current_timestamp - current_timezone)) concat '_' concat varchar(smallint ( rand () *10000 + 1 )) sysibm.sysdummy1"); ...

java - Tomcat unable to deploy my application. It failed with the following error. -

i have been working java project. getting following error when deploy app, error not consistently identified. caused by: java.lang.error: unresolved compilation problems: type javax.net.ssl.hostnameverifier cannot resolved. indirectly referenced required .class files import javax.net.ssl.hostnameverifier cannot resolved import javax.net.ssl.keymanager cannot resolved import javax.net.ssl.keymanagerfactory cannot resolved import javax.net.ssl.sslsession cannot resolved import javax.net.ssl.trustmanager cannot resolved import javax.net.ssl.trustmanagerfactory cannot resolved trustmanagerfactory cannot resolved type keymanagerfactory cannot resolved type trustmanagerfactory cannot resolved type trustmanagerfactory cannot resolved trustmanagerfactory cannot resolved type keymanagerfactory cannot resolved type keymanagerfactory cannot resolved keymanagerfactory cannot resolved type type javax.net.ssl.sslcontext cannot resolved. indirectly referenced ...

wpf - How to set the Scrollbar according to the inner control -

i having user control hooked main window @ run time. so, user control gets width , height in main window. now, user control having expander control , on click of expander other sub user control shown user , these sub user controls of different width , height. so, when small sub user control shown on click of expander, control shown in correct manner if sub user control's size large main user controls width or height, have scroll down see full view of sub user control. now want if sub controls size more user controls size, default full view should shown, have set scroll bar on click of expander. so, how set scrollbar vertically according size of sub user control in xaml part

how to check the username in Active Directory in WPF -

i want check whether username exists in active directory? , depending on need execute code. i have domain , username.how check whether username exists in active directory without password using directorysearcher. your process has run under active directory user otherwise should provide active directory user credentials when creating principalcontext. simple code find user username: var context = new principalcontext(contexttype.domain, "yourdomainhost"); var userinfo = userprincipal.findbyidentity(context, username); edit: if need use directory searcher can try method: bool containsuser(string domain, string username) { string ldapbase = string.format("ldap://{0}", domain); // in case if process not running under ad user use: new directoryentry(ldapbase, "username", "password") using (var entry = new directoryentry(ldapbase)) { using (var searcher = new directoryse...

javascript - How to change deleteAction in Jtable -

please tell me how change setting actions.deleteaction functions deleteconfirmation not change source ? in advance! $('#pages-table').jtable({ title: 'birds', paging: true, pagesize: 15, sorting: true, defaultsorting: 'name asc', selecting: true, multiselect: true, selectingcheckboxes: true, selectonrowclick: false, actions: { listaction: '/aima-admin/?plugin=pages&ajax=yes&action=jtable&jtable=list&catid=1&lang=en', deleteaction: '/aima-admin/?plugin=pages&ajax=yes&action=jtable&jtable=delete' }, deleteconfirmation: function(data) { data.deleteconfirmmessage = '<p>Удалить</p><input type="radio" value="page" name="delpage">Страницу <input type="radio" value="translate" name="delpage">Перевод'; }, get scoop function of source code found _...

Forcibly run android emulator in landscape mode -

i need run emulator size 1366x768 in landscape mode. when launch emulator, automatically changes portrait mode, same scale (height 1366, width 768, need otherwise). so, changing mode pressing ctrl + f12 don't helps, because after changes, proportions stay same. suggestion? you may try genymotion, fast, supports rotation , sensors too. http://www.genymotion.com/

jsf - ui: define inside a h :form -

i have template 3 ui:insert tags's display in different places. on create userpage have this: <ui:composition template="/template.xhtml"> <ui:define name="title"> <h:outputtext value="#{bundle.createemployeestitle}"></h:outputtext> </ui:define> <ui:define name="body"> <h:panelgroup id="messagepanel" layout="block"> <h:messages errorstyle="color: red" infostyle="color: green" layout="table"/> </h:panelgroup> <h:form> <h:panelgrid columns="2"> <h:outputlabel value="#{bundle.createemployeeslabel_businessunitid}" for="businessunitid" /> <h:selectonemenu id="businessunitid" value="#{employeescontroller.selected.businessunitid}"...

Can python ignore the error and return to the line next to the raised line and going on -

something that try: 1/0 print "hello world" print "every thing seems fine..." except zerodivisionerror: print "it not critical error, go next..." somewayallowmetoexeuteprinthelloworld_thelinenexttotheraisedline() except: print "i have no idea, stop work..." after [1/0] raised, , [except zerodivisionerror] catched error, , return [print "hello world"] line, , going on... you can't, , there's no reason should want to: try: 1/0 except zerodivisionerror: print "it not critical error, go next..." print "hello world" print "every thing seems fine..." consider code: try: important_res = f(1/0) send_important_message(important_res) except zerodivisionerror: print "it not critical error, go next..." somewayallowmetoexeuteprinthelloworld_thelinenexttotheraisedline() if allow execution resume, how pick value pass f ? ...

mysql - Why I get "Copying to tmp table on disk" after several iteration of loop -

why "copying tmp table on disk" after several iteration of loop? in first few iterations have not this. table has 10 million , more rows. when set lover offset, loop execute more iteration without "tmp table". my select is select u.domena_id, u.umiestnenie, u.datum (select domena_id, min(datum) min_datum umiestnenie datum between 'date1' , 'date2' group domena_id limit 200000 offset offset (increasing in lopp) ) x inner join umiestnenie u on u.domena_id = x.domena_id , u.datum = x.min_datum table umiestnenie create table if not exists `umiestnenie` ( `id` int(11) not null auto_increment, `domena_id` int(11) not null, `datum` date not null, `umiestnenie` int(11) not null, primary key (`id`), key `fk_umiestnenie_domeny_idx` (`domena_id`), key `datum_idx` (`datum`) ) engine=innodb default charset=utf8 auto_increment=15243077 ; table domena create table if not exists `domena` ( `id` int(11) not null auto_increment, ...

python unipath: path to current file directory (ancestor) outputs nothing -

i have been trying learn python-unipath , have been getting grips basic commands. however, have been stumped issue. so, ancestor(2) of current file. so, on python interpretter, this: python 2.7.3 (default, jan 2 2013, 13:56:14) [gcc 4.7.2] on linux2 type "help", "copyright", "credits" or "license" more information. >>> unipath import path >>> orm_root = path("/home/foo/lump/foobar/turf/orm/unipath_try.py").ancestor(2) >>> orm_root path('/home/foo/lump/foobar/turf') ..which correct , want. now, wrap in file so: # -*- coding: utf-8 -*- # unipath_try.py unipath import path orm_root = path(__file__).ancestor(2) print orm_root when run using python unipath_try.py no output! no import errors either. baffled why - stupid. appreciate help/direction on :( use os.path.abspath(__file__) instead of __file__ . this because __file__ contains relative path in case. __file__ can conta...

javascript - Jquery change css on click -

here have page , when want click on button write code hide content there error: http://jsbin.com/evewota/2/edit and jquery code: $('#button').click { $('#firstpage').css('display', 'none'); } you should use .on() or .click() function in right way! , use .hide() instead of .css() $('#button').on('click', function() { $('#firstpage').hide(); }); $('#button').click(function() { $('#firstpage').hide(); });

c# - How to use deserialized object? -

Image
i serializing , deserializing object in c# windows 8 apps. i serializing object before passing next view, because passing object throws out exceptions. function onnavigatedto: protected override void onnavigatedto(navigationeventargs e) { base.onnavigatedto(e); string xmlstring = e.parameter.tostring(); var thischannel = xmldeserializefromstring(xmlstring, typeof(channel)); ....} deserializing function: public static channel xmldeserializefromstring<channel>(string objectdata) { return (channel)xmldeserializefromstring(objectdata, typeof(channel)); } public static object xmldeserializefromstring(string objectdata, type type) { var serializer = new xmlserializer(type); object result; using (textreader reader = new stringreader(objectdata)) { result = serializer.deserialize(reader); } return result; } i want access data in object, like: thischannel.name doesn...

Symfony 2 | OPcache | Warning: filemtime(): stat failed for Acme-DemoBundle-Controller-SecuredController.cache.php in FileCacheReader.php -

i have installed symfony 2 , have activated opcache (zendoptimizer) extension , when intent generate cache of web page o've got error : warning: filemtime(): stat failed c:/apache24/htdocs/symfony/app/cache/dev/annotations/acme-demobundle-controller-securedcontroller.cache.php in c:\apache24\htdocs\symfony\vendor\doctrine\common\lib\doctrine\common\annotations\filecachereader.php line 97 this opcache config : zend_extension="c:\php\ext\php_opcache.dll" opcache.enable=1 opcache.use_cwd=0 opcache.validate_timestamps=0 ; file stat opcache.revalidate_freq=2 ; seconds opcache.revalidate_path=0 opcache.save_comments=0 opcache.load_comments=0 opcache.dups_fix=0 opcache.inherited_hack=0 opcache.log_verbosity_level=1 opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.enable_file_override=1 opcache.max_wasted_percentage=5 ; percent waste until restart opcache.consistency_checks=0 opc...

android - TWITTER4J - Filter tweets by location: tweets outside defined area -

developing android app, using twitter4j. i'm filtering tweets location: public void filterdatawithnewuserlocation(double latitude, double longitude) { filterquery filterquery = new filterquery(); //double[][] locations = {{12.6340, 45.7828}, {13.6340, 46.7828}}; // sw ne double[][] locations = { {longitude-0.3, latitude-0.3}, {longitude+0.3, latitude+0.3}}; filterquery.locations(locations); twitterstream.filter(filterquery); } and i'm obtaining tweets inside , outside area defined. i'm wrong?

Mysql - Take data from row and copy it to another row -

i have table 2 rows like: row1 row2 ======= ======= 7,3 text 1 1,3 text 2 1,2,3 blabla what need add/copy text row1, @ beginning of row2, plus adding custom text (crlf). like: row1 row2 ======= ======= 7,3 7,3<br />text 1 1,3 1,3<br />text 2 1,2,3 1,2,3<br />blabla so, there way using mysql commands? thanks lucas if row1 , row2 2 separate columns can this: update mytable set row2=concat(row1,' text ',row2);

amazon web services - how to setup AWS/mongodb with replicas so that if an instance crashes there is nothing to do? -

the question pretty in title : how setup aws/mongodb replicas if instance crashes there nothing ? namely, if 1 of instances of replica crashes, guess amazon instantiates new machine , starts processes running. ebs things should fine. only problem : when restarting this, how can add new machine replica set ? instances have changing ips , im not sure how how start machine know replica set join, ip, , how tell join it. if have encountered problem please let me know ! thanks thomas i guess amazon instantiates new machine , starts processes running. ebs things should fine. downing of members can happen many reasons on network aws. recommend not create autoscaling group/cloud template replicas. instead handle bringing new replicas manually. with ebs things should fine. not always, have edge case whereby storage layer dc goes down. infact more both 1 or other. when restarting this, how can add new machine replica set as stated in document on bringin...

vb.net - VB Console application to rename a file -

i trying write console application in vb allow me change name of file. the code have far is: public class form1 private sub btnrename_click(byval sender system.object, byval e system.eventargs) handles btnrename.click if txtpath.text.length <> 0 , txtname.text.length <> 0 ' change "c:\test.txt" path , filename file ' want rename. ' txtpath contains full path file ' txtname contains new name my.computer.filesystem.renamefile(txtpath.tostring, txtname.tostring) else messagebox.show("please fill fields", "error", messageboxbuttons.ok, messageboxicon.warning) end if end sub private sub btnclear_click(byval sender system.object, byval e system.eventargs) handles btnclear.click txtpath.clear() txtname.clear() end sub end class but when try run error in line: my.computer.filesystem.renamefile(t...

oracle - How to convert java class file version without decompiling -

i using java version 1.6.0_07 in oracle r12.1.3. i'm having illegal access error @ run time while accessing java class file has version 1.3. please me solve issue. is there api or tool convert class file version without decompiling?

wmi - Change LogOn properties of a SQL server instance -

i want change logon properties of sql server 2008 r2 instance using code. manually can in sql server configuration manager right clicking on instance name->log on. under built-in account change network service local service. click on apply. sql instance restarted effect changes. now hoe can same(network service local service) using code .i think can done using wmi. please me on this. changing logon properties network service localsystem can done using wmi. use change method of win32_service class in change method specify first 6 parameters blank , specify startname localsystem(you can specify other parameters such login names if required) , startpassword blank password(blank password in case of localsystem). below vbscript it. strcomputer = "." set objwmiservice = getobject _ ("winmgmts:\\" & strcomputer & "\root\cimv2") set colservices = objwmiservice.execquery _ ("select * win32_service name = 'mssql$i...

function - R: scope of local/global variables -

i have 2 r chunks follows: getdetails<-function(files){ read.csv(filenames) } filenames<-list.files("data/", pattern=".csv", full.names=t) df<-lapply(filenames, getdetails) in function, mistake when have mentioned filenames variable instead of files , don't error. there way make r warn this? thanks. environment(getdetails) = parent.env(environment(getdetails)) way remove global scope. works me. problem is, has done every function write.

mysql - How to change collation of all rows from latin1_swedish_ci to utf8_unicode_ci? -

i ignorantly used default latin1_swedish_ci character encoding of varchar rows in database during development , i've determined root of character encoding problems i've been having. in addition that, seems people these days recommending utf8_unicode_ci used. i'd convert character encoding rows in database latin1_swedish_ci utf8_unicode_ci, way know how is change row-by-row in phpmyadmin, time consuming. is there faster way, such query can run changes collation of varchar/text rows latin1_swedish_ci utf8_unicode_ci? if columns using default table character set it's 1 query per table convert: alter table t convert character set utf8 collate utf8_unicode_ci; if character set set individually on each column, afaik there no way on columns of tables in database directly in mysql, write tiny program in language of choice so. your program query information_schema.columns table , @ character_set_name column: select * `information_schema.columns` table...

c# - How can I put data from my datagridview to textboxes? -

what want when select row of data in database, go textbox. example data in column "title" go textbox1 , data in column "isbn" go textbox2. haven't edit properties in properties window of datagridview. can me? you have this: yourtextbox.text = yourdatagridview.selectedrows[0].cells["title"].value.tostring(); yourtextbox2.text = yourdatagridview.selectedrows[0].cells["isbn"].value.tostring(); edit: assume have selected row on datagrid. i´m sorry mistake, cells property instead of columns hope helps.

How can I return a linked list struct to main in C++? -

i trying design program take input file(which consists of integers , words separated space , store words in linked list , print in function. question is: how return linked list struct main() further process? struct list* createlist(file *m); struct list { char data[30]; struct list *next; }; using namespace std; main() { char a[100], ch; cout<<"enter name of file obtaining input.."<<endl; cin>>a; file *in; in=fopen(a,"r"); if(in!=null) { ch=fgetc(in); if(ch=='1') ????=createlist(in); fclose(in); } return 0; } struct list* createlist(file *m) { cout<<"entered createlist function..!"<<endl; char tempstr[30]; list *curr, *head; char c; int i=0; curr=null; while(eof!=(c=fgetc(m))) { if((c==' ') || (c=='\0')) { if(i==0) { continue; ...

actionscript 3 - Adobe AIR Native Extension Game Kit by Vitapoly. How accept invitation? -

i’m trying make real time game. when player accepts invitation, realtimematchescontroller dispatch invite_accepted_event event. realtimematchescontroller.currentmatch null. , match_maker_found_match_event events not dispatches. game stuck @ point. how create match, when invite_accepted_event dispatched? here sample code public function gamecenter() { if (!gamekit.issupported) { return; } _gamekit = gamekit.instance; _gamekit.addeventlistener(gamekit.local_player_authenticated_event, localplayerauthenticated); _gamekit.addeventlistener(gamekit.local_player_not_authenticated_event, localplayernotauthenticated); _gamekit.authenticatelocalplayer(); _gamekit.realtimematchescontroller.addeventlistener(realtimematchescontroller.invite_players_event, inviteplayershandler); _gamekit.realtimematchescontroller.addeventlistener(realtimematchescontroller.invite_accepted_event, inviteacceptedhandler); _gamekit.realtimematchescontroller.init(); _gamekit.realtimematchescontroll...

text mining - Adding custom stopwords in R tm -

i have corpus in r using tm package. applying removewords function remove stopwords tm_map(abs, removewords, stopwords("english")) is there way add own custom stop words list? stopwords provides vector of words, c ombine own ones this. tm_map(abs, removewords, c(stopwords("english"),"my","custom","words"))

Python: merge lists of tuples based on its values -

i'm trying figure out method merge 2 lists in python in order accomplish this: list_a = [(item_1, attribute_x), (item_2, attribute_y), (item_3, attribute_z)] list_b = [(item_1, attribute_n), (item_3, attribute_p) ] as result: list_result = [(item_1, attribute_x, attribute_n), (item_2, attribute_y, false), (item_3, attribute_z, attribute_p)] any ideas? here interesting way solve problem, robust function returns generator: def combine_item_pairs(l1, l2): d = {k:[v, false] k, v in l1} key, value in l2: if key in d: d[key][1] = value else: d[key] = [false, value] return (tuple([key]+value) key, value in d.iteritems()) using it: >>> list(combine_item_pairs(list_a, list_b)) [('item_2', 'attribute_y', false), ('item_3', 'attribute_z', 'attribute_p'), ('item_1', 'attribute_x', 'attribute_n')] here bonus solution (same interface, more ef...

Django query - create record will not return ID -

i experiencing weird behavior , not sure why, able without issue in view. here's issue: creating , saving new record database, after save not give me id new record null, though record being inserted db without error. my code: r = ksprojectrewards() r.project_id = project_id r.reward_description_short = desc_short r.reward_description_long = desc_long r.limit_max = limit r.international_info = international r.is_active = active r.save() r.id # <!-- returns null here model class ksprojectrewards(models.model): id = models.integerfield(primary_key=true) project_id = models.integerfield() reward_description_short = models.charfield(max_length=75l, blank=true) reward_description_long = models.charfield(max_length=500l, blank=true) num_backers = models.integerfield(null=true, blank=true) limit_count = models.integerfield(null=true, blank=true) limit_max = models.integerfield(null=true, blank=true) lim...

powershell - The term 'select-object' is not recognized as the name of a cmdlet -

i getting error when starting sharepoint management shell sp2013 on windows server 2012. select : term 'select-object' not recognized name of cmdlet, function, script file, or operable program. check spelling of name, or if path included, verify path correct , try again. @ c:\program files\common files\microsoft shared\web server extensions\15\config\powershell\registration\sharepoint.ps1:1 char:16 $ver = $host | select version ~~~~~~ categoryinfo : objectnotfound: (select-object:string) [], comma ndnotfoundexception fullyqualifiederrorid : commandnotfoundexception do need import modules ? if so, ? i got work around problem. mine sharepoint 2013 box. found $env:psmodulepath c:\users\user_name\documents\windowspowershell\modules;;c:\program files\appfabric 1.1 windows server\powershellmodules;c:\program files\appfabric 1.1 windows server\powershellmodules can notice appfabric module path has repeated ...

java - Servlet 2.5 injection of EJB3.0, all packaged as WAR -

i'm trying achieve goal: deploy war made of simple servlet injection of ejb, , invoke business method on it. all made using maven project made 2 components: 1) sample ejb (pom.xml packaged ejb) 2) sample war (servlet, pom.xml packaged war. dependency ejb module) i tell first i'm able exercise in way, packaging both war , ejb inside ear, not above mentioned one. can tell me if there limitation of used application server (weblogic 10.3.3)? code snippet simpleservlet (war): public class simpleservlet extends httpservlet { @ejb(mappedname="ejb/simplesessionbean") private simplesessionremote simplesessionbean; code snippet simplesession remote interface (ejb): @remote public interface simplesessionremote { string getmessage(); } code snippet simplesession bean class (ejb): @stateless(name="simplesessionejb", mappedname="ejb/simplesessionbean") @remote(simplesessionremote.class) public class simplesession { ... the ejb doesn...

lucene - SOLR search by external fields -

what need similar discussed here, except not filter actual query: http://lucene.472066.n3.nabble.com/filter-query-from-external-list-of-solr-unique-ids-td1709060.html we'd implement query parser/scorer allow combine solr searches searching external fields. due limitation of having update entire document though field in document needs updated. for example have database table called document_attributes containing 2 columns document_id, attribute_id. document_id corresponds id of documents indexed solr. we'd able pass in query like: attribute_id:123 or text:some_query (attribute_id:123 or attribute_id:456) , text:some_query etc... can implement plugin/module in solr that's able parse above query , fetch document_ids associated attribute_id , combine results normal processing of solr search return 1 set of results entire query. we'd appreciate guidance on how implement if possible. i repeat advice offered referenced question, qualificati...

vmware - Will VimService be supported for future SDK Release? -

we planning develop application monitoring performance counters various esx servers. 2 options available vimservice , esxtop. esxtop may cause cpu consumption @ esx server being monitored (as mentioned here ). doubt in using vimservice not sure if vimservice available future releases of sdk. vsphere client may not exist further release. tried search if vimservice removed future sdk release, couldn't useful. kindly update future plans vimservice sdk. also monitor esx performance counters, there better way other esxtop , vimservice. please clarify. thanking in advance. you can use vsphere api that. vmware's vsphere client uses same api, can sure if supported

Intellij IDEA not importing dependencies from @Grab in Groovy project -

i have groovy script working on, imports dependencies using @grab annotation. script run within idea, , command line. however, within ide, imports shown in red (as unresolvable), , no auto-completion on classes imported given. i accessing corporate repository via proxy, has been configured http proxy within idea (the module should be, , is, in local .m2 repo anyway!) anyone got ideas (no pun intended!)? i using intellij idea 12.5 ultimate (iu-129.1135), jre 1.7, , groovy 2.1.6 as stated crazycoder, alt + enter select grab artifacts , enter

Upgrading GlassFish 3.1.2.2 to use JPA 2.1 -

i working glassfish 3.1.2.2 (i can not upgrade 4 due os restrictions). i'm interested in upgrading jpa 2.0 jpa 2.1 glassfish 3.1.2.2. how can achieve this? this not possible @ all. jpa 2.1 part of ee 7 , therefore not integrated ee 6 gf 3.1.2.2.

vb.net - How to Add Click Listener to Programmatically Added Tabcontrol -

in application i'm programmatically adding tab so: 'show searchresults tab if not present if not tabcontrol1.tabpages.contains(tabsearchresults) tabcontrol1.tabpages.insert(3, tabsearchresults) end if now cant seem manually add click event listener tab in design view, , when in codeview nothing happens when click tab. so question is,.. how add click listener tabsearchresults tab? i assume tabsearchresults tabpage . first create function handler of click event private sub tabsearchresults_click(sender object, e eventargs) 'your code ... end sub then after line initialize tabpage add handler: tabsearchresults = new tabpage() addhandler tabsearchresults.click, addressof tabsearchresults_click

emacs - What's a good workflow for keeping track of which TODO items I've worked on in the last week in org-mode? -

right i'm using inactive timestamps todo items , updating them when i'm working on item. figured out how them show in timeline view. is there better workflow achieve this? e.g. having quicker way update timestamp on item. as mentionned, have use clocking commands (c-c c-x c-i/j/o). see manual. then, when jumping on whichever day or week (or ...) of agenda view, can ask seeing "hidden" past entries pressing 'v l' (view > log). press 'v' in agenda, , have @ possible commands ('v [' viewing inactive timestamps).

sorting - Linux sort command: keys with the same start but different length are not sorted in the same order -

i trying sort 2 files in order join them. of keys sorting similar , seems causing issues. example have 2 keys a1ke , a1k3-b3 . using command: sort -nk1 file.txt -o file.txt in 1 file appear in order , in other appear in reverse. causing issues when try join files. how can sort these files in same order? thanks do not use "-n" option, compares according string numerical value. -n compare according arithmetic value initial numeric string consisting of optional white space, optional - sign, , 0 or more digits, optionally followed decimal point , 0 or more digits. your keys strings, not numbers. instead, should do: sort -k1 file.txt -o file.txt additional info: you can see sort considers keys identical when -n used doing unique sort: sort -un file you see a1k3-b3 , a1ke considered equal (and therefore 1 emitted). if instead do: sort -u file the result contain both a1k3-b3 , a1ke , want.

angularjs - ng-form nested within ng-switch -

i ran issue ng-form not setting form on scope when nested within ng-scope. for example <div ng-controller='testctrl'> <ng-switch on="switchme"> <div ng-switch-default>loading...</div> <div ng-switch-when="true"> <form name="nixtest"> <input placeholder='in switch' ng-model='dummy'></input> <button ng-click="test()">submit</button> </form> </div> </ng-switch> </div> controller: controllers.testctrl = function ($scope) { $scope.switchme = true; $scope.test = function () { if ($scope.nixtest) { alert('nixtest exists') } else { alert('nixtest dne') } } } are there work arounds ? test fiddle can found here ng-switch creates child scope , form created on scope...

asp.net mvc 3 - Arabic font in Web UI and itextsharp -

i'm not able find reason why mvc 3 web site shows arabic font correctly , pdf not. i use bliss font in web site; @font-face { font-family: 'blissregular'; src: url('/fonts/blissregular-webfont.eot'); src: url('/fonts/blissregular-webfont.eot?#iefix') format('embedded-opentype'), url('/fonts/blissregular-webfont.ttf') format('truetype'); font-weight: normal; font-style: normal;} all working fine. after want create pdf of output arabic fonts not appears. i've googled , understand font must have arabic character show correctly. i've changed arial font (that contains arabic character) and... pdf worked. so... how possible bliss font (that not have arabic characters) see arabic font in web site? i'm confused.... thanks lot everybody! for every character browser encounters looks matching glyph in current font. if font doesn't have glyph looks fallback fonts see if have glyph. every browser has...

android - Gradle dependencies not imported into library project -

Image
hey i've been trying hours import android library ( betterpickers latest commit ) project using gradle after importing , setting module, compilation errors. seems wrong dependencies in build.gradle . build.gradle of library project build.gradle of main project as can see, android studio suggests autofix it's not helpful. when try run project/gradle build, compilation errors since library project dependent on nineolddroids lib . when try add nineolddroids dependencies different error: could not resolve dependencies configuration ':sub:bp:_debugcompile'. could not find com.nineoldandroids:library:2.4.0.) i guess both of them derived same thing. how can fix this? a few remarks using latest android studio (0.2.5) android support repository installed in main project, support lib imported fine , no compilation errors when using classes support lib tried many ways import library project, including answers here

visual studio 2010 - Regex search pattern excluding one file -

in visial studio 2010 want use regex pattern in built-in find , replace dialog, , want search in type of files *.cshtml, *.cs, *.js except e.g. mycontroller.cs file. how ? something this? \b^(?!mycontroller\.cs).+\.(cs(html)?|js)$\b

To Group By Hire Date in SQL Server? -

assume following table employee employeeid int firstname varchar(50) lastname varchar(50) supervisoremployeeid int salary money hiredate datetime how show number of employees hired per year last 5 years include average salary employees hired in years. how show number of employees hired per year last 5 years include average salary employees hired in years. checkout datepart function in sql. break , group dates based on interval supplied (ie. day, month, year, etc.) sample: select datepart(year,hiredate) ,count(emplid) ,avg(salary) employee datediff(year, hiredate, getdate) <= 4 group datepart(year,hiredate) order datepart(year,hiredate) asc

wpf - Showing and closing multiple windows -

say have 2 wpf windows. windowa , windowb. each window has 2 buttons. open button show other window , close button close other window (vice versa). example windowa have following click event , sub private sub button1_click(byval sender system.object, byval e system.windows.routedeventargs) handles button1.click windowb.show() closeweaidwindow() end sub public sub closeweaidwindow() dim closewindow = window.getwindow(me) if closewindow isnot nothing closewindow.close() gc.collect() end if end sub however closes entire application , not windowa. windowb opens .5 seconds. how can open window , close current window? sounds application.shutdownmode set onmainwindowclose . if want app remain open long window visible try onlastwindowclose .

servlets - How to load jsp page some data content dynamically without using javascript or ajax? Because my IE8 browser doesn't support most javascript tags? -

i want add dynamic data content database through ejb , servlet b div place without changing background data css or other designs. how this? can iframe? how can this? here b middle space , outer layout. jquery 1.9 (early 2013): we’ll remove many of interfaces deprecated in version 1.8; of them available plugins or alternative apis supported jquery project. ie 6/7/8 supported today. says http://blog.jquery.com/2012/06/28/jquery-core-version-1-9-and-beyond/ so try using jquery send ajax-request. below small snippet used 1 of projects. $.ajax({ type: "post", url: "tradecopy.action", data: $("#tradecopyform").serialize(), complete: function(xhr, textstatus) { $("#innermodalpopupdiv").html(xhr.responsetext); } });

ibm mobilefirst - IBM Worklight 6.0 - Mobile Test Workbench - Instrumentalized iOS App Error -

i’ve got problem instrumentalized ios app mobile test workbench ios-client. after adding necessary environments (iphone , android) , building app worklight, wanted test app mobile test workbench. instrumentalization rtwbuildxcode.sh succeeded , app uploaded simulator (with script-parameter simu). when script uploads app local mobile test workbench instance there following error: workbenchtest: application not supported worklight one. please consider using ibm rational test workbench. i’m confused! it’s worklight app , android-test-environment runs ios 1 doesn’t @ all. thing change in xcode-project “bundle identifier” build app script. original-app runs on android , ios-simulator! me pls? thx! i’m using worklight 6.0 , mobile test workbench 8.5 the issuse said did, changed in xcode-project "bundle identifier" you should not worklight app, need change in application-descriptor.xml change "bundleid" in iphone section fit need. <iphone bundl...

php - get images from directory and ad to ul -

i'm using responsive pattern brad frost's library create image grid (beta version here: http://yogeshsimpson.com/fry ). want have 3 folders of images 3 portfolio categories client can drop images into. from there think php right tool images folder, wrap in li , tags , have them added ul. on homepage see images 3 directories, , on "lighting" page example, see images directory, etc. again i'm assuming easy php, it's bit beyond grasp. appreciated. thanks. something work, run within folder wish list files. <?php if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $thelist .= '<li><a href="'.$file.'">'.$file.'</a>' . "<br>"; } } closedir($handle); } ?> <p>list of files:</p> <p><?=$thelist?...