Random snippets of all sorts of code, mixed with a selection of help and advice.
Reach a cell in a table
17 March 2026 @ 3:11 pm
I work on a table containing values for each day of the year. Rows for day and column for Months. Long job so a little bit of VBA should do. To select a particular day, I selected the top left cell and tried "ActiveCell.offset(day,month) but day (1 to 31) and month (1 to 12) are in variables and wont do even if dimmed as Integer.
Any bright idea? Thanks
Where do I find scapegoat trees real code?
17 March 2026 @ 3:02 pm
The original article on scapegoat trees by Galperin and Rivest is quite interesting, and so seem to be all the courses, lectures, and descriptions, like OpenDataStructures and also with a lesson in video, this CS-273, a lesson from Stanford, and here; I won't even list more, as there's plenty of didactic material.
Although, the
UnicodeEncodeError: 'charmap' codec can't encode characters when writing to HTML
17 March 2026 @ 2:52 pm
I have a pandas DataFrame that I wish to paste into an HTML document. The DataFrame contains Dingbat characters used as symbols to highlight values as good (checkmark), nearly bad (triangle), or bad (exclamation point). Here are the pertinent code snippets:
df.loc[0, 0] = '\u2705'
html = df.to_html(justify='center')
I then use the following function to insert the HTML string html into my template HTML file:
def injectHTML(obj_to_insert, dest_file_path, start_string):
for line in fileinput.FileInput(dest_file_path, inplace=1):
if start_string in line:
line = line.replace(line,line+obj_to_insert)
print (line, end=" ")
Running the whole code, I get the following error:
Traceback (most recent call last):
File ~\AppDat
Alter a SQL Server table column size in production
17 March 2026 @ 2:27 pm
What is the best way to alter a production sql server 18 table's column size, varchar(n +1).
My understanding would be the following:
Shut the website down to stop the transaction from coming in.
Begin transaction
Create a new table with the final structure you want (index and taggers)
Copy the data from the original table to the new table
Rename the old table to, for example, original_name_old
Rename the new table to original_table_name
End transaction
Run the site back on to let the traffic flow in.
Is there a simple way in SQL Server 18 or is this the best and simple way?
Failed to Create GoDaddy API Key
17 March 2026 @ 1:57 pm
Environment:
Browser: Chrome (latest)
Account type: Personal
Region: Philippines
Problem:
I am trying to generate an API key from the GoDaddy Developer Portal but the process fails with no clear error message. I have already contacted GoDaddy Customer Support but they were unable to resolve the issue.
What I have already tried:
Cleared browser cache and cookies
Tried a different browser (Firefox, Chrome incognito)
Verified my account email and phone number
Contacted GoDaddy support, no resolution provided
Question:
Has anyone encountered this issue when generating a GoDaddy API key? Is there a known workaround, or is there an account requirement (s
What I have already tried:
Cleared browser cache and cookies
Tried a different browser (Firefox, Chrome incognito)
Verified my account email and phone number
Contacted GoDaddy support, no resolution provided
Question:
Has anyone encountered this issue when generating a GoDaddy API key? Is there a known workaround, or is there an account requirement (sRunning 32bit windows application inside docker (or Linux wine)
17 March 2026 @ 1:24 pm
Hi I’m a student software engineer
my group project requires us to run an 32bit windows application (metatrader 4) to run some calculations.
Currently we have an vm setup to handle this but our professor wants it to be more scalable and the windows vm is taking up a lot of system resources.
I have already tried to run it with Wine but the program requires some display output and it keeps crashing
Any idea where I can look for a better solution
repeated headers and page numbers not working reliably
17 March 2026 @ 11:47 am
I am building an Electron (Vite + React) desktop application and need to generate professional A4 print/PDF output.
The requirement is to:
show the same header on every page (title, logo, reference, date)
include page numbers at the bottom (e.g. C-1, C-2, etc.)
have this work reliably on both macOS and Windows
I am currently using Electron’s built-in printing and PDF generation.
In the main process, I create a hidden BrowserWindow, load a generated HTML file, and then call print or printToPDF.
await win.webContents.printToPDF({
printBackground: true,
pageSize: 'A4',
preferCSSPageSize: true
});
The HTML is styled for A4 printing using CSS like this:
@page {
size: A4;
margin: 15mm;
}
I have tried multiple approaches to repeat the header and add page numb
When I zoom the browser above 80%, the content on the right side gets cut off instead of adjusting responsively
17 March 2026 @ 11:31 am
I have a reports page in my application where the layout breaks when I zoom the browser beyond 80% on a laptop screen.
Specifically, the content on the right side gets cut off instead of resizing or allowing horizontal scrolling.
Other pages using the same layout do not have this issue.
I am using a common layout wrapper. Here is the parent container:
export defaadsdasult function OneColumn({s
element,
fullHeight = true,
isFullScreen = false,
}: {
element: any;
fullHeight?: boolean;
isFullScreen?: boolean;
}) {
const contentClassName = fullHeight
? "w-full h-screen rounded"
: "w-full h-auto rounded";
return (
<>
<div
className={cx(
" px-0 py-0 sm:px-0 lg:px-0",
isFullScreen ? "max-w-full" : "max-w-7xl",
)}
>
{/* Yourturn my html+css+php code into a PDF as an email attachment
17 March 2026 @ 11:27 am
I've "designed" a business card template using HTML and CSS:
This is my HTML code (with some php):
<div class="businessCard">
<div class="logo img"><img src="<?=dir_images?>logos/<?=$company['logo']?>"></div>
<div class="address">
<span class="office"><?=$company_name?></span>
<?=nl2br($employee['office_addr1']??'')?><br>
<?=nl2br($employee['office_addr2']??'')?><br>
<?=$company['website']?>
</div>
<div class="name"><b><?=$employee['name']?></b></div>
<div class="title"><?=nl2br($employee['title']??'')?></div><br>
<div class="contact">
<span class="contact-key">Office: </span><?=$office_tel_str
Unable to redirect to the external URL in wix
17 March 2026 @ 10:44 am
In the onClick of a button, I need to rediret the user to a new page with an external url in new tab.
import wixLocation from 'wix-location';
import { session } from "wix-storage-frontend";
import wixLocationFrontend from 'wix-location-frontend';
const CHECKOUTS = [
"https://domain.name/buy/basic",
"https://domain.name/buy/pro",
"https://domain.name/buy/growth"
];
$w.onReady(() => {
$w("#repeater1").forEachItem(($item, itemData, index) => {
console.log("button", $item("#button48"));
$item("#button48").onClick(() => {
console.log("onClick..")
const base = CHECKOUTS[index];
const params = [];
["utm_source", "utm_medium", "utm_campaign", "utm_term"]
.forEach(k => {
const v = session.getItem(k);