berimbolo

1

votes
1

answer
63

views

groovy.lang.MissingPropertyException: No such property:

I am trying to get my head around groovy scripting to make some changes to a jenkins pipeline and I keep getting this error: groovy.lang.MissingPropertyException: No such property: credentials for class: I have tried declaring the variable with def but I still get the exception, eclipse does not rec...
berimbolo
1

votes
3

answer
42

views

mongo db - efficient way to search strings

I am looking to search strings that are broken up into a prefix, numbers and letters, I currently need to search 55 million rows and a row looks like this (I also save a concatanated version of the entire string): { 'prefix' : 'AA', 'numbers' : '02', 'letters' : 'AFO', 'code' : 'AA02AFO' 'price' :...
berimbolo
1

votes
0

answer
426

views

iText 7 - Loading font from resources\classpath in war file

I am using iText7 trying to load a font which is in src/main/resources/pdf/fonts, when I give the full path to the font on my filesystem and run my code from a main method I don't have any problems, the issues occur when I am running the code inside a war file with tomcat. I have tried a few differe...
berimbolo
1

votes
1

answer
68

views

Search for a specific row in a two dimensional array

I'm trying to find a specific n'th row in a two dimensional array: public static String searchNum(int[][] playerArr, int[]winNum, int playerId) { // Take in an ID (row) and based on that, check the numbers against the winning numbers and display which category they fall. for(int i = 0; i < playerArr...
Berimbolo
1

votes
1

answer
58

views

Loading properties from file on an 'as needed' basis

I have a task to replace a string lookup system which currently relies on mysql. A screen will pass a list of ID's and a language element to a class which then selects the requested strings out of a table in mysql. I am looking to replace the mysql table with a properties file but I dont want to loa...
berimbolo
1

votes
1

answer
50

views

Running multiple root\no context web apps on single host

I have a host with a single web app and at the moment I am accessing it via www.hostnameA.com/ as the web app is deployed to tomcat/webapps as the tomcat ROOT web app. Now I need to add another web app to my host and I also want this one to have no context either but will access it via another hostn...
berimbolo
1

votes
2

answer
4.2k

views

Spring unit test 404\unknown url in mock mvc

I would like to test that when an unknown url is requested and a 404 error is generated that my web app actually redirects to the right place. I havent been able to get this working, I think because tomcat is handling the 404 errors so the forwardedUrl is always null for the tests. I know this works...
berimbolo
1

votes
2

answer
1.3k

views

Android: Stop new activity bringing app into foreground

I posted a question yesterday as I have some specific requirements that seem to be quite difficult to achieve with android. I am working on an app that shows sensitive data and a requirement is that whenever another app gets focus or the app goes into the background because the home button was press...
berimbolo
1

votes
1

answer
24

views

Git comparison of remote branches

I am very new to git and was trying to use the following command to compare a remote version of a branch with the remote version of develop to show the files which have differences between the two: git diff origin/develop origin/feature/xxx --name-only When ran, this command showed different results...
berimbolo
1

votes
1

answer
82

views

Angular Watchers for expressions

I am coming back to Angular and have been reading about the digest cycle and watchers, one post I read said that for expressions in {{}} then angular will evaluate this in every cycle. Given the following will there be 3 watchers set up (qty, cost and for the expression in curly braces)? Invoice: Qu...
berimbolo
1

votes
1

answer
47

views

MEAN Stack app - Can't set headers after they are sent

I'm basically trying to create a register page using MEAN and I want to check against the database (Mongo using Mongoose) if the user and email already exists, if one of them is true, send a res.json fail. And if the username and email are not already in the database, continue to add the user. I'm g...
Berimbolo
1

votes
1

answer
425

views

Itext 7 - Undesired bottom margin when text is placed a in paragraph

I am using iText 7 and placing paragraphs into a div, I have set the setMultipliedLeading(1.0F) value but I get a margin underneath the paragraphs that I do not want. The paragraphs in question are the red ones labelled Para 1 and Para 2, the other paragraphs have divs to create additional space (as...
berimbolo
1

votes
2

answer
376

views

Css Floating Elements

I was told by a friend a while back that right floated elements should come first in my document, but I think I misunderstood what he was trying to tell me, I wondered if someone could explain why if I have both the right floated divs first that the first left floated div is cleared and comes on the...
berimbolo
1

votes
1

answer
2.6k

views

Why is ControllerClassNameHandlerMapping needed

I thought ControllerClassNameHandlerMapping was for mapping a url to a controller (after removing the Controller portion) but this doesnt seem to be the case with my example. If I remove the '/navigation' mapping from the navigation controller (see below) then I get 404 errors. menuHandler In the c...
berimbolo
1

votes
2

answer
159

views

Posting JSON object using Ajax

I wondered if someone could answer a question for me as I dont quite understand why I needed to read a json object from the request input stream when I passed one to a spring controller manually. Normally I use a json-rpc framework and it handles everything for me so I hadnt actually had to do this...
berimbolo
1

votes
1

answer
253

views

PDFBOX - Unknown number of pages

I am investigating a replacement for iText and have been looking at the API and example code for PdfBox. I am slightly confused by its useage though, it seems I need to manually create the page objects which implies I need to know the number of pages beforehand or at least work out when its time to...
berimbolo
1

votes
2

answer
10.3k

views

Spring returning image as ResponseEntity<byte[]> - image corrupt

I am working on a spring 3.2.7 app and it sends signatures stored in the database as base64 string back to the users browser via a spring controller which outputs the byte array ResponseEntity. The image is always corrupted and I havent worked on this part of the system as I double checked in svn an...
berimbolo
1

votes
1

answer
561

views

hibernate QuerySyntaxException - Field is not mapped

I am getting a QuerySyntaxException trying to run a HQL query against 2 tables: select p from ProductEntity p join p.categories c, p.productType t where c.name = :category and t.name = :type The exception is: org.hibernate.hql.internal.ast.QuerySyntaxException: p.productType is not mapped My entiti...
berimbolo
1

votes
1

answer
636

views

Android FragmentStatePagerAdapter - Missing view

I have created a set of horizontal tabs and for each tab content it has a View pager which in turn allows the content of the view to be swiped. I am currently harcoding this to 3 views in the adaptor and returning a new inner fragment which represents the detail whenever getItem() is called. This wo...
berimbolo
0

votes
0

answer
3

views

pymongo - renaming collection

I am using pymongo to insert a new collection (Plates_X) and when my import routine is finished I want to drop the old collection (Plates) and then change the name of the new collection to be the old, so switching them over. When I rename I do get the new data in Plates, and I get my collection name...
berimbolo
1

votes
2

answer
941

views

Full screen image that scales

I am trying to create a home page that has an image that covers the entire screen, I followed a tutorial and got something like what I want, but it doesnt show the entire image. I see a lot of sites that do this so it must be possible, I have an image that spans the entire screen but the image doesn...
berimbolo
1

votes
2

answer
215

views

Making sense of the open closed principle

I am trying to get my head around the open closed principle: Modules should be open for extension and closed for modification In terms of java is the extension specifically inheritance or does it include inheritance as well as the addition of new methods or properties? I am also struggling to get my...
berimbolo
1

votes
2

answer
485

views

iText 7 - Different footer on last page - Null pointer in PdfDictionary

I am trying to implement a footer in iText7, the footer should be different on the last page of the document, I have added an event handler which is called when the document is closed but trying to then loop over the pages causes a null pointer exception: java.lang.NullPointerException at com.itextp...
berimbolo
1

votes
1

answer
727

views

Git post commit hook - No Git consumers using SCM API plugin

I am trying to set up a jenkins server on the same vm that git is installed on. It seems that when I do a push from my laptop jenkins does trigger a build but I get a message each time which I dont understand: Scheduled polling of Spring Boot Rest No Git consumers using SCM API plugin for: [email protected]
berimbolo
2

votes
1

answer
944

views

Integration testing in maven multi module project

I have a multi module project and I now want to add integration tests to it, I want to use the cargo plugin to start tomcat and deploy my artefacts there and then test end to end using selenium. I have looked through the maven console output for my current build and surefire unit tests and then read...
berimbolo
2

votes
2

answer
1.1k

views

Symfony - Assets in dev mode

I am working through symfony tutorials and the documentation, it seems to imply that in dev mode the resources are available without having to install the assets, something like: I get a 404 error though in dev mode until I actually run the assets:install command. What am I doing wrong?
berimbolo
2

votes
2

answer
2.7k

views

Mongoose, Node.js get sum of a field from a bunch of documents

I have this mongoose method/query which finds all 'incomes' from a certain user but only if the dates of the 'incomes' are within the current month. Code: module.exports.getMonthlyIncome = function(userId, callback){ const now = new Date(); const year = now.getFullYear(); const month = now.getMonth(...
Berimbolo
2

votes
1

answer
493

views

Upgrading to Ansible 2.0 with Digital Ocean api v2 Issues

I have a working vagrant + ansible setup to provision my digital ocean, it was running on api v1, but when DO deprecated it I got an error message telling me there was no support for v1 anymore. After a research I found out I needed to upgrade to ansible 2.0 + update my digital_ocean.py since the ol...
Berimbolo
2

votes
1

answer
281

views

Grunt Connect CORS errors in browser

I am trying to connect a small angular app to my rest webservice written in spring. My tomcat server is running on localhost:8080 and my grunt server is running on localhost:11000. This causes CORS errors in the console and I cannot make requests from my browser to the rest API. I have spent all mor...
berimbolo
2

votes
1

answer
3.5k

views

Maven - Disable local repository completely and only go to remote

I have set up nexus on a server and now I would like to ensure that my local machine only uses nexus to get any dependencies and never goes to its local .m2 directory. Is there a recommended way to do this and in fact is this even recommended at all? Thanks
berimbolo
1

votes
1

answer
439

views

Spring request mapping containing square brackets

A project I am working on has a @RequestMapping mapping for a rest method that looks like: /v{version:[1-9]} Can somebody explain what this is doing, does it mean the url can contain 1-9 in that place?
berimbolo
4

votes
2

answer
392

views

Android - How does cursor loader know underlying dataset has changed?

I am trying to learn Android programming and have been working through the Udacity Sunshine app. There is something that is confusing me. I have a content provider which does the inserts, deletes, selects etc, I have a cursor loader which is also a fragment and I have a cursor adaptor, most of it ma...
berimbolo
1

votes
3

answer
88

views

Covariance in Java - Collection cannot be added to

I was reading an interesting dzone article on covariance in java which is pretty easy to follow but there is one thing bugging me which doesnt make sense, the article is here https://dzone.com/articles/covariance-and-contravariance I am quoting examples from the article here where it is explaining w...
berimbolo
3

votes
1

answer
83

views

Eclipse resetting compiler settings to java 1.5

I have just cloned a git repository for a maven project and then imported the project into STS as a maven project. I set up the project and sub-modules as java 1.8 projects and then ran a maven update and then noticed that all the java 1.5 compiler settings seem to have been reapplied. I cant figure...
berimbolo
2

votes
0

answer
42

views

How to use devise gem to be the Oauth Provider of another app

Basically what I have now are 2 apps, 1 is php and the other one is rails. The rails app is the main app at the moment and contains all the user info, since I'm having a new php based app, I'd like to skip the whole registration and authentication part on php and immediately have it authenticate on...
Berimbolo
6

votes
1

answer
1.4k

views

Is all program code loaded into the text\code section\segment of memory

I have started to look at c programming and whilst I am not a complete beginner (I have knowledge of java and web development) there are a lot of things I do not understand. My question is about when a program is first loaded into memory. I am having trouble understanding what actually happens here....
berimbolo
3

votes
1

answer
7k

views

Positioning inside frame layout

I am trying to add view page indicator circles to a screen and I have the code working in that as I slide the image will change to indicate which page I am on. I cant seem to position the layout where I want it though, it does say in the docs that a frame layout should only contain one child but I h...
berimbolo
2

votes
2

answer
640

views

Android: equivelent of IOS' “applicationDidEnterBackground()”

I am working on an app and in the IOS version whenever an external event happens such as the home button or a call comes in the app shows its password entry screen as it shows sensitive data. I am trying to replicate this in android, I am having trouble because the lifecycle methods can be called an...
berimbolo
3

votes
1

answer
929

views

Is a mapper a version of the adapter pattern

I have been trying to get my head around the adapter pattern, out of all the patterns it's the hardest for me to imagine a use for it. I think I understand what is achieved, to me it is to convert an object to another interface so a client can use it. In the examples I have seen they make sense but...
berimbolo
4

votes
3

answer
833

views

get the last 5 unique created_at dates

I'm trying to get the last 5 days that an object has. Currently my code is like this Post.uniq('performed_at').ascending.last(5).group_by{|p| p.performed_at} but I've been getting 4 dates instead of 5 and I think it's because there are 2 entries of the last 5 that are created on the same day. How do...
Berimbolo

View additional