SShortSingh.
0
ProgrammingDEV Community ·

Developer shares three key lessons from building an NFT marketplace with Foundry

A developer building an NFT marketplace in Solidity using Foundry and OpenZeppelin documented three critical lessons learned during the project. The first lesson was that working code is not necessarily secure code, as functions can operate correctly while still being vulnerable to exploits. The second takeaway was that smart contract architecture matters early on, with clear separation of responsibilities across contracts making code easier to maintain and audit. Third, the developer found that testing should go beyond happy-path scenarios to simulate how malicious users might manipulate contract behavior. The overall conclusion was that smart contract quality depends not just on functionality, but on how the code holds up when actively challenged.

0
ProgrammingDEV Community ·

How to Connect to OCI Always Free MySQL DB via SSH Tunnel Without a VPN

Oracle Cloud Infrastructure's Always Free MySQL DB System exposes only a private IP address by design, making direct external access impossible without additional configuration. A developer guide outlines how to install MySQL Shell on an Oracle Linux compute instance within the same Virtual Cloud Network as the database. Since MySQL Shell is not included in Oracle Linux's default repositories, users must manually add MySQL's Yum/DNF repository and enable the mysql-tools-community subrepository before installing. Once MySQL Shell is installed and a direct private-network connection is confirmed, an SSH tunnel can be created from a local laptop through the compute instance to the private database endpoint. This lightweight approach serves as a practical alternative to setting up a full VPN client, requiring only a single command to establish secure access.

0
ProgrammingDEV Community ·

Developer and AI Both Missed a C++ Bug That Only Sanitizers Could Catch

A C++ worker pool was intermittently returning garbage values in release builds, but not in debug builds, pointing to classic undefined behavior triggered by compiler optimization. Both the developer and an AI coding assistant incorrectly diagnosed the issue as a thread synchronization problem and recommended adding mutex locks. The real cause was a dangling reference: a lambda inside a loop was capturing a local variable by reference, but that variable went out of scope before the async task could execute. Running AddressSanitizer and UndefinedBehaviorSanitizer on a minimal reproducer immediately identified the exact line responsible for the stack-use-after-scope error. The fix required just one word — changing the lambda capture from by-reference to by-value — underscoring that sanitizer-based testing, not code review alone, is what reliably exposes lifetime bugs.

0
ProgrammingDEV Community ·

How to Install GCC 9 on CentOS 7 Using DevToolset and Vault Repos

Developers running CentOS 7 can upgrade GCC to version 9 to support newer software such as Python 3.14. Since CentOS 7 mirrors are no longer active, the first step involves redirecting repository configurations to vault.centos.org using sed commands. After updating the Yum cache, GCC 9 is installed via the Software Collections (SCL) repository using the devtoolset-9 package. The toolset is then enabled with the scl enable command, which launches a new shell session with GCC 9 active. Users can confirm the installation was successful by running gcc --version in the terminal.

0
ProgrammingDEV Community ·

How JWTs Work: Stateless Authentication Explained With a Simple Analogy

JSON Web Tokens (JWTs) were developed to address HTTP's stateless nature, which causes servers to have no memory of previous user interactions. Unlike session-based systems that store user data in a server-side logbook, JWTs are stateless and instead issue the user a cryptographically signed token containing a header, payload, and signature. The payload holds user details such as ID and role, but is only Base64-encoded — not encrypted — meaning it can be decoded if intercepted. To reduce security risks like XSS attacks, developers are advised to store JWTs in httpOnly cookies and hash passwords using tools like bcrypt. JWTs serve two primary purposes in web development: authenticating a user's identity and authorizing what actions or resources that user is permitted to access.

0
IndiaNDTV ·

US Military Strike on Suspected Drug Trafficking Vessel Kills 4 in Caribbean

The United States military carried out a strike on a boat in the Caribbean Sea, resulting in four deaths. US Southern Command (SOUTHCOM) announced the operation via a post on X. The targeted vessel was allegedly involved in narco-trafficking and was said to be traveling along known drug smuggling routes in the region. SOUTHCOM identified the strike as part of efforts to counter drug trafficking activity in Caribbean waters.

0
Crypto & Web3CoinDesk ·

ECB Promises Digital Euro Privacy Protections as Civil Society Raises Concerns

The European Central Bank has claimed that the digital euro will provide the highest possible level of privacy for its users. ECB officials stated that the Eurosystem will be architecturally designed so that it cannot link individual users to their transactions. Despite these assurances, civil society organizations remain doubtful about the extent of these privacy guarantees. The debate reflects broader public concerns over potential government surveillance through a central bank digital currency.

0
IndiaTimes of India ·

Sam Altman gifts 7 custom $1M Swiss watches to select OpenAI staff

OpenAI CEO Sam Altman has commissioned seven bespoke Swiss watches from luxury watchmaker Vanguart for a select group of OpenAI employees. The timepieces are based on Vanguart's titanium Orb model, which starts at $180,000, with each watch estimated at around $1 million. The watches feature the phrase 'COMPUTE IS DESTINY' engraved on the rotor and a line of Python code on the caseback. The gesture reflects a broader Silicon Valley trend, with staff at companies including Google, Palantir, and Uber also commissioning custom luxury timepieces.

0
TechnologyArs Technica ·

IBM Launches Granite 4.2 Models Targeting Agentic and Enterprise AI Use

IBM has released its new Granite 4.2 series of large language models, marking the company's latest advancement in its AI portfolio. The models are designed with a strong emphasis on agentic capabilities, enabling AI systems to perform multi-step tasks with greater autonomy. IBM is also targeting enterprise customers by prioritizing predictable and reliable deployment at scale. The release comes amid growing industry interest in running large language models locally rather than relying solely on cloud-based solutions. Granite 4.2 reflects IBM's strategy to position itself competitively in the rapidly evolving enterprise AI market.

0
TechnologyThe Verge ·

Bill Gates warns world is unprepared for AI in sweeping 6,000-word essay

Microsoft co-founder Bill Gates has published a nearly 6,000-word essay outlining his concerns about the rapid advancement of artificial intelligence. Once considered a strong AI optimist, Gates has shifted to a deeply pessimistic outlook on what the technology means for humanity's future. Titled 'The turbulent AI era is here. The choices we make now are critical,' the essay argues that the world is far from ready for what is coming. Gates also stressed that society is not adequately preparing for the challenges ahead. The essay marks a return to public discourse for Gates, who had been notably silent on AI issues in recent times.

0
SportsESPNcricinfo ·

England Eye Series Win as Pakistan Face Uphill Battle at Lord's

England are poised to clinch the series against Pakistan in the upcoming Test at Lord's. Pakistan's heavy innings defeat at Headingley has raised serious doubts about their ability to mount a comeback. The tourists have struggled with discipline and consistency throughout the series, compounding their challenges. A win at the iconic Lord's ground would seal a series victory for England on home soil.

0
IndiaNDTV ·

CIA Director Meets Russian Intelligence in Moscow, Not Putin, Kremlin Says

CIA Director John Radcliffe made an unannounced visit to Moscow on Tuesday, according to US media reports. He is among the highest-ranking American officials to travel to Russia since the country launched its war against Ukraine in 2022. Radcliffe held talks with Russian intelligence services during the visit. The Kremlin clarified that the meeting did not involve President Vladimir Putin.

0
IndiaNDTV ·

Passenger Caught Smuggling Gold Capsules Hidden in Mouth at Bengaluru Airport

A male traveller was caught attempting to smuggle gold at Kempegowda International Airport in Bengaluru. The incident occurred around 7:30 am at Terminal 1 of the airport. Security personnel discovered the gold, which had been concealed in capsule form inside the passenger's mouth, during a routine frisking. The man was being screened before boarding a flight to Ghaziabad when the contraband was found.

← NewerPage 373 of 3529Older →