Programming

53K

Solutions

41K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.

Share tech news, updates, or what's on your mind.

Sign up to Post

I work for a small company and have been tasked with building a database application to help with some of our industry-specific tracking needs.  I am NOT a database developer or VB coder.  My experience is limited to industrial PLC programming and the occasional small Python script.  

The project includes a Form that executes an OnCurrent event which calls a Class Module (which I did not write the code for).  The purpose of the code is to acquire the Width and Height dimensions (in pixels) of an on-disk image file.  The code executes correctly if the record includes a valid image path.  However, if there is no valid path, I get the following error:
error_91.PNGat this line of code in my Form:
als315_Mod_Error.PNGHere is the code for the ImageDimensions class module:
Option Compare Database
Option Explicit

Private pPixelWidth As Long
Private pPixelHeight As Long
Private pImageFullPath As String

Public Property Get ImageFullPath() As String
  ImageFullPath = pImageFullPath
End Property
Public Property Let ImageFullPath(fullPath As String)
  pImageFullPath = fullPath
  Dim dimensionsText As String

  dimensionsText = GetImageDimensions(fullPath)
  pPixelWidth = Left$(dimensionsText, InStr(dimensionsText, ",") - 1)
  pPixelHeight = Mid$(dimensionsText, InStr(dimensionsText, ",") + 1)
End Property

Public Property Get PixelWidth() As Long
  PixelWidth = pPixelWidth
End Property
Private Property Let PixelWidth(value As Long)
  pPixelWidth = value

Open in new window

0
Your Guide to Achieving IT Business Success
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

type

     TUser=class(Tremotable) //1
     private
     FLastname:AnsiString;
     FFirstName:AnsiString;
     FID:Int32;
     public
     constructor create (id : integer ;firstname:string;lastname:string );
     published
         property id:int32 read fid write fid;
          property Lastname:AnsiString read FLastname write FLastname;
            property FirstName:AnsiString read FFirstName write FFirstName;
     end;

Open in new window

0
Hi Experts,
I am looking for a function that will read a csv file containing employees schedule date & time and identify all the overlapping records.
Below is an example of what the file looks like and what would be considered an overlapping schedule.
UnitCostCenter,EmployeeCode,EmployeeName,StartDate,StartTime,EndTime,Lunch,TotalHours,OnCallFlag,CallBackFlag,ChargeFlag
,A1236       ,J A               ,4/26/2019,3:00:00 AM,11:00:00 AM,1,7,,,
,A1236       ,J A               ,4/25/2019,3:00:00 PM,7:00:00 AM,2,14,,,

"It's because those two TS in the spreadsheet for 4/25/ and 4/26 are overlapped (just put them in correct order - TS 4/25 ends next day at 7AM ):"
Thanks
0
In short, one company is saying another company has stolen source code.  

I have been independently contracted to make this determination.
 
My first thought was to do a text compare via command line.  However, I wanted to reach out to the community to see if there are any suggestions.   I know I can write something myself to do this, but I was curious if there was anything “off the shelf” that I could use to assist.

Any suggestions would be greatly appreciated.
0
Hi,

I am a lab instructor at my university doing Data modeling and programming languages classes.

I need a roadmap for my students who want to learn .net programming using c# from zero to hero.

Topics, Curriculum, Frameworks, ....

Please help me and my students!
0
i'm trying to learn how to use Switch in a perl program.  i get the error "can't locate Switch.pm in @INC(you may need to install he switch module)"
how do i install switch properly?

 #!/usr/bin/perl -w
# try to compare an input string to my name
 
use strict;
use 5.010;
use warnings;
use Switch;
 
say "what is your name";
my $fn = <STDIN>;
chomp ($fn);
say "your name is $fn";


switch ($fn){
    case "dan"      {  say "How are you doing today Danny?"}
    case "donna"    {  say "How are you doing today Donna?"}
    else            {  say "get off me"                    }
}

Open in new window

ex2018_05_08.txt
0
If you had to consider all the myriad of stock trading indicators out there that many novice and advanced traders alike base their trading on, and you had to group that huge number of indicators into the broadest possible major categories, what would those categories be?

I'm thinking there may only be two (2) categories off the top of my head:  Price and Volume.

What do you think?
0
Hi EE,

My developer is trying to resolve the error: A connection cannot be made to redirector. Ensure the 'SQL Browser Service is running'

Troubleshooting so far:

- Restarted the SSAS service and SQL browser,
- Allowed inbound connections on port 2832,2833 for the SQL Server Browser.
- A can log into the SSAS instance fine using the DC1DEVRPT01\DC1DEVRPT01 via SSMS.
- Gave the SSAS service dedicated port 3100, no fix. Although I am not sure I'm entering in the connection string correction:

Any chance this could be a permissions thing? I'm using Visual Studio 2017.

Attached is the error message and my config for SSAS.

Any assistance is welcome.

Thank you.
msmdsrv.ini
Visual-Studio-Development.PNG
0
I have two large batches of programs - several years work - in QuickBasic and Fortran IV .
I need to update these to a more modern language (Python?).
Are there any automatic translators?
where would I find them?
0
I wrote this Javascript snippet for a Polymer fronted and it works without issues.

Are there any ways that you could suggest to make it more efficient / shorter?

        var expandedItems = this.shadowRoot.querySelectorAll('expandable-item');
        
        for (var i = 0; i < expandedItems.length; ++i) {
          if (expandedItems[i].hasAttribute("expanded")){
            expandedItems[i].getElementsByClassName("expandable-icon")[0].setAttribute("icon", "arrow:chevron-open-down");
          } else {
            expandedItems[i].getElementsByClassName("expandable-icon")[0].setAttribute("icon", "arrow:chevron-open-right");
          }
        }

Open in new window

1
Become a Certified Penetration Testing Engineer
LVL 13
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

hi,

does mariaDB support java programming ?

I know oracle can .
0
Hi EE,

How do redirect/configure the Powershell ISE or VSCode editors to run PowerShell scripts using PowerShell console (Powershell v6) terminal?

I have already tried the info in these posts:

https://techcommunity.microsoft.com/t5/ITOps-Talk-Blog/Configure-Visual-Studio-Code-to-run-PowerShell-for-Windows-and/ba-p/283258
https://4sysops.com/archives/vscode-as-a-console-for-powershell-core-6-part-1-multiple-shells/

And this works in VScode if I run the script from the command line.

But when I try to run the PS script with the intention of debugging it I get the following screen: see attached.

Basically what I need is when I hit the start debugging button F5 I need the terminal version to default to 'pwsh' (powershell v6)instead of PowerShell integrate

Below is my settings json file:

{
    "terminal.integrated.shell.windows": "c:/Program Files/PowerShell/6/pwsh.exe"
}


"shellLauncher.shells.windows": [
    {
        "shell": "C:\\Windows\\system32\\cmd.exe",
        "label": "cmd"
    },
    {
        "shell": "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe",
        "label": "PowerShell 5.1"
    },
    {
        "shell": "C:\\Program Files\\PowerShell\\6\\pwsh.exe",
        "label": "PowerShell 6.0"       
    },
    {
        "shell": "C:\\Program Files\\Git\\bin\\bash.exe",
        "label": "Git bash"
    },

],

Open in new window

Any assistance is welcome.

Let me know if my query needs clarification.

Thank you.
Capture.PNG
1
Using python to change number formats in Excel (Openpyxl)


The script is reading excel, to add an additional three zeros, which it does,
it also updates cell format to a custom value, the change does not reflect to the cell, as the cell does not identify itself as a number.
How do I update the cell to reflect it is an [int] format?

I've attached a copy of the xlsx file pre script change.  

from bs4 import BeautifulSoup
from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.styles import Color, PatternFill, Font, Border
from openpyxl.styles import colors
from openpyxl.cell import Cell
from termcolor import colored
import colorama
from colorama import Fore, Style
import os


wb = Workbook()
xlfile = "Test.xlsx"
wb = load_workbook(xlfile)
dash = "-"

for xws in wb.sheetnames:
	worksheet = wb[xws]

	tuple(worksheet['B3':'E5'])
	for rowOfCellObjects in worksheet['B3':'E5']:
		for cellObj in rowOfCellObjects:
			print(cellObj.coordinate, cellObj.value)
		print('--- END OF ROW BEFORE---')

for xws in wb.sheetnames:
	worksheet = wb[xws]
	tuple(worksheet['B3':'E5'])
	for rowOfCellObjects in worksheet['B3':'E5']:
		for cellObj in rowOfCellObjects:
			cellValue = cellObj.value
			if cellValue != dash:
				x = cellValue
				print(Fore.RED + x)
				y = str(x) + ",000"
				print(Fore.WHITE + y)
				#z = (format(int(y),","))
				#print(Fore.GREEN + z)
				#cellObj = y
				#print(Fore.WHITE + cellObj)
				cellObj.value = y
				

Open in new window

0
I am looking at my shiny new GitHub account and I see the default setting for any new repository is to make it public. Is there a setting or preference I can change to make the default private?
0
How to use TreeView navigation  in correct approach. I'd like to use two vertical panel and make the left one as TreeView navigation panel and i'd like to show content on the right panel according to choosen node.

I searched some possible ways but i don't know which one is efficent and logic for programming approach.

1) Creating different forms without borders and when user select the node it will add that form to right panel. Like;

Dim f as Form
f.dispose()
f = New frmNewForm
f.TopLevel = false

MainPanel.Controls.Add(f)
f.show()

2) Adding panels with controls to MainForm's main panel(right panel) and make visible/invisible the panels according to selected node.

These are coming my mind at first. If you have experience about this topic could anyone help and guide me which method is suitable for it.

Note: I'll have apprx. like 15-20 navigation panel.

Thanks
0
I'm a non-programmer (i.e., designer) using JQuery Mobile 1.2.1 (I know this is old, in the process of updating). When a visitor arrives at a particular static page via an outside link that includes a #hash at the end of the URL (i.e., "my-site.com/mypage.html#target", #target being a section inside a collapsible), I need a collapsible on that page to expand, then I need the page to scroll smoothly to the target of the hash.

At the moment, this is a very specific use case, where I know the exact section and the target I want to scroll to, but it would be nice if this code could be reusable for any external link coming to a page where I would like to scroll to any target that's inside any collapsible. At this point, I'd settle for anything that works, as this is a somewhat urgent request.

I'm able to accomplish this sort of thing when just navigating to targets within a page via click, but when arriving from outside the page/site via a hash link URL, the results are very random and somewhat unpredictable. The collapsible opens, and then either the page scrolls to the target then immediately resets to view to the top of the page, or the scroll lands off target by varying margins. Kinda maddening.

This is where I've arrived most recently before throwing up my hands and running here.

$(window).bind("load", function() {
    	var hashName = window.location.hash;
//because I know the specific hash, I put it in an if statement to keep it from possibly interfering 

Open in new window

0
Need a VB.net module to merge PDF's
is any idea or some freeware that achive that, we can't purchase several PDF pro licences only for that propouse.
Pleas help me out you experts!
0
Please explain Gamma Compression algorithms. How to write Gamma Compression algorithms for typical video and image processing system?  Please provide some detailed examples.  How to gain sufficient understanding to be able to write Gamma Compression in 'C' or MATLAB?
0
Hi,
I have performed mvn release:prepare release:perform.
And a tag got created. I am using git and phabricator
Now i had to make some minor changes to the code. But dont want to create another tag unnecessarily.
So can i make the earlier tag point to the new code ?
The tag is important because that is how the build system in our office works...
But each time i make some change for deployment i dont want to create a new tag. and somehow make the older tag point to new code

Please suggest how to do it. and any alternatives ?

Thanks
0
Exploring SQL Server 2016: Fundamentals
LVL 13
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

As will soon become clear, I'm not a master of Git or even Gitkraken. As such, I just have a hotfix, a master and a feature branch. I make changes in hotfix, commit, push, and merge into master (which I then also push). So far I've endeavored not to get more complicated than this.

Even my one feature branch is a bit cowardly, in that that I still keep my feature work separate (in separate files/directories) from my working files, and consistently merge master into the feature branch so I don't lose all the site's hotfixes – all so that my crucial site files are kept whole and untouched regardless of branch. I consider this an intermediate practice as I continue to maintain the site while getting my head around Git. Since now I'm having this bizarre issue, I can see why I hadn't taken that leap yet. Apparently I'm indeed not ready to power-use Git or Gitkraken.

This morning, I did some work on hotfix, and merged it into master. No issue. Then I tried to switch to the feature branch (which I hadn't been in for weeks as it has been all about hot fixes lately), and all hell broke loose. Gitkraken throws the error: "Checkout failed. Could not remove [swf file - one that was there long before my last commit] Operation not permitted." What? Web searches with these key phrases turned up literally nothing... making me the first person to have this happen, I guess.

Then!... immediately, still in hotfix and having done nothing further, suddenly there are 27 file changes staged …
0
I am trying to write code that will determine the resolution of the screen the user is using in order to properly size charts.  I am having trouble getting anything to work. Can someone please help? I am using ASP.Net chart control and vb.net.

Following is code that does not work.

Thanks for the help.

Dim CurScreenWidth As Integer = Screen.PrimaryScreen.Bounds.Width
        Dim CurScreenHeight As Integer = Screen.PrimaryScreen.Bounds.Height
        Dim DesignWidth As Integer = 1680        
Dim DesignHeight As Integer = 1050 
        Dim WidthRatio As Single
        Dim HeightRatio As Single

        WidthRatio = CurScreenWidth / DesignWidth
        HeightRatio = CurScreenHeight / DesignHeight

        Dim ChartWidth As Single = DesignWidth * WidthRatio * 0.96         
Dim ChartHeight As Single = DesignHeight * HeightRatio * 0.85

Open in new window

0
Some web apps update status messages when a process is running.
Other web apps require me to press F5 or refresh the browser using one of the icons at the top of the screen.

Question:   Can these two types of status updates or app messages be classified (i.e. apps programmed in ______ require you to press F5 to receive an updated status message, however, apps programmed in _____  refresh messages on their own and do not require you to press F5.
0
Hi,
I have noticed sometimes whenever i do a git pull.
The editor will open up for merging with the default message :
Merge branch 'branch-name' of 10.1.5.12:app-portal into 'branch_name'
And i unnecessarily end up creating a new commit.

I dont know why this is happening ?
Ideally when i do a git pull it should just pull out the changes and not merge something...
Moreover why this message is appearing in the commit ?

Thanks
0
We are using a software which is time logging, so staff logs in there time when they start and logs off when they stop. Its called PC Clock.
Now when users starts the computer it opens fine but when they restart the computer or logs off it doesn't work for Windows 10 computers (Works fine for Windows 7 computers)
What can we do to resolve this issue?
Thanks
1
New to Java.  Trying to re-create a layout see attached image.  I was trying to use the GridBagLayout.  My issue seems to be to place the buttons in the desired location.   With the JTextArea in place, I can't seem to determine how to place the desired buttons to the right of the JTextArea.

Here is some of my existing code:
        dropBtn = new JButton("Drop");
        eatBtn = new JButton("Eat");
        lookBtn = new JButton("Look");
        listBtn = new JButton("List");
        helpBtn = new JButton("Help");
        pickupBtn = new JButton("Pickup");
        westBtn = new JButton("West");
        eastBtn = new JButton("East");
        northBtn = new JButton("North");
        downBtn = new JButton("Down");
       
        setLayout (new GridBagLayout());
        GridBagConstraints position = new GridBagConstraints();
               
        // create results area to support twenty lines of text
        results = new JTextArea(20,40);
        JScrollPane scrollPane = new JScrollPane(results);
        results.setBorder(new EmptyBorder(20,20,20,20));
        // allow word wrap
        results.setLineWrap(true);
        results.setWrapStyleWord(true);

        // supports auto scrolling within the JTextArea
        DefaultCaret caret = (DefaultCaret) results.getCaret();
        caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
       
        position.gridx = 0;
        position.gridy = 0;
        add(results,position);        
       
 …
0

Programming

53K

Solutions

41K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.