Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read
Q&A

General Q&A about programming, scripting, software design & architecture, process, tools, testing, and more.

62%
+3 −1
Are there practical reasons for designing a method-only class/object?

Are there practical reasons for designing/implementing a method(s)-only class/object? Follow-up background notes: This question is for languages that are not exclusively Object-Oriented, for exam...

3 answers  ·  posted 1y ago by CodeFarmer‭  ·  last activity 1y ago by hkotsubo‭

22%
+0 −5
Why I am unable to find a class after implementing library also?

I had found a better way to plot in Java. int n = Integer.parseInt(args[0]); // the function y = sin(4x) + sin(20x), sampled at n+1 points // between x = 0 and x = pi ...

0 answers  ·  posted 1y ago by Anonymous‭  ·  edited 1y ago by Anonymous‭

28%
+0 −3
How to plot in C++?

I was trying to plot using following lines in C++. #include "koolplot.h" int main() { plotdata x(-6.0, 6.0); plotdata y = sin(x) + x/5; plot(x, y); return 0; } When I was...

0 answers  ·  posted 1y ago by Anonymous‭

50%
+0 −0
Why some items aren't clickable in RecyclerView?

if (type=="dialer") { String timestamp = list.get(position).get(Constants.DATE); holder.txtTimestamp.setVisibility(View.VISIBLE); holder.imgDelete.s...

0 answers  ·  posted 1y ago by Anonymous‭

36%
+2 −5
What is the main difference between event delegation to other event handling patterns in JavaScript?

I define a software event as any state of a program to which we can probably respond. In JavaScript, how does event delegation differs from more simple and probably more common event handling patt...

1 answer  ·  posted 1y ago by deleted user  ·  edited 1y ago by Alexei‭

22%
+0 −5
Why margin isn't working in SVG for path?

&lt;?xml version="1.0" encoding="iso-8859-1"?&gt; &lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"&gt; &lt;svg version="1.1" id="Capa_1" x="0px...

0 answers  ·  posted 1y ago by Anonymous‭  ·  edited 1y ago by Alexei‭

60%
+1 −0
WARNING: environment variable DISPLAY is not set (netbeans)

I was trying to install Netbeans in Xubuntu. I had installed Netbeans using Snapd. sudo snap install netbeans --classic I was trying to start Netbeans then I got an error which was looking like...

1 answer  ·  posted 1y ago by Anonymous‭  ·  last activity 1y ago by Anonymous‭

25%
+0 −4
Adding support on mathematical expressions

MarkFuncs has really gotten huge progress, at least in my eyes, and now, I want to make math possible in the language. Background MarkFuncs is a programming language that I have been working on f...

0 answers  ·  posted 1y ago by General Sebast1an‭  ·  edited 1y ago by Lundin‭

87%
+12 −0
What compiler options are recommended for beginners learning C?

When reading questions about C programming from beginners, I very often see them describing peculiar run-time errors and crashes, segmentation faults and similar. They have spent a lot of time chas...

1 answer  ·  posted 1y ago by Lundin‭  ·  edited 1y ago by Lundin‭

75%
+4 −0
Get the length of a slice from a multi-dimensional array

If I have a one-dimensional array, I can get the length of it quite easily: var x = moves.Length(). However, if the array is multi-dimensional, .Length() returns the total number of elements. If ...

2 answers  ·  posted 1y ago by FrankLuke‭  ·  last activity 1y ago by FoggyFinder‭

60%
+1 −0
can't find git repo (library)

Could not find com.github.Kunzisoft:Android-SwitchDateTimePicker:1.9. Required by: project :app Search in build.gradle files I was trying to use the library. I had searched for 2.1, 2.0 a...

1 answer  ·  posted 1y ago by Anonymous‭  ·  last activity 1y ago by Anonymous‭

33%
+0 −2
Why comma is expected for auto_increment?

query = "CREATE TABLE "+TABLE+" ("+COLUMN1+" INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT, "+COLUMN2+" VARCHAR(255), " + COLUMN3+" VARCHAR(255), "+COLUMN4+" TEXT, "+ COLUMN5+" VARCHAR(255)...

1 answer  ·  posted 1y ago by Anonymous‭  ·  edited 1y ago by Alexei‭

60%
+1 −0
Why is the switch statement not executing the correct case blocks?

In the code below, the value of order variable should change according to i's value: String order; switch (i){ case 0: order = CallLog.Calls.DATE + " DESC "; contactViewAda...

1 answer  ·  posted 1y ago by Anonymous‭  ·  last activity 1y ago by hkotsubo‭

66%
+2 −0
What's the better way to store base64 in SQLite Database?

What's the better way to store base64 in SQLite Database? I was thinking to put base64 as TEXT since base64 has lots of chars. CREATE TABLE name (id INTEGER PRIMARY KEY AUTO_INCREMENT, image TEXT)...

1 answer  ·  posted 1y ago by Anonymous‭  ·  edited 1y ago by Anonymous‭

60%
+1 −0
How can I export metrics from Angular frontend to be read with Prometheus ?

How can I monitor an Angular frontend with Prometheus? I was able to create metrics for my Node.js API using the express-prometheus module. But I can't find any Angular/Prometheus integration. Basi...

0 answers  ·  posted 1y ago by nelson777‭  ·  edited 1y ago by Peter Mortensen‭

57%
+2 −1
How to append HTML to the DOM with JavaScript?

I have a .html file containing only the following data, and I keep that file on top of my website's directory. &lt;link rel="stylesheet" href="./css/mobile_general_structure.css"&gt;&lt;/link&gt; ...

2 answers  ·  posted 1y ago by deleted user  ·  last activity 1y ago by Ullallulloo‭

40%
+0 −1
How to load two or more files in one AJAX call?

In my browser's JavaScript console I can add to the &lt;body&gt; element one file (index.html) with the following AJAX code: const whereToLoad = document.querySelector("body"); const ajax = new X...

0 answers  ·  posted 1y ago by deleted user  ·  edited 1y ago by deleted user

40%
+2 −4
What are the disadvantages of using static methods in Java?

I was using static method few moments ago. But I noticed that I was returning a variable using that static method. According to the article, Static is a keyword that identifies the class-related...

4 answers  ·  posted 1y ago by Anonymous‭  ·  last activity 1y ago by hkotsubo‭

57%
+2 −1
What's the minimum API level for activity transition?

I was trying to show transition on activity changes. I had followed two method from SO. I lost those link so I can't add them here. My first method was I had used overridePendingTransition on onCr...

1 answer  ·  posted 1y ago by Anonymous‭  ·  last activity 1y ago by Anonymous‭

50%
+0 −0
What should I use instead of managedQuery?

managedQuery is recently deprecated. ManagedQuery was used for using Cursor. What should I use since managedQuery was deprecated? Without it, I can't work with Cursor. So there must be alternative ...

1 answer  ·  posted 1y ago by Anonymous‭  ·  edited 1y ago by Alexei‭

60%
+1 −0
Why ArrayList is always same value in only Adapter?

This is the worst bug I have ever seen.. I was fetching CallLogs following way. ArrayList&lt;HashMap&lt;String, String&gt;&gt; callLog= new ArrayList&lt;&gt;(); HashMap&lt;String, Strin...

1 answer  ·  posted 1y ago by Anonymous‭  ·  last activity 1y ago by Anonymous‭

60%
+1 −0
event_start always returning contact number in android

Why ContactsContract.CommonDataKinds.Event.START_DATE always returning contact number. The number is available in Google Contacts. Here what I am doing... Cursor c; if (contactID==""...

0 answers  ·  posted 1y ago by Anonymous‭

87%
+12 −0
Why is it considered bad practice to use float for representing currency?

This is intended to be a canonical post for this problem which is pretty common. Especially among beginners. I've heard that I should avoid using floating point variables for representing curren...

2 answers  ·  posted 1y ago by klutt‭  ·  last activity 1y ago by klutt‭

50%
+0 −0
What's the alternative of "ContactsContract.Contacts.LAST_TIME_CONTACTED"?

What should I use instead of ContactsContract.Contacts.LAST_TIME_CONTACTED? According to documentation, LAST_TIME_CONTACTED variable was deprecated. Even it was written in ContactsContract.class /...

0 answers  ·  posted 1y ago by Anonymous‭  ·  edited 1y ago by Anonymous‭

71%
+3 −0
What does android:ems do?

What does ems in xml do? I saw that I was using following line in EditText. But, I never thought what it does. I was trying to check what actually it does by removing the line. I couldn't see any d...

1 answer  ·  posted 1y ago by Anonymous‭  ·  edited 1y ago by Alexei‭

50%
+0 −0
Executing a PHP HTML-CSS container on top of various content management systems

I have created two PHP modules, one is a contact form module and one is a a sticky "call now" module. I can access the contact form by example.com/contact_form.php but in contrast, example.com/cal...

0 answers  ·  posted 1y ago by deleted user  ·  edited 1y ago by Alexei‭

80%
+6 −0
Python Regex to parse multiple "word. word. word."

I'm trying to parse lines like "THIS. THAT..OTHER " so that "THIS. THAT." is found. There can be more than one &lt;word&gt;&lt;dot&gt; separated by a space except no space after the last one. ...

2 answers  ·  posted 2y ago by CodeFarmer‭  ·  last activity 1y ago by hkotsubo‭

60%
+1 −0
Find image for contact list in Android Java

How to get image of contact list? I was using cursor to get contact list. Here how it looks like. ArrayList&lt;HashMap&lt;String, String&gt;&gt; contactList = new ArrayList&lt;&gt;(); Has...

1 answer  ·  posted 1y ago by Anonymous‭  ·  last activity 1y ago by Anonymous‭

25%
+0 −4
Git deployment vs SFTP deployment [closed]

I personally use git for deploying my hobby projects into cloud like Heroku. I came across the concept of sftp for uploading files. Now please differentiate these two deployments like when to use w...

0 answers  ·  posted 1y ago by aditya98‭  ·  closed 1y ago by Alexei‭

42%
+1 −2
What's the better way to deal with deprecated feature?

It's a very old question came to my mind. Whenever I start building some applications for Android using Android Studio. In every update, lots of tools get deprecated. I know I can use deprecated "t...

0 answers  ·  posted 1y ago by Anonymous‭  ·  edited 1y ago by Anonymous‭

80%
+6 −0
Is it a good idea to have a permanent branch for a feature?

I'm rather new to using git, so I'm not sure about the best practices regarding it. I have a feature branch branched off, and periodically when the feature needs to be updated I will add some commi...

3 answers  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by Hyperlynx‭

33%
+0 −2
How to break line in XML?

How to break line in XML? I was trying to follow the answer. But, It wasn't helpful for me. I had tried &lt;br/&gt; and &lt;br /&gt;. None of them works. &lt;?xml version="1.0" encoding="UTF-8"?&g...

0 answers  ·  posted 1y ago by Anonymous‭  ·  edited 1y ago by Anonymous‭

40%
+0 −1
How to initialize variable assignment in a non-OOP interpreter?

I'm still in the process of making MarkFuncs and having given up from copy-pasting open-source interpreters, them using OOP too, I decided to make one without OOP and with scratch alongside with th...

1 answer  ·  posted 1y ago by General Sebast1an‭  ·  last activity 1y ago by Canina‭

71%
+3 −0
How to make the text box such that its placeholder goes up and arranges itself in the centre of the border upon clicking?

How to make the placeholder so that it goes to the top of the border line on click? For example, when you go to Gmail and click on the input field, the placeholder text goes up and arranges itself...

1 answer  ·  posted 1y ago by nobodyImportant‭  ·  edited 1y ago by hkotsubo‭

60%
+1 −0
What input functions can I use in TIO's PHP?

Try It Online! is an online interpreter for many supported languages, including PHP. I'm trying to solve coding challenges using the language, specifically "Hello, {name}!". In PHP, you can litera...

1 answer  ·  posted 1y ago by General Sebast1an‭  ·  last activity 1y ago by hkotsubo‭

60%
+1 −0
How to properly manage PGP signing key storage, access, and usage for dev and automation?

I work for an IoT company. We recently got secure boot to work for a customer-visible product. For secure boot to work, the images we generate must be signed. Obviously, we want customer-visible sy...

0 answers  ·  posted 1y ago by ghost-in-the-zsh‭  ·  edited 1y ago by ghost-in-the-zsh‭

71%
+3 −0
Credentials for multiple tenants with Azure.Identity

Situation: I have an Azure account which has management permissions for various subscriptions in various directories (tenants). I have a GUI tool to do various management tasks whose details are ir...

0 answers  ·  posted 1y ago by Peter Taylor‭

60%
+1 −0
Error: Cannot find module 'is-color-stop' in Tailwind CLI

While compiling the code for production in Tailwind CLI using: npx tailwindcss -m -o ./build/tailwind.css --purge "./**/*.html" I get: node:internal/modules/cjs/loader:941 const err = new ...

0 answers  ·  posted 1y ago by Kevin M. Mansour‭

60%
+1 −0
Using http.get to get page from frontend

It's possible to use Angular 8 http.get to get a page from the frontend itself ? My local frontend url: https://192.168.0.177:4200/ I tried in a service: test(): Observable&lt;string&gt; { ret...

1 answer  ·  posted 1y ago by nelson777‭  ·  last activity 1y ago by Derek Elkins‭

66%
+4 −1
Is it possible to mutate the DOM directly from HTML, without any JavaScript?

All the ways I know of to mutate a DOM are JavaScript. Just for broadening general knowledge I want to know if there is any common way to mutate the DOM via HTML itself, without involving any Java...

2 answers  ·  posted 1y ago by deleted user  ·  last activity 1y ago by nelson777‭

80%
+6 −0
How to read lines into an array in Bash

I wish to fill an array with strings, using Bash scripting. The strings are in a file, one per line. Here is what I've tried: declare -a my_array=() while read line; do my_array+=( "$line"...

3 answers  ·  posted 1y ago by LVx0‭  ·  edited 1y ago by Alexei‭

70%
+5 −1
How allocated memory is calculated?

int arr[] = {10,123,14,14,15,16}; cout&lt;&lt;sizeof(arr)/sizeof(arr[0]); I was reading the article. When sizeof() is used with the data types such as int, float, char… etc it simply ret...

1 answer  ·  posted 1y ago by Anonymous‭  ·  last activity 1y ago by Canina‭

42%
+1 −2
What might happen if I ignore warning?

#include &lt;iostream&gt; using namespace std; int linearSearch(int array[], int n, int key){ for(int i=0;i&lt;=n;i++){ if(array[i]==key){ return i; } } } int main() { int ...

2 answers  ·  posted 1y ago by Anonymous‭  ·  last activity 1y ago by Lundin‭

71%
+3 −0
setting of translateX for carousel image slider

I made carousel image slider by following tutorials. To slide images , I made the below function. const moveToSlide = (track, currentSlide, targetSlide) =&gt; { track.style.transform = 'translat...

0 answers  ·  posted 1y ago by aya2222‭  ·  edited 1y ago by aya2222‭

42%
+1 −2
How do I filter an array in C?

No, I'm not trying to get the full program written completely in C by you guys. I only need some way to implement the functionalities of each function I found confusing. In this challenge in Code ...

2 answers  ·  posted 1y ago by General Sebast1an‭  ·  last activity 1y ago by Derek Elkins‭

50%
+1 −1
Nannou model requires a function pointer: How to return a function pointer

Trying to make a nannou app from the template but with a customizable model() function. The template has this main(): fn main() { nannou::app(model).update(update).run(); } The model t...

0 answers  ·  posted 1y ago by telefza‭  ·  edited 1y ago by Alexei‭

57%
+2 −1
Function.prototype.call()

I wanted to print to browser console the number of li list items of a given ul list. This didn't work (console output was undefined): console.log(document.querySelectorAll(".example").length); ...

1 answer  ·  posted 1y ago by deleted user  ·  edited 1y ago by Alexei‭

57%
+2 −1
How to include HTML files in another HTML file with vanilla Javascript?

I develop an HTML-CSS-JavaScript-PHP contact form and I have a large HTML file which is very long and very wide (lots of horizontal scrolling due to nesting) and it's hard for me personally to work...

0 answers  ·  posted 1y ago by deleted user  ·  edited 1y ago by Alexei‭

81%
+7 −0
How do I ask git-show-branch to display a commit range?

For some tasks, I find git show-branch easier to follow than git log. For example, inspecting the history on someone's PR before merging it. git show-branch master topic stops at the first common ...

1 answer  ·  posted 1y ago by ajv‭  ·  edited 1y ago by Alexei‭

60%
+1 −0
Uncaught ReferenceError: variable is not defined

I have a variable defined using const keyword. function Text() { const variable = "Hello!"; } console.log(variable); When I try to access this variable, I get: Uncaught ReferenceError...

1 answer  ·  posted 1y ago by Kevin M. Mansour‭  ·  edited 1y ago by Alexei‭