2018-10-22         Lilith

How to set-up Hybris 6.7 local with MySQL

I am trying to set-up a local Hybris Instant with MySQL instead of HSQLDB.local.properties mysql.optional.tabledefs=CHARSET\=utf8 COLLATE\=utf8_bin db.url=jdbc\:mysql\://localhost/6showcase?useConfigs\=maxPerformance&characterEncoding\=utf8&useSSL\=false db.driver=com.mysql.jdbc.Driver db.username=root db.password=root db.tableprefix= mysql.tabletype=InnoDB installed.tenants=**Build Successfully(ant clean all).Getting runti:**ERROR [localhost-startStop-4] [DataSourceImpl] error connecting to DataSource having url jdbc:mysql://localhost/6showcase?useConfigs=maxPerfor...

 mysql                     2 answers                     7 view
 2018-10-22         Lilith

Assign class methods from YAML file

In short,I've written an application that parses text files in specified formats from different email feeds. Currently, there are two formats allowed by users in order to correctly upload information. I've also included a simple YAML file that allows people with non-programming backgrounds (ie sysadmins) to define the basics parsing parameters such as delimiters for each different email feed.As it turns out, users are going to require a lot more formats than the ones I've defined. As in entirely-different-parsing-algorithm format.Since it would be difficult for someone n...

 python                     1 answers                     58 view
 2018-10-22         Lilith

REACT- Storing data that needs to be updated frequently as a global variable instead of using setState() - not recommended?

I am trying to determine the best way to increase performance in my onScroll event listener within my React Component. I have a simple listener which tracks the scrollY To keep track of this (cross-browser), I have the following:handleScroll = (event) => { let scrollTop = Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop)}Now, I need to determine whether the user is scrolling up or down. I was hoping that the actual event object would have some kind of flag, but I've mostly seen people suggesting keeping track of the previous scr...

 javascript                     1 answers                     11 view
 2018-10-22         Lilith

Trying to create a Discord Welcome/Leave Bot

I'm trying to create a bot that publicly and privately (via DM) welcomes a new user to a Discord server AND sends a message to the Moderator channel when a user leaves the server.I can get the welcome dm and welcome message working, but when I add the code after #Mod Leave Announcement nothing happens.import all necessary commands and librariesimport discordimport asyncioimport logging@client.eventasync def on_ready():print('logged in as')print(client.user.name)print(client.user.id)print('-----')newUserDMMessage = "Welcome DM"#Public Welcome@client.eventasync def on_member_...

 python                     1 answers                     12 view
 2018-10-22         Lilith

Use SQL Server as Subscriber PostgreSQL as publisher

I have a rather large PostgreSQl database.This server is set up as a publisher.Now I want to set up MSSQL server as a subscriber to this publisher, is that possible?PostgreSQL = 10.4 MSSQL = 2017 DBsync is a solution that is simple to implement but does it's work good for a low price [XXX]

 sql-server                     1 answers                     55 view
 2018-10-22         Lilith

Destructor not being called in a Python script

Below is module which executes as I would expect.class Z(): def Y(self): return def __del__(self): print('Z deleted.')def W(v): class Form: def X(self): #v.Y() return returndef U(): t = Z() W(t)U()Running the above module produces the following outputZ deleted.When I remove the comment as shown below, no output is produced.class Z(): def Y(self): return def __del__(self): print('Z deleted.')def W(v): class Form: def X(self): v.Y() return returndef U(): ...

 python                     1 answers                     93 view
 2018-10-22         Lilith

Django templates: how do I save an item inside a {% for %} loop?

This application returns schoolmates of lawyers.When a user searches for first name only and there are more than 1 result I leave the query in the form and ask them to enter a last name. But I thought that it would be nicer if the user just clicks to one of the names and search results are returned directly. (at this point the link takes you to search form again.) In the template the query and the last name that I need are inside the {% for lawyer in lawyers %} loop as attributes: lawyer.first and lawyer.last. I couldn't figure out how to save them to create a query. Can yo...

 django                     2 answers                     85 view
 2018-10-22         Lilith

Tablayout animation like whatsapp

I am using TabLayout and SearcView. How can I do , when click search button to hide tab layout like whatsapp.I try setEnabled method but it can't work properly.I also used Visibility,setActivated method.What can I do?I don't know. I must use setAnimation method or something else?MainActivity.javaprivate Toolbar toolbar; private TabLayout tabLayout; private ViewPager viewPager; private CoordinatorLayout coordinatorLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act...

 java                     2 answers                     50 view
 2018-10-22         Lilith

Implementing timer in pygame

I want to add timer to my game, where it starts to count from 0 when I start the game and when i touch yellow rectangle (finish line) it stops and it says in what time I finished my level. I tried to do something, but I am having trouble because "while" confuses me and I can't figure out how to get a time correctly in seconds.Here is the code:import pygameimport sysimport timepygame.init()pygame.display.set_caption("Protostar")screen_width, screen_height = 1200, 600screen = pygame.display.set_mode((screen_width, screen_height))clock = pygame.time.Clock()BLUE = pygame.Color(...

 python                     1 answers                     88 view
 2018-10-22         Lilith

Merge date columns in different tables

I am trying to merge the month column and join data from two different table. I've tried union all and full join but it didnt come out as what I expected. I want to have 1 month column, and 4 other columns (doesn't matter if they have null value) Much appreciated!Here is the result that I want:month | new_placements | new_mrr | exits | lost_mrr20190101 | null | null | 8 | 1990020181101 | 144 | 148000 | null | nullfrom these two tables:table1month1 | new_placements | new_mrr 20181101 | 144 | 148000table2month | exits ...

 mysql                     2 answers                     67 view
 2018-10-22         Lilith

SQL Query Count content in one column where equal to x or y

I have one column that contains either X or Y. How can I create one query that counts each as below?Example of Input-----------------XXYDesired OutputCountX | CountY-----------------2 | 1 select sum(iif(input = 'X', 1, 0)) as countX, sum(iif(input = 'Y', 1, 0)) as countYfrom your_table [XXX]

 sql                     1 answers                     11 view
 2018-10-22         Lilith

.NET Core 2.1 Unit Testing with NHibernate and InMemory SQLite

I'm getting the following error when I run my XUnit tests FluentNHibernate.Cfg.FluentConfigurationException : An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail. NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=, Culture=neutral, PublicKeyToken=aa95f207798dfdb4. System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. NHibernate.Hiberna...

 .net-core                     1 answers                     32 view
 2018-10-22         Lilith

Why Azure AD Graph API might still be appropriate over Microsoft Graph API

Microsoft strongly recommend to use Microsoft Graph instead of Azure AD Graph API to access Azure Active Directory resourcesThere are a very limited number of scenarios for which Azure AD Graph API might still be appropriate according to this post written in 2017 May.those Gaps between Microsoft Graph and Azure AD Graph still exist ? Yes.For example Applications and Service principals are only available on the beta endpoint for MS Graph API.And the beta endpoint is not recommended to be used in production applications.So if you need to make automation related to app reg...

 azure                     1 answers                     57 view
 2018-10-22         Lilith

How to hand-over a TCP listening socket with minimal downtime?

While this question is tagged EventMachine, generic BSD-socket solutions in any language are much appreciated too.Some background:I have an application listening on a TCP socket. It is started and shut down with a regular System V style init script.My problem is that it needs some time to start up before it is ready to service the TCP socket. It's not too long, perhaps only 5 seconds, but that's 5 seconds too long when a restart needs to be performed during a workday. It's also crucial that existing connections remain open and are finished normally.Reasons for a restart of ...

 sockets                     2 answers                     50 view
 2018-10-22         Lilith

How to get count for each day between certain times

I'm trying to get a total count for each day between 07:00 and 19:00 for the last 7 days. The below query only displays the count for the date 7 days back and not each individual day. Any help would be greatly appreciated. Thanks!DECLARE @Date AS DATETIME = DATEADD(HOUR, 7, CAST(CAST(DATEADD(DAY, -7, GETDATE()) AS DATE) AS DATETIME))DECLARE @Date2 AS DATETIME = DATEADD(HOUR, 19, CAST(CAST(DATEADD(DAY, -7, GETDATE()) AS DATE) AS DATETIME))SELECT CONVERT(NVARCHAR(20), DATE, 120) AS Report_Date, COUNT(DISTINCT GUID) AS ROW_COUNTFROM TABLE WITH (NOLOCK)WHERE DATEADD(MINUTE, +...

 sql                     3 answers                     34 view
 2018-10-22         Lilith

Check for response status without Alamofire

I followed a tutorial to how fetch something from Firebase. The guy in the video said you maybe should check for the response status of 200 (HTTP OK).What are the benefits from checking this and is there a way without Alamofire?Code looks like this:guard let url = URL(string: profileImageUrl) else { return }URLSession.shared.dataTask(with: url) { (data, response, err) in if let err = err { print("Failed to fetch the profile image:", err); return } //check for response status here guard let data = data else { return } let image = UIImage(data: data) DispatchQu...

 ios                     1 answers                     78 view

Page 1 of 142  |  Show More Pages:  Top Prev Next Last