Tomcat instances on newly added node can't start with SSL

Uncategorized
Question: exception: "java.lang.Exception: Connector attribute SSLCertificateFile must be defined when using SSL with APR" I have found that it is because of missing APR library which has to be manually installed: "The APR is a native library that you may install during Tomcat installation." So this library probably missing on new installed Tomcat instances (czchols3883/czstlls346). When I commented out line in server.xml with APR listener: , Tomcat started correctly! So looks like issue is really caused by this missing library. Please could you check it and install missing library on new nodes rh6.5 and tomcat 7.0.59? Answer: Read more
Read More

HTML data is not rendering properly in UIWebView

Uncategorized
Question: I am really confuse. Probably HTML data is not correct format so it is not rendering in UIWebView. Below is code :self.contentBlog.frame.size.height = 1 self.contentBlog.frame.size = self.contentBlog.sizeThatFits(.zero) self.contentBlog.delegate = self; self.contentBlog.loadHTMLString(dataString, baseURL: nil) below is html data link which i am getting using web services.I was not able to paste content because it was not accepting. http://collabedit.com/57h26 Answer: Read more
Read More

Web API get query params

c#
Question: I've got the following method definition in a Web API controller:public async Task Get([FromUri] Paging pageParams) And corresponding Paging class would be 'something' like:public class Paging { public int pageIndex { get; set; } public int pageSize { get; set; } public Columns order { get; set; } } Received request is /api/search?order(description)=asc&pageIndex=2&pageSize=25 which I'd not have limited control. What would be correct Columns class definition in order to get the binding for the order parameter? Answer: You could use a string containing "asc" or "desc" instead of an object, if you want to make a linq query, the following library allows to use the string directly: https://weblogs.asp.net/scottgu/dynamic-linq-part-1-using-the-linq-dynamic-query-library and the nuget package: https://www.nuget.org/packages/System.Linq.Dynamic/ Here is an example:[HttpGet] public IActionResult Get(int count, int offset, string order = "asc") { if…
Read More

How to save data from RDD to relational database in Apache Spark

Uncategorized
Question: I've searched and found some answers(my too old) anyawy my questions was not answered completelly.I am with difficulties to find a good model to store data in a relational database from RDD in Apache Spark. The objective is: Once the data it's in RDD, group it, then save the keys in tableA and the values to the tableB (with foreign key to the key tableA) my tables are from Oracle database. So based in many searchs in web I've constructed the follow code final JavaSparkContext sparkContext = getContext(); sparkContext.parallelize(Arrays.asList( new Sale("West", "Apple", 2, 10), new Sale("West", "Apple", 1, 15), new Sale("West", "Microsoft", 1, 15) )) .map((Function) v1 -> { return new SaleSummary(v1.store, v1.product, v1.amount, v1.units); }) .keyBy((Function) v1 -> { return new SaleKey(v1.product, v1.store); }) .groupByKey(100) .foreachPartition((VoidFunction) salesGroups ->…
Read More

Saving of Checkboxes selected into database using Angular and spring mvc

Uncategorized
Question: Here what I am trying to do is,as you can see I have College table,CommitteeMember table and Committee_College table.I am having some data in CommitteeMembers table.When i click on Assign button I am trying to assign colleges to Committee Members. In popup I am getting CollegeTypes dropdown.Based on collegetype selected I am getting all Colleges that is assigned in database i.e one Collegetype can have many colleges under it.I have three College types which i am showing in dropdown. After selecting any one i am getting all colleges under that particular collegeType.After that I am displaying all Committee Members that are stored in database along with checkboxes to every names.Now what i want to do is I have to assign colleges to individual Committee Members by clicking on checkboxes.Its…
Read More

IllegalStateException: parcel.readString() must not be null

Uncategorized
Question: I put Parcelable object in Intent to next Activity:val intent = Intent(mContext, ShowTestActivity::class.java) intent.putExtra("test", test) Log.d("myLog", "${intent.getParcelableExtra("test")}") // No problem mContext.startActivity(intent) And get this object in next Activity:if (!intent.hasExtra("test")) throw Exception("Intent doesn't has 'test' extra") val test: Test = intent.getParcelableExtra("test") And here are throwing Exception:public open class QBase(): Parcelable { ... protected constructor(parcel: Parcel?) : this() { parcel?.let { question = parcel.readString() // parcel.readString() must not be null helpText = parcel.readString() qValue = parcel.readDouble() qType = QType.valueOf(parcel.readString()) } } override fun writeToParcel(parcel: Parcel, flags: Int) { parcel.writeString(question) parcel.writeString(helpText) parcel.writeDouble(qValue) parcel.writeString(qType.name) } ... } And in Test:public class Test(): Parcelable { ... public var questions: ArrayList = ArrayList() constructor(parcel: Parcel?): this() { parcel?.let { ... parcel.readTypedList(questions, QBase.CREATOR) } } override fun writeToParcel(p: Parcel?, p1: Int) { p?.let { ... it.writeTypedList(questions)…
Read More

What does super(User, self).__init__(**kwargs) mean Python [duplicate]

Uncategorized
Question: This question already has an answer here:Understanding Python super() with __init__() methods [duplicate] 7 answers I got somecode like this:class User(UserMixin, db.Model):#... def __init__(self, **kwargs):super(User, self).__init__(**kwargs) if self.role is None:if self.email == current_app.config['FLASKY_ADMIN']:self.role = Role.query.filter_by(permissions=0xff).first() if self.role is None:self.role = Role.query.filter_by(default=True).first() The code is for checking if the user have a role, if not, then add the default role to the user. When i use a generate fake user tool to generate some fake user, the user didn't have the role with the generate_fake function. So if i want to add the role to the user, how can i call this function when the manage.py runs? Or how can I call this function in shell? I also don't understand the super(User, self).__init__(**kwargs) , this function is under class User,…
Read More

How to run virtualized Win10+VS2017+Docker (guest or host) on macOS Sierra?

Uncategorized
Question: I installed Windows 10 together with Visual Studio 2017 Enterprise Edition and Docker for Windows as a Parallels virtual machine on my Macbook Pro running macOS Sierra and enabled Nested Virtualization. When starting up Docker for Windows to run Linux containers, the MobyLinuxVM Hyper-V image on the Windows 10 virtual machine seems to crash with the following message: Docker hv-sock proxy (vsudd) is not reachable at Docker.Backend.ContainerEngine.Linux.ConnectToVsud(TaskCompletionSource`1 vmId) in C:gopathsrcgithub.comdockerpinatawinsrcDocker.BackendContainerEngineLinux.cs:line 266 at Docker.Backend.ContainerEngine.Linux.DoStart(Settings settings) in C:gopathsrcgithub.comdockerpinatawinsrcDocker.BackendContainerEngineLinux.cs:line 250 at Docker.Backend.ContainerEngine.Linux.Start(Settings settings) in C:gopathsrcgithub.comdockerpinatawinsrcDocker.BackendContainerEngineLinux.cs:line 123 at Docker.Core.Pipe.NamedPipeServer.c__DisplayClass9_0.b__0(Object[] parameters) in C:gopathsrcgithub.comdockerpinatawinsrcDocker.CorepipeNamedPipeServer.cs:line 47 at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) in C:gopathsrcgithub.comdockerpinatawinsrcDocker.CorepipeNamedPipeServer.cs:line 145 When I switch to running Windows containers the Hyper-V image does not crash. Now, I have been reading Docker documentation, Parallels documentation and a lot of forum posts. It seems like Docker…
Read More

FAB layout_anchor crash with a exist resource

Uncategorized
Question: Today, I was making a Login Activity which used a FAB as the Login Button. The codes were right. When I was arranging the layout file, I used these codes:android:id="@+id/floatingActionButton3" android_layout_width="match_parent" android_layout_height="wrap_content" android_layout_gravity="center_horizontal" android_layout_marginTop="20dp" android_clickable="true" app_elevation="15dp" app_layout_anchor="@id/EText1" app_layout_anchorGravity="end" app_fabSize="normal" app_srcCompat="@drawable/ic_arrow_forward" Android Studio didn't report any bugs when I typed these codes. But when I was going to run it as a debug app on my phone, it crashed with this mistake:Error:(16, 28) No resource found that matches the given name (at 'layout_anchor' with value '@id/EText1'). And I noticed a mistake in Render Errors:Couldn't resolve resource @id/visible I hope someone can help me to solve this problem. I will appreciate it if someone can give me a solution. Thanks Anyway! Answer: Make sure you have a view with "EText1" id…
Read More

Cannot read property 'render' of undefined

Uncategorized
Question: i am making a simple program in koa.js in which i am trying to rendering the information to the html page i.e index.html and whenever i trying to run the code it gives the error.. i am tired of this thing, still can't find a better solution.. TypeError: Cannot read property 'render' of undefined at Object.render (C:UsershamzaDesktopTheFirstKoaAppTask3app.js:27:8) at next (native) at Object.dispatch (C:UsershamzaDesktopTheFirstKoaAppnode_modules koa-routerlibrouter.js:331:14) at next (native) at onFulfilled (C:UsershamzaDesktopTheFirstKoaAppnode_modulescoindex.js:65:19) at C:UsershamzaDesktopTheFirstKoaAppnode_modulescoindex.js:54:5 at Object.co (C:UsershamzaDesktopTheFirstKoaAppnode_modulescoindex.js:50:10) at Object.toPromise (C:UsershamzaDesktopTheFirstKoaAppnode_modulescoindex.js:119:63) at next (C:UsershamzaDesktopTheFirstKoaAppnode_modulescoindex.js:100:29) at onFulfilled (C:UsershamzaDesktopTheFirstKoaAppnode_modulescoindex.js:70:7) at process._tickCallback (node.js:368:9) here is my code.. app.js:const koa = require('koa'); const router = require('koa-router'); const config = require(__dirname+"/config.js"); const app = new koa(); var route = router(); app.use(route.routes()); var views = require("co-views"); var render = views("views", { map: { html: 'swig' }}); route.all("/hi", function…
Read More