#const in PHP
Explore tagged Tumblr posts
Text
PHP Constants Explained: Learn How to Use Constants in PHP
Master PHP constants with this detailed guide. Learn how to define constants using define() and const, understand use cases, and explore best practices. đ Ultimate Guide to PHP Constants PHP Constants are essential for creating immutable values in your scripts â values that never change once defined. This tutorial covers everything you need to know about PHP Constants, including how to define,âŠ
#const in PHP#define()#global constants PHP#PHP const class#PHP constant vs variable#PHP Constants#PHP magic constants
0 notes
Text
Listenansichten in FileMaker optimieren/ PHP und FileMaker
Listenansichten in FileMaker optimieren Nach einigen Jahren und vielen 1000 DatensĂ€tzen die neu ins FileMaker-System gekommen sind, war es soweit. Eine spĂŒrbare Verschlechterung der Performance beim Aufbau einer extrem komplexen Listenansicht. Diese Ansicht enthĂ€lt sehr viele Sortierungen, diverse bedingte Formatierungen zum Ein und Ausblenden von Symbolen, Farbgebung etc. Wenn jetzt noch jemand per VPN auf die Datenbank zugreifen wollte, so konnte es einige Zeit dauern bis die ArbeitsfĂ€higkeit hergestellt war. Dabei wurde die Struktur schon ohne Formeln entwickelt. Die schnellste und effektivste Lösung. Alles wird ĂŒber ein WebViewer abgewickelt. Betritt der User das Listen-Layout wird ein Serverscript gestartet, sammelt alle FileMaker Daten und ĂŒbertrĂ€gt diese dann an ein PHP-Script. Bruchteile spĂ€ter, steht die Liste schon zum arbeiten bereit. Da die Liste nur mit Java-Script arbeitet, sind alle Aktionen sehr schnell. Die Daten werden mithilfe eines FileMaker-Skripts vorbereitet und mit Insert from URL an eine PHP-Datei auf dem Server geschickt. Der Request erfolgt als klassischer application/x-www-form-urlencoded-POST-Aufruf. Der Server nimmt die Daten entgegen, bereinigt sie, zerlegt ggf. Pipe-getrennte Listen, und speichert sie in einem assoziativen Array zur weiteren Verarbeitung.
<?php // Daten sĂ€ubern function cleanData($value) { return trim($value); } // Pipe-Werte aufspalten (z.âŻB. '4711|4712|4713') function processPipeSeparatedValues($value) { return array_map('trim', explode('|', $value)); } // POST-Verarbeitung starten if ($_SERVER['REQUEST_METHOD'] === 'POST') { $postData = array_map('cleanData', $_POST); // Weiterverarbeitung folgt... } ?>
Auf der FileMaker-Seite wird der Post so aufbereitet Das PHP-Skript erzeugt eine strukturierte HTML-Tabelle, die ĂŒber CSS und JavaScript erweitert wird. Sticky-Header, Hover-Effekte, Icons, Kartenintegration, alles dabei. Dank JavaScript lassen sich die EintrĂ€ge mit einem Klick sortieren. Nach PLZ, StraĂe oder Kategorie. Auch Gruppierungen sind möglich, z.âŻB. nach Stadtvierteln oder Bezirken, die dynamisch ĂŒber Google Maps Geocoding ermittelt werden.
function sortByPLZ() { const table = document.querySelector("table"); const tbody = table.querySelector("tbody"); const rows = Array.from(tbody.querySelectorAll("tr")); // Entferne alte Gruppenköpfe document.querySelectorAll(".plz-header").forEach(row => row.remove()); // Sortiere Zeilen nach PLZ (Spalte 12, also index 12) rows.sort((a, b) => { const plzA = a.cells[12].textContent.trim(); const plzB = b.cells[12].textContent.trim(); return plzA.localeCompare(plzB, "de", { numeric: true }); }); // Neue Gruppierung einfĂŒgen let currentPLZ = ""; rows.forEach(row => { const plz = row.cells[12].textContent.trim(); if (plz !== currentPLZ) { currentPLZ = plz; const headerRow = document.createElement("tr"); headerRow.className = "plz-header"; const headerCell = document.createElement("td"); headerCell.colSpan = row.cells.length; headerCell.textContent = "PLZ: " + plz; headerRow.appendChild(headerCell); tbody.appendChild(headerRow); } tbody.appendChild(row); }); }
In dieser Ansicht wird unter anderem die Entfernung zu den nĂ€chsten Standorten ermittelt. Nach erfolgter Sortierung ist es sehr schnell möglich AuftrĂ€ge zu verketten bei minimierter Fahrzeit. In dieser Ansicht aber nur berechnet ĂŒber die Haversinsche Formel. Aber es ist ein extrem schneller Anhaltspunkt um AuftrĂ€ge in Gruppen zusammenzufassen. Besonders charmant: Das ganze geht auch ĂŒber die Google Maps API. Die Ansicht dann ĂŒber Google Maps. Ăber das InfoWindows-Fenster lassen sich unendlich viele Informationen einblenden. In meinem Fall kann aus dieser Perspektive schon die Tourenzusammenstellung erfolgen. Es wird die Arbeitszeit ermittelt und kenntlich gemacht. Eine implementierte Fahrzeiten-Anzeige hat sich fĂŒr Berliner-VerhĂ€ltnisse als Unsinnig herausgestellt. Zu viele VerkehrsĂ€nderungen, zu viel Stau, in diesem Fall bedarf es der Erfahrung von Mitarbeitern und Disponenten. Wichtig, ist natĂŒrlich auch die Sequentielle-Suche. Diese kann natĂŒrlich wie schon einmal berichtet, auch in normalen FileMaker-Listen, Anwendung finden. Eine klassische FileMaker angelehnte Suche fehlt natĂŒrlich auch nicht. Hier lassen sich verschieden Kriterien verbinden und ermöglichen eine flexible Suche, Ă€hnlich der klassischen FileMaker-Suche. Das ich im Regelfall innerhalb von FileMaker immer Arbeitslayouts nutze, die im Hintergrund bei -30000 Pixel arbeiten, kann ich aus dem WebViewer heraus, alle FileMaker Script nutzen, die im Vorfeld genutzt wurden. Sie bekommen die Parameter in einer etwas anderen Form, meist als Liste. Somit ist der Aufwand auf der FileMaker-Seite ĂŒberschaubar. Fehlerbehandlung und Fallbacks NatĂŒrlich kann nicht immer alles glattlaufen, etwa wenn der Server nicht erreichbar ist oder die Daten aus FileMaker unvollstĂ€ndig ĂŒbertragen werden. FĂŒr diesen Fall habe ich einen einfachen Mechanismus eingebaut. Wenn keine oder fehlerhafte Daten ankommen, zeigt das Skript entweder eine Hinweisbox oder einen minimalen Fallback-Inhalt an. Dabei ist es wichtig, am Anfang der Datei gleich zu prĂŒfen, ob zentrale POST-Werte gesetzt wurden. Gerade bei VPN-Nutzern oder instabilen Mobilverbindungen ist das hilfreich, der Nutzer bekommt sofort RĂŒckmeldung, statt auf eine leere Seite zu starren.
if (!isset($_POST['touren']) || empty($_POST['touren'])) { die("<div class='error'>Keine Daten empfangen. Bitte erneut versuchen.</div>"); }
Unterschied zwischen FileMaker-Client und Server Eine kleine, aber entscheidende Stolperfalle hat mich bei diesem Projekt einige Nerven gekostet. WĂ€hrend der gesamte Aufbau der Liste ĂŒber den FileMaker Pro Client reibungslos funktionierte, lief das gleiche Script nicht mehr, wenn es ĂŒber ein Server-Script (FileMaker Server) angestoĂen wurde. Die WebViewer-Seite blieb leer. Kein Fehler, kein Hinweis, einfach nichts. Nach lĂ€ngerer Analyse stellte sich heraus, die Anzahl und Verschachtelungen der DOM-Elemente war der Grund. Im Client lief das Rendering noch sauber durch, aber der FileMaker Server scheint bei der Generierung und Ăbergabe des WebViewers, speziell in Kombination mit âInsert from URLâ -> WebViewer -> HTML-Rendering, empfindlicher zu reagieren. Besonders bei vielen verschachtelten div-Containern, Tabellen-Inlays und Icon-Ebenen war Schluss. Die Lösung war eher pragmatisch als elegant, ich habe den DOM deutlich verschlankt, viele dekorative Elemente entfernt oder durch schlankere Varianten ersetzt. Statt
mit drei Ebenen fĂŒr Rahmen, Schatten und Hover, verwende ich jetzt.
<tr class="hover"> <td>4711</td> <td>Berlin</td> <td>âŠ</td> </tr>
Und auch bei Zusatzinfos im InfoWindow der Google Maps Ansicht wurde auf alles ĂberflĂŒssige verzichtet. Das Resultat, die Darstellung lĂ€uft jetzt reibungslos auch bei serverseitiger Ăbergabe, ohne dass der WebViewer hĂ€ngen bleibt oder gar leer bleibt. Was bleibt nach dieser Umstellung? Ganz klar, die WebViewer-Lösung ist ein echter Gamechanger fĂŒr groĂe, komplexe Listenansichten in FileMaker. Die Performance ist kaum vergleichbar mit der klassischen Layoutdarstellung, besonders dann, wenn Sortierungen, Gruppierungen und visuelle Hilfsmittel wie Karten gebraucht werden. Eine HTML-Tabelle mit JavaScript schlĂ€gt hier jedes FileMaker-Layout um LĂ€ngen.
0 notes
Text
PHP Constants
PHP constants are names or identifiers that can't be changed during the execution of the script except for magic constants, which are not really constants. 2 ways can define PHP constants:
Using define() function
Using const keyword
Constants are similar to the variable, except once they are defined, they can never be undefined or changed. They remain constant across the entire program. PHP constants follow the same PHP variable rules. For example, it can be started with a letter or underscore only. Conventionally, PHP constants should be defined in uppercase letters.
0 notes
Text
Super Simple OpenAI PHP Class
Iâve been playing around with hooking up ChatGPT/Dall-E to WordPress and WP-CLI. To do this, I whipped up a super simple class to make this easier: <?php class OpenAI_API { public const API_KEY = 'hunter2'; // Get your own darn key! /** * Generates an image based on the provided prompt using the OpenAI API. * * @param string $prompt The text prompt to generate the image from. Default is anâŠ
0 notes
Text
A Guide to Stripe Payment Gateway Integration
Integrating a payment gateway is a critical step for any fintech software application, and Stripe is one of the leading solutions available today. Known for its ease of use, robust features, and extensive documentation, Stripe offers a comprehensive payment processing system for businesses of all sizes. This guide will walk you through the key steps for successful Stripe payment gateway integration, ensuring a seamless transaction experience for your users.
Understanding Stripe
Stripe provides a suite of tools to accept and manage online payments. It supports various payment methods, including credit cards, debit cards, and mobile wallets, making it a versatile choice for fintech software. Moreover, Stripe is designed to handle everything from simple payment processing to complex subscription billing, making it suitable for diverse business models.
Steps for Stripe Payment Gateway Integration
1. Create a Stripe Account
The first step in payment gateway integration with Stripe is to sign up for a Stripe account. Go to the Stripe website and register. Once your account is set up, you will gain access to the Stripe Dashboard, where you can manage payments, view analytics, and access your API keys.
2. Set Up Your Business Profile
After creating your account, configure your business profile within the Stripe Dashboard. This includes entering essential details such as your business name, address, and bank account information for fund transfers. Ensure that all information is accurate to prevent any payment processing issues later on.
3. Obtain API Keys
To integrate Stripe into your fintech software, you need to obtain your API keys. In the Stripe Dashboard, navigate to the âDevelopersâ section, then âAPI keys.â You will find a pair of keys: one for testing (in "test" mode") and one for production. Always keep these keys secure, as they are crucial for authenticating your application.
4. Integrate the Stripe SDK
Stripe offers SDKs for various programming environments, including JavaScript, Ruby, Python, and PHP. Depending on your mobile or web application framework, you can choose the appropriate SDK. Hereâs a brief overview of how to integrate the Stripe.js library for a web application:
Include the Stripe.js Library: Add the following script to your HTML file:htmlCopy code<script src="https://js.stripe.com/v3/"></script>
Initialize Stripe: Use your publishable API key to initialize Stripe in your JavaScript code:javascriptCopy codeconst stripe = Stripe('your-publishable-key');
5. Create a Payment Form
A user-friendly payment form is essential for a seamless payment experience. You can create a custom payment form using HTML and integrate Stripe Elements, which are pre-built UI components. Hereâs a simple example:
html
Copy code
<form id="payment-form"> <div id="card-element"><!-- A Stripe Element will be inserted here --></div> <button id="submit">Pay</button> <div id="payment-result"></div> </form>
6. Handle Payment Processing
Once the payment form is set up, you need to handle the payment process. Use JavaScript to listen for form submissions and call the Stripe API to create a payment token:
javascript
Copy code
const form = document.getElementById('payment-form'); form.addEventListener('submit', async (event) => { event.preventDefault(); const { paymentMethod, error } = await stripe.createPaymentMethod({ type: 'card', card: cardElement, // Reference to your card Element }); if (error) { // Display error message document.getElementById('payment-result').innerText = error.message; } else { // Process paymentMethod.id on your server } });
7. Backend Integration
After generating a payment method token on the client side, you must send it to your server for processing. On the server, use your secret API key to create a charge or set up a customer. Here's an example using Node.js:
javascript
Copy code
const stripe = require('stripe')('your-secret-key'); app.post('/charge', async (req, res) => { try { const { amount, paymentMethodId } = req.body; const paymentIntent = await stripe.paymentIntents.create({ amount, currency: 'usd', payment_method: paymentMethodId, confirmation_method: 'manual', confirm: true, }); res.json({ success: true, paymentIntent }); } catch (error) { res.status(500).json({ error: error.message }); } });
8. Testing Your Integration
Before launching your application, thoroughly test the payment gateway integration in Stripeâs test mode. Use the test card numbers provided in the Stripe documentation to simulate various payment scenarios, including successful transactions and declines. Testing ensures that your integration works smoothly and handles potential issues effectively.
9. Go Live
Once testing is complete and youâre satisfied with the results, switch your Stripe API keys from test to live mode in your application. Double-check that all settings are correctly configured, and you're ready to start processing real transactions.
10. Monitor and Optimize
After launching, continuously monitor your transactions through the Stripe Dashboard. Look for patterns, user feedback, and potential issues. Regularly update your fintech software to enhance security, improve user experience, and add new features as needed.
Conclusion
Integrating Stripe as your Payment gateway intregation is a strategic choice for any fintech software application. By following the outlined stepsâsetting up your account, integrating the SDK, and creating a secure payment processâyou can provide a seamless transaction experience for your users. With Stripeâs robust features and extensive support, youâll be well-equipped to manage payments efficiently and effectively, setting the foundation for your businessâs success.
0 notes
Text

How do you define a constant in @php?
a. define_constant() b. const() c. define() d. constant()
#quiz#scriptzol#letsconnect#PHPScript#PHPScriptquiz#PHPScriptpoll#followme#followforfollow#instadaily#follow4follow#like4like#PHPScriptdevelopmentTips#PHPScriptdevelopmentquiz#PHPScriptdevelopmentpoll#PHPQuiz#ScriptDevelopment#CodingChallenge#PHPConstants#TechTrivia#ProgrammingLife#DevCommunity#CodeMasters#GeekModeOn#LearnPHPNow
0 notes
Text
This Week in Rust 457
Hello and welcome to another issue of This Week in Rust! Rust is a programming language empowering everyone to build reliable and efficient software. This is a weekly summary of its progress and community. Want something mentioned? Tweet us at @ThisWeekInRust or send us a pull request. Want to get involved? We love contributions.
This Week in Rust is openly developed on GitHub. If you find any errors in this week's issue, please submit a PR.
Updates from Rust Community
Project/Tooling Updates
rust-analyzer changelog #143
Slint UI crate weekly updates
This week in Databend #56: A Modern Cloud Data Warehouse for Everyone
What's new in axum 0.6.0-rc.1
HexoSynth Modular Synthesizer in Rust - Devlog #10: Alpha-1 Release
Fornjot (code-first CAD in Rust) - Weekly Release - 2022-W34
Observations/Thoughts
Come contribute to Salsa 2022!
State Machines II
Rust Walkthroughs
Tauri + Async Rust Process
Writing a container in Rust
Experimentally compiling PHP code to Rust - Ryan Chandler
STM32F4 Embedded Rust at the HAL: GPIO Interrupts
[video] Rust Traits vs C++ Concepts
[video] Writing Procedural Macros
[video] Get under the hood of Rust Language with Assembly!!
[video] Scoped threads in Rust 1.63
[video] 1Password Developer Fireside Chat: Demystifying Atomics
Crate of the Week
This week's crate is sass-embedded, a library to communicate with Embedded Dart Sass.
Thanks to Ahab for the self-suggestion.
Please submit your suggestions and votes for next week!
Call for Participation
Always wanted to contribute to open-source projects but didn't know where to start? Every week we highlight some tasks from the Rust community for you to pick and get started!
Some of these tasks may also have mentors available, visit the task page for more information.
Ockam - Add syntax highlighting to examples in ockam clap command help using syntect
Ockam - Add examples section to ockam tcp-inlet create command's help
Ockam - Make ockam node delete --all --force command more forceful
Mirrord - Consider using mold linker
Mirrord - mirrod-layer and mirrord bin are being built twice when running cargo +nightly build
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
411 pull requests were merged in the last week
mitigate stale data reads on SGX platform
support 128-bit atomics on all aarch64 targets
rustc_metadata: deduplicate strings to prevent multiple copies in rmeta/query cache blow file size
make NOP dyn casts not require anything about the vtable
implied bounds: explicitly state which types are assumed to be wf
never consider unsafe blocks unused if they would be required with deny(unsafe_op_in_unsafe_fn)
do not allow Drop impl on foreign fundamental types
don't derive PartialEq::ne
lazily decode SourceFile from metadata
make must_not_suspend lint see through references when drop tracking is enabled
mention as_mut alongside as_ref in borrowck error message
point at a type parameter shadowing another type
recover keywords in trait bounds
reenable disabled early syntax gates as future-incompatibility lints
improved diagnostic for function defined with def, fun, func, or function instead of fn
suggest fn if fun, func, function or def is used to define a function
suggest once_cell::Lazy for non-const statics
suggest adding a reference to a trait assoc item
suggest adding an array length if possible
suggest the right help message for as_ref
UnreachableProp: preserve unreachable branches for multiple targets
kind-less SessionDiagnostic derive
convert diagnostics in parser/expr to SessionDiagnostic
migrate "invalid variable declaration" errors to SessionDiagnostic
migrate emoji identifier diagnostics to SessionDiagnostic in rustc_interface
migrate lint reports in typeck::check_unused to LintDiagnostic
migrate more rustc_borrowck diagnostics to SessionDiagnostic
migrate rustc_ast_passes diagnostics to SessionDiagnostic and translatable messages (first part)
migrate typeck's used expected symbol diagnostic to SessionDiagnostic
migrations for rustc_expand transcribe.rs
migrate some rustc_borrowck diagnostic
miri: breaking posix_memalign precondition is not UB
miri: improve information sharing across SB diagnostics
miri: add very basic Android support
remove manual implementations of HashStable for hir::Expr and hir::Ty
shrink ast::Attribute
box the MacCall in various types
use AttrVec more
add IpDisplayBuffer helper struct
rework Ipv6Addr::is_global to check for global reachability rather than global scope
make slice::reverse const
refactor iteration logic in the Flatten and FlatMap iterators
futures: fix incorrect termination of select_with_strategy streams
cargo: fix file locking being not supported on Android raising an error
cargo: improve error message for an array value in the manifest
cargo: improve error message for wrong target names
rustdoc: merge source code pages HTML elements together v2
rustdoc: count deref and non-deref as same set of used methods
rustdoc: strategic boxing to reduce the size of ItemKind and Type
rustfmt: Unicode comment align
clippy: add unused_peekable lint
clippy: add manual_empty_string_creations lint
clippy: add new lint positional_named_format_parameters
clippy: don't lint on match pattern-binding in question_mark
clippy: enhance needless_borrow to consider trait implementations
clippy: fix non_ascii_literal in tests
clippy: fix to_string_in_format_args false positive
clippy: fix false positives of needless_match
clippy: lint collapsible_str_replace
clippy: more lint pass merges
clippy: refactor FormatArgsExpn
clippy: rework only_used_in_recursion and move it back to complexity
clippy: transmute_undefined_repr fix
clippy: check for if-some-or-ok-else-none-or-err
clippy: Do not lint needless_collect if the target code is inside a loop
clippy: suggest map_or in case_sensitive_file_extension_comparisons
clippy: unwrap_used and expect_used: trigger on uses of their _err variants
rust-analyzer: consider bounds on inherent impl in method resolution
rust-analyzer: implement IntoFuture type inference
rust-analyzer: implement lsp extension for cancelling running flychecks
rust-analyzer: log rustfmt parsing errors as warnings
rust-analyzer: pop an error notification when flycheck can't be restarted
rust-analyzer: add a setting for keyword hover popups
rust-analyzer: add an assist for inlining all type alias uses
rust-analyzer: generate static method using Self::assoc() syntax
rust-analyzer: improved inline_call to replace Self
rust-analyzer: run test mod from anywhere in parent file
rust-analyzer: make trait assoc items become inactive due to cfg
rust-analyzer: fix panics on GATs involving const generics
rust-analyzer: escape keywords used as names in earlier editions
rust-analyzer: record completion filtering
rust-analyzer: resolve associated types of bare dyn types
rust-analyzer: resolve path Self alone in value namespace
tidy: check fluent files for style
Rust Compiler Performance Triage
Overall some really impressive wins this week. Note in particular PR #100209, "Lazily decode SourceFile from metadata" (which improved 75 primary benchmark scenarios and 158 secondary scenarios) and PR #98655 "Don't derive PartialEq::ne", which improved 65 primary scenarios and 27 secondary scenarios). There were a few cases that pnkfelix explicitly decided not to mark as triaged; see report for more details there. Also pnkfelix wonders if there is a recent slight-upward trend on max-rss for the past week, see the summary graph
Triage done by @pnkfelix. Revision range: 14a459bf..4a24f08b
Summary:
(instructions:u) mean range count Regressions â (primary) 0.6% [0.4%, 0.8%] 27 Regressions â (secondary) 0.4% [0.2%, 0.6%] 9 Improvements â
(primary) -1.7% [-20.1%, -0.3%] 91 Improvements â
(secondary) -3.6% [-18.7%, -0.3%] 160 All ââ
(primary) -1.2% [-20.1%, 0.8%] 118
3 Regressions, 4 Improvements, 4 Mixed; 3 of them in rollups 43 artifact comparisons made in total
Full report
Call for Testing
An important step for RFC implementation is for people to experiment with the implementation and give feedback, especially before stabilization. The following RFCs would benefit from user testing before moving forward:
No RFCs issued a call for testing this week.
If you are a feature implementer and would like your RFC to appear on the above list, add the new call-for-testing label to your RFC along with a comment providing testing instructions and/or guidance on which aspect(s) of the feature need testing.
Approved RFCs
Changes to Rust follow the Rust RFC (request for comments) process. These are the RFCs that were approved for implementation this week:
No RFCs were approved this week.
Final Comment Period
Every week, the team announces the 'final comment period' for RFCs and key PRs which are reaching a decision. Express your opinions now.
RFCs
No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
[disposition: merge] Register wf obligation before normalizing in wfcheck
[disposition: merge] Partially stabilize bound_as_ref by stabilizing Bound::as_ref
[disposition: merge] Document NonZeroXxx layout guarantees
[disposition: merge] Strengthen invalid_value lint to forbid uninit primitives, adjust docs to say that's UB
[disposition: merge] Make forward compatibility lint deprecated_cfg_attr_crate_type_name deny by default
New and Updated RFCs
[new] RFC: Statics in patterns
Upcoming Events
Rusty Events between 2022-08-24 - 2022-09-21 đŠ
Virtual
2022-08-24 | Virtual (Beijing, CN) | WebAssembly and Rust Meetup (Rustlang)
Tech Talk Live Appointment: Customize GitHub Workflow with Serverless Functions - How to use Rust and JavaScript to automate GitHub processes
2022-08-24 | Virtual + Wellington, NZ | Rust Wellington
Flywheel Edition: 3 talks on Rust!
2022-08-25 | Virtual (Karlsruhe, DE) | The Karlsruhe Functional Programmers Meetup Group
Stammtisch: together with the C++ UG KA; various topics, from C++ to Rust
2022-08-27 | Virtual (Bangalore, IN) | Polkadot India
Substrate Saturday - Bootcamp Series 2: Fundamentals of Rust & Substrate
2022-08-30 | Virtual (Berlin, DE) | OpenTechSchool Berlin
Rust Hack and Learn
2022-08-30 | Virtual + Dallas, TX, US | Dallas Rust
Last Tuesday
2022-09-01 | Virtual (PDT Timezone) | Conf42
Conf42: Rustlang 2022
2022-09-01 | Virtual | Google Open Source Live
Rust Day on Google Open Source Live
2022-09-02 | Virtual (NĂŒrnberg, DE) | Rust Nuremberg
Rust Nuremberg Get Together
2022-09-03 | Virtual (Bangalore, IN) | Polkadot India
Substrate Saturday - Bootcamp Series 2: Fundamentals of Rust & Substrate
2022-09-03 | Virtual (NĂŒrnberg, DE) | Rust Nuremberg
Deep Dive Session 1: Tokio my-redis Tutorial
2022-09-04 | Virtual (Seattle, WA, US) | Seattle Rust Meetup
September Meetup
2022-09-06 | Virtual (Beijing, CN) | WebAssembly and Rust Meetup (Rustlang)
Monthly WasmEdge Community Meeting, a CNCF sandbox WebAssembly runtime
2022-09-06 | Virtual (Buffalo, NY, US) | Buffalo Rust Meetup
Buffalo Rust User Group, First Tuesdays
2022-09-07 | Virtual (Indianapolis, IN, US) | Indy Rust
Indy.rs - with Social Distancing
2022-09-10 | Virtual | Rust GameDev
Rust GameDev Monthly Meetup
2022-09-10 | Virtual (Bangalore, IN) | Polkadot India
Substrate Saturday - Bootcamp Series 2: Fundamentals of Rust & Substrate
2022-09-12 | Virtual + Dublin, IE | Linux Plumbers Conference
Rust Microconference in LPC 2022
2022-09-13 | Virtual + Dallas, TX, US | Dallas Rust
Second Tuesday
2022-09-13 | Virtual (Rostock, DE) | Altow Academy
Rust Meetup Rostock
2022-09-14 | Virtual (Malaysia)| Golang Malaysia
Rust Meetup September 2022
2022-09-15 | Virtual (Columbus, OH, US) | GDG Columbus
Past, Present, and Future of Internet Money! (Custom tokenomics, RUST and CosmWASM library...)
2022-09-20 | Virtual (Washington, DC, US) | Rust DC
Mid-month Rustful
2022-09-21 | Virtual (Vancouver, BC, CA) | Vancouver Rust
Rust Study/Hack/Hang-out (Call for Participation)
Europe
2022-08-25 | Copenhagen, DK | Copenhagen Rust group
CPH Hack Night #28
2022-08-25 | Stockholm, SE | StockholmCpp
0x21: Learning from Rust, Typical C++
2022-08-30 | Utrecht, NL | Rust Nederland
Run Rust Anywhere
2022-09-12 | Dublin, IE + Virtual | Linux Plumbers Conference
Rust Microconference in LPC 2022
North America
2022-08-23 | Toronto, ON, CA | Rust Toronto
WebAssembly plugins in Rust
2022-08-25 | Ciudad de México, MX | Rust MX
Concurrencia & paralelismo con Rust
2022-08-25 | Lehi, UT, US | Utah Rust
Using Github Actions to Deploy Cargo Crates with Jordan and Food!
2022-08-31 | New York, NY, US | Rust NYC
August Meetup: Rewriting a high performance Vector Database in Rust.
Oceania
2022-08-24 | Wellington, NZ + Virtual | Rust Wellington
Flywheel Edition: 3 talks on Rust!
2022-08-26 | Melbourne, VIC, AU | Rust Melbourne
August 2022 Meetup
If you are running a Rust event please add it to the calendar to get it mentioned here. Please remember to add a link to the event too. Email the Rust Community Team for access.
Jobs
Please see the latest Who's Hiring thread on r/rust
Quote of the Week
A fast executing language that crashes all the time is like a supercar⊠that crashes all the time.
â Tris on youtube
Thanks to scottmcm for the suggestion!
Please submit quotes and vote for next week!
This Week in Rust is edited by: nellshamrell, llogiq, cdmistman, ericseppanen, extrawurst, andrewpollack, U007D, kolharsam, joelmarcey, mariannegoldin.
Email list hosting is sponsored by The Rust Foundation
Discuss on r/rust
0 notes
Photo

VAR vs LET vs CONST A little reminder of how and when to use the right data container! #javascript #html #programming #css #coding #java #python #developer #programmer #webdeveloper #webdevelopment #code #coder #php #webdesign #software #softwaredeveloper #computerscience #codinglife #reactjs #technology #frontend #development #programmers #js #web #softwareengineer #programmingmemes #linux #javascriptdeveloper https://www.instagram.com/p/CnRFZPGP2j8/?igshid=NGJjMDIxMWI=
#javascript#html#programming#css#coding#java#python#developer#programmer#webdeveloper#webdevelopment#code#coder#php#webdesign#software#softwaredeveloper#computerscience#codinglife#reactjs#technology#frontend#development#programmers#js#web#softwareengineer#programmingmemes#linux#javascriptdeveloper
5 notes
·
View notes
Text
Web development, just like any software development domain, requires you to stay updated always. At GeekyMinds, we help budding web developers in the same and much more geeky content.
#geekyminds#geekymindsblog#webdev#html#css#bootstrap#angular#react#javascript#javascript basics#javascript let const#javascript es6#typescript#ionic framework#ionic 4#php#web application#webdesign#website#webapps#web development
0 notes
Text
Configure default datetime format of Symfony Serializer DateTimeNormalizer
I know thatâs a mouthful of a title but it has just taken me forever to find out how to do this and hopefully this title will help some people to not run down the same rabbit holes.
By default the Symfony Serializer Component uses the built in DateTimeNormalizer. That will take a DateTime object (or anything that implements the interface, such as datetimeimmutable) and normalize it into a string. The default is given as DateTimeInterface::RFC3339 which produces output like 2005-08-15T15:52:01+00:00 for the normalized value. That is fine for most people but I needed a bit extra. Although the official RFC3339 supports milliseconds at least, in PHP itâs hidden behind the DateTimeInterface::RFC3339_EXTENDED constant, which then produces 2005-08-15T15:52:01.000+00:00 as an output. What if you want that or even go down to microseconds (6 decimals)? A lot of nothing is to be found everywhere on that topic. So I came up with my own.
Simply put, you just overwrite the default normalizers service definition with your own. This is from a Symfony 5.0.1 application and itâs in the root directory services.yaml file on the config folder. Order of loading things matters, so if it doesnât work for you, you might need to check when itâs getting loaded.
services:   serializer.normalizer.datetime:     class: 'Symfony\Component\Serializer\Normalizer\DateTimeNormalizer     arguments       -         !php/const Symfony\Component\Serializer\Normalizer\DateTimeNormalizer::FORMAT_KEY: 'Y-m-d\TH:i:s.uP'     tags:       - { name: serializer.normalizer, priority: -910 }
And thatâs it. The âY-m-d\TH:i:s.uPâ part is what you need to replace with your own pattern to have what you need. This will operate on every single date time though now, so if you need a more finegrained control on a per property basis, this will probably not be for you.
6 notes
·
View notes
Text
Sequentielle Suche mit FileMaker und PHP
Manchmal sind es nicht die groĂen Frameworks oder hochkomplexen API-Integrationen, die den Unterschied machen, sondern ein bewusst einfacher, robuster Ansatz, der sich nahtlos in vorhandene Workflows integriert. Genau das war der Ausgangspunkt fĂŒr eine kleine aber wirkungsvolle Lösung, die FileMaker mit einem PHP-basierten Webinterface verbindet â mit dem Ziel, eine sequentielle Suche ĂŒber eine gröĂere Datenmenge performant und flexibel umzusetzen. Das derzeitige Problem beim Kunden, vor Jahren habe ich eine Sequentielle Suche nativ in FileMaker umgesetzt. Die ĂŒbliche Vorgehensweise, ein Script sucht bei jedem Tastenanschlag, genutzt werden alle Felder die in der Schnellsuche eingeschlossen sind. Ăber die Jahre wuchs der Datenbestand, es wurden Felder innerhalb von Ausschnitten erfasst. Es musste so kommen, der Kunde konnte die Suche kaum mehr nutzen, tippen, warten, tippen. Sehr unschön und langsam. Dann kam mir im Zuge einer Listenansicht, in die ich eine Suche integriert habe, die Idee. FileMaker ĂŒbertrĂ€gt per -Aus URL einfĂŒgen- Tabellendaten an ein PHP-Script. Im WebViewer wird dann die Tabelle angezeigt, nebst einem Suchfeld. Also frisch ans Werk gemacht und schnell festgestellt, die Felder in Variablen zu verpacken, macht in der Menge keinen SpaĂ. Also das ganze per Schleife, Feldnamen holen, die Werte dazu sammeln. In Schleife, ist das gut machbar, aber trotzdem ein nicht unerheblicher Zeitaufwand. Dann eine Eingebung, exportiere die Tabelle und verarbeite die Daten direkt auf dem Server per PHP. Vorgehen: FileMaker exportiert eine strukturierte Datenmenge als CSV â diese Datei wird im Hintergrund automatisch an ein kleines PHP-Script ĂŒbermittelt. Dort wird sie interpretiert, analysiert und in einer visuellen OberflĂ€che dargestellt, ĂŒber die eine freie Volltextsuche möglich ist. Der Clou: Mit jedem Tastendruck wird die Ergebnisliste dynamisch reduziert â und bei Bedarf lassen sich ĂŒber die Enter-Taste direkt Projektnummern an ein FileMaker-Script zurĂŒckgeben, das dann wiederum die interne Detailansicht aktualisiert. Ganz ohne Datenbankabfragen im Webserver, ganz ohne MySQL, Redis oder externe Services. Die PHP-Logik bleibt dabei angenehm ĂŒberschaubar. Ein Beispiel fĂŒr das Parsen und Darstellen der Daten sieht so aus:
<?php $csvData = []; $data = file_get_contents("php://input"); if ($data && strlen($data) > 0) { $lines = preg_split('/\r\n|\r|\n/', $data); foreach ($lines as $line) { if (trim($line) !== "") { $csvData[] = str_getcsv($line, "\t"); // Tab-getrennt } } if (!empty($csvData) && empty(array_filter(end($csvData)))) { array_pop($csvData); } } $spaltenIndizes = range(0, count($csvData[0] ?? []) - 1); ?>
In der Darstellung im WebViewer werden alle DatensĂ€tze tabellarisch angezeigt. Der Clou kommt mit JavaScript: Dort wird bei jeder Eingabe automatisch geprĂŒft, welche Zeilen noch zum aktuellen Suchbegriff passen. ZusĂ€tzlich hebt ein kleiner Style-Block die passenden Zellen farblich hervor, um die Treffer visuell zu unterstĂŒtzen. Und weil alles clientseitig passiert, bleibt es schnell â auch bei mehreren tausend EintrĂ€gen. Besonders elegant wirkt die Integration in FileMaker: Die Projektnummern der sichtbaren Zeilen werden bei einem Enter-Klick gesammelt und per fmp://-URL an ein FileMaker-Script ĂŒbergeben. Diese Direktverbindung ermöglicht, das Webinterface wie eine native Erweiterung der Datenbank zu nutzen â ohne Performanceverlust, ohne Redundanz, ohne HĂŒrden.
document.getElementById("searchInput").addEventListener("keypress", function(event) { if (event.key === "Enter") { event.preventDefault(); const rows = document.querySelectorAll("#csvTable tbody tr:not(.hide)"); const ids = []; rows.forEach(row => { const id = row.querySelectorAll("td")[0]?.textContent.trim(); // Erste Spalte = ID if (id) ids.push(id); }); if (ids.length > 0) { const param = encodeURIComponent(ids.join("|")); const url = `fmp://$/AVAGmbH?script=Projekt_LIST_Suche_PHP¶m=${param}`; window.location.href = url; } } });
Nach dem Klick, startet das FM-Script. Wir holen uns die ID,s nach ĂŒblicher Vorgangsweise und suchen in Schleife alle ID,s zusammen. In dem Zug, wird natĂŒrlich auch das Suchfenster in FileMaker geschlossen. Diese Form der sequentiellen Suche hat sich im Test als stabil und pflegeleicht erwiesen â gerade in Szenarien, in denen FileMaker allein bei umfangreichen DatensĂ€tzen an die Grenzen kommt, etwa bei mehrdimensionalen Suchen ĂŒber unstrukturierte Felder oder bei extern generierten Listen. Und auch wenn es kein High-End-AI-Suchcluster ist: Die Lösung hat Charme. Weil sie genau das tut, was sie soll. Weil sie den Workflow nicht verbiegt, sondern erweitert. Und weil sie etwas bietet, das man oft zu selten hat: unmittelbare RĂŒckmeldung und Kontrolle ĂŒber den gesamten Prozess. Jetzt wird nur noch ein wenig mit CSS das ganze verschönt, dann kann der Kunde damit arbeiten.
0 notes
Note
Hi Midge! Anon who asked about the careers and the newspaper. I was able to follow your instructions for the newspaper and it worked, kinda, lol. I wanted to change the number of jobs offered to 5 and while 5 do come up, the first job offered comes up 3 times (1st, 2nd, & 4th). Is there a way to make it so that the jobs don't repeat or did I edit the wrong line? (I edited 0x16 (22): [prim 0x0002] Expression (Local 0x0002 := Literal 0x0003). I appreciate your help and any advice you can give!
Hi again Midge; anon who asked about the paper. Sorry to bother you but I did further research on my newspaper issue (www(.)modthesims(.)info/showthread(.)php?p=5202387#post5202387) and it looks like the number of jobs offered is hard coded. So my new question is would it be possible to create a new, local token that overrides this, that the paper can then choose from? Idk anything about tokens so any insight would be appreciated.
Ah, I see! After looking into it myself I think that MTS thread is inaccurate, though. For one, you donât need a token for this. Extract the OBJD and in the raw data increase ânum attributesâ by 6 (to 1b in hexadecimal or 27 in decimal). Now attribute 0x0015 and 0x0016 will be the 4th and 5th adult jobs, 0x0017 and 0x0018 will be teen jobs, 0x0019 and 0x001a will be pet jobs. Thereâs three BHAVs, âSub - Set Daily Jobsâ, âSub - Set Daily Pet Jobsâ, and âSub - Set Daily Teen/Elder Jobsâ which now need to be expanded to set the new attributes; make sure in the beginning when it sets the first two job attributes equal to 0 it sets the first four, and then essentially make two more loops: first count the available jobs, check if the returned value is greater than the number of jobs youâve already set, get a random job, make sure the returned value isnât zero or equal to any of the already-set jobs; otherwise, go find another random job. Once a suitable job has been found, set the next job attribute to that job. Finally, edit âoffer jobâ, âoffer pet jobâ, and âoffer teen/elder jobâ: currently if Param 0x0001 != Literal 0x0003 and Param 0x0001 != Literal 0x0002 it defaults to the same job offer, so you need to add two more checks of Param 0x0001 (if itâs literal 5 or literal 4) and if itâs literal 5 set the stack object id to the first of the new attributes for that job type, if itâs literal 4 set it to the other.
If you want to save some time by not having to worry about pets/teens, you can go back to the âReadâ BHAV and have it set local 2 to 5 only if local 4 == Const 0x0106:0x20 (âJobDataâ Value: 0x0020), or maybe if you want all human sims to get 5 offers but pets only need 3 set local 2 to 5 only if local 4 != Const 0x016C:0x1B (âJobData - Petsâ Value: 0x009B). If whatever conditions you pick arenât satisfied, set local 2 to the original value of 3. You can ignore the two BHAVs for the jobtypes where local 2 gets sets to 3, and only increase the number of attributes by 2 x the number of types of jobs that get 5 offers.
Also worth noting extracting the OBJD means the object gets a custom star. You can always put it in the game install files (eg. your bins folder) to remove it.
Feel free to message me again if you need elaboration/clarification!
3 notes
·
View notes
Text
Creating a Full-Stack Web Application with React JS and Python Flask

React Native is a popular framework for building cross-platform mobile apps using JavaScript and React. It allows developers to create high-quality, performant mobile apps that work on both iOS and Android platforms. Python Django is a powerful web framework that can be used to build RESTful APIs that can be used by mobile apps.
In this article, we will walk through the process of building a React Native mobile app that communicates with a Python Django API.
Step 1: Set up the Django API
The first step is to create the Django API that our mobile app will communicate with. To do this, we'll need to create a new Django project and add a new app to it.
First, install Django by running the following command:
pip install django
Next, create a new Django project by running the following command:
django-admin startproject my project
This will create a new Django project called myproject. Next, create a new app called api by running the following command:
bash
cd myproject
python manage.py startapp api
This will create a new app called api inside the myproject project.
Next, open the settings.py file in the myproject folder and add the api app to the INSTALLED_APPS list:
css
INSTALLED_APPS = [  ...  'api',]
Now, open the urls.py file in the myproject folder and add the following code:
php
from django.urls import include, path
urlpatterns = [
    path('api/', include('api.urls')),
]
This code creates a new URL pattern that maps to the api app.
Now, create a new file called urls.py in the api folder and add the following code:
python
from django.urls import path
from . import views
urlpatterns = [
    path('hello/', views.hello),
]
This code creates a new URL pattern that maps to a new view called hello.
Finally, create a new file called views.py in the api folder and add the following code:
python
from django.http import JsonResponse
def hello(request):
    return JsonResponse({'message': 'Hello from Django!'})
This code creates a new view that returns a JSON response with the message "Hello from Django!".
Now, start the Django development server by running the following command:
python manage.py runserver
This will start the development server on http://localhost:8000. If you navigate to http://localhost:8000/api/hello/ in your web browser, you should see the message "Hello from Django!". If you're looking for training in react native, then you can check out our react native course in Bangalore.
Step 2: Set up the React Native app
The next step is to set up the React Native app that will communicate with the Django API. To do this, we'll need to create a new React Native app using the expo-cli command line tool.
First, install the expo-cli tool by running the following command:
npm install -g expo-cli
Next, create a new React Native app by running the following command:
csharp
expo init myapp
This will create a new React Native app called myapp. Choose the "blank" template when prompted.
Next, install the axios library, which we'll use to make API requests, by running the following command:
Copy code
npm install axios
Finally, open the App.js file in the myapp folder and replace the existing code with the following:
python
Copy code
import React, { useEffect, useState } from 'react';
import {
import { StyleSheet, Text, View } from 'react-native';
import axios from 'axios';
export default function App() {
const [message, setMessage] = useState('');
useEffect(() => {
axios.get('http://localhost:8000/api/hello/')
.then(response => {
setMessage(response.data.message);
})
.catch(error => {
console.log(error);
});
}, []);
return (
<View style={styles.container}>
<Text>{message}</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
vbnet
Copy code
This code imports the necessary libraries, sets up a state variable called `message`, and makes an API request to the Django server using the `axios` library. The `useEffect` hook is used to make the API request when the component is mounted, and the response is used to update the `message` state variable. Finally, the `message` variable is displayed in the app. If you're looking for training in python, then you can check out our Python course in Bangalore.
Now, start the Expo development server by running the following command:
expo start
vb net
Copy code
This will start the Expo development server on `http://localhost:19002`. You can then run the app on your mobile device using the Expo app or on an emulator using the options provided on the development server page.
Conclusion
In this article, we walked through the process of building a React Native mobile app that communicates with a Python Django API. We created a new Django project and app, set up a new view to return a JSON response, and used the `axios` library to make API requests from our React Native app. By following these steps, you can build powerful mobile apps that communicate with a Python backend using the Django web framework.
In conclusion, building a React Native mobile app that communicates with a Python Django API is a powerful way to create cross-platform mobile applications. React Native offers a simple and efficient way to build mobile applications that work across multiple platforms, while Python and Django provide a flexible and robust backend that can handle complex data processing and business logic. By combining these two technologies, developers can create high-performance mobile apps with a powerful backend API. If you're looking for training in react JS, then you can check out our React JS course in Bangalore.
In this article, we covered the basics of setting up a Python Django API, creating a view to return JSON data, and building a React Native mobile app that communicates with the API. By following these steps, developers can build powerful, cross-platform mobile apps that can handle complex data and business logic. With the power of Python and Django on the backend and React Native on the frontend, the possibilities for mobile app development are endless.
0 notes
Text
How To Integrate Google Maps in Laravel
A number of ways are available through the Google Maps JavaScript API to build maps for web applications. We will incorporate Google Maps into the Laravel project step-by-step in this tutorial.
Create a new Laravel project
composer create-project laravel/laravel laravel-google-maps
Create a view and add the following code
resources/views/map.blade.php
Laravel Google Maps
It's important to remember to change your Google API Key. Markers can be simply added and removed. Additionally, you can add more characteristics to the marker object based on your needs. - Add a marker const marker = new google.maps.Marker({ position: { lat: 28.625043, lng: 79.810135 }, label: { color: "white", text: "P4" }, draggable: true, map }); markers.push(marker); 2. Remove a marker Remove P4 marker const index = markers.findIndex(marker => marker.label.text == "P4"); if(index != -1) { markers.setMap(null); markers.splice(index, 1); } 3. Update marker properties Update P4 marker const index = markers.findIndex(marker => marker.label.text == "P4"); if(index != -1) { markers.setOptions({ ...markers, position: { lat: 28.625043, lng: 79.810135 } }); } Set marker properties using setOptions(options). Set the marker position using setPosition(latlng). Set a marker label with setLabel(label). show/hide a marker by using setVisible(boolean).
Create a controller and add the following code
php artisan make:controller MapController Read the full article
0 notes
Text
Experience in Using Synchrotron Radiation for Structural Researches of Biological Systems- Crimson Publishers
Experience in Using Synchrotron Radiation for Structural Researches of Biological Systems by Korneev VN in Integrative Journal of Conference Proceedings
Studying the structural mechanism of the functional activity of biological systems, an important role belongs to the instrumental and methodical developments intended for the energy-dispersive (Î=const) and monochromatic (λ=const) diffractometry using Synchrotron Radiation (SR). To solve the problems of structural biology of tissues, the SR of two Russian centers of collective use-the Siberian and Moscow regions-was used. X-ray stations were created on beam-lines of storage ring VEPP-3 (SCSTR, Novosibirsk) and Siberia-2 (NRC «Kurchatov Institute», Moscow). Experimental techniques and research methods were intended for the following experiments: the study of the structure and structural dynamics of cross-striated skeletal muscle; the structural study of epithelial tissue samples in normal and pathological conditions; the study of natural and engineering silk constructions, as well as the effect of high-frequency electrosurgical welding (HF-welding) on biological tissues.
Read more articles in our site:Â https://crimsonpublishers.com/icp/fulltext/ICP.000545.php
For more articles in our journal click on:Â https://crimsonpublishers.com/icp/index.php
0 notes