October 23, 2024
Chicago 12, Melborne City, USA
python

botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the GetCelebrityInfo operation:

I’m trying to run some of the rekognition examples from the "amazon-rekognition-developer-guide" github repo. I’ve created a user account with full Rekognition access and set the profile as per the instructions and can run the "python-detect-faces.py" on an image in an S3 bucket, but when I go to test others, I get an access denied

Read More
javascript

Typescript – Is it possible to extract a list of types from a constant object?

I’m trying to read from a data file where everything is stored in arrays, and transfer that to the equivalent Javascript object. What I want to be able to do with typescript is create a system that automatically reads the arrays, and stores them in corresponding object, but also is able to verify that the

Read More
pdf

IFrame and Object elements not supporting base64 when displaying pdf-s on smallers screen sizes (mobile)

I want to display a pdf from contentBase64, using Object does not work with Safari browser for some reason. Just displays a grey screen. Works with chrome on desktop view but not with mobile. So I tried using IFrame, which works fine on Safari, but then again Chromes mobile view is not supported. Am i

Read More
templates

Template deduction guide doesn't work well with aggregate initialization

I am studying how to use deduction guides. I composed this program. template<typename T> struct Test { void f() { cout << std::is_same_v<T, std::size_t> << endl; } T t; }; Test(int) -> Test<std::size_t>; int main() { Test t1(1.2); t1.f(); } I expected the deduction guide will only kick in when if I pass an integer

Read More
security

Using scrypt + gpg –symmetric to encrypt files, is this configuration correct?

I have written the following python script to derive a key from password using hashlib.scrypt and then passing the hexadecimal encoded key to gpg, please tell me whether this is a secure approach. This is for my personal backups and I am trying to put together something that is simple, reliable and does not require

Read More
SQL

Required suggestion to improve performance of C# methods

I am working on code optimization task below is detail code public class UserPrivileges { #region Properties public int UserId { get; set; } public int NPSiteId { get; set; } public string UserName{ get; set; } public bool IsPlaybackPortalAdministrator { get; set; } public Dictionary<int, LegacySitePrivileges> Permissions { get; set; } public string LoginName

Read More
jQuery

Passing a jQuery variable to @Url.Action in ASP.NET MVC

This is an example of a function that takes the ID of a thumbnail image and when clicked brings up the full image in a modal: $('.imageLandscapeFloatLeft').on('click', function () { var vIDString = this.getAttribute('id'); if (vIDString.indexOf("image_") >= 0) { var vID = vIDString.substring(6); if ($.isNumeric(vID)) { jQuery.ajax({ url: '@Url.Action("ReturnSoftwareImage", "Business")', type: 'POST', data: { ImageID:

Read More
Android

How to set custom dialog full screen? (android)

I want to show custom dialog in full screen. But It’s not now. I don’t know why. This is my code val dialog = Dialog(requireContext()) val view = LayoutInflater.from(activity).inflate(R.layout.custom, null) dialog.requestWindowFeature(Window.FEATURE_NO_TITLE) dialog.setContentView(view) dialog.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) dialog.window?.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN) dialog.window?.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) dialog.window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY You need to sign in to view this answers

Read More
PHP

How to render non-latin characters in chrome-php on Almalinux system when browser is running in headless mode?

Non-Latin characters are showing as boxes or not showing at all when text in rendered in headless chromium running via Chrome-Php on AlmaLinux OS as seen below: The characters show as intended when the webpage is opened in Chrome on Windows/Android/iOS. How to resolve this issue? You need to sign in to view this answers

Read More
C#

Using C Libraries for C++ Programs

I am trying to control Dynamixel servos using a GUI made using Qt. Dynamixel provides a C set of C libraries to control the motors, while the only way of making GUI’s I know is Qt, which is essentially C++. Will it be possible to use Dynamixel C libraries from Qt C++ code in any

Read More