Loading...

Gal Ratner

I blog about all things technology. Especially Software Development.

Latest Posts

I am a CTO Here are my 4 Hacks to Make Your Company love You

As a chief technology officer (CTO), I am responsible for leading the development and implementation of innovative solutions that drive our organization's growth and success. However, I cannot do this alone. I rely on a team of talented and motivated professionals who share my vision and passion for excellence. That is why human capital and talent strategy are essential aspects of my role as a CTO. In this post I am going to try and give you my 4 essential hacks to make your organization as sucessful as in can be. Human Capital and Talent Strategy Human capital refers to the collective skills, knowledge, abilities and potential of our employees. Talent strategy is the process of aligning our human capital with our organizational goals and objectives, ensuring that we have the right peop


The Inverted Software DataBlock Quick Start Tutorial

The Inverted Software DateBlock has been recently enhanced, so I thought I would take the opportunity to write a short quick start tutorial that would help you get started with incorporating it into your application:Getting objectsCRUDHelper.GetObject<Category>(() => new Category(), "GetCategory", mainConnectionString, new SqlParameter("@categoryCode", SqlDbType.VarChar, 200) { Value = "myValue" }); Getting collectionsCRUDHelper.GetObjectList<Category>(() => new Category(), "GetCategories", mainConnectionString); For a paged list use:CRUDHelper.GetObjectList<Category>(() => new Category(), 0, 10, "GetCategories", mainConnectionString, out virtualTotal); Getting parent child collectionsIf you use a single stored procedure to retrieve parent / child objects you


Use TcpClient with SslStream to request an HTTPS URL (And add your own headers!)

You can use a Socket to request any http URL on the web just by sending your own HTTP formatted request, but what about https URLs?To programmatically request a secure URL over SSL we will need to use an SslStream stream and negotiate the exchange od certificates.First lets construct the request we will be sending to the remote server over port 443.string host = "www.76psychics.com"; string path = "/Psychic/lucinda"; int port = 443; string request = "GET "+ path + " HTTP/1.1\r\nHost: " + host + "\r\n" + "Referer: Gal Ratner's Blog\r\n" + "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36&nb


Pagination in .NET Core / 5 / 6 MVC with Entity Framework Core

Pagination is useful with large results sets. There are plenty of solutions out there to create next and previous buttons, but I couldn’t find anything that creates a nice Bootstrap paginator so I just wrote my own:To use it first add a The PaginatedList class to your code. This is a Modified version of the one found on MSDN.using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; namespace Messages.Utilities {     public class PaginatedList<T> : List<T>     {         public int PageIndex { get; private set; }    


Record Your Webcam with HTML5 and Javascript

If you ever wanted to record your webcam without any special plug in or software, HTML5 has MediaRecorder built in functionality.Its pretty simple:First you need to request access to the the user's camera and microphone:navigator.mediaDevices.getUserMedia({ audio: true, video: true }).then(startPreview); Then set a preview stream to your own video element:player.srcObject = stream; and start a MediaRecorder with the same stream using your desired encoding - as long as your browser supports it:if (MediaRecorder.isTypeSupported('video/webm;codecs=vp9')) { options = { mimeType: 'video/webm; codecs=vp9' }; } else if (MediaRecorder.isTypeSupported('video/webm;codecs=vp8')) { options 


Logging To a File or Database in .NET Core and ASP.NET Core

NET Core’s architecture supports a logging API that works with a variety of built-in and third-party logging providers. This article will explore using a provider in order to log into a file or a database.The default Logging Providers included in .NET Core are:ConsoleDebugEventSourceEventLog (only when running on Windows)Which only partially cover most logging use cases.By adding PLogger from Inverted Software, you can add file and database logging capability to your application.To add PLogger, add the following Nuget Package.Once the package is added, change your CreateHostBuilder method to something like this:public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureLogging((hostingContext, logging) 


Record Movies with Java Media Framework (JMF)

While I was writing my own instant messenger using JMF (Java Media Framework), I had to figure out solutions to many challenging obstacles.The most difficult aspect of recording a movie from a webcam was making sure the proper ingredients were put in the correct order.Through my experience, I gained a higher level of mastery of JMF.If anyone is learning or exploring JMF, this tutorial will improve his or her working knowledge of the framework.To begin, JMF is Sun's API for processing audio, video, and other time-based media. This is an optional package and can be downloaded from java.sun.com.In this tutorial, we are going to learn how to utilize JMF in order to record movies captured by a webcam connected to your computer.Streaming MediaStreaming Media, or time-based media, is a term used


Top