lony

1

votes
2

answer
1.2k

views

No EXPOSE in aws docker fails deployment

I have a scrapy project run continously by cron hosted inside a docker image. When I run and deploy this locally everything works fine. If I try to deploy the same to AWS I get the following error inside the logs: No EXPOSE directive found in Dockerfile, abort deployment (ElasticBeanstalk::ExternalI...
lony
1

votes
1

answer
76

views

Easier XQuery statement

I ask myself if I could make the following statement simpler? Can you help me out? { for $sws in distinct-values(doc('uni')//Vorlesung/SWS) order by $sws return { for $v in doc('uni')//Vorlesung[SWS=$sws] order by $v/Titel return } } The source XML is available here and you could also try out the...
lony
1

votes
1

answer
240

views

Copy S3 user metadata with file

I copy files from one bucket to another. The files have user metadata attached. How can I copy the metadata together with the files?
lony
1

votes
1

answer
438

views

How to stop Webpack-3's PurifyCSSPlugin from cleaning to much?

Problem Everything else equal, my final pages differ in their CSS result. The prod version lacks the proper flexbox alignment as seen in the following comparison: Dev Prod The problem is caused by the PurifyCSSPlugin. I don't know how to configure it still cleaning up the right parts of the css, kee...
lony
1

votes
1

answer
590

views

How to extract JSON from a binary protobuf?

Considering a Apache Spark 2.2.0 Structured Stream as: jsonStream.printSchema() root |-- body: binary (nullable = true) The data inside body is of type Protocol Buffers v2 and a nested JSON. It looks like syntax = 'proto2'; message Data { required string data = 1; } message List { repeated Data entr...
lony
1

votes
1

answer
402

views

Test scrapy spider still working - find page changes

How can I test a scrapy spider against online data. I now from this post that it is possible to test a spider against offline data. My target is to check if my spider still extracts the right data from a page, or if the page changed. I extract the data via XPath and sometimes the page receives and u...
lony
1

votes
1

answer
24

views

Using Python anonymous instance with __dict__

I have the following code: mock_reporter_obj = type('DbUserObjMock', (object,), { 'uuid': 'test_uuid', 'username': 'test_username', })() test = mock_reporter_obj.__dict__ I would expect the following result in test { 'uuid': 'test_uuid', 'username': 'test_username', } But I get an empty dict instead...
lony
1

votes
2

answer
729

views

How does the Built-in Bindings of Google Guice work?

I tried Google Guice the first time and find it very nice. But, when I reached the part of Built-in Bindings I do not understand the examples. For me it looks like I can use it for logging like an interceptor, but I don't know how. Could someone of you explain this type of Binding and how I can use...
lony
1

votes
1

answer
663

views

Zend App on host without mod_rewrite and no virtual hosts

I try to export my local developed app to a shared hoster environment. By doing this I figured out that either I could use mod_rewrite nor virutal hosts. Now my question is a) how do I have to change my app to deploy it and b) how do I do it in a secure way by c) letting the URL looking as nice as p...
lony
1

votes
1

answer
613

views

Boto3 get only S3 buckets of specific region

The following code sadly lists all buckets of all regions and not only from 'eu-west-1' as specified. How can I change that? import boto3 s3 = boto3.client('s3', region_name='eu-west-1') for bucket in s3.list_buckets()['Buckets']: bucket_name = bucket['Name'] print(bucket['Name'])
lony
5

votes
1

answer
1.5k

views

Use Vagrant trigger to execute bash script on host

I use Vagrant to start my testing environment. Sadly I have to retrieve information (passwords) before spinning up my Vagrant box. So far I use Vagrant-Triggers to do this and have multiple run 'do something' commands. IS [:up, :provision].each do |cmd| config.trigger.before cmd, stdout: true do run...
lony
5

votes
1

answer
604

views

Jenkins multiconfiguration project handle concurrent device usage

Case I have a Jenkins slave witch run's calabash tests on mobile devices (android, ios). To separate on which machines (the mac for iOS or Linux for Android) the tests is run, I also use the Throttle Concurrent Builds Plug-in. This way I separate between the Android or Mac Jenkins slaves the devices...
lony
4

votes
1

answer
60

views

Fgets progress - easier way?

I read a big text file ~500MB and want to get the progress during my read operations. To do so I now count the lines the files has and then compare it to the ones I already read. This needs two complete iterations over the file. Is there an easier way using the filesize and fgets buffer size? My cur...
lony
1

votes
2

answer
362

views

C# Looking for a key in a hash table and gather the corresponding value

can anyone tell me how I can search a hash table for a specific key and put off the corresponding value in a variable (e.g. Both key and value are from the class point) I add the values as followed: Hashtable Hash = new Hashtable(); Hash.Add(new Point(Po.X - 1, Po.Y), new Point(Po.X, Po.Y));
LoNy
11

votes
3

answer
2.4k

views

Trigger S3 create event

I use S3 Create events to trigger AWS-Lambdas. If my processing fails I want to do some magic and then trigger the 'event' again to start my processing ones more. So far the only option I see to do this is re-uploading the file. Can I trigger the event 'again' without re-uploading the file? I use Py...
lony
3

votes
1

answer
3.7k

views

Using bulma together with webpack

I have this really simple webpack projects in with I now want to also use bulma a css framework. I installed the package via npm i bulma and tried to include it inside my app.js-file using the following snipped unsuccessfully: import bulma from '~bulma/bulma.sass'; I also tried using a specific sass...
lony
3

votes
1

answer
1.7k

views

Jenkins pipeline (parallel && dynamically)?

Question I have simple parallel pipeline (see code) which I use together with Jenkins 2.89.2. Additionally I use parameters and now want to be able to in-/decrease the number of deployVM A..Z stages automatically by providing the parameter before job execution. How can I dynamically build my pipelin...
lony
2

votes
1

answer
464

views

Symfony 2 Securing Login with IP

I have a firewall rule which together with annotations allows only access to actions as specific user. Additionally I would love to block ANY login if it is not coming from a certain network. Searching for a solution I came across additional access_control rules following this guide. The problem the...
lony
2

votes
1

answer
1.6k

views

`tabulate` order columns by keys

I want to print my list output in a different column order. I use tabulate but could use other tools. The strings have different length and part of the problem is to 'automatically' define the column length, which tabulate does really well! Code: parameter_list = [] parameter_list.append({ 'A': 'Hel...
lony
2

votes
2

answer
272

views

Searching for Java library to build an app that interacts with data

I have a project where I should analyse data via cluster analysis. Basically the data should be visualised like this picture shows Each dataset - for example let it be people - is one horizontal row, where vertical lines showing the attributes like sex, age, and so on. Now if this data could be sho...
lony
2

votes
1

answer
328

views

Hand response from one calling java program to another

I have a question concerning the communication of two Java programs, one embeds the other. The embedded one is a CPLEX linear program (Java SE + CPLEX libs) which calculates resources and the other root application is a simulation software (AnyLogic). Now the idea is that the simulation should use t...
lony
7

votes
2

answer
4.2k

views

Cloudformation how to reference Managed-Policy from another stack

I have the following role. From within it I want to use an existing managed policy from another stack. How can I do so? 'TestRole': { 'Properties': { 'AssumeRolePolicyDocument': { 'Statement': [ { 'Action': [ 'sts:AssumeRole' ], 'Effect': 'Allow', 'Principal': { 'Service': [ 'lambda.amazonaws.com' ]...
lony
1

votes
4

answer
82

views

List only folders of certain depth using Java 8 streams

Considering there is the 'new' streams API in Java 8 I can use Files.walk to iterate over a folder. How can I only get the child folders of my given directory if using this method or maybe depth=2? I currently have this working example, which sadly also prints the root path as all 'subfolders'. File...
lony
5

votes
5

answer
3.2k

views

LaTeX blank after number and before text

How could I make a blank after the number in my footnotes? In a general way, for ALL footnotes! Example: good: 1 Hello World bad : 1Hello World
lony
5

votes
1

answer
2.1k

views

Updating symfony2 libs?

I have tested symfony and started with 2.0 now the new 2.0.1 version it out and I want to update. Is there an easy way to update the sources? In Zend it is basically replacing the Zend folder with new libs. Maybe I can use an script like php bin/vendors install ?
lony
2

votes
1

answer
1.9k

views

Yii2 extending Gii CRUD with many-to-many form elements

I have the following 3 tables: Rule -id -name CombinedRule -id -name RuleCombineMapping -id_rule -id_combine I generated a CRUD for Rule and for the CombinedRule table. Inside the CombinedRule model class I created a mapping the class looks like the following:
lony
7

votes
1

answer
698

views

IE8 only jumps back to top of previous page not where I was before (but only with JS on)

I have a horrible, scattered page with lots of JavaScript: It has a list view and if you like you can watch one of the items in the list in detail. The problem is now if I want to go back from the details view to the list view by using the browser back button I get different results. In Chrome and F...
lony
2

votes
1

answer
397

views

Calabash how to speed up execution time

I have a Android device connected to my PC. Running a calabash test I use the following command: calabash-android run .apk features/.feature Now before running a feature Calabash always uploads the application again witch takes time. How can I disable this? Any help would be appreciated! Thank you!
lony
7

votes
1

answer
2.6k

views

Connection Pooling with PostgreSQL and AWS

Having a microservices architecture, multiple services speak to my PostgresSQL database. If I now want to deploy parts of my application as AWS Lambda functions, how can I avoid running out of connections? Reading a couple of articles [1], [2], [3] I realized PgBouncer may be a good fit for my micro...
lony
1

votes
3

answer
128

views

Calabash save login credentials

I have a Android device connected to my PC. Running a calabash test I use the following command: calabash-android run .apk features/.feature Every time I run this again I also have to re-login to my applications because the credentials are not stored. Any help would be appreciated! Thank you!
lony
2

votes
1

answer
15.4k

views

ANT FTP upload file: 425 Unable to build data connection: Connection timed out

I try to automate the deployment of a small site via ANT FTP. I use Win7-64bit and what started as an easy task gets more and more a challenge. I first figured out that I had to install additional classes which I did. commons-net-3.0.1.jar, jakarta-oro-2.0.8.jar Then I had to deactivate parts of my...
lony
3

votes
1

answer
294

views

zsh having right prompt on same level as left using prezto

I'm new to zsh and also prezto. Now as in my bash shell I want to have the current path on the left and my current branch at the right as you can see in the picture so far so good..... ... Now the problem is the right part of the prompt is in the second line and not in the one the path is in! # Defi...
lony
1

votes
3

answer
536

views

Change bash without making it default shell Mac

When running bash scripts inside zsh-Terminal I want it to use the homebrew bash version 4 instead of the default 3 of OS X. How can I do that? I installed bash 4 on my MacBook. brew install bash Instead of using it as the default shell using the following command, I want to keep my zsh. chsh -s $(b...
lony
3

votes
2

answer
872

views

Facebook API Authentication

if I want to authenticate a user through facebook is it necessary to get an 'offline_access' permission for my application. It should be possible for the user to link his application profile to his facebook account. So if he is already logged in to facebook he didn't has to authenticate again in my...
lony
2

votes
1

answer
23

views

SES how to get ARN of identity?

How to get the Identity ARN of a verified SES email? I have an SES email which is verified and I want to get the Identity ARN to assign it to Cognito programmatically. Looking into the Boto3 config I can not find any method giving me this information. The closest I get is list_verified_email_address...
lony
2

votes
0

answer
46

views

Binary stream detect if protobuf

I use https://github.com/h2non/filetype.py for detecting GZ and would love to add 'protobuf detection' in a similar way, analysing the head bytes of the file. Is it possible to detect if a binary file is a protobuf file or not?
lony
2

votes
1

answer
1.8k

views

Logback loses log messages, even with discardingThreshold=0

Reading this question about logback losing log statements, I added an discardingThreshold=0 statement. Sadly still some lines are missing in my log file. If I use only a RollingFileAppender, skipping AsyncAppender it works fine. AsyncAppender misses every statement after Period 51, but the log file...
lony
2

votes
1

answer
78

views

Scraping multiple pages, staying independent

I want to scrap a bunch of pages. Feeding different data pots and are then matched later on. [Page1]-Get-PostProcessing-Store-[Pot1]-+ [Page2]-Get-PostProcessing-Store-[Pot2]-+--Match---[ResultPage]-REST-API [Page3]-Get-PostProcessing-Store-[Pot3]-+ ... Now I want to be as independent as possible co...
lony
5

votes
1

answer
333

views

How to write integration tests for Sparks new Structured Streaming?

Trying to test Spark Structured Streams ...and failing... how can I test them properly? I followed the general Spark testing question from here, and my closest try was [1] looking something like: import simpleSparkTest.SparkSessionTestWrapper import org.scalatest.FunSpec import org.apache.spark.sq...
lony
2

votes
0

answer
115

views

Disable `pip` retry installing packages - Speedup installation

I have a custom pip repository which is used inside my company but not outside. Now every time I'm at home and want to install something eg. pip install pandas it is trying also the 'company' repo. Even decreasing the timeout pip still tries multiple times which takes a long time. What can I do to s...
lony

View additional