david dabush

Ranch Hand
+ Follow
since Sep 16, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by david dabush

Ron McLeod wrote:If you compress your resource in the application and then pass it the server something with a Content-Type of application/gzip, the server will no longer be able to tell the format of the representation (json, xml, csv, etc.).  The compression and expansion of the payload should be managed by the HTTP client and server and it should be transparent to the application at either end.  Here's an example of what the HTTP headers will look like leaving the HTTP client without and with gzip encoding:

Without gzip compression enabled in the client:

With gzip compression enabled in the client:





ok' I did what you told me in rest client named DHC (chrome app).
I am sending now json ~1MB and I dont see and improvement.

my Tomcat:
3 years ago
I have rest server in Java Spring on Tomcat. One of my apis is to post to the server very big json ~4MB. I want that the client will gzip it and post it to the server. How can I retrieve it with Java and Spring on the server side?

Content-Type : application/gzip Content-Encoding: gzip
3 years ago
I Have a spring boot server and I want to connect it to my mongoDB replica set. (3 servers in the set)

1.in application.properties I configured: spring.data.mongodb.uri=mongodb://user:password@172.1.1.55:27017/admin but if I try to write to server that is not the primary I get error. so how can I configure it that my spring boot app always know who is the primary and write to the primary?

I always connect to the admin DB. but I need access to another db because my collection is there. how can I configure that the user will connect to all db? because this user will work with different dbs and different collections?
Thanks a lot
4 years ago
Hi all,
I was working in the past with java spring framework and i did all the spring configuration in myself.
also I had access to files of tomcat.
now I heard about spring boot but I cant see catalina.out file and I cant have access to web.xml. its not so comfort.
so why to use it?
4 years ago
Hi all,
I will have table with user data : first name, last name, city, user id ....
I will have big data table that collect from the users every 0.5 second : userid, gps cordinates, blood pressure, heart rate....
I will have tables that is a result of calculations of other tables : userid, date, avg blood pressue ....
I will have other tables that are store static data like : country, language, capital city.
I need to do analytics on the big data tables but also to do joins between them to tables that store the users data.

what do you recommend me to do? use redshift for all the tables even for the users?
maybe to use also mongo? maby for the static data like users?
Thanks,
Boris
4 years ago
Hi All,
I need to scrap some web page but before I need to do some actions in order to get to it.
I am filling some fields and clicking on a search button and moving to another window.
but the Chrome web driver is still pointing on the previous window. as you can see I am printing the handle windows of the driver before the click and after and I see only one window in the list.
this window is the previous one.

why I see only one?
how can I fix it and that the driver will point on the new one?

my current code :

from selenium import webdriver
browser = webdriver.chrome()
browser.get('https://a836-acris.nyc.gov/DS/DocumentSearch/PartyName')
firstName = browser.find_element_by_name("edt_first")
LastName = browser.find_element_by_name("edt_last")
firstName.send_keys("John")
LastName.send_keys("Smith")
print ('--------------------------------------------------------------------------------------------')
print (browser.window_handles)
browser.find_element_by_name("Submit").click()
print (browser.window_handles)


Thanks
4 years ago
Hi all,
I am new to it.
I have a link to website and I want to fill a form and click on a button. (java script)
for example to insert something to google and click search.
how to do it?
can you give me an example code?


Thanks
4 years ago

Tim Holloway wrote:This isn't really a Tomcat question, but I'll try.

AWS, like some other cloud platforms, is based on the concept of overlaying local mods on a master image. You can then make a snapshot image containing these mods.

Yes, you can resize the virtual disk that you're running on (although you should consider using an alternative daa-only virtual disk), but that doesn't resize the original image. Basically, what effectively happens when a new instance is created is that a new, blank virtual disk is created, the OS image is copied onto it and booted, and any unused space in the virtual disk is just ordinary free space. If you stop the instance, the virtual disk remains. If you terminate the instance, the virtual disk (and its contents) are deleted. Eventually. AWS cleans up when it's convenient, so it doesn't immediately delete terminated instances.



I ment Image = picture

on Cloudinary you specify the image size on the url image request as parameters. does Amazon has such a service? dont give me a third party solution
4 years ago
Hi,
We want to be able to resize our images on run time.
does aws has such a service like cloudinary?



Thanks,
David
4 years ago

chris webster wrote:There are 3 elements to this functionality:

1. Spatial data.
2. Spatially aware database
3. Spatially aware query functions.

1. Spatial data

From what you say, it sounds like you want to be able to query with a long/lat point and find out which country contains that point e.g. (51N,1W) would be in the UK. You will need a set of data which holds the long/lat polygon (shape) coordinates for each country you're interested in e.g. if you lived in an imaginary square country, then the polygon would just have 4 pairs of coordinates. Unfortunately, real countries have much more complex shapes (and islands) which means their boundary polygons contain a lot more coordinates. The most widely used spatial data file format is probably ESRI's shapefile format, which most GIS (geographical information systems) products can read. You should be able to find one of these online e.g. here is a free shapefile with country boundaries and some other data. Once you have a suitable file, you will need a suitable place to put it so you can query it properly.

2. Spatially aware database

There are several free open source databases that can handle spatial data.

PostgreSQL is a mature and widely used relational (SQL) database that can be used for all kinds of applications, including GIS. If you decide to work with PostgreSQL, you will also need to install the PostGIS extensions (some PostgreSQL distributions may include this or you can install it yourself). PostGIS provides a lot of clever SQL extension functions that allow you to perform very rich queries on spatial data, combining spatial queries with regular SQL queries, as well as powerful indexing tools to make querying spatial data more efficient, and a range of functions to do things like converting between coordinate systems e.g. long/lat <--> Universal Transverse Mercator etc. PostgreSQL/PostGIS are widely used for GIS, and they are well documented online and in books, with lots of tutorials and examples.

MongoDB is another open source DB that can do some spatial queries, but the spatial functionality here is much less sophisticated than in PostgreSQL/PostGIS, and of course it is a NoSQL database so it may not be as easy to integrate with other parts of your application.

3. Spatially aware query functions

Your query needs to be able to handles questions like "what country contains the point (51N, 1W)?". In order to do this, the query tool needs to know how to interpret spatial data and also how to do so efficiently via spatial indexes. PostgreSQL/PostGIS and MongoDB can both do this, but they do so with very different query syntax. Unless you have a particular need to use MongoDB, I would recommend you try PostgreSQL/PostGIS because the spatial queries are easier to design, easier to implement and easier to integrate with other non-spatial queries. And of course there are lots of examples of how to do this with PostGIS e.g. this tutorialmight help you get started.

If you decide to use MongoDB, there are some basic tutorials on their website as well.

Hope this helps.






Hi,
thanks for the answer but I am looking for a free tool to do that and not to implement it by myself. is there any free one?



4 years ago
Hi all,
I need to my server a local DB for mapping between long & lat to country. NOT API!!!
do you no any beside Maxmind? is there any free one?



Thanks,
David
4 years ago
Hi,
I installed tomcat 8 on linux.
I edit tomcat-users.xml and restart tomcat couple of times and I still cant su to tomcat with password tomcat.
what to do?

below is my tomcat-users.xml :


<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<tomcat-users xmlns="http://tomcat.apache.org/xml";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.
-->
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>

<role rolename="admin"/>
<role rolename="admin-gui"/>
<!-- <role rolename="admin-script"/> -->
<!-- <role rolename="manager"/> -->
<!-- <role rolename="manager-gui"/> -->
<!-- <role rolename="manager-script"/> -->
<!-- <role rolename="manager-jmx"/> -->
<!-- <role rolename="manager-status"/> -->
<user name="admin" password="adminadmin" roles="admin,manager,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" />
</tomcat-users>


Thanks
4 years ago
Hi all,
I am using Document in Java to create XML and in the end I am doing toString() to get the xml as a String.
the problem is that the xml contains a url and all the & become &.
how to prevent it from happening and not using : myxml.replaceAll("&ammp";, "&");


Thanks,
David
4 years ago

mydukuri sreenu wrote:

david dabush wrote:Hi,
i am using @RequestParam(value = "ip",required = false) String ip to get ip from url.
but my partners can use many formats like : ip,dip ipaddress.
how can I use multiple mapping?



Hi david,

you can pass map as parameter in the place of string , then you can get the value based on the key syntax as fallows

@RequestParam(value = "multipleIps",required = false) Map multipleIps

Sreenivas.M







no you didn't understand what I ment.


example :

www.mywebsite.com?dip=10.10.10.10
www.mywebsite.com?ipadress=10.10.10.10
www.mywebsite.com?usersip=10.10.10.10


on all these 3 cases i want that @requestparam ip will get the value 10.10.10.10
5 years ago
Hi,
i am using @RequestParam(value = "ip",required = false) String ip to get ip from url.
but my partners can use many formats like : ip,dip ipaddress.
how can I use multiple mapping?


5 years ago