sinatra roger

Ranch Hand
+ Follow
since Feb 11, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
6
Received in last 30 days
0
Total given
17
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sinatra roger

I am planning to study spring framework. Is Spring in Action, Fifth Edition published in 2018 outdated for 2023? Is I still usable?

I find reading a much better resource to learn than watching videos. hence would really prefer a book over a udemy video course.
6 months ago
Hello Guys,

I have been an IBMi RPG programmer for around 10 years and finally getting a chance to write some java production level stuff.

I can figure out what a code is doing by looking at it and chatgpt is always there to help. But feeling confused when writing new stuff.

For ex, please see the below class:



This is a class which executes a junit test for a bunch of hardcoded values. I want to replace the hardcoded values to be dynamic by reading from an excel file. I figured out how to do this, but the question is should I use a new class for this example, TestData with a provideTestData method and modify the annotation as OR could I just write it in the same method?

I am often having difficulties designing such stuff as RPG is mostly about modularising logic based on functionality which is straight forward to me. However in java in cases like this, not really sure if I should could just write a new method for this or an entirely new class. I guess what I am lacking is OOAD knowledge.
1 year ago
I have the below Javascript code:



Output from first console.log.



Output from second console.log:


Though I understand that in the second output, product is a key and the value is an object (which are further key-value pairs), I dont understand how this conversion is done?

Just by enclosing the object name "product" inside braces, what is happening? Is there any technical term for this?
I am trying to create an IBMi DB2 mask over a table as below:


The problem is with the IESWEBSERP.IES_CHECK_AUTH user defined function used in the RETURN CASE.

As per the documentation, I understand that the RETURN CASE statement cannot use a Non-Deterministic function. So below is how this udf is defined:


All the UDF does is it checks if value of field MSTCONTL.USRC2 is 'U' or 'P' for the user record of the current session user. If it is so, it returns a value of '1' which would allow the user to see the value of the field WSVNDPWD without any masking.

But the catch is that if the value MSTCONTL.USRC2 is updated to a value other than 'U' or 'P', the function would still return '1' (if '1' was returned earlier as well).. This I believe is because the function is defined as DETERMINISTIC.

If I make the function non DETERMINSTIC, the create mask statement fails. So I am not sure how to handle this situation. I want a "dynamic" result from the function. Please can someone advise how this can be handled?

I am trying to compare the performance of a DB2 view before and after adding an index. So I am trying to measure the performance of it using below query:



As you might guess, the idea is to measure how much time the above query takes to complete in both cases. i.e create a temp table with the required data.

Can I please get some feedback on how good this method is for comparison?

db2
I am trying to speed up the below query which is running very slow. This is just half of the original query I am using and the other half is a union to another query. Can someone please let me know if they are seeing any obvious red flags in the below query?

The other painful thing is, I am unbale to find any indexes in index advisor.

Hi All,

I have a DB2 SQL view created with below statement:

The problem I am facing is kind of strange. When we do a select * on this view, it runs slow for the first few times every new session. But then after 2 to 3 executions, the speed improves drastically and execution time reduces to 2 seconds from the initial 40 seconds.

Can someone guide on any possible optimizations:


 
We had a couple of huge SQL statements (executed within an embedded sqlrpgle program) for which we created separate views - one for each SQL.

The SQL statements were being executed within the programs conditionally. That is, the program had some conditional logic in it (written in RPG) which would determine whether we would execute one query or the other.

Now what we are trying to do is to create a single view which would be an equivalent of the RPG program.

That is somehow include the conditional logic in the view code.

Below is the simplest pseudocode of the view that I could imagine of what I am trying to achieve



The if condition logic needs to be part of the view that I am trying to create. Is something like this possible in DB2?

Please note that the condition 1 used above is a very high level representation. The logic is actually comprised of several program calls etc.

Any advise would be appreciated.

So I have got a simple splash screen that needs to be displayed for my android app. All I see is a white screen instead of the splash screen image. I am not sure why its behaving like this as the settings are fairly straight forward in config.xml.

Can someone point out if I am doing anything wrong?

I have all the required image files placed in the correct folders. So I am not sure what else needs to be checked.

3 years ago
I am working on a hybrid mobile-app and one of the screens is having an issue where the height and width of a div element is being set to 0px causing the screen to not display as required.

Below is how the screen is expected to look like:



The issue is with the grid like div element in the middle. When this screen is displayed above as required, the height and width of this div is set to 500px and 358px respectively.



However, the issue is that when this screen loads for the first time, the screen is displayed as below:


As can be seen, the grid in the middle is not displayed.

The content-section div has width and height set to 0 pixels.



However if we select a different order (using the dropdown on the top), the screen is reloaded and displayed correctly as required (with height and width set to appropriate pixel values).

Now I am not looking for the exact answer to this issue (if somebody can give this, nothing like it) but I am trying to understand if you faced this issue, what would be the next step to follow. How can we identify the root cause behind the height and width getting set to 0 px the first time the screen is
3 years ago
Hi Tim,

Sorry for not replying earlier. Yes I tried --force and the error message while adding the platform no longer seems to come. But now, the issue described below is what I am facing:

https://coderanch.com/t/733668/mobile/Android-build-issues-cordova
3 years ago
have a cordova android app that I am trying to build with android version 8.1.0.

While I attempt build, I see the below error:

FAILURE: Build failed with an exception.



I can see the below in the platforms/android/build.gradle file:


There is another build.gradle in the app folder. I cant see any minsdkversion there.

Can somebody please help me to understand what the error message means and how I can resolve it?
3 years ago
I have noticed that though the error message I mentioned about is coming up, when I run the phonegap platform ls command, I can see android 8.1.0, the version that I am trying to install. Is this a normal scenario?
3 years ago
I am facing the below error while trying to build my app. The installed version in android 8.0.0.

Failed to install 'cordova-plugin-file-transfer': CordovaError: Version of installed plugin: "cordova-plugin-file@2.0.0" does not satisfy dependency plugin requirement "cordova-plugin-file@^4.0.0". Try --force to use installed plugin as dependency.
I have tried removing and re-adding the platform but no luck. There are plenty of similar other questions but couldnt see anything that would help me out?

How can i resolve this error?
3 years ago
Doing work for a different department is not possible here due to a rigid organizational structure. My question is, is it fair to expect to get an overall training or orientation of such huge a legacy system? Would senior 60+ devs expect that the guys following them should learn things on the fly as and when an issue/a new requirement comes?
6 years ago