Posts

Showing posts from April, 2011

asp.net - c#.net Error: There is already an open DataReader associated with this Command which must be closed first -

help, new asp.net c#. tried codes once before didn't seems have error. can't seems figure make changes to. sever error : there open datareader associated command must closed first. codes: string strconnectionstring = configurationmanager.connectionstrings["fypdb"].connectionstring; sqlconnection myconnect = new sqlconnection(strconnectionstring); string strcommandtext = "select promoid fypdb.dbo.promotions membershiptype '%' + @membership + '%' , defaults '%' + @defaults + '%'"; try { string ddlmembership = ((dropdownlist)dvinsertpromotion.findcontrol("ddladdmembershiplist")).selecteditem.tostring(); string ddldefault = ((radiobuttonlist)dvinsertpromotion.findcontrol("radiobuttonlist2")).text.tostring(); dataset da = dal.retrievemembership(ddlmembership, ddldefault); sitegridview.datasource = da; sitegridview.databind(); sqlcommand cmd = new sqlcommand(strcommandtext...

Image.open() cannot identify image file in python script file -

i trying execute script from pil import image im = image.open("image.jpg") nx, ny = im.size it working fine when run in python shell pytesser_v0.0.1]#env python >>> pil import image >>> im = image.open("image.jpg") <pil.jpegimageplugin.jpegimagefile image mode=rgb size=46x24 @ 0x7fa4688f16d0> but when put in test.py file , run python test.py getting error file "test1.py", line 17, in <module> im = image.open("image.jpg") file "/usr/local/python.2.7.11/lib/python2.7/site-packages/pil/image.py", line 2309, in open % (filename if filename else fp)) ioerror: cannot identify image file 'image.jpg' please me issue, thanks ps: earlier installed pil imaging-1.1.7 setup.py, later installed pillow, think problem in mutual presence of pil , pillow library on machine. make sure "image.jpg" in same directory "test1.py". if isn't either move it, or p...

php - Apply htmlentities to stripped tags -

researched links: how apply htmlentities selectively? , php function strip tags, except list of whitelisted tags , attributes they close not expected. what have tried? <?php define('charset', 'utf-8'); define('replace_flags', ent_html5); function htmlcleaned($string) { $string = htmlentities($string); return str_replace( array("&lt;i&gt;", "&lt;b&gt;", "&lt;/i&gt;", "&lt;/b&gt;", "&lt;p&gt;", "&lt;/p&gt;"), array("<i>", "<b>", "</i>", "</b>", "<p>", "</p>"), $string); } echo htmlcleaned("<p>how you?</p><p><b>this bold</b></p><p><i>this italic</i></p><p><u>this underline</u></p><p><br></p><ul><li>this list item 1...

Import WSO2 Identity Server default schemas into OpenLDAP -

i'm trying set wso2 identity server openldap primary user store. add idp embedded apacheds schemas': wso2person, identityperson , scimperson openldap not able import neither schema nor wso2person, identityperson , scimperson ldif files. can provide example regarding how achive goal? i trying import files new openldap on ubuntu server 16 lts using apacheds studio or other ldap clients every time try import files error thrown. i.e.: launching sudo ldapadd -q -y external -h ldapi:/// -f ou\=schema.ldif the server responds: server in unwilling perform (53) no global superior knowledge or, trying import wso2person.ldif ldapadd -d ldap:/// -d "cn=admin,dc=example,dc=org" -x -w -f wso2person.ldif the following error thrown: invalid syntax (21) additional info: attributetypes: value #0 invalid per syntax it not necessary use wso2person schema. can use of schemas supported external ldap (for ex: inetorgperson). thing have claim mapping ...

php - ifconfig parameter with store condition -

in magento xml layut or config file can write ifconfig parameter in tag apply condition this <action method="addlink" translate="label title" module="contacts" ifconfig="contacts/contacts/enabled"> <label>contact us</label> <url>contacts</url> <title>contact us</title> <prepare>true</prepare> </action> i trying find ifconfig alternative of function mage::getstoreconfig($path,mage::app()->getstore()); so can include store condition along path in ifconfig. appreciated. there no built in way that, because ifconfig constraint used current store. when calling mage::getstroreconfig() 1 parameter current store used second parameter. , layout loaded current store. if insist, here possible idea on how it. action tags in layout parsed , applied in method mage_core_model_layout::_generateaction() . piece of code checks ifconfig attribute. if (isset($node['ifc...

windows - How to delete recent opened file session on Visual Studio Code? -

i opened few files during coding (both files in project , out project). after that, close few in (by ctrl+w , click 'x' button). when type ctrl+tab , see opened files. i try restart vscode, restart windows nothing change. how close unnecessary files? i use vs code 1.0 + windows 10. edit: feature added in new versions i mistaken don't want delete, "clear" opened files. if case, follow these steps in regards vs code version 1.15.0: press ctrl + p then, within quick open bar, type in >clear opened press enter , restart visual studio code, , should see nothing under recent .

Normalization data and show NA in R -

i try normalized data in r, , show n/a actually. data before normalization data after normalization is data small? or problem? have research , found add na.rm=t , can put? normalized <-function(x) {(x-min(x,na.rm=t))/(max(x,na.rm=t)-min(x,na.rm=t))} if that, found outcome positive. thanks answering.

Windows Container with Docker: Cannot reach httpd in container from host (Win2016 TP5) -

i have windows server 2016 tp5 machine use container host. i have windows container running manage docker . inside container have apache httpd running on port 88. the port mapping when start container is: 0.0.0.0:80->88/tcp , map port 80 of container host port 88 of container. output docker inspect : http://pastebin.com/avem1egv i can reach apache http start page other computer in network through dns or ip. in case: http://10.10.1.162/ http://documents.test2016-3.company.com/ but same not work when try call same host system or inside container . so, on host system, try access same url via browser or wget, , getting: c:\> wget -usebasicparsing http://documents.test2016-3.company.com/ wget : unable connect remote server in both cases. but can ping host both host container. from host: c:\>ping test2016-3.company.com ping wird ausgeführt für test2016-3.company.com [fe80::847a:1430:8a10:b120%4] mit 32 bytes daten: from container: ps c:\> p...

How do I change the android actionbar title with tab menu? -

Image
how change android actionbar title when select tab menu? in onpageselected() , try following code, getsupportactionbar().settitle("my title");; this may helps you.

asp.net mvc 4 - Orchard CMS 301 redirection -

i wondering best place hook 301 url redirection codes in orchard cms 1.6? sample code or idea helpful. cant use rewrite rules module on gallery? http://gallery.orchardproject.net/packages/orchard.module.contrib.rewriterules

php - volley not populating ListView with remote server -

my android app connects server , information database , fills in listview. works fine xampp on localhost . after uploading files server doesn't work. no error in log except. d/volley: [1] 2.onerrorresponse: viewguidesactivity but when run php file on web browser returns json data perfectly. public class viewguidesactivity extends appcompatactivity { private static final string tag = viewguidesactivity.class.getsimplename(); private progressdialog pdialog; private list<guide> guidelist = new arraylist<guide>(); private listview listview; private customlistadapter adapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_view_guides); listview = (listview) findviewbyid(r.id.list); adapter = new customlistadapter(this, guidelist); listview.setadapter(adapter); pdialog = new progressdialog(this); // showing progress dialog before making http r...

batch command execution through jenkins not extracting files though it extracts when run as bat file -

i have written below batch script in jenkins. when run bat file in jenkins server workspace same folder, runs without issues. when run through jenkins using "execute windows batch command" not extracting. prints line "about copy from" relevant paths , keeps executing there. nothing printed in console output , nothing extracted. below script. echo %cd% /d %%p in ("%cd%\setups\*") rmdir "%%p" /s /q call mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get -drepourl=http://10.101.2.23:8081/nexus/content/repositories/releases/ -dartifact=test:update-service:1.0.3 -ddest=setups/services/update-service.jar call mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get -drepourl=http://10.101.2.23:8081/nexus/content/repositories/releases/ -dartifact=test:installer-prerequisites:1.0.0 -ddest=setups/prerequisites/installer-prerequisites.zip -dpackaging=zip echo came after downloads /r %%i in (*.zip) ( echo copy %%~dpi %%~fi call :u...

hadoop - HDFS can I specify replication factor per file to increase avaliability -

i'm newbie in hdfs, sorry if question naive. suppose store files in hadoop cluster. files popular , requested often(but not put them in memory) other. worth keep more copies(replicas) of files. can implement in hdfs or there best practice tackle task? yes, can entire cluster/directory/file individually. you can change replication factor(lets 3) on per-file basis using hadoop fs shell. [sys@localhost ~]$ hadoop fs –setrep –w 3 /my/file alternatively, can change replication factor(lets 3) of files under directory. [sys@localhost ~]$ hadoop fs –setrep –w 3 -r /my/dir to change replication of entire hdfs 1: [sys@localhost ~]$ hadoop fs -setrep -w 1 -r / but replication factor should lie between dfs.replication.max , dfs.replication.min value.

python - Need help converting Matlab's bsxfun to numpy -

i'm trying convert piece of matlab code, , line i'm struggling with: f = 0 wlab = reshape(bsxfun(@times,cat(3,1-f,f/2,f/2),lab),[],3) i've come wlab = lab*(np.concatenate((3,1-f,f/2,f/2))) how reshape now? matlab reshape(x,[],3) is equivalent of numpy np.reshape(x,(-1,3)) the [] , -1 place holders 'fill in correct shape here'. =============== i tried matlab expression octave - it's on different machine, i'll summarize action. for lab=1:6 (6 elements) bsxfun produces (1,6,3) matrix; reshape turns (6,3), i.e. removes first dimension. cat produces (1,1,3) matrix. np.reshape(np.array([1-f,f/2,f/2])[none,none,:]*lab[none,:,none],(-1,3)) for lab shape (n,m), bsxfun produces (n,m,3) matrix; reshape make (n*m,3) so 2d lab , numpy needs be np.array([1-f,f/2,f/2])[none,none,:]*lab[:,:,none] (in matlab lab 2d (or larger), 2nd case closer action if n 1). ======================= np.array([1-f,f/2,f/2])*lab[....

git pre-commit hook bypass email -

i have pre-commit hook runs php codesniffer on files in staging area. however, developers bypass hook adding --no-verify option git commit command. there way can send email each time developer bypasses hook? too long comment, not complete answer. whooph... in dvcs world happens in private repo private business. team repository administrator can propose them facilities enhance , simplify job, shouldn't overcarry. you, however, can , should put automatic sanity checks on receiving commits on team repository side. pre-receive hook better place obligatory checks. alternatively, , indeed it's recommended "valuable" project, set more complex system code review (our team uses gerrit there're plenty of them including written in php). thus, team members familiarize other members works, suggest improvements , on, while robots perform routine tasks, checking code-style, running unit- , integration tests , on.

r - Most efficient way of ordering columns and creating rank variables -

i have data frame several columns. want create function/loop or might more efficient take data frame, order column, create variable rank(with name rank_columnname) based on order , add data frame. dat <- data.frame(indi1=rnorm(10),indi2=rnorm(10)) dat1 <- dat[order(dat$indi1), ] dat1$rank_indi <- 1:nrow(dat) dat2 <- dat1[order(dat1$indi2), ] dat2$rank_indi2 <- 1:nrow(dat2) this example want, in cumbersome way. i've tried using lapply can't seem update data frame new column similar name. any appreciated. here's simple loop insert in "rank_indi" variables: for(i in names(dat)){ dat[order(dat[,i]),paste0("rank_", i)] <- 1:nrow(dat) } dat indi1 indi2 rank_indi1 rank_indi2 1 1.45829065 -0.3322692 10 2 2 0.55972129 2.5031318 7 10 3 0.45870293 -0.6216859 6 1 4 1.03814922 1.4284271 9 8 5 -0.75211259 0.5600499 3 ...

javascript - hide, show using jquery -

i show , hide section landing on div second screen when hover 1 section want hide , show here's i've done lately. have tried lot of things nothing works. <div class=" banner"> <div class="section-left"> <section class="ha"> <p> الوافد الجديد</p> <a href="#"><h6> تسوق الان</h6></a> </section> </div> <div class="section-mid"> <section> <p> الوافد الجديد</p> <a href="#"><h6> تسوق الان</h6></a> </section> </div> <div class="section-right"> <section> <p> الوافد الجديد</p> <a href="#"><h6> تسوق الان</h6></a> </section> </div> .section-left { background-image: ur...

getting an error while trying to read a csv file in c# -

this code , code seems exiting without printing onto console: string s_item = "error 500"; var lines = file.readlines("c:/users/lenovo/desktop/probablisitic automata/data/april/april_steady_state.csv"); foreach (string line in lines) { if (line.contains(s_item)) { console.writeline(line); } } i following error : 'read_april_csv.vshost.exe' (clr v4.0.30319: read_april_csv.vshost.exe): loaded 'c:\users\lenovo\documents\visual studio 2015\projects\read_april_csv\read_april_csv\bin\debug\read_april_csv.exe'. symbols loaded. thread 0x2878 has exited code 0 (0x0). thread 0x3ed8 has exited code 0 (0x0). program '[13288] read_april_csv.vshost.exe' has exited code 0 (0x0).

c# - Thread synchonization -

i have list of commands processed concurrently on multiple threads. list static, each thread generates output , not interfere other threads, works ok far. some of commands require complex calculations on dataset accompanies command. result of calculations same threads. @ moment each thread performs calculations when reaches command waste of time , resources. what perform calculation once , share results between threads. thread reaches first command starts calculation, other threads reach command wait till calculation complete , use result. i have little experience thread synchronization , not know synchronization primitives should use scenario , should put lock on calculation. can tell me classes (for synchronization) should use in scenario , thread should wait , on object? my code looks this: private void threadfunc(object state) { context ctx = (context)state; command cmd = ctx.commandlist; processor proc = ctx.processor; while (cmd != null) { ...

wso2is - ConfirmationCode is not getting invalid in wso2 -

when use userinformationrecoveryservice verifyconfirmation code web service,it should invalid after verified once.we sending askpassword email after creating user.user should able use confirmation code once. is there config need modified.?? currently confirmation codes retrieved @ password reset invalidated @ successful password reset or @ confirmation code expiration. please follow details here . as far remember, had plan make configurable, jira can't find have implemented or not, haven't done yet.

c# - How to react to a onlick in an ultragrid -

i have code creates ultragrid column has columnstyle.button it's style. private void grid_initializelayout(object sender, initializelayouteventargs e){ grid.resetemptyselectedappearance(); var column = grid.setcolumn("draw lines", "draw lines", 30); column.style = columnstyle.button; grid.hideothercolumns(); } now make react being clicked on. have found this not show me how bind variable, can either double click in visual studio editor (but in case directs me grid_initializelayout ) or can go the item in question , add function onclick variable, 1 doesn't exist. private void grid_initializerow(object sender, initializeroweventargs e) var buttoncell= e.row.cells["draw lines"]; //something here? this want call private void ondrawline(object sender, infragistics.win.ultrawingrid.celleventargs e) { debug.print("test test"); } it's trivial i...

java - How to make a stop button function with a play/pause toggle and seekBar widget -

i have been trying can stop song in android studio app mediaplayer package. have place song inside app , plays fine when play , pause too. however, when play song or pause song after pressed stop function, unexpectedly crash app saying "unfortunately, playpausestop has stopped." can sure going on in stop function, not quite sure need stop actual song , restart beginning. additionally, trying add seekbar reads length of song duration. sure need setduration();, setmax();, , more. appreciate helpful resource can use track trying this. here code far, not best: package com.example.hamzeh.playpausestop; import android.media.mediaplayer; import android.media.mediaplayer; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.toast; import android.widget.togglebutton; import android.widget.seekbar; public class mainactivity extends appcompatactivity { seekbar seek_bar; int pause;...

c++ - decltype and static template method -

in attempt use sfinae, following code fails compile: template<typename objecttype, typename groupa, typename groupb, typename = void> struct delegateimpl; // default version template<typename objecttype, typename groupa, typename groupb> struct delegateimpl<objecttype, groupa, groupb, decltype(groupa::get<objecttype>())>; // specialization with gcc: error: template argument 4 invalid with msvc, surprisingly more helpful: error c3553: decltype expects expression not type my aim have compiler pick specialization if expression groupa::get<objecttype>() valid. question: how use decltype static template method? neither compilers give helpful errors actually. real issue you're missing template keyword before get : template get<objecttype>() see cppreference's page on dependent names

xamarin.android - Multiple Android apps within one xamarin solution -

what best way create multiple android apps in 1 xamarin form solution? i've tryed add new android project solution, updated references, packages , mainactivity.cs build in .android project when try run project system.nullreferenceexeption in loadappliction(new app()); function i should suggest unload other projects while testing one. example wrote preprocessor directives handle platform specific codes on shared codes like #if __ios__ bla bla #endif #if __android__ bla bla #endif but setup ios project start project, visual studio did not see ios symbol; defined on ios project properties! did unload android project , went well. unload ios project , load android , android project gone too. i'm not sure case can give try :)

javascript - Angular and passing objects between controllers -

i in progress of making angularjs app c# web api. i have controller , b. in controller a, have list of objects, when click add (between 2 list items), controller b. //add item $location.path("/controllerb") inside controller b prestented list of objects, when select, need selected item, appear in controller a's list, @ sepcified index. my approach far: localstorage: use localstorage store selected object, accessible controller a, need index, , if store in ls access controller b, im headed down path of bad decisions feel :d so best guess far: 1. save index controller in local storage. (go b) 2. save selecteditem controller b in local storage. (go a) 3. push selecteditem index. so please, point me in angular direction. consider using angular service hold data, inject service in controller , controller b. have @ topic: what's correct way communicate between controllers in angularjs?

java - Android : Avoid app to quit after automation testing -

i writing android automation test using robotium , after successful test, want take screenshot of app. the problem application quits after test completed , job screen capture takes home screenshot not desired. is there way stop application quit app screen active , desired screenshot? below test case have written. also, not using teardown activity. public class mytest extends activityinstrumentationtestcase2 { private static final string launch_activity_name = "com.demo.activity.myactivity"; private solo solo; private static class<?> splashactivityclass; static { try { splashactivityclass = class.forname(launch_activity_name); } catch (classnotfoundexception e) { throw new runtimeexception(e); } } public test() throws classnotfoundexception { super(splashactivityclass); } @override protected void setup() throws exception { solo = new solo(getinstrumentation(), getactivity()); } @suppresslint({ "simpledateformat...

mysql - C# Syntax issue in my If statment -

im having issues if statment , 1 in think main issue in: (string.isnullorwhitespace(txtfirstname.text) || string.isnullorwhitespace(txtlastname.text) || string.isnullorwhitespace(txtemail.text) || string.isnullorwhitespace(txthotel.text)) i want if statements false should execute mysql command (ps working moment syntax fells wrong.) if (appointment.checkstate == checkstate.checked) { if (string.isnullorwhitespace(txtfirstname.text)) { txtfirstname.backcolor = color.red; messagebox.show("please enter first name!"); } else { txtfirstname.backcolor = color.white; } if (string.isnullorwhitespace(txtlastname.text)) { txtlastname.backcolor = color.red; messagebox.show("please enter last name!"); } else { txtlastname.back...

java - Which would be the best way of encryption for following scenario? -

i want know best java encryption type can use secure application authentication details. in application have use credentials database , 1 application. putting in 1 properties file. db_username = abc db_password = password if dont want password visible in properties file. cant hardcode in application. command prompt application , run using script runs automatically. available encryption methods can use? thanks.. you take username , password arguments program, call example: java -jar yourprogram -user john -pass 1234 you move security issue os (make sure batch accessible authorised users). alternatively can pass properties file, place secure location. see this related post .

android - How to deploy files into a device for multi-app access -

my idea develop application android, able following: the apk-file contains resource, e.g. pdf-file. , file should accessible other apps. intention install /res/raw/-file in dedicated directory, e.g. /download/pdf-files, can accessed different applications. this process should done installation of app. how should configure manifest.xml purpose? during installation process, no action can performed unless user presses 'open' launch app. code first executes after oncreate() method of mainactivity specified in manifest. have add code in oncreate() method. need add following permission:

javascript - jQuery 'find' undefined -

i have set of nested <div> , on completion of page load need take action on inner <div> of each of outer <div > in .ready() of page, iterate through each of $('.outer').each() calling dosomething() function, attempts find() <div class='inner'> . the problem .find() method failing object doesn't support property or method 'find' below view source (from ie11) demonstrate issue. markup @{ viewbag.title = "index"; } <h2>index</h2> <div class="outer"> <div class="inner"> 1 </div> </div> <div class="outer"> <div class="inner"> 2 </div> </div> <div class="outer"> <div class="inner"> 3 </div> </div> <script src="scripts/jquery-1.10.2.js"></script> <script src="scripts/jquery.fitte...

Reference in Coq Lists library not found -

i'm trying use concat function appears in https://coq.inria.fr/distrib/current/stdlib/coq.lists.list.html . tried following: require import arith coq.lists.list. import listnotations. definition con (l : list nat):= (concat [[0]; l]). but error error: reference concat not found in current environment. thought should work since i've imported library, don't know error comes from. i'm using version 8.4pl3 (january 2014). version issue? concat added in this commit. think close end of 8.4pl3 release not pushed release, rather next 8.5

angularjs - How to calculate time from now in javascript? -

i'm code newbie forgive me if answer question obvious! i'm collecting json data api , have value, expecteddatetime, i'd use calculate number of minutes , seconds now . it has format: 2016-05-09t12:26:26 i've tried this: function applytimetovallingby(data) { $scope.timetovallingby = 0; $scope.timetovallingby2 = 0; d = new date(); for(i=0;i<data.responsedata.buses.length;i++){ if(data.responsedata.buses[i].journeydirection === 2){ if($scope.timetovallingby===0){ $scope.timetovallingby=(d-data.responsedata.buses[i].expecteddatetime); }else if($scope.timetovallingby!=0&&$scope.timetovallingby2===0){ $scope.timetovallingby2=d-data.responsedata.buses[i].expecteddatetime; } } } } but doesn't work. i've tried find way convert new date() value similar format of expecteddatetime, can subtract,...

r - ConditionalPannels not showing -

i having weird issue when using conditional panels. i have similar this shinyui(bootstrappage( selectinput(inputid = "grapht", label = "type of graph :", choices = c("x","y"), selected = "x"), conditionalpanel( condition = "input.grapht == 'x'", plotoutput(outputid = "plot1")), conditionalpanel( condition = "input.grapht == 'y'", splitlayout( cellwidths = c("50%", "50%"), plotoutput(outputid = "plot1"), plotoutput(outputid = "plot2") )) )) if remove either of condition panels, other renders when select correct option. if keep both conditional panels nothing shows, don't error or message, it's not sending input. gives? the problem have 2 outputs same id plot1 . if change in chunk outputid plot3 conditionalpanel( condi...

SQL Server : DBMail Stored Procedure -

i novice sql server, , have created stored procedure amalgamation of posts. here stored procedure - works well, apart fact uses number of days first entry, , doesn't change subsequently, same @numberofdays each email. alter procedure [dbo].[renewalscheck] declare @companyname nvarchar (50) = null declare @productkey nvarchar (50) = null declare @productname nvarchar (50) = null declare @maintenancestartdate nvarchar (10) = null declare @maintenanceenddate nvarchar (10) = null declare @result nvarchar (10) = null declare @emailed int = null declare @sent nvarchar (10) = null declare @body nvarchar (max) = null declare @subject nvarchar (max) = null declare @salesmanemail nvarchar (max) = null declare @numberofdays nvarchar (5) = null declare @followup int = null declare cemail cursor local fast_forward select [companyname], [product key], [product name], [maintenance...

How to bind Ctrl-Enter in fish? -

in order configure user binding (version 2.2.0), must in fish_user_key_bindings function: function fish_user_key_bindings bind \n 'commandline -f accept-autosuggestion execute' end this works fine. i wanted expand binding ctrl + enter , using appropriate modifier : function fish_user_key_bindings bind \c\n 'commandline -f accept-autosuggestion execute' end this not work: enter uses current (up cursor) suggestion (which default) but ctrl + enter well (as if action modifier not taken account) binding \c\n doesn't make sense because \n control character. applying control modifier second time control character has no effect. since \n alias \cj you're trying equivalent of binding \c\cj . way bind [ctrl][enter] configure terminal send unique sequence key combination. p.s., if grab current git head source can make fish_key_reader build handy program show lot of information different keys send (although you'll need wait few...

c# - SQLite returns count equal to 0 -

i use sqlite return count of records match condition. problem count equal 0 (i thought wrong in query, have copied ctrl + c / ctrl + v sqlite gui manager , returns 10 - value...). the code use is: _command = _sqlite.createcommand(); _command.commandtype = commandtype.text; _command.commandtext = query; int32 recordsfound = (int32) _command.executescalar(); // 0 here, should 10 my query being used: select count(*) test_table address match '4 , church' why work fine in gui, not code?:/ [edit] but what's strange. if use below query result should 2044 , 2044... wtf? select count(*) test_table address match '4' read answer here : sqlite full text search doesn't find results when space in query you have escape spaces in query using "". is, 'match' looking 4 whole word.

Liferay 6.2 adding a new ckeditor -

i want add new ckeditor liferay because need limit functionality of 1 available. however, not want change original 1 because migth later on need in different form. how can add new ckeditor can used create structure webcontent articles? need create new theme liferay or this? info: our liferay runs on jboss server edit: i have created hook overrides html\js\editor\ckeditor\ckconfig.jsp file , added config.toolbar_mini = [ ['bold', 'italic', 'underline', 'strike'], ['bulletedlist'] ]; additionally, have changed lines in concerning liferay-ui:input editor in \html\portlet\journal\article\content.jsp file. <div class="journal-article-component-container"> <liferay-ui:input-editor contentslanguageid="<%= validator.isnotnull(tolanguageid) ? tolanguageid : defaultlanguageid %>" editorimpl="<%= editor_wysiwyg_impl_key %>" name="articlecontent" toolbarset=...

Merge files in SPSS - key variable -

i merged few files in spss same id number. made sure id numbers sorted ascending in each file. names of ids same in every file , variables contain exact same numbers. problem width, number of decimals , number of columns differ between files? or have make sure al these features same in files? if encountering problem best post exact syntax , exact error message receive.

sql - Why does oracle optimiser treat join by JOIN and WHERE differently? -

Image
i have query on used query optimiser: select res.studentid, res.examid, r.percentcorrect, max(attempt) attempt tbl res join (select studentid, examid, max(percentcorrect) percentcorrect tbl group studentid, examid) r on r.studentid = res.studentid , r.examid = res.examid , r.percentcorrect = res.percentcorrect group res.studentid, res.examid, r.percentcorrect order res.examid what surprised me optimiser returned following on 40% faster: select /*+ no_cpu_costing */ res.studentid, res.examid, r.percentcorrect, max(attempt) attempt tbl res, (select studentid, examid, max(percentcorrect) percentcorrect tbl group studentid, examid) r r.studentid = res.studentid , r.examid = res.examid , r.percentcorrect = res.percentcorrect group res.studentid, res.examid, r.percentcorrect order res.exa...

powershell - ExpandProperty not showing other properties with Select-Object? -

i having trouble -expand parameter of select-object cmdlet. understand file can select-object output expanded properties and other properties, doesn't seem working in case. following example file, following works: ps> get-process | select-object name -expand modules | fl name : chrome modulename : chrome.exe filename : c:\program files (x86)\google\chrome\application\chrome.exe baseaddress : 10682368 modulememorysize : 868352 entrypointaddress : 10980160 fileversioninfo : file: c:\program files (x86)\google\chrome\application\chrome.exe internalname: chrome_exe originalfilename: chrome.exe fileversion: 28.0.1500.72 ... trying same want doesn't work though: ps> get-wmiobject win32_computersystem | select -property __class,__superclass,__dynasty -expand __derivation | fl cim_unitarycomputersystem cim_computersystem cim_system cim_logicalelement cim_mana...

twisted - WAMP with Django App using Python 2.7 AND 3.4 - is it possible? -

the essence of question is: possible use wamp notifications in django application supporting both python 2.7 , 3.4, considering code should running , interrupted if remote procedure call made? (that is, it's not waiting rpc come) how want use wamp: program has javascript frontend python/django backend. 1 of things start function in backend when button in frontend clicked. takes time though, allow user cancel clicking button. 1 makes remote procedure call, cause function stop earlier (it changes variable checked in function). there might other needs rpc or pub/sub in future too. we got working python 2.7 using autobahn_sync module, uses twisted, hasn't yet been ported python 3.x. that's why need way of getting our wamp notification work on 3.x. asyncio supported , crossbar documentation seemed used instead of twisted, can't work without blocking code should running in parallel (code added below). , there doesn't seem autobahn_sync using asyncio instead o...

php - send verification mail form my live site (domain email address) using cpanel -

i'm working on project in codeigniter follows mvc pattern, i've created model send verification email website's signed members. code working using google's smtp on localhost site live , don't know protocols , web-mail, i'm new this.. localhost code here: $config = array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'my mail', 'smtp_pass' => 'my password', 'mailtype' => 'html', 'charset' => 'iso-8859-1', 'wordwrap' => true ); now changes needed use through web mail cpanel?? in webmail settings find smtp settings. ports same in major case. need change host, username , password per new server. there link "configure mail client" in email secti...

c++ - Can I enforce this operator call count requirement at compile time? -

i have class which, interface-wise, simple this: struct foo { inline foo & operator << (int i) { return *this; } }; i can use in following way: foo foo; foo << 1 << 2 << 3 << 4; now restrict usage of operator. for instance , called number of times between sequence points. i address problem using internal proxy class. temporary created which, @ end of control sequence, destroyed , checks how many times operator has been called: struct foo { inline foo() : m_count(0) {} private: struct fooproxy { friend struct foo; inline ~fooproxy(); inline struct foo & operator << (int i); private: inline fooproxy(struct foo &foo) : m_foo(foo) {} struct foo &m_foo; }; public: inline fooproxy operator << (int i); private: int m_count; }; inline foo::fooproxy foo::operator << (int i) { ++m_count; return fooproxy(*this); } in...

java - Vaadin and SQLContainers not working with ListSelects -

this seems simple, reason using vaadin 7.0.7 , listselect seems marked dirty while obtaining data display. the code .... fieldgroup group = new fieldgroup(bean); sqlcontainer c = new sqlcontainer(new tablequery(null, "user", "system", pool, new oraclegenerator())); listselect options = new listselect("system", c); group.bind(options, "system"); .... but seems throwing error, when listselect obtaining ids, sql container seems marked dirty when there's update java.lang.illegalstateexception: connector should not marked dirty while response being written. @ com.vaadin.ui.connectortracker.markdirty(connectortracker.java:346) @ com.vaadin.server.abstractclientconnector.markasdirty(abstractclientconnector.java:139) @ com.vaadin.ui.abstractselect.fireitemsetchange(abstractselect.java:1679) @ com.vaadin.ui.abstractselect.containeritemsetchange(abstractselect.java:1646) @ com.vaadin.data.util.sqlcontainer.sqlcontainer.firecontentschange(sq...

sql - Set Variable with select query with dynamic schema name -

i trying set variable query result. problem below code runs in while loop & schemaname different. while (@i <= (select max(idx) @schema_table)) begin set @userid = (select aspnetusers.id schemaname.aspnetusers left join schemanameaspnetuserroles on aspnetuserroles.userid = aspnetusers.id left join schemaname.aspnetroles on aspnetroles.id = aspnetuserroles.roleid aspnetroles.name = 'superadmin') end how set schemaname variable can dynamic in while loop. something help: declare @sql nvarchar(4000), @schemaname nvarchar(200), @i int = 1, @vparams nvarchar(100) set @vparams = '@uid int output' while (@i <= (select max(idx) @schema_table)) begin select @schemaname = schemaname @schema_table idx = @i select @sql = ' select @userid = aspnetusers.id schemaname.aspnetusers ...

javascript - How to create rectangles of variable size in Heatmap according to data given in json using D3.js? -

i have made heatmap represents value color intensity.how create heatmap in size of rectangles used represent value json? have tried following code not giving required output. <body> <div id="chart"></div> <div id="dataset-picker"> </div> <script type="text/javascript"> var width=400, height=300, buckets=9, colors = ["#ccd9ff", "#99b3ff", "#668cff", "#3366ff", "#0040ff", "#0033cc", "#002699", "#002080", "#00134d"], datasets = [{ "day": 1, "hour": 1, "value1":16, "value2":20 }, { "day": 1, "hour": 2, "value1":23, "value2":10 ...

mysql - select average from average -

i have following table: rating -------- | id | account_id | room | kitchen | bathroom | ----------------------------------------------- | 1 | 1 | 5 | 5 | 5 | | 2 | 1 | 2 | 4 | 1 | | 3 | 1 | 5 | 2 | 1 | ----------------------------------------------- people can rate room, kitchen , bathroom (from 1-5). average rating id = 1: 5 (because 15/3 = 5) average rating id = 2: 2.3333 (because 7/3 = 2.33333) average rating id = 3: 2.6666 (because 8/3 = 2.66665) first question as can see, average rating id = 2 => 2.3333... , id = 3 => 2.6666. how can make floor() , ceil()? (when < .5 => floor, when > .5 => ceil), avg rating id = 2 becomes 2 (instead of 2.3333) , avg rating id = 3 becomes 3 (instead of 2.6666...) second question i want select average rating of average ratings (so average rating rows together). - when floor() , ceil() used have 3 average ratings: 5, 2 , 3 => 10/15...

webpack - require() inside require()'d file -

my webpack config compiles .scss files css in pretty standard way: { test: /\.scss$/, exclude: /(node_modules|bower_components)/, loaders: ['style', 'css', 'sass'] } what i'd do, though, have url , file loaders work inside *.scss files, end goal of inlining smaller images: &.backdrop { background-image: require('../../assets/images/backdrop-1.jpg'); } it seems webpack ignoring require() call, though, css results identical code above (i.e. browser told try , render background image found @ require('../../' [etc etc] . loader i've been trying above: { test: /\.jpg$/, loader: 'url', query: { limit: 250000 } } can suggest i'm going wrong?

python - SwapRateHelper fails for swap with 4W frequency: "undecidable comparison between 4W and 1M" -

i using quantlib 1.7 in python. i trying build swap curve mxn tiie swaps, vanilla fixed-float frequency of 4 weeks on both legs. when call swapratehelper error message "undecidable comparison between 4w , 1m". there no reference 1m tenor anywhere on code... don't understand problem. import quantlib ql tiie_index = ql.iborindex('tiie', ql.period('4w') , 1, ql.mxncurrency(), ql.nullcalendar(), ql.following, false, ql.actual360()) rate = 0.02 tenor = ql.period('12w') frequency = ql.everyfourthweek bdays_adj = ql.following day_count = ql.actual360() h = ql.swapratehelper(ql.quotehandle(ql.simplequote(rate)), tenor, ql.mexico(), frequency, bdays_adj, day_count, tiie_index) it's bug fixed in version 1.7.1; see https://github.com/lballabio/quantlib/issues/28 .

Spring Context initialization failed while bootstrapping with Websphere 7.x server -

i working on migration task migrating project websphere 6.1 websphere 7.0.0.39. upgraded jdk version 1.5 1.6. actually 1 of web project, uses spring , hibernate combination. version of spring 2.5.3. spring context initialized while bootstrapping i.e. @ server startup. so getting org.springframework.web.context.contextloader initwebapplicationcontext context initialization failed error while server startup. i did google search on below issue , found jira spr-4788 says spring2.5 && ibm jdk6 produce npe below. stack trace server startup log : org.springframework.context.support.abstractapplicationcontext obtainfreshbeanfactory bean factory application context [org.springframework.web.context.support.xmlwebapplicationcontext@27822782]: org.springframework.beans.factory.support.defaultlistablebeanfactory@39ed39ed [5/9/16 16:29:03:417 ist] 0000000c defaultlistab org.springframework.beans.factory.support.defaultsingletonbeanregistry destroysingletons destroying single...