Categories
Mastering Development

php fatal error: cannot redeclare App\Exceptions\Handler::render() in G:\Xampp\htdocs\blog\app\Exceptions\Handler.php on line 55

I am creating a User Roles and Permissions using laravel 5.8, and in that when I want to run PermissionTableSeeder and i run in cmd like this: php artisan db:seed –class=PermissionTableSeeder . But it showing this error: php fatal error: cannot redeclare App\Exceptions\Handler::render() in G:\Xampp\htdocs\blog\app\Exceptions\Handler.php on line 55 and this is my code: <?php namespace […]

Categories
Development

Data Binding based on loaded XML-Model at runtime

My aim is to create an application which acts like an “editor” for xml-files. The UI was done by JavaFx. There is a menu bar, at which the user can “open” a well defined xml-file, which is loaded by Jaxb and is hold as a static variable in a Config-class. Now, the UI should show […]

Categories
Development

NLog MySql .Net Core 3.0 logging not saving to database

I have setup NLog on my project that will save the logging to my audit database (separate from the default database). However, it is failing to write to the database. I have a console logger target as well and that is logging as expected. No errors are shown or given. It merely fails to write […]

Categories
Development

How to send data from HTTP input to ElasticSearch using Logstash ans jdbc_streaming filter?

I want to send data from Http to elasticsearch using logstash and I want to enrich my data using jdbc_streaming filter plugin. This is my logstash config: input { http { id => “sensor_data_http_input” user => “sensor_data” password => “sensor_data” } } filter { jdbc_streaming { jdbc_driver_library => “E:\ElasticStack\mysql-connector-java-8.0.18\mysql-connector-java-8.0.18.jar” jdbc_driver_class => “com.mysql.jdbc.Driver” jdbc_connection_string => “jdbc:mysql://localhost:3306/sensor_metadata” […]

Categories
Development

ArgumentError error while creating SQLAlchemy database

I can’t understand what the mistake was, I did everything according to the instructions) An error occurs while trying to create a database Text error: Traceback (most recent call last): File “C:\Users\Alex\Desktop\AlNews\env\lib\site-packages\sqlalchemy\sql\schema.py”, line 108, in _init_items spwd = item._set_parent_with_dispatch AttributeError: ‘function’ object has no attribute ‘_set_parent_with_dispatch’ The above exception was the direct cause of the […]

Categories
Development GitHub

How to alter dropEvent action in treeview without loosing basic drag-n-drop functionality in PyQt5?

I’m using my custom item model (subclassed from QAbstractItemModel) with custom QTreeView. I want to allow internal drag-n-drop movement (MoveAction) and, when modifier key or right mouse button is pressed, pass CopyAction to my model (to dropMimeData) to copy items. However, default implementation of dropEvent() in QTreeView seems (from C code) only capable of passing […]

Categories
Development

simple Compiler (separation of instruction in a procedural programs)

I am writing a program that simulates a simple compiler by using regex. When I find a “;” I separate the instructions… then I use another regex for the separation inside each line to get the tokens then put it in a Arraylist, for example: int x=5; int y=6; it will be [ [int, x, […]

Categories
ASP.NET Development MVC

C# MVC 5 ASP.NET

I created registration and login to my app. But when I login i don’t see logged user. How can I do that? I create all redirection to home page when user is connected but I don’t see connected user like on this site. I was fallowing this tutorial. And all is working fine. But how […]

Categories
Database Development

Want to log Database connection failure issue in other file using NLog

I am working on .Net Core 2.2 and MySQL. General log of application are logged into Database using NLog but I want to log only DB errors (If occurs while logging) to the file. How I can capture DB connection failure to the file with custom fields like UserID.? Here’s the code of NLog.config: <?xml […]

Categories
Development

original_exception method stops working on Rails 5

Upgrading from Rails 4 to Rails 5, the following code, in an exception handler, stops working: exception.instance_of?(ActiveRecord::StatementInvalid) && exception.original_exception.is_a?(PG::Error) which now gives this error: <NoMethodError: undefined method `original_exception’ for #<ActiveRecord::StatementInvalid:0x00007fd2ceb4ba10>> I am trying to do this in the Pry exception handler, so the full code is: Pry.config.exception_handler = proc do |output, exception, _pry_| output.puts “#{exception.class}: […]