This document contains PHP code for generating Excel files, CSV files, and file archives from report data. It includes classes for connecting to databases and retrieving report information and data. The code processes report parameters, loops through entities to generate individual files, then zips the files together. Styles and headers are applied to the Excel files before saving.
This document compares several machine learning algorithms for a binary classification problem using a census dataset:
1. It builds logistic regression, decision tree, random forest, and boosted tree models on a 80% training set and evaluates their performance on a 10% test set.
2. Tuning is performed on decision tree and random forest models which improves their AUC.
3. The best performing models are boosted trees with an AUC of 0.922 and logistic regression with an AUC of 0.91, as evaluated on the held-out test set.
This document defines functions for tracking events and sending data to a server. It creates a TrackingQueue class that stores events in a queue and sends them to the server in batches. It also defines functions for adding events to the queue, serializing the event data, and making requests to the server.
The document contains PHP code for analyzing images and text. It includes functions for segmenting images into pixels and detecting edges, backgrounds, and object outlines. It also includes functions for parsing text into words and sentences, looking up word types in dictionaries, and checking grammar patterns. The goal is to interpret images and text, recognize objects in images, and generate sentences with missing words that can be named based on the images.
This document defines functions for handling JSONP requests and interactions with slide bands in a slide presentation. It includes functions for making JSONP requests, handling callbacks, summarizing responses, and tracking errors. It also defines an object for interacting with slide bands that allows clicking bands to navigate between slides and tracking those interactions.
The document defines a fib function that recursively calculates Fibonacci numbers and prints the 10th Fibonacci number. It then defines some unit tests for a Calculator class that test the add method by asserting the expected result. Finally, it defines some unit tests for a User class that test validating a user object.
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
As present at FluentConf 2014 on March 11th, 2014.
AngularJS is one of the most popular, and powerful, JavaScript frameworks for building rich client-side applications. AngularJS is both simultaneously both simple to use and extremely full featured. With AngularJS a little goes a long way, but to make the most of it, you need to know what you’re doing.
In this workshop we will build a complex application to help exercise all of the salient points of the AngularJS framework.
Topics covered include, ngResource, directives, fitlers, routing, templates, controllers, testing, and more.
Code can be found at: https://github.com/markbates/fluent-2014
This document compares several machine learning algorithms for a binary classification problem using a census dataset:
1. It builds logistic regression, decision tree, random forest, and boosted tree models on a 80% training set and evaluates their performance on a 10% test set.
2. Tuning is performed on decision tree and random forest models which improves their AUC.
3. The best performing models are boosted trees with an AUC of 0.922 and logistic regression with an AUC of 0.91, as evaluated on the held-out test set.
This document defines functions for tracking events and sending data to a server. It creates a TrackingQueue class that stores events in a queue and sends them to the server in batches. It also defines functions for adding events to the queue, serializing the event data, and making requests to the server.
The document contains PHP code for analyzing images and text. It includes functions for segmenting images into pixels and detecting edges, backgrounds, and object outlines. It also includes functions for parsing text into words and sentences, looking up word types in dictionaries, and checking grammar patterns. The goal is to interpret images and text, recognize objects in images, and generate sentences with missing words that can be named based on the images.
This document defines functions for handling JSONP requests and interactions with slide bands in a slide presentation. It includes functions for making JSONP requests, handling callbacks, summarizing responses, and tracking errors. It also defines an object for interacting with slide bands that allows clicking bands to navigate between slides and tracking those interactions.
The document defines a fib function that recursively calculates Fibonacci numbers and prints the 10th Fibonacci number. It then defines some unit tests for a Calculator class that test the add method by asserting the expected result. Finally, it defines some unit tests for a User class that test validating a user object.
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
As present at FluentConf 2014 on March 11th, 2014.
AngularJS is one of the most popular, and powerful, JavaScript frameworks for building rich client-side applications. AngularJS is both simultaneously both simple to use and extremely full featured. With AngularJS a little goes a long way, but to make the most of it, you need to know what you’re doing.
In this workshop we will build a complex application to help exercise all of the salient points of the AngularJS framework.
Topics covered include, ngResource, directives, fitlers, routing, templates, controllers, testing, and more.
Code can be found at: https://github.com/markbates/fluent-2014
This document provides information on programming with HDInsight including important port numbers, using WebHDFS and WebHCat to interact with HDFS and Hive, running MapReduce jobs with .NET, and using Mahout for machine learning tasks like classification, clustering, and collaborative filtering recommendations.
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonfRafael Dohms
As developers we write code everyday, only to frown at it a week after that. Why do we have such a hard time with code written by others and ourselves, this raging desire to rewrite everything we see? Writing code that survives the test of time and self judgment is a matter of clarity and simplicity. Let's talk about growing, learning and improving our code with calisthenics, readability and good design.
This document provides an overview of an AngularJS application for ordering food delivery. It describes the key components including modules, routes, controllers, services, and views. It also discusses how AngularJS promotes testability through features like dependency injection and separation of concerns. Unit testing is demonstrated with a sample Jasmine test of the DeliveryInfoCtrl controller.
This presentation will introduce AJAX in Grails through the GrailsUI plugin. We'll start with the core concepts behind the plugin and give examples of the most widely used and interesting widgets GrailsUI
provides.
Some examples will include methods of interacting with the widgets and handling events. We will also talk about how to provide proper JSON data to the widgets from the server.
Zend_Db is a component of the Zend Framework that provides database abstraction functionality. It includes Zend_Db_Adapter which connects to databases and Zend_Db_Table which provides data access objects and row/rowset functionality to work with database tables. Zend_Db_Table allows selecting, inserting, updating data using row objects and rowsets which can be iterated over or converted to arrays. Relationships between tables can also be represented using row methods.
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...Rafael Dohms
The document provides advice and best practices for writing code that lasts over time. It discusses improving code through practices like making it more comprehensible, flexible, tested, and refactorable. Specific techniques mentioned include object calisthenics exercises like limiting indentation levels and instance variables, using first class collections, and avoiding getters/setters. The document emphasizes continuously improving code through practices like reading and sharing code with others.
The document discusses jQuery and event-driven JavaScript. It includes an introduction to jQuery and covers topics like DOM manipulation, events, effects, AJAX, and jQuery plugins. It also discusses using jQuery with Rails applications and integrating jQuery with Ajax functionality in Rails.
CS442 - Rogue: A Scala DSL for MongoDBjorgeortiz85
Talk at Stanford's CS442 (High Productivity and Performance with Domain Specific Languages in Scala http://www.stanford.edu/class/cs442/), on Rogue. 5/24/2011
Your code sucks, let's fix it - PHP Master Series 2012Rafael Dohms
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
This C function sets dynamic titles for Oracle database monitoring reports. It takes a case number as input and uses a switch statement to return the appropriate title as a string. There are over 50 different case options that map monitoring statistics like "Oracle Version", "Active Parameters", "Datafile I/O", "Wait Events", and "SQL Area CPU Usage" to static title strings. The titles are returned in a character array for use in reporting interfaces.
This presentation was given at DevFest Twin Cities in 2013, and introduces droidQuery - the Android port of jQuery, that allows UI manipulation and traversal of the Android layout, asynchronous REST client calls, event handling, animations, and much more.
How well do you know the API tools Joomla! 3 has to offer to developers? Take the guided tour with an experienced Joomla! developer and long-time contributor.
Яків Крамаренко “Локатори і з чим їх їдять:)”Dakiry
This document discusses refactoring locators in test automation. It provides examples of refactoring locators from redundant or fragile XPath locators to more stable and maintainable CSS locators. Some key points discussed include using the most readable locators that are also stable and avoid issues like redundancy or being too strict or fragile. It also touches on balancing strict vs weaker locators, consistency, abstraction levels, and different approaches like CSS vs generated locators. The document advocates that best practices depend on the context and aims to provide food for thought around locator strategies.
This document provides an introduction to advanced caching methods in WordPress, including the Transients API and Object Cache API. It explains that Transients store temporary data with expiration times, either in the database or memory if a caching backend is available. Object Cache non-persistently stores data in memory by default. Examples are given showing how to use Transients to cache fragmented data like navigation menus or remote data from APIs. Best practices are outlined like refreshing caches only when data changes and using cache failures gracefully.
Your code sucks, let's fix it (CakeFest2012)Rafael Dohms
The document discusses object calisthenics and code readability. It introduces object calisthenics as a set of simple, rhythmical exercises to achieve better object-oriented design and code quality. Some specific object calisthenics rules are presented, such as having only one indentation level per method to improve readability. The document also provides an example of refactoring code based on these principles to make it more readable and maintainable.
This document discusses using a Raspberry Pi to log temperature and humidity readings and display the data in a graph on a WordPress site. It describes creating a custom post type to store fever log entries, registering REST API routes to log readings and retrieve the history, and using a Python script and crontab to automatically log readings. JavaScript and CSS are used to display a graph of the fever readings on the WordPress site.
This document summarizes the Database API for Drupal 6 and 7. It provides examples of how to perform common SQL queries like SELECT, INSERT, UPDATE, and DELETE using both the procedural and object-oriented database abstraction layers. Key differences are highlighted, such as how placeholders are handled and the introduction of a query builder interface in Drupal 7.
This document contains code snippets for connecting to and extracting information from various data sources and applications using PHP, including:
1. Connecting to Microsoft Word and extracting the subject text from a document.
2. Retrieving thumbnail images from Adobe Lightroom files.
3. Accessing elevation data from SRTM files by calculating file offsets.
4. Sending SNMP traps containing error information from a RADIUS monitoring script.
5. Connecting to an Avaya OSSIS system using telnet and extracting field data.
The following illustrates some of the common security challanges Node.js developers are up against. The presentation covers various types of JavaScript-related hacks and NoSQL injection hacking via Express and MongoDB.
This document provides information on programming with HDInsight including important port numbers, using WebHDFS and WebHCat to interact with HDFS and Hive, running MapReduce jobs with .NET, and using Mahout for machine learning tasks like classification, clustering, and collaborative filtering recommendations.
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonfRafael Dohms
As developers we write code everyday, only to frown at it a week after that. Why do we have such a hard time with code written by others and ourselves, this raging desire to rewrite everything we see? Writing code that survives the test of time and self judgment is a matter of clarity and simplicity. Let's talk about growing, learning and improving our code with calisthenics, readability and good design.
This document provides an overview of an AngularJS application for ordering food delivery. It describes the key components including modules, routes, controllers, services, and views. It also discusses how AngularJS promotes testability through features like dependency injection and separation of concerns. Unit testing is demonstrated with a sample Jasmine test of the DeliveryInfoCtrl controller.
This presentation will introduce AJAX in Grails through the GrailsUI plugin. We'll start with the core concepts behind the plugin and give examples of the most widely used and interesting widgets GrailsUI
provides.
Some examples will include methods of interacting with the widgets and handling events. We will also talk about how to provide proper JSON data to the widgets from the server.
Zend_Db is a component of the Zend Framework that provides database abstraction functionality. It includes Zend_Db_Adapter which connects to databases and Zend_Db_Table which provides data access objects and row/rowset functionality to work with database tables. Zend_Db_Table allows selecting, inserting, updating data using row objects and rowsets which can be iterated over or converted to arrays. Relationships between tables can also be represented using row methods.
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...Rafael Dohms
The document provides advice and best practices for writing code that lasts over time. It discusses improving code through practices like making it more comprehensible, flexible, tested, and refactorable. Specific techniques mentioned include object calisthenics exercises like limiting indentation levels and instance variables, using first class collections, and avoiding getters/setters. The document emphasizes continuously improving code through practices like reading and sharing code with others.
The document discusses jQuery and event-driven JavaScript. It includes an introduction to jQuery and covers topics like DOM manipulation, events, effects, AJAX, and jQuery plugins. It also discusses using jQuery with Rails applications and integrating jQuery with Ajax functionality in Rails.
CS442 - Rogue: A Scala DSL for MongoDBjorgeortiz85
Talk at Stanford's CS442 (High Productivity and Performance with Domain Specific Languages in Scala http://www.stanford.edu/class/cs442/), on Rogue. 5/24/2011
Your code sucks, let's fix it - PHP Master Series 2012Rafael Dohms
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
This C function sets dynamic titles for Oracle database monitoring reports. It takes a case number as input and uses a switch statement to return the appropriate title as a string. There are over 50 different case options that map monitoring statistics like "Oracle Version", "Active Parameters", "Datafile I/O", "Wait Events", and "SQL Area CPU Usage" to static title strings. The titles are returned in a character array for use in reporting interfaces.
This presentation was given at DevFest Twin Cities in 2013, and introduces droidQuery - the Android port of jQuery, that allows UI manipulation and traversal of the Android layout, asynchronous REST client calls, event handling, animations, and much more.
How well do you know the API tools Joomla! 3 has to offer to developers? Take the guided tour with an experienced Joomla! developer and long-time contributor.
Яків Крамаренко “Локатори і з чим їх їдять:)”Dakiry
This document discusses refactoring locators in test automation. It provides examples of refactoring locators from redundant or fragile XPath locators to more stable and maintainable CSS locators. Some key points discussed include using the most readable locators that are also stable and avoid issues like redundancy or being too strict or fragile. It also touches on balancing strict vs weaker locators, consistency, abstraction levels, and different approaches like CSS vs generated locators. The document advocates that best practices depend on the context and aims to provide food for thought around locator strategies.
This document provides an introduction to advanced caching methods in WordPress, including the Transients API and Object Cache API. It explains that Transients store temporary data with expiration times, either in the database or memory if a caching backend is available. Object Cache non-persistently stores data in memory by default. Examples are given showing how to use Transients to cache fragmented data like navigation menus or remote data from APIs. Best practices are outlined like refreshing caches only when data changes and using cache failures gracefully.
Your code sucks, let's fix it (CakeFest2012)Rafael Dohms
The document discusses object calisthenics and code readability. It introduces object calisthenics as a set of simple, rhythmical exercises to achieve better object-oriented design and code quality. Some specific object calisthenics rules are presented, such as having only one indentation level per method to improve readability. The document also provides an example of refactoring code based on these principles to make it more readable and maintainable.
This document discusses using a Raspberry Pi to log temperature and humidity readings and display the data in a graph on a WordPress site. It describes creating a custom post type to store fever log entries, registering REST API routes to log readings and retrieve the history, and using a Python script and crontab to automatically log readings. JavaScript and CSS are used to display a graph of the fever readings on the WordPress site.
This document summarizes the Database API for Drupal 6 and 7. It provides examples of how to perform common SQL queries like SELECT, INSERT, UPDATE, and DELETE using both the procedural and object-oriented database abstraction layers. Key differences are highlighted, such as how placeholders are handled and the introduction of a query builder interface in Drupal 7.
This document contains code snippets for connecting to and extracting information from various data sources and applications using PHP, including:
1. Connecting to Microsoft Word and extracting the subject text from a document.
2. Retrieving thumbnail images from Adobe Lightroom files.
3. Accessing elevation data from SRTM files by calculating file offsets.
4. Sending SNMP traps containing error information from a RADIUS monitoring script.
5. Connecting to an Avaya OSSIS system using telnet and extracting field data.
The following illustrates some of the common security challanges Node.js developers are up against. The presentation covers various types of JavaScript-related hacks and NoSQL injection hacking via Express and MongoDB.
This document contains PHP code for a web application that demonstrates the Yahoo! Content Analysis API (CAS). The index.php file defines the overall page structure using frames. The left.php file contains a text input and form to select the CAS method. The form submits to test.php which calls the CAS API, parses the XML response, and displays the results.
The document describes a function that generates an HTML file containing contract details from a database, opens the file in a browser control, and provides print and close buttons. It defines styles, writes header and body tags to a new HTML file, loops through database records to write title and text fields, closes areas and the file, defines a dialog with browser and buttons, and activates the dialog.
- Propel is an ORM (object-relational mapper) for PHP that was started in 2005 and is based on concepts from Apache Torque.
- It uses code generation from XML schemas to quickly map database schemas to PHP classes.
- Propel supports various database backends including MySQL, PostgreSQL, SQLite, MSSQL, and Oracle. It uses inheritance mapping strategies like single table, class table, and concrete table inheritance.
This document describes how to use jQuery DataTables to dynamically display data from a MongoDB database. It includes code snippets for setting up the HTML table structure, initializing DataTables with JavaScript, and creating a Java servlet to retrieve data from MongoDB and return it in JSON format for population into the table. The servlet queries the MongoDB collection, converts the results to a JSON string, and returns it to the calling page to populate the DataTables initialization. This allows dynamic loading and display of tabular data from a MongoDB database into an HTML table using jQuery DataTables.
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...MongoDB
This document discusses analyzing flight data using MongoDB aggregation pipelines and visualization with JSON Studio. It provides examples of aggregation queries to group and calculate statistics on carriers, airports, routes and delays. These include finding the largest carriers, airports with most cancellations, carrier delay statistics, and hub airports. Visualizing the results in JSON Studio is recommended to explore the data further.
Introduction à CoffeeScript pour ParisRB jhchabran
This document provides an overview of CoffeeScript, highlighting some of its key features and benefits compared to JavaScript. It discusses CoffeeScript's lighter syntax, object literals, list comprehensions, and implicit returns. It also addresses some criticisms of CoffeeScript, such as concerns about it being "just JavaScript" or a "toy language." Overall, the document promotes CoffeeScript as a cleaner syntax for writing JavaScript code.
This document defines PHP functions and constants for handling communication channels, encryption, and command execution in a meterpreter payload. It initializes global variables, defines TLV constants, registers core commands, and provides functions for opening, reading/writing, and closing channels. It also includes functions for negotiating encryption, getting system information, and loading additional modules.
The document describes an online examination application that allows students to enter their details, answer multiple choice questions, and view their results and marks. It uses JSP to insert student data into a database, display the question form, and output the marks sheet. Validation is performed on the form entries before submission to check for empty fields or invalid data.
Ruby is amazing. It has a huge standard library and a core choc full of weird and wonderful things. In this talk, given at the Ipswich Ruby User Group, I give a whimsical nonstop tour through some of the more obscure parts of Ruby.
The document discusses PowerCMS, an open-source content management system. It provides code examples for common CMS tasks like template includes, conditionals, loops, and database operations. It also mentions PowerCMS X, the next version, and includes basic financial projections for PowerCMS Professional and Enterprise editions.
The document discusses the PowerCMS content management system and its templating features over multiple versions. It provides code examples of templating tags for variables, loops, and conditional logic across different versions of PowerCMS and other CMS platforms. It also references plans to release new editions of PowerCMS Professional and Enterprise in future quarters and years.
Presentation held at London XQuery Meetup in September 2011. In general, it shows how Web Scraping has naturally evolved towards XQuery. Additionally, it discusses different obstacles in scraping websites. A live example is shown as proof of solving these problems using XQuery.
The Ipsos - AI - Monitor 2024 Report.pdfSocial Samosa
According to Ipsos AI Monitor's 2024 report, 65% Indians said that products and services using AI have profoundly changed their daily life in the past 3-5 years.
The Building Blocks of QuestDB, a Time Series Databasejavier ramirez
Talk Delivered at Valencia Codes Meetup 2024-06.
Traditionally, databases have treated timestamps just as another data type. However, when performing real-time analytics, timestamps should be first class citizens and we need rich time semantics to get the most out of our data. We also need to deal with ever growing datasets while keeping performant, which is as fun as it sounds.
It is no wonder time-series databases are now more popular than ever before. Join me in this session to learn about the internal architecture and building blocks of QuestDB, an open source time-series database designed for speed. We will also review a history of some of the changes we have gone over the past two years to deal with late and unordered data, non-blocking writes, read-replicas, or faster batch ingestion.
Open Source Contributions to Postgres: The Basics POSETTE 2024ElizabethGarrettChri
Postgres is the most advanced open-source database in the world and it's supported by a community, not a single company. So how does this work? How does code actually get into Postgres? I recently had a patch submitted and committed and I want to share what I learned in that process. I’ll give you an overview of Postgres versions and how the underlying project codebase functions. I’ll also show you the process for submitting a patch and getting that tested and committed.
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Aggregage
This webinar will explore cutting-edge, less familiar but powerful experimentation methodologies which address well-known limitations of standard A/B Testing. Designed for data and product leaders, this session aims to inspire the embrace of innovative approaches and provide insights into the frontiers of experimentation!
End-to-end pipeline agility - Berlin Buzzwords 2024Lars Albertsson
We describe how we achieve high change agility in data engineering by eliminating the fear of breaking downstream data pipelines through end-to-end pipeline testing, and by using schema metaprogramming to safely eliminate boilerplate involved in changes that affect whole pipelines.
A quick poll on agility in changing pipelines from end to end indicated a huge span in capabilities. For the question "How long time does it take for all downstream pipelines to be adapted to an upstream change," the median response was 6 months, but some respondents could do it in less than a day. When quantitative data engineering differences between the best and worst are measured, the span is often 100x-1000x, sometimes even more.
A long time ago, we suffered at Spotify from fear of changing pipelines due to not knowing what the impact might be downstream. We made plans for a technical solution to test pipelines end-to-end to mitigate that fear, but the effort failed for cultural reasons. We eventually solved this challenge, but in a different context. In this presentation we will describe how we test full pipelines effectively by manipulating workflow orchestration, which enables us to make changes in pipelines without fear of breaking downstream.
Making schema changes that affect many jobs also involves a lot of toil and boilerplate. Using schema-on-read mitigates some of it, but has drawbacks since it makes it more difficult to detect errors early. We will describe how we have rejected this tradeoff by applying schema metaprogramming, eliminating boilerplate but keeping the protection of static typing, thereby further improving agility to quickly modify data pipelines without fear.
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeWalaa Eldin Moustafa
Dynamic policy enforcement is becoming an increasingly important topic in today’s world where data privacy and compliance is a top priority for companies, individuals, and regulators alike. In these slides, we discuss how LinkedIn implements a powerful dynamic policy enforcement engine, called ViewShift, and integrates it within its data lake. We show the query engine architecture and how catalog implementations can automatically route table resolutions to compliance-enforcing SQL views. Such views have a set of very interesting properties: (1) They are auto-generated from declarative data annotations. (2) They respect user-level consent and preferences (3) They are context-aware, encoding a different set of transformations for different use cases (4) They are portable; while the SQL logic is only implemented in one SQL dialect, it is accessible in all engines.
#SQL #Views #Privacy #Compliance #DataLake
Learn SQL from basic queries to Advance queriesmanishkhaire30
Dive into the world of data analysis with our comprehensive guide on mastering SQL! This presentation offers a practical approach to learning SQL, focusing on real-world applications and hands-on practice. Whether you're a beginner or looking to sharpen your skills, this guide provides the tools you need to extract, analyze, and interpret data effectively.
Key Highlights:
Foundations of SQL: Understand the basics of SQL, including data retrieval, filtering, and aggregation.
Advanced Queries: Learn to craft complex queries to uncover deep insights from your data.
Data Trends and Patterns: Discover how to identify and interpret trends and patterns in your datasets.
Practical Examples: Follow step-by-step examples to apply SQL techniques in real-world scenarios.
Actionable Insights: Gain the skills to derive actionable insights that drive informed decision-making.
Join us on this journey to enhance your data analysis capabilities and unlock the full potential of SQL. Perfect for data enthusiasts, analysts, and anyone eager to harness the power of data!
#DataAnalysis #SQL #LearningSQL #DataInsights #DataScience #Analytics
Analysis insight about a Flyball dog competition team's performanceroli9797
Insight of my analysis about a Flyball dog competition team's last year performance. Find more: https://github.com/rolandnagy-ds/flyball_race_analysis/tree/main
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...Social Samosa
The Modern Marketing Reckoner (MMR) is a comprehensive resource packed with POVs from 60+ industry leaders on how AI is transforming the 4 key pillars of marketing – product, place, price and promotions.
2. }
function makeTitle($title) {
if (strlen($title) > 30) {
$title = substr($title, 0, 27) . "...";
}
return $title;
}
?>
GENERADOR DE GRID:
<?php
require_once('../config.php');
require_once($CFG->dataroot . '/lib/com/repuce/bo/reportesBO.php');
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
$type = $_REQUEST['type']; // get the direction
$entidad = $_REQUEST['entidad_federativa'];
$params = $_REQUEST;
if(!$sidx) $sidx =1;
3. $bo = new reportesBO();
$theData = $bo->getData($page, $limit, $sidx, $sord,$type,$entidad, $params);
echo json_encode($theData);
?>
GENERADOR DE ARCHIVOS DE SOPORTE
<?php
set_time_limit(14400);
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('America/Mexico_City');
define('EOL', '<br />');
if (PHP_SAPI == 'cli')
die('This example should only be run from a Web Browser');
/** Include PHPExcel */
require_once '../lib/excel/PHPExcel.php';
require_once("../config.php");
require_once($CFG->dataroot . '/lib/com/repuce/dao/reportesSoporteDAO.php');
$params = $_REQUEST;
//echo var_dump($params);
$reporteDao = new reportesSoporteDAO($params["reportType"], $params);
$reportInfo = $reporteDao->getReportInfo();
7. deleteTmpFiles($CFG->dataroot . "/view/tmpDocs/", $fileNames);
}
break;
default:
$dataToreturn = new stdClass();
$dataToreturn->result = new stdClass();
$dataToreturn->result->estatus = false;
$dataToreturn->result->filename = "";
break;
}
echo json_encode($dataToreturn);
/* fin configuracion header** */
function titleToFileName($title) {
$title = str_replace(" ", "_", $title);
$title = makesafe($title);
return $title;
}
function makeTitle($title) {
if (strlen($title) > 30) {
$title = substr($title, 0, 27) . "...";
}
return $title;
}
function deleteTmpFiles($path, $files) {
foreach ($files as $file) {
//make sure the file exists
if (file_exists($path . $file)) {
unlink($path . $file);
}
}
}
function makesafe($cadena) {
$regex = array('#(.){2,}#', '#[^A-Za-z0-9._- ]#', '#^.#');
return preg_replace($regex, '', $cadena);
}
/**
*
* @param type $path
* @param type $files
* @param type $destination
* @param type $overwrite
* @return boolean
*/
function create_zip($path, $files = array(), $destination = '', $overwrite = false) {
//if the zip file already exists and overwrite is false, return false
if (file_exists($destination) && !$overwrite) {
return false;
}
//vars
$valid_files = array();
//if files were passed in...
8. if (is_array($files)) {
//cycle through each file
foreach ($files as $file) {
//make sure the file exists
if (file_exists($path . $file)) {
$valid_files[] = $file;
}
}
}
//if we have good files...
if (count($valid_files)) {
//create the archive
$zip = new ZipArchive();
if ($zip->open($destination, $overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !==
true) {
return false;
}
//add the files
foreach ($valid_files as $file) {
$zip->addFile($path . $file, $file);
} $zip->close();
//check to make sure the file exists
return file_exists($destination);
} else {
return false;
}
}
?
function createSupportFile() {
viewProgress();
$.getJSON('controller/support/1.php?' + $('#frmTempFilt').serialize(), function(data) {
closeProgress();
var strhtml = "";
if (data.result.estatus) {
strhtml += "Archivo de soporte documental generado con éxito.<br>";
strhtml += "<center><a style='text-decoration:underline;' href='" + data.result.filename + "'
target='_blank'>Presione aqui para decargarlo</a></center><br>";
}
else {
strhtml = "Ocurrio un error, inténtelo nuevamente."
}
viewAlert(strhtml);
});
}
GESTION DE BASE DE DATOS
<?php
/**
9. * Description of Abstract
*
* @author jopejimx
*/
class DaoAbstract {
var $link;
var $usuq;
/** Short description
* Este método se ejecuta al inicio de cada instanciamiento y abre la conexion a la base de datos
*/
public function __construct() {
$dbConfig = new DBconfig();
$this->link = mysqli_init();
mysqli_real_connect($this->link, $dbConfig->server, $dbConfig->username, $dbConfig->password,
$dbConfig->databasename, $dbConfig->port);
mysqli_set_charset($this->link, "utf8");
$this->throwExceptionOnError($this->link);
}
/** Short Description
* Este método se ejecuta al finalizar el ciclo de vida del objeto cerrando la conexion a la base de datos
*
*/
public function __destruct() {
mysqli_close($this->link);
}
/**
* Función publica que permite conectar a la base de datos y recuperar registros
* a partir de una consulta
*
* @param mysqli $link Link de conexion mysqli
* @param String $query Cadena con la consulta a ejecutar
* @param array $fieldList array con los nombre de los campos a consultar
* o null si no tiene
*/
public function getBySqlQuery(&$link, $query, $fieldNames) {
$sqlStatement = $query;
$stmt = mysqli_prepare($link, $sqlStatement);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
$rows = array();
$strBinResults = "mysqli_stmt_bind_result($stmt";
foreach ($fieldNames as $field) {
$strBinResults .= ", $row->" . $field;
}
$strBinResults .= ");";
eval($strBinResults);
$this->throwExceptionOnError();
while (mysqli_stmt_fetch($stmt)) {
$rows[] = $row;
$row = new stdClass();
eval($strBinResults);
}
10. mysqli_stmt_free_result($stmt);
//echo var_dump($rows);
if (count($rows) > 0) {
return $rows;
} else {
return null;
}
}
/**
* Utilidad para lanzar una exception si ocurre un error
* durante la ejecución de un comando de mysql
*/
public function throwExceptionOnError($link = null) {
if ($link == null) {
$link = $this->link;
}
if (mysqli_error($link)) {
$msg = mysqli_errno($link) . ": " . mysqli_error($link);
echo $msg;
throw new Exception('MySQL Error - ' . $msg);
}
}
}
?>
CONEXION A BASE DE DATOS
<?php
/**
* Class DBConfig
* Short Description
* Clase con los datos de configuración para la conexión con la base de datos
*
* @author LIA. José Pérez Jiménez
*/
class DBConfig {
//esta es la base de datos del ciclo escolar 2012 - 2013
// var $databasename = "repuce_campus_virtuales_com2";
//------------------------------------------------------
11. var $username = "repuce.campus-vi";
var $password = "r3puc3erk592lf78";
var $server = "localhost";
var $port = "3306";
var $databasename = "repuce_campus_virtuales_com2";
//var $databasename = "repuceindicadores02";
}
?>
CONFIGURACION DE GRIDS PARA REPORTES E INDICADORES:
<?php
require_once('DaoAbstract.php');
require_once('DBConfig.php');
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of dataGridDAO
*
* @author jopeji
*/
class dataGridConfDAO extends DaoAbstract {
//put your code here
/**
*
* @param type $type
* @return string
*/
public function getConfInfoReport1() { // Avance constitucion CEPS
$confInfo = new stdClass();
24. * Clase con los datos de configuración para la conexión con la base de datos
*
* @author LIA. José Pérez Jiménez
*/
class DBConfig {
// var $server = "localhost";
var $username = "root";
var $password = "4rtur0g4rz4";
// var $port = "3306";
//esta es la base de datos del ciclo escolar 2013 - 2014
//var $databasename = "conapase";
//------------------------------------------------------
//esta es la base de datos del ciclo escolar 2012 - 2013
// var $databasename = "repuce_campus_virtuales_com2";
//------------------------------------------------------
//var $username = "repuce.campus-vi";
//var $password = "r3puc3erk592lf78";
var $server = "localhost";
var $port = "3306";
var $databasename = "repuce_campus_virtuales_com2";
//var $databasename = "repuceindicadores02";
}
?>
public function getConfInfoReport12() { //Número de consejos que reportan recursos y distribución por fuente
$query = "SELECT
CONCAT('SUM(IF(c_recurso =',
c_recurso,
', 1, 0)) as f',
c_recurso) AS function,
CONCAT('f', c_recurso) AS fieldname,
IF(c_recurso = 0,
'Donación',
IF(c_recurso = 1,
'Rifa',
IF(c_recurso = 3, 'APF', ''))) AS colname
FROM
(SELECT DISTINCT
c_recurso
FROM
ce_recurso) AS final;";
$fieldNames = array("function", "fieldname", "colname");
$tipoProgs = $this->getBySqlQuery($this->link, $query, $fieldNames);
$confInfo = new stdClass();
30. $confInfo->hiddenVals = $hiddenVals;
$confInfo->formatters = $formatters;
$confInfo->formatoptions = $formatOptions;
$confInfo->colsToGraph = $colsToGraph;
$confInfo->colsToSummary = $colsToSummary;
$confInfo->colsToGraphNames = $colsToGraphNames;
$confInfo->functions = $functions;
$confInfo->xaxis = "ID";
$confInfo->yFormatString = "%d";
$confInfo->sortField = "ID";
$confInfo->sortorder = "desc";
$confInfo->idfield = "ID";
$confInfo->xangle = 0;
return $confInfo;
<?php
/**
* Class DBConfig
* Short Description
* Clase con los datos de configuración para la conexión con la base de datos
*
* @author LIA. José Pérez Jiménez
*/
class DBConfig {
// var $server = "localhost";
var $username = "root";
var $password = "4rtur0g4rz4";
// var $port = "3306";
//esta es la base de datos del ciclo escolar 2013 - 2014
//var $databasename = "conapase";
//------------------------------------------------------
//esta es la base de datos del ciclo escolar 2012 - 2013
// var $databasename = "repuce_campus_virtuales_com2";
//------------------------------------------------------
//var $username = "repuce.campus-vi";
//var $password = "r3puc3erk592lf78";
var $server = "localhost";
var $port = "3306";
var $databasename = "repuce_campus_virtuales_com2";
//var $databasename = "repuceindicadores02";
}
?> }*/
31. public function getConfInfoReport17() { // Porcentaje de CEPS que cumplieron las metas establecidas en
relación con la prueba ENLACE
$confInfo = new stdClass();
$confInfo->fieldNames = array("id_entidadfed", "nom_entidadfed","cumplieron");
$confInfo->colNames = array("ID", "Entidad", "Porcentaje cumplieron metas");
$confInfo->dataAligns = array("left", "left", "right");
$confInfo->sortables = array(false, true, true);
$confInfo->sortTypes = array("number", "text", "number");
$confInfo->hiddenVals = array(true, false, false);
$confInfo->formatters = array(null, null, "currency");
$confInfo->formatoptions = array(null, null,
array("decimalSeparator" => ".", "thousandsSeparator" => ",", "decimalPlaces" => 2, "defaulValue" =>
0, "suffix" => " %"));
$confInfo->colsToGraph = array("cumplieron");
$confInfo->colsToSummary = array("cumplieron");
$confInfo->colsToGraphNames = array("Porcentaje cumplieron metas");
$confInfo->xaxis = "nom_entidadfed";
$confInfo->yFormatString = "%d";
$confInfo->sortField = "id_entidadfed";
$confInfo->sortorder = "asc";
$confInfo->idfield = "id_entidadfed";
$confInfo->xangle = -45;
return $confInfo;
}
public function getConfInfoReport18() { // Porcentaje de CEPS que conocen el cumplimiento de la planeación
anual en su centro escolar
$confInfo = new stdClass();
$confInfo->fieldNames = array("id_entidadfed", "nom_entidadfed","cumplieron");
$confInfo->colNames = array("ID", "Entidad", "Porcentaje conocen planeación");
$confInfo->dataAligns = array("left", "left", "right");
$confInfo->sortables = array(false, true, true);
$confInfo->sortTypes = array("number", "text", "number");
$confInfo->hiddenVals = array(true, false, false);
$confInfo->formatters = array(null, null, "currency");
$confInfo->formatoptions = array(null, null,
array("decimalSeparator" => ".", "thousandsSeparator" => ",", "decimalPlaces" => 2, "defaulValue" =>
0, "suffix" => " %"));
$confInfo->colsToGraph = array("cumplieron");
$confInfo->colsToSummary = array("cumplieron");
$confInfo->colsToGraphNames = array("Porcentaje conocen planeación");
$confInfo->xaxis = "nom_entidadfed";
$confInfo->yFormatString = "%d";
$confInfo->sortField = "id_entidadfed";
$confInfo->sortorder = "asc";
$confInfo->idfield = "id_entidadfed";
$confInfo->xangle = -45;
return $confInfo;
}
public function getConfInfoReport19() { // Tasa de transparencia
$confInfo = new stdClass();