text
stringlengths
454
608k
url
stringlengths
17
896
dump
stringclasses
91 values
source
stringclasses
1 value
word_count
int64
101
114k
flesch_reading_ease
float64
50
104
Kaggle is hosting a contest where the task is to predict survival rates of people aboard the titanic. A train set is given with a label 1 or 0, denoting ‘survived’ or ‘died’. We are going to use Vowpal Wabbit to get a score of about 0.79426 AUC (top 10%). The contest In this Kaggle contest, they ask you to complete the analysis of what sorts of people were likely to survive. In particular, they ask you to apply the tools of machine learning to predict which passengers survived the tragedy. Under construction. Come back soon. Tutorials This Kaggle Getting Started Competition provides an ideal starting place for people who may not have a lot of experience in data science and machine learning. The data is highly structured and they provide 4 tutorials of increasing complexity. - Getting started with Excel - Getting started with Python - Getting started with Scikit random forests - Getting started with R Automated ML We take the approach we dubbed “Automated ML”. This means we are going to create a submission in under 1 hour and make heavy use of tools and multi-purpose scripts to keep this process as automatic and streamlined as possible. First we need to convert the .csv train and test file to a format that Vowpal Wabbit can deal with. Vowpal Wabbit allows for very human-readable data sets. Download the data sets for this competition and run the following script (perhaps changing the location/name of your train and test sets to match the script) import csv import re i = 0 def clean(s): return " ".join(re.findall(r'\w+', s,flags = re.UNICODE | re.LOCALE)).lower() with open("train_titanic.csv", "r") as infile, open("train_titanic.vw", "wb") as outfile: reader = csv.reader(infile) for line in reader: i+= 1 if i > 1: vw_line = "" if str(line[1]) == "1": vw_line += "1 '" else: vw_line += "-1 '" vw_line += str(line[0]) + " |f " vw_line += "passenger_class_"+str(line[2])+" " vw_line += "last_name_" + clean(line[3].split(",")[0]).replace(" ", "_") + " " vw_line += "title_" + clean(line[3].split(",")[1]).split()[0] + " " vw_line += "sex_" + clean(line[4]) + " " if len(str(line[5])) > 0: vw_line += "age:" + str(line[5]) + " " vw_line += "siblings_onboard:" + str(line[6]) + " " vw_line += "family_members_onboard:" + str(line[7]) + " " vw_line += "embarked_" + str(line[11]) + " " outfile.write(vw_line[:-1] + "\n") i = 0 with open("test_titanic.csv", "r") as infile, open("test_titanic.vw", "wb") as outfile: reader = csv.reader(infile) for line in reader: i+= 1 if i > 1: vw_line = "" vw_line += "1 '" vw_line += str(line[0]) + " |f " vw_line += "passenger_class_"+str(line[1])+" " vw_line += "last_name_" + clean(line[2].split(",")[0]).replace(" ", "_") + " " vw_line += "title_" + clean(line[2].split(",")[1]).split()[0] + " " vw_line += "sex_" + clean(line[3]) + " " if len(str(line[4])) > 0: vw_line += "age:" + str(line[4]) + " " vw_line += "siblings_onboard:" + str(line[5]) + " " vw_line += "family_members_onboard:" + str(line[6]) + " " vw_line += "embarked_" + str(line[10]) + " " outfile.write(vw_line[:-1] + "\n") This Python scripts turns .csv lines like: 1,0,3,"Braund, Mr. Owen Harris",male,22,1,0,A/5 21171,7.25,,S Into .vw (vowpal wabbit) lines like: -1 '1 |f passenger_class_3 last_name_braund title_mr sex_male age:22 siblings_onboard:1 family_members_onboard:0 embarked_S Vowpal Wabbit Download and install Vowpal Wabbit from the Github Repository. Then run Vowpal Wabbit with the following command: vw train_titanic.vw -f model.vw --binary --passes 20 -c -q ff --adaptive --normalized --l1 0.00000001 --l2 0.0000001 -b 24 This says to train a model (model.vw) on train_titanic.vw. As it is binary classification it is recommended to use the parameter --binary. Then we do 20 passes over our dataset, we create a cache file for this. We use quadratic features with -q ff, meaning we create feature pairs. We use adapative and normalized rules. Some l1 and l2 regularization to prevent over-fitting. And 24 bits to store our feature hashes. Now we use our model and test set to create predictions. vw -d test_titanic.vw -t -i model.vw -p preds_titanic.txt We can turn our predictions to Kaggle format with the following Python script: import csv with open("preds_titanic.txt", "r") as infile, open("kaggle_preds.csv", "wb") as outfile: outfile.write("PassengerId,Survived\n") for line in infile.readlines(): kaggle_line = str(line.split(" ")[1]).replace("\n","") if str(int(float(line.split(" ")[0]))) == "1": kaggle_line += ",1\n" else: kaggle_line += ",0\n" outfile.write(kaggle_line) Submit kaggle_preds.csv to receive your top 10% public leaderboard score! 3 thoughts on “Titanic – Machine Learning From Distaster with Vowpal Wabbit” Strange. I followed all the steps outlined in this page and downloaded the latest version of vw from git as of today May 13, 2015 and got a “Your submission scored 0.73206” instead of the 0.79426. Anyone else seeing this and any clues of why my results are way off ? Hi, I tried running the script, and its running successfully. But I’m getting output in between -1 and +1. And because of this getting error while converting vowpal wabbit output to kaggle required .csv format. Any idea why it’s happening ? Thanks Raj
http://mlwave.com/tutorial-titanic-machine-learning-from-distaster/
CC-MAIN-2017-09
refinedweb
834
60.72
In the past 12 months, Microsoft has released major versions of Visual Studio (Team System), SQL Server, Windows, SharePoint, and Office. Any one of these products alone would provide enough new features and development possibilities to keep me writing into next year (both code and articles!). Clearly it is a monumental year in Redmond and they aren't finished, as the release of Windows Server 2008 looms later this year. Windows Server 2008 promises to be a boon to developers because it provides a more powerful, and yet simpler, foundation for building applications than previous Windows Server versions. Microsoft has positioned the benefits of Windows Server 2008 around three core themes of control, protection, and flexibility. These are great themes and they serve to get the discussion of Windows Server 2008 started on a mass scale. New Features Open a Multitude of Possibilities Before I dig into some of the features, I want to state clearly that there are more features than can be covered in an overview such as this. Windows Server 2008 offers something for everyone, so I encourage you to spend some time researching all that it has to offer as your interests will most certainly vary from mine. The remainder of the article will cover features that I, a developer and ISV business owner, find the most compelling. IIS 7.0 IIS has been great ever since the version 6.0 included with Windows Server 2003. Without a doubt, it is the best Web server in the market today. But once you take a look at IIS 7, you will be ready to migrate your applications as quickly as possible. IIS 7 is composed of over 30 different, independent, modularized components. Microsoft has moved away from the tabbed dialog window approach of configuring IIS to a "Control Panel" approach. Each component is an icon within the IIS manager application. This strategy simplifies configuration, as it allows you to quickly install and configure only the components that you require for a Web application. IIS 7 adopts the same configuration method as ASP.NET, which means you can copy your entire ASP.NET application to a Web server and control the configuration settings with a configuration file. The config file works the same as the ASP.NET web.config XML file. The IIS config file is an XML file that defines the configuration settings for an IIS application. As a result, deploying Web applications are truly XCopy deployments as the IIS configurations are stored with the Web application's source code and related content. Using the web.config file, you can enable and disable IIS features (i.e. FTP, SMTP, etc.), configure security, and much more. The bottom line is that, with IIS 7, you can completely automate deployment of your Web applicationsthanks to the modular architecture of IIS 7.0. This ease of deployment will save you time when deploying new applications for your client base. In addition, it will allow you to automatically enable enhanced features of your application when a client purchases them. In fact, they could purchase these advanced features within the application and have them enabled without any interaction from your staff. Also, if you want to add additional features to the base functionality provided by IIS 7, you can build them using either native or managed code. IIS 7 provides a powerful extensibility model that allows you to support custom scenarios not supported out-of-the-box. For example, you could build a module that adds a 2-pane HTML frame for a demo version of your application in which one pane displays instructions and the other pane displays the application. Or you could build a module to rewrite or shorten URLs. And given the modular architecture of IIS 7, any extension you build can be enabled only in the sites that require it. You are not limited to only adding new features. The extensibility API lives up to its name and allows you to extend or even replace out-of-the-box IIS modules. Another great feature of IIS 7 is the increased manageability of application pools. IIS provides the Windows Process Activation Services (WPAS) to manage both HTTP and non-HTTP sites. A non-HTTP site is any site that does not rely on HTTP for exchanging packages (i.e. MSMQ). The technologies that comprise Windows Communication Foundation (discussed below) are great examples of non-HTTP technologies. WPAS gives you the ability to manage the application pools and configurations for both HTTP and non-HTTP sites from a single console. This dual-management of HTTP and non-HTTP sites makes it possible for you to run applications with protocols within the same application pool. For example, you could have two sites that receive packets: one via an ASP.NET Web Service and the other via a WCF Service with a Named Pipe binding. MSMQ. Each could have the same application pool settings and could also be configured within one central application, IIS 7. Another benefit of WPAS, besides increased manageability of applications pools as illustrated above, is the ability to host non-HTTP sites within IIS 7. Since application pool management in IIS 6 was handled by the WWW Service, applications hosted within IIS 6 were limited to being HTTP-based. Since WPAS is largely protocol agnostic, you can now host sites using technologies like WCF Services within IIS 7. This is true even if the site is using a non-HTTP-based binding, like MSMQ, TCP, or Named Pipe. So, where before you would have to potentially write your own application hosting environment for WCF Services (like a Windows Console, or Windows Service), you can now directly leverage the new capabilities in IIS 7. The majority of features that will be shipped with the Windows Server 2008 version of IIS 7 are already available in the Windows Vista version of IIS 7. This means it's relatively painless to familiarize yourself with IIS 7 and begin the process of determining how to best utilize its new features in your applications. The .NET Framework 3.0 Think of the latest version of the .NET Framework as the .NET Framework 2.0 + 4 (components). This version of the framework includes the four components that previously comprised what was known as WinFx: Windows Presentation Foundation, Windows Communication Foundation, Workflow Foundation, and Windows CardSpace. Here, I am only concerned with the server aspects of these components so I will not discuss Windows Presentation Foundation or Windows CardSpace are they are primarily targeted for the client-side of Windows. Workflow Foundation (WF) provides a programming model and engine that enables you to build workflows into your applications. Business of all shapes and sizes are looking to automate repetitive tasks and WF provides you with a Rules Engine, and Activity Model, a Workflow Designer, and Workflow Runtime to seamlessly automate both people and other software components. Using the Workflow Designer (accessed within Visual Studio) you can graphically build an Activity Model comprised of a series of Activities. You can create your own activities (by writing code) or choose from a set provided by Microsoft. The Rules Engine provides the capability to build rules into the workflowfor example, checking for proper credit before accepting an order. The rules engine gives the ability to check for conditions and branch the activities of your workflow as you desire. The Workflow Runtime is the engine that executes a workflow's activity model. The runtime is .NET and can be hosted within any .NET application (i.e. WinForm, WebForm and Windows Service applications). Although Microsoft already has other workflow engines in BizTalk and Exchange, WF will serve as the foundation for additional Microsoft products in the future, as it is the unified workflow model that is part of .NET 3.0. The goal of WF is to provide developers with the components required to build workflows into their applications (both automated and manual steps). Developers can use WF to build workflows and tools intended to support business users and their processes. Therefore, WF represents a significant opportunity for any ISV to integrate workflows into their applications. This could be done in a couple of ways. The first is to provide a library of workflows for performing activities relevant to your application. This is just common sense. However, using WF as a foundation, you could also incorporate a "wizard" framework that allows your users to build custom workflows of their own. For example, in a Forums ASP.NET application, you could add design a set of workflows around forum management (i.e. reviewing new posts, identifying foul language, approving new users, etc.). If your focus is server management, you could build workflows that archive log files, alert and schedule hardware maintenance based or desired metrics, and much more. Again, you are only limited by your creative mind. Windows Communication FoundationWCF consolidates features provided by several existing technologies(i.e. MSMQ, .NET Remoting, Web Services Extensions, COM+, etc.) to create a unified communication API. This API reduces the complexity of sending messages and data across application barriers. Thanks to this unified model, you can adopt a single strategy for application communication and use the components you need versus the old method of stringing together the various required components from the differing available communication APIs. Think of WCF as simplifying your ability to create inter-connected applications through a Service Oriented Architecture (SOA). WCF's unified programming model provides a single namespace (System.ServiceModel) for sending and receiving messages between applications. Using this namespace you can send messages via using Web services, remoting, System.Messaging, and more but you will only need to know one programming model. This loosely-coupled strategy will allow you to build modularized applications in a simplified manner. By taking advantage of the SOA features of WCF, you can build modules easily, separate your application into modules, and offer your customers a more tailored version of your software that meets their needs. For example, you could build a hosted project management application that allows a team to chat securely from remote locations. In addition, you could more easily roll-out new modules that operate within your SOA architecture as your application matures. Using the same project management application example, you could add a whiteboard module or a screen-sharing module for increased team collaboration. There are many more features and it is worth your while to start your own research efforts today. In fact, Microsoft has simplified this process by creating the Innovate on Windows Server Program. This is a free program for any Microsoft partner (the partner program itself is free at its lowest level) that provides you with deep technical resources as they become available (i.e. whitepapers, Webcasts, TechNet forums). One final benefit is the opportunity to have your application tested to be "Certified for Windows Server." This certification is a way to provide extra credibility to your customers that your product is ready for Windows Server 2008. Also, inclusion in the Microsoft marketing for Windows Server 2008 is a nice benefit too. Windows Server 2008 is currently in Beta 2 with a Beta 3 scheduled in the very near future (first half 2007). And with the RTM version not expected until the latter part of 2007, I readily admit you may have more pressing concerns. However, I offer to you that Windows Server 2008 will provide you with a significant number of features and capabilities that will be of benefit to your application and its user base. Given this fact, it isn't much of a leap to realize that a small investment in learning about Windows Server 2008 benefits and planning to incorporate its features into your application will put you in a position to lead the market for your type of application. *This article was commissioned by and prepared for Microsoft Corporation. This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.
http://www.devx.com/MicrosoftISV/Link/34499
crawl-001
refinedweb
1,996
54.32
Posting a video on tumblr.com allows you to just paste the URL of the video on youtube, vimeo, whatever and tumblr automatically does the embedding for you. I assume that this would ... Greetings all, I am trying to download 'gz' file using URL class .Code snippet is as: URL url = new URL(""); InputStream conn = new GZIPInputStream(url.openStream()); Exception in thread ... I`m trying to read an image from an URL (with the java package java.net.URL) to a byte[]. "Everything" works fine, except that the content isnt being enterely read from the stream ... the string [playlist]numberofentries=2File1= NewsLength1=-1File2= News BackupLength2=-1Version=2 i wanna cut all of the links in this file, how to? I would like to create player that play mp3 music from the internet by url. I tried this, but it doesn't work: import java.net.URL; import sun.audio.AudioData; import sun.audio.AudioPlayer; import sun.audio.AudioStream; import sun.audio.ContinuousAudioDataStream; public class Player { public ... I have problem to read last n lines from url. How to do that ? I have url.openstream but there is no contrsuctor for RandomAccessFile which has input for stream. Can ... So I know how to use URLClassLoader, and I know what it does, what I want to know is how exactly does it do it. Basically I'm asking: Is it a live ... To Jos: Why do you say I will have a 30 second delay before anything is sent? This is not true, actually. My sniffing with Wireshark shows that data is sent immediately, the data that is already in the data file. The PHP script reads this, parses and formats it, and sends it to the browser immediately. This is also the ... Hi. I have a URL reader, and i need to know how many rows it reads when it goes through. Has anyone had to do this before? I'm not sure if theres an inbuilt lineCounter in the BufferedReader (i read through the documenation and couldn't find anything). Any suggestions on how i could go about doing this? Thanks.
http://www.java2s.com/Questions_And_Answers/Java-Network/url/stream.htm
CC-MAIN-2013-20
refinedweb
351
69.58
Firebase Authentication in Flutter - Production Patterns. This tutorial will cover the implementation and architecture for Firebase Authentication. We use Firebase Authentication in production to keep my code maintainable and easy to manage. We cover the basic login and sign up functionality. Today we'll be going over the production practices I follow when implementing email authentication using Firebase in Flutter. We'll be building a social media app called compound. It's called compound because that's the middle word of the book in front of me on my desk. "The Compound Effect". Even if you don't want to build a social media app, I'll be teaching you the principles you need to apply to a firebase project to build literally any app you want.The Architecture If you don't know, I use an Mvvm Style architecture with Provider for my UI / Business logic separation and get_it as a service locator. I've found this to be the most consistent and easy to understand architecture that I've used in production. It keeps implementations short and specific. In short the architecture specifies that each view or basic widget can have it's own ViewModel that contains the logic specific to that piece of UI. The ViewModel will make use of services to achieve what the user is requesting through their interactions. Services is where all the actual work happens. ViewModels make use of the services but doesn't contain any hard functionality outside of conditionals and calling services. So, to get to the task at hand. We'll have an Authentication service that we'll use to sign in or sign up with that will store an instance of the current firebase user for us to use when required. We will have two views, Login and SignUp view which will make of the two functions on the service. The entire backend of the application will be built using Firebase so make sure to go to your console and login with a gmail account.Setup Firebase Project Open up the firebase console and click on "Add Project". Call it "compound", go next, select your account and then create. This will take a few seconds to setup. When it's complete click on continue and you'll land on the overview page. Click on the Android Icon (or iOS) and add your package name, I'll set mine to com.filledstacks.compound. I'll set the nickname to "Compound". Register the app and then download the google-services.json file. If you have your own project or want to use my starting code, which you can download here, open up the code and place the google-service.json file in the android/app folder. Then open the build.gradle file in the android/app folder and change the applicationId to match the one you entered for your Firebase project. Open up the pubspec.yaml and add the firebase_auth plugin. firebase_auth: ^0.15.3 Then we have to enable the google services. Open the build.gradle file in the android folder and add the google services dependency. dependencies { // existing dependencies classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Add the google services classpath classpath 'com.google.gms:google-services:4.3.0' } Open up the android/app/build.gradle file and apply the google services plugin. Add the following line at the bottom of the file. // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services' That's it for the Android setup. Lets continue with the Firebase project. Once you've created the app you can go next and skip the firebase comms check that they do. On the left hand side, click on the Authentication Icon. The third icon from top (might change). Click on the Setup sign in methods button and click on email / password and enable it. That's it for the project setup, we'll get back to the Firebase console in the next episode.Authentication Implementation The starting code that I provided has a few things setup already. This is to make sure we keep the app to the point and only show the firebase parts. We'll be creating the Authentication service and then using it in the viewmodels, which are completely empty. The responsibility of the AuthenticationService in this case is to wrap the Firebase Authentication functionality for us. It will send the info we entered, and then tell us if it's successful or not. If it fails we return an error message to show the user. Under the services folder create a new file called authentication_service.dart. import 'package:flutter/foundation.dart'; class AuthenticationService { Future loginWithEmail({@required String email, @required String password}) { // TODO: implement loginWithEmail return null; } Future signUpWithEmail({@required String email, @required String password}) { // TODO: implement signUpWithEmail return null; } } We'll start off keeping a reference to the FirebaseAuth instance locally. Then we'll perform signInWithEmailAndPassword and store the result in a variable called user. If there's no errors we'll check if the user is not null and return that value. If it fails we return the message from the error. final FirebaseAuth _firebaseAuth = FirebaseAuth.instance; Future loginWithEmail({ @required String email, @required String password, }) async { try { var user = await _firebaseAuth.signInWithEmailAndPassword( email: email, password: password); return user != null; } catch (e) { return e.message; } } Sign up looks very similar. The only difference is that the result of the createUserWithEmailAndPassword function returns a FirebaseAuth object instead of the user like login. Future signUpWithEmail({ @required String email, @required String password, }) async { try { var authResult = await _firebaseAuth.createUserWithEmailAndPassword( email: email, password: password); return authResult.user != null; } catch (e) { return e.message; } } That's it for the AuthenticationService. Open up the locator.dart file and register the service as a lazy singleton. All that means is that there will only ever be 1 authentication service in existence, and we'll lazily create it once it has been requested the first time.4 void setupLocator() { locator.registerLazySingleton(() => NavigationService()); locator.registerLazySingleton(() => DialogService()); locator.registerLazySingleton(() => AuthenticationService()); } We'll start with sign up so that we can then perform a login afterwards. Open up the main.dart file and make sure home is set to SignUpView. Then open up the signup_view_model.dart file. We'll start by retrieving the AuthenticationService, NavigationService and DialogService from the locator. Then we'll create a function called SignUp that takes the email and password. In this function we'll set the view to busy before requesting, do the sign up. Then check the result, if it's a bool and it's true then we navigate to the HomeView. If it's false we'll show a general dialog, if it's a string we'll show the content as a dialog. class SignUpViewModel extends BaseModel { final AuthenticationService _authenticationService = locator<AuthenticationService>(); final DialogService _dialogService = locator<DialogService>(); final NavigationService _navigationService = locator<NavigationService>(); Future signUp({@required String email, @required String password}) async { setBusy(true); var result = await _authenticationService.signUpWithEmail( email: email, password: password); setBusy(false); if (result is bool) { if (result) { _navigationService.navigateTo(HomeViewRoute); } else { await _dialogService.showDialog( title: 'Sign Up Failure', description: 'General sign up failure. Please try again later', ); } } else { await _dialogService.showDialog( title: 'Sign Up Failure', description: result, ); } } } Open up the BusyButton to take in the busy property from the model and in the onPressed function call model.signUp. BusyButton( title: 'Sign Up', busy: model.busy, onPressed: () { model.signUp( email: emailController.text, password: passwordController.text, ); }, ) If you run the app now, enter some details and login you'll see it navigate to the HomeView. If you want to see the error dialog enter a password with less than 6 characters and you'll see the dialog pop up. Also if you've already signed up you can try signing up with the same email again and you'll get a friendly error message :)Login Logic The login logic logic is literally exactly the same as the sign up logic. Being able to refactor for shared code is a good skill to have, I'll leave it up to you as an exercise to do. For now we'll write non dry code by simple repeating the pattern. Open up the login_view_model.dart class LoginViewModel extends BaseModel { final AuthenticationService _authenticationService = locator<AuthenticationService>(); final DialogService _dialogService = locator<DialogService>(); final NavigationService _navigationService = locator<NavigationService>(); Future login({@required String email, @required String password}) async { setBusy(true); var result = await _authenticationService.loginWithEmail( email: email, password: password); setBusy(false); if (result is bool) { if (result) { _navigationService.navigateTo(HomeViewRoute); } else { await _dialogService.showDialog( title: 'Login Failure', description: 'Couldn\'t login at this moment. Please try again later', ); } } else { await _dialogService.showDialog( title: 'Login Failure', description: result, ); } } } Open the login view. Pass the busy value to the BusyButton and in the onPressed function call the login function. BusyButton( title: 'Login', busy: model.busy, onPressed: () { model.login( email: emailController.text, password: passwordController.text, ); }, ) Open up the main.dart file and change home to LoginView. If you re-run the code now you'll land on the LoginView. Enter the details you entered, click login and you're done :) . This is just the start of the app, we'll add functionalities a normal app would have throughout the rest of the series. In the next tutorial we'll make sure once we're signed in we go straight to the HomeView. We'll also create a user profile, make sure it's always available when the app is open and add roles (for later use ;) ). I decided to ask you guys to start sharing the tutorials more, I'm still seeing some unmaintainable code when new clients come to me. We have to spread the architecture and code quality love around and make that the core focus when building apps. Until next time, Dane Mackier. :) In this tutorial we'll see how to add Apple Sign In to our Flutter apps from scratch. Learn how to implement Apple Sign In with Flutter & Firebase Authentication (from scratch), and give your iOS users a convenient way of signing into your app. Apple Sign In with Flutter & Firebase Authentication. In this tutorial we'll see how to add Apple Sign In to our Flutter apps from scratch. Apple Sign In is a new authentication method that is available on iOS 13 and above. It is very convenient, as your iOS users already have an Apple ID, and can use it to sign in with your app. So just as you would offer Google Sign In on Android, it makes sense to offer Apple Sign In on iOS. We will use the Apple Sign In Flutter plugin available on pub.dev. Note: this plugin supports iOS only, and you can only use this on devices running iOS 13 and above. After creating a new Flutter project, add the following dependencies to your pubspec.yaml file: dependencies: firebase_auth: ^0.15.3 apple_sign_in: ^0.1.0 provider: ^4.0.1 Note: we will use Provider for dependency injection, but you can use something else if you prefer. Next, we need add Firebase to our Flutter app. Follow this guide for how to do this: After we have followed the required steps, the GoogleService-Info.plist file should be added to our Xcode project. And while in Xcode 11, select the Signing & Capabilities tab, and add "Sign In With Apple" as a new Capability: Once this is done, ensure to select a team on the Code Signing section: This will generate and configure an App ID in the "Certificates, Identifiers & Profiles" section of the Apple Developer portal. If you don't do this, sign-in won't work. As a last step, we need to enable Apple Sign In in Firebase. This can be done under Authentication -> This completes the setup for Apple Sign In, and we can dive into the code.Checking if Apple Sign In is available Before we add the UI code, let's write a simple class to check if Apple Sign In is available: import 'package:apple_sign_in/apple_sign_in.dart'; class AppleSignInAvailable { AppleSignInAvailable(this.isAvailable); final bool isAvailable; static Future<AppleSignInAvailable> check() async { return AppleSignInAvailable(await AppleSignIn.isAvailable()); } } Then, in our main.dart file, let's modify the entry point: void main() async { // Fix for: Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized. WidgetsFlutterBinding.ensureInitialized(); final appleSignInAvailable = await AppleSignInAvailable.check(); runApp(Provider<AppleSignInAvailable>.value( value: appleSignInAvailable, child: MyApp(), )); } The first line prevents an exception that occurs if we attempt to send messages across the platform channels before the binding is initialized. Then, we check if Apple Sign In is available by using the class we just created. And we use Provider to make this available as a value to all widgets in our app. Adding the UI codeAdding the UI code Note: this check is done upfront so that appleSignInAvailableis available synchronously to the entire widget tree. This avoids using a FutureBuilderin widgets that need to perform this check. Instead of the default counter app, we want to show a Sign In Page with a button: import 'package:apple_sign_in/apple_sign_in.dart'; import 'package:apple_sign_in_firebase_flutter/apple_sign_in_available.dart'; import 'package:apple_sign_in_firebase_flutter/auth_service.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class SignInPage extends StatelessWidget { @override Widget build(BuildContext context) { final appleSignInAvailable = Provider.of<AppleSignInAvailable>(context, listen: false); return Scaffold( appBar: AppBar( title: Text('Sign In'), ), body: Padding( padding: const EdgeInsets.all(6.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ if (appleSignInAvailable.isAvailable) AppleSignInButton( style: ButtonStyle.black, // style as needed type: ButtonType.signIn, // style as needed onPressed: () {}, ), ], ), ), ); } } Note: we use a collection-if to only show the AppleSignInButtonif Apple Sign In is available. See this video for UI-as-code operators in Dart. Back to our main.dart file, we can update our root widget to use the class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Apple Sign In with Firebase', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.indigo, ), home: SignInPage(), ); } } At this stage, we can run the app on an iOS 13 simulator and get the following:Adding the authentication code Here is the full authentication service that we will use to sign in with Apple (explained below): import 'package:apple_sign_in/apple_sign_in.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/services.dart'; class AuthService { final _firebaseAuth = FirebaseAuth.instance; Future<FirebaseUser> signInWithApple({List<Scope> scopes = const []}) async { // 1\. perform the sign-in request final result = await AppleSignIn.performRequests( [AppleIdRequest(requestedScopes: scopes)]); // 2\. check the result switch (result.status) { case AuthorizationStatus.authorized: final appleIdCredential = result.credential; final oAuthProvider = OAuthProvider(providerId: 'apple.com'); final credential = oAuthProvider.getCredential( idToken: String.fromCharCodes(appleIdCredential.identityToken), accessToken: String.fromCharCodes(appleIdCredential.authorizationCode), ); final authResult = await _firebaseAuth.signInWithCredential(credential); final firebaseUser = authResult.user; if (scopes.contains(Scope.fullName)) { final updateUser = UserUpdateInfo(); updateUser.displayName = '${appleIdCredential.fullName.givenName} ${appleIdCredential.fullName.familyName}'; await firebaseUser.updateProfile(updateUser); } return firebaseUser; case AuthorizationStatus.error: print(result.error.toString()); throw PlatformException( code: 'ERROR_AUTHORIZATION_DENIED', message: result.error.toString(), ); case AuthorizationStatus.cancelled: throw PlatformException( code: 'ERROR_ABORTED_BY_USER', message: 'Sign in aborted by user', ); } return null; } } First, we pass a List<Scope> argument to our method. Scopes are the kinds of contact information that can be requested from the user ( fullName). Then, we make a call to AppleSignIn.performRequests and await for the result. Finally, we parse the result with a switch statement. The three possible cases are authorized, error and cancelled. Authorized If the request was authorized, we create an OAuthProvider credential with the identityToken and authorizationCode we received. We then pass this to _firebaseAuth.signInWithCredential(), and get an AuthResult that we can use to extract the FirebaseUser. And if we requested the full name, we can update the profile information of the FirebaseUser object with the fullName from the Apple ID credential. Error or Cancelled If authentication failed or was cancelled by the user, we throw a PlatformException that can be handled by at the calling site. Now that our auth service is ready, we can add it to our app via Provider like so: class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return Provider<AuthService>( create: (_) => AuthService(), child: MaterialApp( title: 'Apple Sign In with Firebase', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.indigo, ), home: SignInPage(), ), ); } } Then, in our SignInPage, we can add a method to sign-in and handle any errors: Future<void> _signInWithApple(BuildContext context) async { try { final authService = Provider.of<AuthService>(context, listen: false); final user = await authService.signInWithApple( requestEmail: true, requestFullName: true); print('uid: ${user.uid}'); } catch (e) { // TODO: Show alert here print(e); } } Finally, we remember to call this on the callback of the AppleSignInButton: Testing thingsTesting things AppleSignInButton( style: ButtonStyle.black, type: ButtonType.signIn, onPressed: () => _signInWithApple(context), ) Our implementation is complete, and we can run the app. If we press the sign-in button and an Apple ID is not configured on our simulator or device, we will get the following: After signing in with our Apple ID, we can try again, and we will get this: After continuing, we are prompted to enter the password for our Apple ID (or use touch ID/face ID if enabled on the device). If we have requested full name and email access, the user will have a chance edit the name, and choose to share or hide the email: After confirming this, the sign-in is complete and the app is authenticated with Firebase. Note: if the sign-in screen is not dismissed after authenticating, it's likely because you forgot to set the team in the code signing options in Xcode. The next logical step is to move away from the SignInPage and show the home page instead. This can be done by adding a widget above the onAuthStateChaged stream of FirebaseAuth. Congratulations, you have now enabled Apple Sign In in your Flutter app! Your iOS users are grateful. 🙏 Full Source Code is here on GitHub. Happy coding!.
https://morioh.com/p/95a0edfaf41d
CC-MAIN-2020-10
refinedweb
2,973
50.53
Understanding routing in you application is the key to creating a single page application. Routing is what allows view navigation in your application like ‘detail views’, end user bookmarking and even allows you to set up a ‘logged in’ version of your applications views. Routing isn’t included by default in Angular 2, in fact you have to explicitly include it as a library. I also will say, it’s not incredibly intuitive to configure. We’ll take some time to explain the history of the router and dive into some of the basic concepts. The router itself is implemented in the optional Router Module, which is kept separate to keep the base library size low. Include it in your main module like this: import { RouterModule } from '@angular/router'; ... @NgModule({ declarations: [ ... ], imports: [ RouterModule.forRoot(routes), ... ], providers: [ ... ], entryComponents: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } The base HREF is the starting point for your application and is used to create your home route. It’s this starting point that your browser will also use to create a history to prevent ‘breaking the back button’ which is always a sticking point in SPAs. Here’s the syntax you need to add to you html: <base href="/"> const routes = [ // Default, or home, path. This matches your Base HREF { path: '', component: HomeComponent }, ... // Wildcard, or the 'catch-all' route pattern. If the requested // route does not match anything above, this route is displayed. { path: '**', component: HomeComponent } ]; Resolves are services that must be completed before allowing the route to be accessed and loaded. This is how we can ensure that the data is available for the route prior to allowing the user to access the route. A quick example of this would be a UserResolve class that retrieves a list of users before displaying the route. Guards are a method to prevent a route from being accessed unless a certain state is met. A quick example of this would be a LoggedInGuard class that prevents a user from accessing a route unless they are logged in. Child routes are a way to add specific routes to a feature. Below is an example of an application with a single route. This illustrates including the router module, a base href and a very basic route configuration. Below is an example of an application with a single route that requires a service to resolve a data retrieval before rendering. Below is an example of an application with two routes and a child route. While it may take some time to completely wrap your mind around routing in angular it’s clearly an important part of creating a real SPA. Don’t be afraid to take and reference your own notes! Lets talk!
https://www.arroyolabs.com/2016/10/angular-2-routing/
CC-MAIN-2019-30
refinedweb
452
62.07
Using Typescript with Javascript React.JS is a straightforward process. It allows for you to use type checking with your code which comes in handy when cutting down on errors, having a clear definition for state and props and documentation. In this tutorial, we’ll go over using Typescript with Stateful React Components. If you’re interested in the video lesson, please head over to our video tutorials in the link. React Typescript Setup The first thing you have to do is set up your react project to use Typescript. Run the following command in your terminal. npx create-react-app my-app --typescript This will create a project that uses Typescript by default. Under your src folder, you should see aa App.tsx file. Creating a Stateful React Component The next step will be to create a stateful react component. Now create a file called Profile.tsx import React, { Component } from 'react'; export default class Profile extends Component { } The next thing you’ll want to do is define the type of state and props the component will take. We’ll create two interfaces. interface ProfileProps { name: string, username: string, age: number } interface ProfileState { publicStatus: boolean; }; Now we can have a component whose state and props have been defined. We can also define the initial state. export default class Profile extends Component<ProfileProps, ProfileState> { state: ProfileState = { publicStatus: false }; } Rendering the React Component The last step will be to render our component. This component will display profile information for a user and display if they are a public or private user. export default class Profile extends Component<ProfileProps, ProfileState> { state: ProfileState ={ publicStatus: false }; changeStatus = () => { this.setState({ publicStatus: (!this.state.publicStatus) }); } render(){ return( <div> { this.state.publicStatus ? ( <h1>This Profile is Public</h1> ) : ( <h1>This Profile is Private</h1> )} <p>Name: {this.props.name}</p> <p>Username: {this.props.username}</p> <p>Age: {this.props.age}</p> <button onClick={this.changeStatus}>Set Status</button> </div> ) } } Now in the App.tsx file, we will import that Profile component and pass in props to be displayed. import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; import Profile from './Profile'; class App extends Component { render() { return ( <div className="App"> <header className="App-header"> <Profile name="James" username="Codebrains" age={23}/> </header> </div> ); } } export default App; Now when you run the app, you should now see the user profile information based on the props that you provided. Typescript React Conclusion Using Typescript with React is a great way to add type checking functionality. It cuts down on errors are helps document how components work. If you’re interested in learning more, check out some of our videos are courses.codebrains.io.
https://codebrains.io/stateful-react-components-with-typescript/
CC-MAIN-2021-10
refinedweb
449
58.38
Swift version: 5.1 A so-called “fair” random number generator is one that generates each of its possible values in equal amounts and with an even distribution. For example, if you were generating numbers between 1 and 4, you might get 4, 2, 1, 3, but you would never get 4 4 1 4. GameplayKit has support for fair random number generation using GKShuffledDistribution. First, add an import for the GameplayKit framework: import GameplayKit Second, create an instance of GKShuffledDistribution, telling it the lowest and highest values it can generate: let distribution = GKShuffledDistribution(lowestValue: 1, highestValue: 8) Finally, call nextInt() on it as needed to generate numbers. You should get all numbers between 1 and 8 at least once before you see any repeated. LEARN SWIFTUI FOR FREE I have a massive, free SwiftUI video collection on YouTube teaching you how to build complete apps with SwiftUI – check it out! Available from iOS 9.0 – see Hacking with Swift tutorial 35 This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.
https://www.hackingwithswift.com/example-code/games/how-to-generate-fair-random-numbers-using-gkshuffleddistribution
CC-MAIN-2019-47
refinedweb
180
51.58
sphinx-all man page sphinx-all — Sphinx documentation generator system manual Introduction This PDF file using LaTeX, rinohtype or rst2pdf (see See the pertinent section in the FAQ list. Prerequisites See tutorial for an introduction. It also contains links to more advanced sections in this manual for the topics it discusses. First Steps with Sphinx This document is meant to give a tutorial-like overview of all common tasks while using Sphinx. The green arrows designate “more info” links leading to advanced sections about the described task. Install Sphinx Install Sphinx, either from a distribution package or from PyPI with $ pip install Sphinx Setting up the documentation sources /man/sphinx-apidoc for details. Defining document structure. reStructuredText directives toctree is a reStructuredText directive, a very versatile piece of markup. Directives can have arguments, options and content. Arguments are given directly after the double colon following the directive’s name. Each directive decides whether it can have arguments, and how many. Options are given after the arguments, in form of a “field list”. The maxdepth is such an option for the toctree directive. Content follows the options or arguments after a blank line. Each directive decides whether to allow content, and what to do with it. A common gotcha with directives is that the first line of the content must be indented to the same level as the options are.. [image: more info] [image]. [image: more info] [image] See rst-primer for a more in-depth introduction to reStructuredText and sphinxmarkup for a full list of markup added by Sphinx. Running the build. [image: more info] [image] Refer to the sphinx-build man page <sphinx-build>. For example, to document Python’s. [image: more info] [image] See domains for all the available domains and their directives/roles. Basic configuration # comments the rest of the line). To change'). [image: more info] [image] See build-config for documentation of all available config values. Autodoc. [image: more info] [image] See sphinx.ext.autodoc for the complete description of the features of autodoc. Intersphinx. [image: more info] [image] See sphinx.ext.intersphinx for the complete description of the features of intersphinx. More topics to be covered Other extensions: - ext/math, - ext/viewcode, - ext/doctest, - … - Static files - Selecting a theme - setuptools - Templating - Using extensions - Writing extensions Footnotes - [1] This is the usual layout. However, conf.py can also live in another directory, the configuration directory. Refer to the sphinx-build man page <sphinx-build> for more information. Man Pages These are the applications provided as part of Sphinx. Core Applications sphinx-quickstart Synopsis sphinx-quickstart Description sphinx-quickstart is an interactive tool that asks some questions about your project and then generates a complete documentation directory and sample Makefile to be used with sphinx-build(1). Options - -q, --quiet Quiet mode that will skips interactive wizard to specify options. This option requires -p, -a and -v options. - -h, --help, --version Display usage summary or Sphinx version. Structure Options.INDENT 0.0 - --sep If specified, separate source and build directories. - --dot=DOT Inside the root directory, two more directories will be created; “_templates” for custom HTML templates and “_static” for custom stylesheets and other static files. You can enter another prefix (such as “.”) to replace the underscore. Project Basic Options.INDENT 0.0 - -p PROJECT, --project=PROJECT Project name will be set. (see project). - -a AUTHOR, --author=AUTHOR Author names. (see copyright). - -v VERSION Version of project. (see version). - -r RELEASE, --release=RELEASE Release of project. (see release). - -l LANGUAGE, --language=LANGUAGE Document language. (see language). - --suffix=SUFFIX Source file suffix. (see source_suffix). - --master=MASTER Master document name. (see master_doc). - --epub Use epub. Extension Options.INDENT 0.0 - --ext-autodoc Enable sphinx.ext.autodoc extension. - --ext-doctest Enable sphinx.ext.doctest extension. - --ext-intersphinx Enable sphinx.ext.intersphinx extension. - --ext-todo Enable sphinx.ext.todo extension. - --ext-coverage Enable sphinx.ext.coverage extension. - --ext-imgmath Enable sphinx.ext.imgmath extension. - --ext-mathjax Enable sphinx.ext.mathjax extension. - --ext-ifconfig Enable sphinx.ext.ifconfig extension. - --ext-viewcode Enable sphinx.ext.viewcode extension. - --extensions=EXTENSIONS Enable arbitary extensions. Makefile and Batchfile Creation Options.INDENT 0.0 - --use-make-mode, --no-use-make-mode Makefile/make.bat uses (or doesn’t use) make-mode. Default is use, which generates a more concise Makefile/make.bat. Changed in version 1.5: make-mode is default. - --makefile, --no-makefile Create (or not create) makefile. - --batchfile, --no-batchfile Create (or not create) batchfile Project templating New in version 1.5: Project templating options for sphinx-quickstart - -t, --templatedir=TEMPLATEDIR Template directory for template files. You can modify the templates of sphinx project files generated by quickstart. Following Jinja2 template files are allowed: - master_doc.rst_t - conf.py_t - Makefile_t - Makefile.new_t - make.bat_t - make.bat.new_t In detail, please refer the system template files Sphinx provides. (sphinx/templates/quickstart) - -d NAME=VALUE Define a template variable See also sphinx-build(1) sphinx-build) Additional Applications sphinx-apidoc) sphinx-autogen Synopsis sphinx-autogen [options] <sourcefile> … Description sphinx-autogen is a tool for automatic generation of Sphinx sources that, using the autodoc extension, document items included in autosummary listing(s). sourcefile is the path to one or more reStructuredText documents containing autosummary entries with the :toctree:: option set. sourcefile can be an fnmatch-style pattern. Options - -o <outputdir> Directory to place the output file. If it does not exist, it is created. Defaults to the value passed to the :toctree: option. - -s <suffix>, --suffix <suffix> Default suffix to use for generated files. Defaults to rst. - -t <templates>, --templates <templates> Custom template directory. Defaults to None. - -i, --imported-members Document imported members. Example Given the following directory structure: docs ├── index.rst └── ... foobar ├── foo │ └── __init__.py └── bar ├── __init__.py └── baz └── __init__.py and assuming docs/index.rst contained the following: Modules ======= .. autosummary:: :toctree: modules foobar.foo foobar.bar foobar.bar.baz If you run the following: $ PYTHONPATH=. sphinx-autodoc doc/index.rst then the following stub files will be created in docs: docs ├── index.rst └── modules ├── foobar.bar.rst ├── foobar.bar.baz.rst └── foobar.foo.rst and each of those files will contain a autodoc directive and some other information. See also sphinx-build(1), sphinx-apidoc(1) Restructuredtext Primer: - field lists (ref) - option lists (ref) - quoted literal blocks (ref) - doctest blocks (ref) Source Code cells cannot contain multiple lines. They look like this: ===== ===== ======= A B A and B ===== ===== ======= False False False True False False False True False True True True ===== ===== ======= Two more syntaxes are supported: CSV tables and List tables. They use an explicit markup block, see Directives section. Hyperlinks External links Internal linking is done via a special reST role provided by Sphinx, see the section on specific markup, ref-role. Sections documenting: - image (see also Images below) - figure (an image with caption and optional legend): - raw (include raw target-format markup) - include (include reStructuredText from another file) – in Sphinx, when given an absolute include file path, this directive takes it as relative to the source directory - class (assign a class attribute to the next element) [1] HTML specifics: - meta (generation of HTML <meta> tags) - title (override document title)markup. default-substitutions. Every explicit markup block which isn’t a valid markup construct (like the footnotes above) is regarded as a comment (ref). - [1] When the default domain contains a class directive, this directive will be shadowed. Therefore, Sphinx re-exports it as rst-class. Sphinx Markup Constructs Sphinx adds a lot of new directives and interpreted text roles to standard reST markup. This section contains the reference material for these facilities. The TOC tree. - NOTE: Simple “inclusion” of one file in another can be done with the include directive. - .. toctree::: - Tables of contents from all those documents are inserted, with a maximum depth of two, that means one nested heading. toctree directives in those documents are also taken into account. - Sphinx knows the relative order of the documents intro, strings and so forth, and it knows that they are children of the shown document, the library index. From this information it generates “next chapter”, “previous chapter” and “parent chapter” links. You can use caption option to provide a toctree caption and you can use name option to provide implicit target name that can be referenced by using ref: .. toctree:: :caption: Table of Contents :name: mastertoc foo use the reversed flag option to reverse the order of the entries in the list. This can be useful when using the glob flag option to reverse the ordering of the files. Example: .. toctree:: :glob: :reversed: recipe/*. Changed in version 1.3: Added “caption” and “name” option. Special names: - Do not use the colon : for HTML based formats. Links to other parts may not work. - Do not use the plus + for the ePub format. Some resources may not be found. Footnotes - [1] The LaTeX writer only refers the maxdepth option. Paragraph-level markup in that it is recommended over note for information regarding security. - .. versionadded:: version Similar to versionadded, but describes when and what changed in the named feature in some way (new parameters, changed side effects, etc.). - .. deprecated:: version Similar to versionchanged, but describes when the feature was deprecated. An explanation can also be given, for example to inform the reader what should be used instead. Example: .. deprecated:: 3.1 Use :func:`spam` instead. ---- - .. seealso:: Many sections include a list of references to module documentation or external documents. These lists are created using the seealso directive. The seealso directive is typically placed in a section just before any subsections. For the HTML output, it is shown boxed off from the main flow of the text. The content of the seealso directive:: This directive creates a centered boldfaced line of text. Use it as follows: .. centered:: LICENSE AGREEMENT Deprecated since version 1.1: This presentation-only directive is a legacy from older versions. Use a rst-class directive instead and add an appropriate style. - .. hlist:: This directive must contain a bullet list. It will transform it into a more compact list by either distributing more than one item horizontally, or reducing spacing between items, depending on the builder. For builders that support the horizontal distribution, there is a columns option that specifies the number of columns; it defaults to 2. Example: .. hlist:: :columns: 3 * A list of * short items * that should be * displayed * horizontally New in version 0.6. Table-of-contents markup The toctree directive, which generates tables of contents of subdocuments, is described in toctree-directive. For local tables of contents, use the standard reST contents directive. Glossary - .. glossary:: This directive must contain a reST definition-list-like markup with terms and definitions. The definitions will then be referencable with the term role.list serves to distinguish different sets of production lists that belong to different grammars. Blank lines are not allowed within productionlist directive` Showing code examples:: language Example: .. highlight:: c This language is used until the next highlight directive is encountered. For documents that have to show snippets in different languages, there’s also a code-block directive that is given the highlighting language directly: - .. code-block:: language Use it like this: .. code-block:: ruby Some Ruby code. The directive’s alias name sourcecode works as well. The valid values for the highlighting language are: - none (no highlighting) - python (the default when highlight_language isn flag is automatically activated: .. code-block:: ruby :lineno-start: 10 Some more Ruby code, with line numbering starting at. Changed in version 1.6.6: LaTeX supports the emphasize-lines option. Includes - .. literalinclude:: filename option with the desired tab width. Like code-block, the directive supports the linenos flag option to switch on line numbers, the lineno-start option to select the first line number, the emphasize-lines option to emphasize particular lines, and a language option.. When specifying particular parts of a file to display, it can be useful to display the original line numbers. This can be done using the lineno-match option, which is however allowed only when the selection consists of contiguous lines. You can prepend and/or append a line to the included code, using the prepend and append option, respectively. This is useful e.g. for highlighting PHP code that doesn’t include the <?php/?> markers. If you want to show the diff of the code, you can specify the old file by giving a diff option: .. literalinclude:: example.py :diff: example.py.orig This shows the diff between example.py and example.py.orig with unified diff format. New in version 0.4.3: The encoding option. New in version 0.6: The pyobject, lines, start-after and end-before options, as well as support for absolute filenames. New in version 1.0: The prepend and append options, as well as tab-width. New in version 1.3: The diff option. The lineno-match option. Changed in version 1.6: With both start-after and lines in use, the first line as per start-after is considered to be with line number 1 for lines. Caption and name an additional feature that if you leave the value empty, the shown filename will be exactly the one given as an argument. Dedent New in version 1.3. A dedent option can be given to strip indentation characters from the code block. For example: .. literalinclude:: example.rb :language: ruby :dedent: 4 :lines: 10-15 code-block also supports the dedent option. Footnotes - [1] There is a standard .. include directive, but it raises errors if the file is not found. This one only emits a warning. Inline markup-referencing syntax. Cross-referencing anything - :any:. Cross-referencing objects These roles are described with their respective domains: - Python - C - C++ - JavaScript - ReST Cross-referencing arbitrary locations - :ref: <label-name>`. - NOTE: Reference labels must start with an underscore. When referencing a label, the underscore must be omitted (see examples above). Using ref is advised over standard reStructuredText links to sections (like `Section title`_) because it works across files, when section headings are changed, and for all builders that support cross-references. Cross-referencing documents New in version 0.6. There is also a way to directly link to documents: - :doc: New in version 0.6. - :download:>`. Cross-referencing figures by figure number New in version 1.3. Changed in version 1.5: numref role can also refer sections. And numref allows {name} for the link text. - :numref:) <my-figure>`),. Cross-referencing other items of interest The following roles do possibly create a cross-reference, but do not refer to objects: - :envvar: An environment variable. Index entries are generated. Also generates a link to the matching envvar directive, if it exists. - :token: The name of a grammar token (used to create links between productionlist directives). - :keyword: The name of a keyword in Python. This creates a link to a reference label with that name, if it exists. - :option: A command-line option to an executable program. This generates a link to a option directive, if it exists. The following role creates a cross-reference to a term in a glossary: - :term:. Other semantic markup The following roles don’t do anything special except formatting the text in a different style: - :abbr: An abbreviation. If the role content contains a parenthesized explanation, it will be treated specially: it will be shown in a tool-tip in HTML, and output only once in LaTeX. Example: :abbr:`LIFO (last-in, first-out)`. New in version 0.6. - . - :guilabel:)`. Creates a hyperlink to an external site rendering the manpage if manpages_url is defined. - :menuselection:. There is also an index role to generate index entries. The following roles generate external links: - :pep:. - |today| Replaced by either today’s date (the date on which the document is read), or the date set in the build configuration file. Normally has the format April 14, 2007. Set by today_fmt and today. Miscellaneous markup File-wide metadata reST: - tocdepth The maximum depth for a table of contents of this file. New in version 0.4. If set, the web application won’t display a comment form for a page generated from this source file. - orphan If set, warnings about this file not being included in any toctree will be suppressed. New in version 1.0. Meta-information markup - .. sectionauthor:: name <email>. - .. codeauthor:: name <email> The codeauthor directive, which can appear multiple times, names the authors of the described code, just like sectionauthor names the author(s) of a piece of documentation. It too only produces output if the show_authors configuration value is True. Index-generating markup>: - single Creates a single index entry. Can be made a subentry by separating the subentry text with a semicolon (this notation is also used below to describe what entries are created). - pair pair: loop; statement is a shortcut that creates two index entries, namely loop; statement and statement; loop. - triple Likewise, triple: module; search; path is a shortcut that creates three index entries, which are module; search path, search; path, module and path; module search. - see see: entry; other creates an index entry that refers from entry to other. - seealso Like see, but inserts “see also” instead of “see”. - module, keyword, operator, object, exception, statement, builtin These all create two index entries. For example, module: hashlib creates the entries module; hashlib and hashlib; module. (These are Python-specific and therefore deprecated.). - :index:. Tables Use reStructuredText tables, i.e. either - grid table syntax (ref), - simple table syntax (ref), - csv-table syntax, - or list-table syntax. The table directive serves as optional wrapper of the grid and simple syntaxes. Theys of the LRCJ columns are attributed by tabulary in proportion to the observed shares in a first pass where the table cells are rendered at their natural “horizontal” widths. By default, Sphinx uses a table layout with J for every column. New in version 0.3. Changed in version 1.6: Merged cells may now contain multiple paragraphs and are much better handled, thanks to custom Sphinx LaTeX macros. This novel situation motivated the switch to J specifier and not L by default. - HINT: Sphinx actually uses T spec directive with an explicit p{40pt} (for example) for that column. You may use also l spec directive. If you do, the table will be set with tabulary but you must use the p{width} construct (or Sphinx’s \X and \Y specifiers described below) for the columns containing these elements. Literal blocks do not work with tabulary at all, so tables containing a literal block are always set with tabular. The verbatim environment used for literal blocks only works in p{width} (and \X/b of the current line width. You can use it in the tabularcolumns (it is not a problem if some LaTeX macro is also called \X.) It is not needed for b to be the total number of columns, nor for the sum of the fractions of the \X spec conflicts with :widths: option of table directives. If both are specified, :widths: option will be ignored. Math See math-support. Footnotes - [1] For most builders name and format are the same. At the moment only builders derived from the html builder distinguish between the builder format and the builder name. Note that the current builder tag is not available in conf.py, it is only available after the builder is initialized. More markup is added by domains. Sphinx Domains New in version 1.0. What is a Domain?. Basic Markup: - .. default-domain:: name Select a new default domain. While the primary_domain selects For cross-reference roles provided by domains, the same facilities exist as for general cross-references. See xref. The Python Domain The Python domain (name py) provides the following directives for module declarations: - .. py:module:: name. - .. py:currentmodule:: name:module directive, the others only py:currentmodule. The following directives are provided for module and class contents: - .. py:function:: name. - .. py:data:: name Describes global data in a module, including both variables and values used as “defined constants.” Class and object attributes are not documented using this environment. - .. py:exception:: name Describes an exception class. The signature can, but need not include parentheses with constructor arguments. - .. py:class:: name - .. Describes an object data attribute. The description should include information about the type of the data to be expected and whether it may be changed directly. - .. py:method:: name(parameters) Describes an object method. The parameters should not include the self parameter. The description should include similar information to that described for function. See also Python Signatures and Info field lists. - .. py:staticmethod:: name(parameters) Like py:method, but indicates that the method is a static method. New in version 0.4. - .. py:classmethod:: name(parameters) Like py:method, but indicates that the method is a class method. New in version 0.6. - .. py:decorator:: name - ... - .. py:decoratormethod:: name - .. py:decoratormethod:: name(signature) Same as py:decorator, but for decorators that are methods. Refer to a decorator method using the py:meth role. Python Signatures. Info field lists The following roles refer to objects in modules and are possibly hyperlinked if a matching identifier is found: - :py:mod: Reference a module; a dotted name may be used. This should also be used for package names. - :py:func: Reference a Python function; dotted names may be used. The role text needs not include trailing parentheses to enhance readability; they will be added automatically by Sphinx if the add_function_parentheses config value is True (the default). - :py:data: Reference a module-level variable. - :py:const: Reference a “defined” constant. This may be a Python variable that is not intended to be changed. - :py:class: Reference a class; a dotted name may be used. - :py:meth: Reference a method of an object. The role text can include the type name and the method name; if it occurs within the description of a type, the type name can be omitted. A dotted name may be used. - :py:attr: Reference a data attribute of an object. - :py:exc: Reference an exception. A dotted name may be used. - :py:obj: close(). The C Domain The C domain (name c) is suited for documentation of C API. - .. c:function:: function prototype:: declaration role. - .. c:macro:: name Describes a “simple” C macro. Simple macros are macros which are used for code expansion, but which do not take arguments so cannot be described as functions. This is a simple C-language #define. Examples of its use in the Python documentation include PyObject_HEAD and Py_BEGIN_ALLOW_THREADS. - .. c:type:: name Describes a C type (whether defined by a typedef or struct). The signature should just be the type name. - .. c:var:: declaration Describes a global C variable. The signature should include the type, such as: .. c:var:: PyObject* PyClass_Type Cross-referencing C constructs The following roles create cross-references to C-language constructs if they are defined in the documentation: - :c:func: Reference a C-language function. Should include trailing parentheses. - :c:member: Reference a C-language member of a struct. - :c:macro: Reference a “simple” C macro, as defined above. - :c:type: Reference a C-language type. - :c:data: Reference a C-language variable. The C++ Domain The C++ domain (name cpp) supports documenting C++ projects. Directives The following directives are available. All declarations can start with a visibility statement (public, private or protected). - .. cpp:class:: class specifier class template - .. cpp:var:: (member) variable declaration. - typedef std::vector<int> MyList A typedef-like declaration of a type. - type MyContainer::const_iterator Declaration of a type alias with unspecified type. - using MyType = std::unordered_map<int, std::string> Declaration of a type alias. template<typename T> using MyContainer = std::vector<T> - .. cpp:enum:: unscoped enum declaration - .. cpp:enum-struct:: scoped enum declaration - .. cpp:enum-class:: scoped enum declaration - .. cpp:enumerator:: name = constant Describe an enumerator, optionally with its value defined, e.g.,: .. cpp:enumerator:: MyEnum::myEnumerator .. cpp:enumerator:: MyEnum::myOtherEnumerator = 42 - .. cpp:concept:: template-parameter-list name -<typename It>: - template<typename It> concept std::Iterator Proxy to an element of a notional sequence that can be compared, indirected, or incremented. Notation - It r An lvalue. Valid Expressions - *r, when r is dereferenceable. - ++r, with return type It&, when r is incrementable. Options Some directives support options: - :noindex:, see Basic Markup. - :tparam-line-spec:, for templated declarations. If specified, each template parameter will be rendered on a separate line. Constrained Templates - WARNING: The support for concepts is experimental. It is based on the current draft standard and the Concepts Technical Specification. The features may change as they evolve. - NOTE: Sphinx does not currently support requires clauses. Placeholders) A function template with a template parameter constrained to be an Iterator. - std::LessThanComparable{T} class MySortedContainer - :cpp:expr:: int a = 42 int f(int i) An expression: a * f(a). A type: const MySortedContainer<int>&. Namespacing<typename T> \ std::vector .. cpp:namespace:: template<typename T> std::vector .. cpp:function:: std::size_t size() const declares size Change the scope relatively to the current scope. For example, after: .. cpp:namespace:: A::B .. cpp:namespace-push:: C::D the current scope will be A::B::C::D. - .. cpp:namespace-pop:: Info field lists The C++ directives support the following info fields (see also Info field lists): - param, parameter, arg, argument: Description of a parameter. - tparam: Description of a template parameter. - returns, return: Description of a return value. - throws, throw, exception: Description of a possibly thrown exception. Cross-referencing These roles link to the given declaration types: - :cpp:any: - :cpp:class: - :cpp:func: - :cpp:member: - :cpp:var: - :cpp:type: - :cpp:concept: - :cpp:enum: - :cpp:enumerator: Reference a C++ declaration by name (see below for details). The name must be properly qualified relative to the position of the link. - Note on References with Templates Parameters/Arguments Sphinx’s syntax to give references a custom title can interfere with linking to class templates, For linking to non-templated declarations the name must be a nested name, e.g., f or MyClass::f. Templated declarations Assume the following declarations. - class Wrapper - template<typename TOuter> class Outer template<typename TInner> class Inner class template Assume the following declarations. - template<typename TOuter> class Outer template<typename TInner> class Inner - template<> class Outer<int> template<typename TInner> class Inner template<> class Inner<bool> Assume the following declaration. template<typename T> class Outer<T *> References to partial specialisations must always include the template parameter lists, e.g., template\<typename T> Outer\<T*> (template<typename T> Outer<T*>). Currently the lookup only succeed if the template parameter identifiers are equal strings. Configuration Variables See cpp-config. The Standard directive is a deprecated alias for the option directive. - .. envvar:: name Describes an environment variable that the documented code or program uses or defines. Referencable by envvar. - .. program:: name and svn commit separately). New in version 0.5. There is also a very generic object description directive, which is not tied to any domain: - .. describe:: text - .. object:: text This directive produces the same formatting as the specific ones provided by domains, but does not create index entries or cross-referencing targets. Example: .. describe:: PAPER You can set this variable to select a paper size. The JavaScript Domain The JavaScript domain (name js) provides the following directives: - .. js:module:: name. To clear the current module, set the module name to null or None New in version 1.6. - .. js:function:: name(signature). - .. js:method:: name(signature) This directive is an alias for js:function, however it describes a function that is implemented as a method on a class object. New in version 1.6. - .. js:class:: name - .. js:data:: name Describes a global variable or constant. - .. js:attribute:: object.name Describes the attribute name of object. These roles are provided to refer to the described objects: :js:mod: :js:func: :js:meth: :js:class: :js:data: :js:attr: The reStructuredText domain The reStructuredText domain (name rst) provides the following directives: - .. rst:directive:: name. - .. rst:role:: name Describes a reST role. For example: .. rst:role:: foo Foo description. will be rendered as: - :foo: Foo description. These roles are provided to refer to the described objects: :rst:dir: :rst:role: More domains. Available Builders These are the built-in Sphinx builders. More builders can be added by extensions. The builder’s “name” must be given to the -b command-line option of sphinx-build to select a builder. - class sphinx.builders.html.StandaloneHTMLBuilder This is the standard HTML builder. Its output is a directory with HTML files, complete with style sheets and optionally the reST sources. There are quite a few configuration values that customize the output of this builder, see the chapter html-options for details. name = 'html' format = 'html' supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg'] - class sphinx.builders.html.DirectoryHTMLBuilder/. name = 'dirhtml' format = 'html' supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg'] New in version 0.6. - class sphinx.builders.html.SingleFileHTMLBuilder This is an HTML builder that combines the whole project in one output file. (Obviously this only works with smaller projects.) The file is named like the master document. No indices will be generated. name = 'singlehtml' format = 'html' supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg'] New in version 1.0. - class sphinx.builders.htmlhelp.HTMLHelpBuilder This builder produces the same output as the standalone HTML builder, but also generates HTML Help support files that allow the Microsoft HTML Help Workshop to compile them into a CHM file. name = 'htmlhelp' format = 'html' supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] - class sphinx.builders.qthelp.QtHelpBuilder This builder produces the same output as the standalone HTML builder, but also generates Qt help collection support files that allow the Qt collection generator to compile them. name = 'qthelp' format = 'html' supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg'] - class sphinx.builders.applehelp.AppleHelpBuilder This builder produces an Apple Help Book based on the same output as the standalone HTML builder. If the source directory contains any .lproj folders,_tools to True, in which case the output will not be valid until hiutil has been run on all of the .lproj folders within the bundle. name = 'applehelp' format = 'html' supported_image_types = ['image/png', 'image/gif', 'image/jpeg', 'image/tiff', 'image/jp2', 'image/svg+xml'] New in version 1.3. - class sphinx.builders.devhelp.DevhelpBuilder This builder produces the same output as the standalone HTML builder, but also generates GNOME Devhelp support file that allows the GNOME Devhelp reader to view them. name = 'devhelp' format = 'html' supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] - class sphinx.builders.epub3.Epub3Builder This builder produces the same output as the standalone HTML builder, but also generates an epub file for ebook readers. See epub-faq for details about it. For definition of the epub format, have a look at or. The builder creates EPUB 3 files. name = 'epub' format = 'html' supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg'] New in version 1.4. Changed in version 1.5: Since Sphinx-1.5, the epub3 builder is used for the default builder of epub. - class sphinx.builders.latex.LaTeXBuilder This builder produces a bunch of LaTeX files in the output directory. You have to specify which documents are to be included in which LaTeX files via the latex_documents configuration value. There are a few configuration values that customize the output of this builder, see the chapter latex-options uses latexmk (not on Windows). This makes sure the needed number of runs is automatically executed to get the cross-references, bookmarks, indices, and tables of contents right. One can pass to latexmk options via the LATEXMKOPTS Makefile variable. For example: make latexpdf LATEXMKOPTS="-silent" reduces console output to a minimum. Also, if latexmk version executable, use variable LATEXOPTS. make latexpdf LATEXOPTS="--interaction=nonstopmode" name = 'latex' format = 'latex' supported_image_types = ['application/pdf', 'image/png', 'image/jpeg'] Note that a direct PDF builder is being provided by rinohtype. The builder’s name is rinoh. Refer to the rinohtype manual for details. There is also PDF builder using ReportLab in rst2pdf version 0.12 or greater. However, rst2pdf is no longer being actively maintained and suffers from some problems when used with recent Sphinx versions. See the rst2pdf manual for usage instructions. - class sphinx.builders.text.TextBuilder This builder produces a text file for each reST file – this is almost the same as the reST source, but with much of the markup stripped for better readability. name = 'text' format = 'text' supported_image_types = [] New in version 0.4. - class sphinx.builders.manpage.ManualPageBuilder This builder produces manual pages in the groff format. You have to specify which documents are to be included in which manual pages via the man_pages configuration value. name = 'man' format = 'man' supported_image_types = [] New in version 1.0. - class sphinx.builders.texinfo.TexinfoBuilder-faq for more details. The Texinfo format is the official documentation system used by the GNU project. More information on Texinfo can be found at. name = 'texinfo' format = 'texinfo' supported_image_types = ['image/png', 'image/jpeg', 'image/gif'] New in version 1.1. - class sphinx.builders.html.SerializingHTMLBuilder A module that implements dump(), load(), dumps() and loads() functions that conform to the functions with the same names from the pickle module. Known modules implementing this interface are simplejson, phpserialize, plistlib, and others. - out_suffix The suffix for all regular files. - globalcontext_filename The filename for the file that contains the “global context”. This is a dict with some general configuration values such as the name of the project. - searchindex_filename The filename for the search index Sphinx generates. See Serialization builder details for details about the output format. New in version 0.5. - class sphinx.builders.html.PickleHTMLBuilder This builder produces a directory with pickle files containing mostly HTML fragments and TOC information, for use of a web application (or custom postprocessing tool) that doesn’t use the standard HTML templates. See Serialization builder details for details about the output format. - name = 'pickle' The old name web still works as well. format = 'html' supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg'] The file suffix is .fpickle. The global context is called globalcontext.pickle, the search index searchindex.pickle. - class sphinx.builders.html.JSONHTMLBuilder This builder produces a directory with JSON files containing mostly HTML fragments and TOC information, for use of a web application (or custom postprocessing tool) that doesn’t use the standard HTML templates. See Serialization builder details for details about the output format. name = 'json' format = 'html' supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg'] The file suffix is .fjson. The global context is called globalcontext.json, the search index searchindex.json. New in version 0.5. - class sphinx.builders.gettext.MessageCatalogBuilder This builder produces gettext-style message catalogs. Each top-level file or subdirectory grows a single .pot catalog template. See the documentation on intl for further reference. name = 'gettext' format = '' supported_image_types = [] New in version 1.1. - class sphinx.builders.changes.ChangesBuilder This builder produces an HTML overview of all versionadded, versionchanged and deprecated directives for the current version. This is useful to generate a ChangeLog file, for example. name = 'changes' format = '' supported_image_types = [] - class sphinx.builders.dummy.DummyBuilder This builder produces no output. The input is only parsed and checked for consistency. This is useful for linting purposes. name = 'dummy' supported_image_types = [] New in version 1.4. - class sphinx.builders.linkcheck.CheckExternalLinksBuilder This builder scans all documents for external links, tries to open them with requests, and writes an overview which ones are broken and redirected to standard output and to output.txt in the output directory. name = 'linkcheck' format = '' supported_image_types = [] Changed in version 1.5: Since Sphinx-1.5, the linkcheck builder comes to use requests module. - class sphinx.builders.xml.XMLBuilder This builder produces Docutils-native XML files. The output can be transformed with standard XML tools such as XSLT processors into arbitrary final forms. name = 'xml' format = 'xml' supported_image_types = [] New in version 1.2. - class sphinx.builders.xml.PseudoXMLBuilder. name = 'pseudoxml' format = 'pseudoxml' supported_image_types = [] New in version 1.2. Built-in Sphinx extensions that offer more builders are: - doctest - coverage Serialization builder details: - SerializingHTMLBuilder.globalcontext_filename A pickled dict with these keys: - project, copyright, package is available on unpickling. The Build Configuration File class in the sphinx.builders module. - Remember that document names use / as the path separator and don’t contain the file name extension. - Since. - There is a special object named tags available in the config file. It can be used to query and change the tags (see tags). Use tags.has('tag') to query, tags.add('tag') and tags.remove('tag') to change. Only tags set via the -t command-line option or via tags.add('tag') can be queried using tags.has('tag'). Note that the current builder tag is not available in conf.py, as it is created after the builder is initialized. - SEE ALSO: Additional configurations, such as adding stylesheets, javascripts, builders, etc. can be made through the /extdev/appapi. General configuration - extensions A list of strings that are module names of extensions. These can be extensions coming with Sphinx (named sphinx.ext.*) or custom ones. Note that you can extend sys.path within from the subdirectory sphinxext. The configuration file itself can be an extension; for that, you only need to provide a setup() function in it. - source_suffix The file name extension, or list of extensions, of source files. Only files with this suffix will be read as sources. Default is '.rst'. Changed in version 1.3: Can now be a list of extensions. - source_encoding The encoding of all reST source files. The recommended encoding, and the default value, is 'utf-8-sig'. New in version 0.5: Previously, Sphinx accepted only UTF-8 encoded sources. - source_parsers If given, a dictionary of parser classes for different source suffices. The keys are the suffix, the values can be either a class or a string giving a fully-qualified name of a parser class. The parser class can be either docutils.parsers.Parser. New in version 1.3. - master_doc The document name of the “master” document, that is, the document that contains the root toctree directive. Default is 'contents'. - exclude_patterns file (replaces entry in unused_docs) - 'library/xml' – ignores the library/xml directory - 'library/xml*' – ignores all files and directories starting with library/xml - '**/.svn' – ignores all .svn directories exclude_patterns is also consulted when looking for static files in html_static_path and html_extra_path. New in version 1.0. - templates_path A string of reStructuredText that will be included at the beginning of every source file that is read. New in version 1.0. - primary_domain-role directive. New in version 0.4. - keep_warnings. - suppress_warnings - ref.python - If set to a major.minor version string like '1.1', Sphinx will compare it with its version and refuse to build if it is too old. Default is no requirement. New in version 1.0. Changed in version 1.4: also accepts micro version string - needs_extensions dev-extensions for how to do that). New in version 1.3. - manpages_url A URL to cross-reference manpage directives. If this is defined to{path}, the :manpage:`man(1)` role will like.7. - nitpicky If true, Sphinx will warn about all references where the target cannot be found. Default is False. You can activate this mode temporarily using the -n command-line switch. New in version 1.0. - nitpick_ignore. - numfig If true, figures, tables and code-blocks are automatically numbered if they have a caption. The numref role is enabled. Obeyed so far only by HTML and LaTeX builders. Default is False. NOTE: The LaTeX builder always assigns numbers whether this option is enabled or not. New in version 1.3. - numfig_format -. - 2 means that numbers will be x.y.1, x.y.2, … if located in a sub-section (but still x.1, x.2, … if located directly under a section and 1, 2, … if not in any top level section.) - etc… New in version 1.3. Changed in version 1.7: The LaTeX builder obeys this setting (if numfig is set to True). - smartquotes and text (see smartquotes_excludes.) A docutils.conf file located in the configuration directory (or a global ~/.docutils file) is obeyed unconditionally if it deactivates smart quotes via the corresponding Docutils option. But if it activates them, then smartquotes does prevail. - smartquotes_action This string, for use with Docutils 0.14 or later, customizes the Smart Quotes transform. See the file smartquotes.py at the Docutils repository for details. The default 'qDe' educates normal quote characters ", ', em- and en-Dashes ---, --, and ellipses .... New in version 1.6.6. - smartquotes_excludes This is a dict whose default is: {'languages': ['ja'], 'builders': ['man', 'text']} Each entry gives a sufficient condition to ignore the smartquotes setting following make html needs. - tls_verify If true, Sphinx verifies server certifications. Default is True. New in version 1.5. - tls_cacerts A path to a certification file of CA or a path to directory which contains the certificates. This also allows a dictionary mapping hostname to the path to certificate file. The certificates are used to verify server certifications. New in version 1.5. Project information - project The documented project’s name. A copyright statement in the style '2008, Author Name'. - version The major project version, used as the replacement for |version|. For example, for the Python documentation, this may be something like 2.6. - release - today_fmt The default language to highlight source code in. The default is 'python3'. The value should be a valid Pygments lexer name, see A dictionary of options that modify how the lexer specified by highlight_language generates highlighted source code. These are lexer-specific; for the options understood by each, see the Pygments documentation. New in version 1.3. - pygments_style A boolean that decides whether parentheses are appended to function and method role text (e.g. the content of :func:`input`) to signify that the name is callable. Default is True. - add_module_names A boolean that decides whether module names are prepended to all object names (for object types where a “module” of some kind is defined), e.g. for py:function directives. Default is True. - show_authors A boolean that decides whether codeauthor and sectionauthor directives produce any output in the built files. - modindex_common_prefix Trim spaces before footnote references that are necessary for the reST parser to recognize the footnote, but do not look too nice in the output. New in version 0.6. - trim_doctest_flags These options influence Sphinx’s Native Language Support. See the documentation on intl for details. - language setting, the message catalogs (compiled from .po format using msgfmt) must be in ./locale/language/LC_MESSAGES/sphinx.mo. The text domain of individual documents depends on gettext_compact. The default is ['locales']. Changed in version 1.5: Use locales directory as a default value - gettext_compact 3rd-party package written in C by using pip install python-levenshtein. The default is False. New in version 1.3. - gettext_location If true, Sphinx generates location information for messages in message catalogs. The default is True. New in version 1.3. - gettext_auto_build If true, Sphinx builds mo file for each translation catalog files. The default is True. New in version 1.3. - gettext_additional_targets To specify names to enable gettext extracting and translation applying for i18n additionally. You can specify below names: - Index index terms - Literal-block literal blocks: :: and code-block. - Doctest-block doctest block - Raw raw content - Image image/figure uri and alt For example: gettext_additional_targets = ['literal-block', 'image']. The default is []. New in version 1.3. - figure_language_filename The filename format for language-specific figures. The default value is {root}.{language}{ext}. It will be expanded to dirname/filename.en.png from ... en For example, setting this to {path}{language}/{basename}{ext} will expand to dirname/en/filename.png instead. New in version 1.4. Changed in version 1.5: Added {path} and {basename} tokens. Options for HTML output These options influence HTML as well as HTML Help output, and other builders that use Sphinx’s HTMLWriter class. - html_theme The “theme” that the HTML output should use. See the section about theming. The default is 'alabaster'. New in version 0.6. - html_theme_options A dictionary of options that influence the look and feel of the selected theme. These are theme-specific. For the options understood by the builtin themes, see this section. New in version 0.6. - html_theme_path A list of paths that contain custom themes, either as subdirectories or as zip files. Relative paths are taken as relative to the configuration directory. New in version 0.6. - html_style to import the theme’s stylesheet. - html_title The “title” for HTML documentation generated with Sphinx’s own templates. This is appended to the <title> tag of individual pages, and used in the navigation bar as the “topmost” element. It defaults to '<project> v<revision> documentation'. - html_short_title A shorter “title” for the HTML docs. This is used in for links in the header and in the HTML Help docs. If not given, it defaults to the value of html_title. New in version 0.4. - html_context A dictionary of values to pass into the template engine’s context for all pages. Single values can also be put in this dictionary using the -A command-line option of sphinx-build. New in version 0.5. - html_logo directory of the output HTML, but only if the file does not already exist there. - html_favicon directory of the output HTML, but only if the file does not already exist there. - html_static_path A list of paths that contain extra files not directly related to the documentation, such as robots.txt_patterns on copying extra files and directories, and ignores if path matches to patterns. - html_last_updated_fmt If this is not None, a ‘Last updated on:’ timestamp is inserted at every page bottom, using the given strftime() format. The empty string is equivalent to '%b %d, %Y' (or a locale-dependent equivalent). - html_use_smartypants If true, quotes and dashes are converted to typographically correct entities. Default: True. Deprecated since version 1.6: To disable smart quotes, use rather smartquotes. - html_add_permalinks. - html_sidebars will be removed in.html and Additional templates that should be rendered to HTML pages, must be a dictionary that maps document names to template names. Example: html_additional_pages = { 'download': 'customdownload.html', } This will render the template customdownload.html as the page download.html. - html_domain_indices_use_index If true, add an index to the HTML documents. Default is True. New in version 0.4. - html_split_index If true, the index is generated twice: once as a single page with all the entries, and once as one page per starting letter. Default is False. New in version 0.4. - html_copy_source If true (and html_copy_source is true as well), links to the reST sources will be added to the sidebar. The default is True. New in version 0.6. - html_sourcelink_suffix Suffix to be appended to source links (see html_show_sourcelink), unless they have this suffix already. Default is '.txt'. New in version 1.5. - html_use_opensearch This is the file name suffix for generated HTML files. The default is ".html". New in version 0.4. - html_link_suffix Suffix for generated links to HTML files. The default is whatever html_file_suffix is set to; it can be set differently (e.g. to support different web server setups). New in version 0.6. - html_show_copyright If true, “(C) Copyright …” is shown in the HTML footer. Default is True. New in version 1.0. - html_show_sphinx If true, “Created using Sphinx” is shown in the HTML footer. Default is True. New in version 0.4. - html_output_encoding Encoding of HTML output files. Default is 'utf-8'. Note that this encoding name must both be a valid Python encoding name and a valid HTML charset value. New in version 1.0. - html_compact_lists Suffix for section numbers. Default: ". ". Set to " " to suppress the final dot on section numbers. New in version 1.0. - html_search_language - Accelerating A dictionary with options for the search language support, empty by default. The meaning of these options depends on the language selected. The English support has no options. The Japanese support has these options: -. To keep compatibility, 'mecab', 'janome' and 'default' are also acceptable. However it will be deprecated in Sphinx-1.6. Other option values depend on splitter value which you choose. - Options for 'mecab': - dic_enc is the encoding for the MeCab algorithm. - dict is the dictionary to use for the MeCab algorithm. - lib is the user dictionary file path for Janome. - user_dic_enc is the encoding for the user dictionary file specified by user_dic option. Default is ‘utf8’. New in version 1.1. Changed in version 1.4: html_search_options for Japanese is re-organized and any custom splitter can be used by type settings. The Chinese support has these options: - dict – the jieba dictionary path if want to use custom dictionary. - html_search_scorer The name of a JavaScript file (relative to the configuration directory) that implements a search results scorer. If empty, the default will be used. New in version 1.2. - html_scaled_image_link If true, images itself links to the original image if it doesn’t have ‘target’ option or scale related options: ‘scale’, ‘width’, ‘height’. The default is True. New in version 1.3. - htmlhelp_basename Output file base name for HTML help builder. Default is 'pydoc'. - html_experimental_html5_writer Output is processed with HTML5 writer. This feature needs docutils 0.13 or newer. Default is False. New in version 1.6. Options for Apple Help output_name The basename for the Apple Help Book. Defaults to the project name. - applehelp_bundle_id The bundle ID for the help book bundle. WARNING: You must set this value in order to generate Apple Help. - applehelp_dev_region The development region. Defaults to 'en-us', which is Apple’s recommended setting. - applehelp_bundle_version The bundle version (as a string). Defaults to '1'. - applehelp_icon The help bundle icon file, or None for no icon. According to Apple’s documentation, this should be a 16-by-16 pixel version of the application’s icon with a transparent background, saved as a PNG file. - applehelp_kb_product The product tag for use with applehelp_kb_url. Defaults to '<project>-<release>'. - applehelp_kb_url for no remote search. - applehelp_remote_url The URL for remote content. You can place a copy of your Help Book’s Resources folder at this location and Help Viewer will attempt to use it to fetch updated content. e.g. if you set it to and Help Viewer wants a copy of index.html for an English speaking customer, it will look at. Defaults to None for no remote content. - applehelp_index_anchors If True, tell the help indexer to index anchors in the generated HTML. This can be useful for jumping to a particular topic using the AHLookupAnchor function or the openHelpAnchor:inBook: method in your code. It also allows you to use help:anchor URLs; see the Apple documentation for more information on this topic. - applehelp_min_term_length Controls the minimum term length for the help indexer. Defaults to None, which means the default will be used. - applehelp_stopwords Either a language specification (to use the built-in stopwords), or the path to a stopwords plist, or None if you do not want to use stopwords. The default stopwords plist can be found at /usr/share/hiutil/Stopwords.plist and contains, at time of writing, stopwords for the following languages: Defaults to language, or if that is not set, to en. - applehelp_locale Specifies the locale to generate help for. This is used to determine the name of the .lproj folder inside the Help Book’s Resources, and is passed to the help indexer. Defaults to language, or if that is not set, to en. - applehelp_title Specifies the help book title. Defaults to '<project> Help'. - applehelp_codesign_identity Specifies the identity to use for code signing, or None if code signing is not to be performed. Defaults to the value of the environment variable CODE_SIGN_IDENTITY, which is set by Xcode for script build phases, or None if that variable is not set. - applehelp_codesign_flags_indexer_path The path to the hiutil program. Defaults to '/usr/bin/hiutil'. - applehelp_codesign_path The path to the codesign program. Defaults to '/usr/bin/codesign'. - applehelp_disable_external_tools These options influence the epub output. As this builder derives from the HTML builder, the HTML options also apply where appropriate. The actual values for some of the options is not really important, they just have to be entered into the Dublin Core metadata. - epub_basename The basename for the epub file. It defaults to the project name. - epub_theme The HTML theme for the epub output. Since the default themes are not optimized for small screen space, using the same theme for HTML and epub output is usually not wise. This defaults to 'epub', a theme designed to save visual space. - epub_theme_options A dictionary of options that influence the look and feel of the selected theme. These are theme-specific. For the options understood by the builtin themes, see this section. New in version 1.2. - epub_title The title of the document. It defaults to the html_title option but can be set independently for epub creation. - epub_description The description of the document. The default value is 'unknown'. New in version 1.4. Changed in version 1.5: Renamed from epub3_description - epub_author The author of the document. This is put in the Dublin Core metadata. The default value is 'unknown'. - epub_contributor The name of a person, organization, etc. that played a secondary role in the creation of the content of an EPUB Publication. The default value is 'unknown'. New in version 1.4. Changed in version 1.5: Renamed from epub3_contributor - epub_language The language of the document. This is put in the Dublin Core metadata. The default is the language option or 'en' if unset. - epub_publisher The publisher of the document. This is put in the Dublin Core metadata. You may use any sensible string, e.g. the project homepage. The default value is 'unknown'. - epub_copyright The copyright of the document. It defaults to the copyright option but can be set independently for epub creation. - epub_identifier An identifier for the document. This is put in the Dublin Core metadata. For published documents this is the ISBN number, but you can also use an alternative scheme, e.g. the project homepage. The default value is 'unknown'. - epub_scheme The publication scheme for the epub_identifier. This is put in the Dublin Core metadata. For published books the scheme is 'ISBN'. If you use the project homepage, 'URL' seems reasonable. The default value is 'unknown'. - epub_uid A unique identifier for the document. This is put in the Dublin Core metadata. You may use a XML’s Name format string. You can’t use hyphen, period, numbers as a first character. The default value is 'unknown'. - epub_cover A list of files that are generated/copied in the build directory but should not be included in the epub file. The default value is []. - epub_tocdepth The depth of the table of contents in the file toc.ncx. It should be an integer greater than zero. The default value is 3. Note: A deeply nested table of contents may be difficult to navigate. - epub_tocdup This flag determines if a toc entry is inserted again at the beginning of its nested toc listing. This allows easier navigation to the top of a chapter, but can be confusing because it mixes entries of different depth in one list. The default value is True. - epub_tocscope This setting control the scope of the epub table of contents. The setting can have the following values: - 'default' – include all toc entries that are not hidden (default) - 'includehidden' – include all toc entries New in version 1.2. - epub_fix_images because the automatic conversion may lose information. New in version 1.2. - epub_max_image_width If true, add an index to the epub document. It defaults to the html_use_index option but can be set independently for epub creation. New in version 1.2. - epub_writing_mode It specifies writing direction. It can accept 'horizontal' (default) and 'vertical' - [2] Options for LaTeX output These options influence LaTeX output. See further latex. - latex_engine The LaTeX engine to build the docs. The setting can have the following values: - 'pdflatex' – PDFLaTeX (default) - 'xelatex' – XeLaTeX - 'lualatex' – LuaLaTeX - 'platex' – pLaTeX (default if language is 'ja') PDFLaTeX’s support for Unicode characters covers those from the document language (the LaTeX babel and inputenc packages map them to glyph slots in the document font, at various encodings allowing each only 256 characters; Sphinx uses by default (except for Cyrillic languages) the times package),ia package to see how to instruct LaTeX to use some other OpenType font if Unicode coverage proves insufficient (or use directly \setmainfont et. al. as in this example.) - latex_documents here.) - to If given, this must be the name of an image file (relative to the configuration directory) that is the logo of the docs. It is placed at the top of the title page. Default: None. - latex_toplevel_sectioning This value determines the topmost sectioning unit. It should be chosen from 'part', 'chapter' or 'section'. The default is None; the topmost sectioning unit is switched by documentclass: section is used if documentclass will be howto, otherwise chapter will be used. Note that if LaTeX uses \part command, then the numbering of sectioning units one level deep gets off-sync with HTML numbering, because LaTeX numbers continuously \chapter (or \section for howto.) New in version 1.4. - latex_appendices A list of document names to append as an appendix to all manuals. - latex If true, add page references after internal references. This is very useful for printed copies of the manual. Default is False. New in version 1.0. - latex_show_urls is still accepted. - latex_use_latex_multicolumn The default is False: it means that Sphinx’s own macros are used for merged cells from grid tables. They allow general contents (literal blocks, lists, blockquotes, …) but may have problems if the tabularcolumns directive was used to inject LaTeX mark-up of the type >{..}, <{..}, @{..} as column specification. Setting to True means to use LaTeX’s standard \multicolumn; this is incompatible with literal blocks in the horizontally merged cell, and also with multiple paragraphs in such cell if the table is rendered using tabulary. New in version 1.6. - latex_elements New in version 0.5. A dictionary that contains LaTeX snippets that override those Sphinx usually puts into the generated .tex files. when used in image attributes width and height. The default value is '0.75bp' which achieves 96px=1in (in TeX 1in = 72bp = 72.27pt.) To obtain for example 100px=1in use package options for the Sphinx LaTeX style, default empty. See latex. is used if no language.) For Japanese documents, the default is the empty string. Changed in version 1.5: For latex_engine set in code-blocks to compensate. Since 1.5 this is not hard-coded anymore, and can be modified via inclusion in 'preamble' key of \\fvset{fontsize=auto}. This is recommended if the fonts match better than Times and Courier. At 1.8 a separate 'fvset' key will permit such customization without usage of 'preamble' key. Changed in version 1.2: Defaults to '' when the language uses the Cyrillic script. Changed in version 1.5: Defaults to '' when latex_engine is 'xelatex'. Changed in version 1.6: 'lualatex' also uses fontspec option if latex_engine file and howto classes.) itself A dictionary mapping 'howto' and 'manual' to names of real document classes that will be used as the base for the two Sphinx classes. Default is to use 'article' for 'howto' and 'report' for 'manual'. New in version 1.0. Changed in version 1.5: In Japanese docs (language is 'ja'), by default 'jreport' is used for 'howto' and 'jsbook' for 'manual'. - latex_additional_files These options influence text output. - text_newlines. - text_sectionchars A string of 7 characters that should be used for underlining sections. The first character is used for first-level headings, the second for second-level headings and so on. The default is '*=-~"+`'. New in version 1.1. - text_add_secnumbers A boolean that decides whether section numbers are included in text output. Default is True. New in version 1.7. - text_secnumber_suffix Suffix for section numbers in text output. Default: ". ". Set to " " to suppress the final dot on section numbers. New in version 1.7. Options for manual page output These options influence manual page output. - man_pages here.) -. - man_show_urls If true, add URL addresses after links. Default is False. New in version 1.1. Options for Texinfo output These options influence Texinfo output. - texinfo_documents here.) - DIR menu file. - description: Descriptive text to appear in the top-level DIR menu file. - category: Specifies the section which this entry will appear in the top-level DIR menu file. - A list of document names to append as an appendix to all manuals. New in version 1.1. - texinfo Control how to display URL addresses. - 'footnote' – display URLs in footnotes (default) - 'no' – do not display URLs - 'inline' – display URLs inline in parentheses New in version 1.1. - texinfo_no_detailmenu If true, do not generate a @detailmenu in the “Top” node’s menu containing entries for each sub-node in the document. Default is False. New in version 1.2. - texinfo_elements' New in version 1.1. Options for QtHelp output These options influence qthelp output. As this builder derives from the HTML builder, the HTML options also apply where appropriate. - qthelp_basename The basename for the qthelp file. It defaults to the project name. - qthelp_namespace The namespace for the qthelp file. It defaults to org.sphinx.<project_name>.<project_version>. - qthelp_theme The HTML theme for the qthelp output. This defaults to 'nonav'. - qthelp_theme_options A dictionary of options that influence the look and feel of the selected theme. These are theme-specific. For the options understood by the builtin themes, see this section. Options for the linkcheck builder - linkcheck_ignore A list of regular expressions that match URIs that should not be checked when doing a linkcheck build. Example: linkcheck_ignore = [r':\d+/'] New in version 1.1. - linkcheck_retries The number of times the linkcheck builder will attempt to check a URL before declaring it broken. Defaults to 1 attempt. New in version 1.4. - linkcheck_timeout A timeout value, in seconds, for the linkcheck builder. The default is to use Python’s global socket timeout. New in version 1.1. - linkcheck_workers The number of worker threads to use when checking links. Default is 5 threads. New in version 1.1. - linkcheck_anchors If true, check the validity of #anchors in links. Since this requires downloading the whole document, it’s considerably slower when enabled. Default is True. New in version 1.2. - linkcheck_anchors_ignore - xml_pretty If true, pretty-print the XML. Default is True. New in version 1.2. Footnotes - [1] A note on available globbing syntax: you can use the standard shell constructs *, ?, [...] and [!...] with the feature that these all don’t match slashes. A double star ** can be used to match any sequence of characters including slashes. Options for the C++ domain - cpp_index_common_prefix A list of prefixes that will be ignored when sorting C++ objects in the global index. For example ['awesome_lib::']. New in version 1.5. - cpp_id_attributes A list of strings that the parser additionally should accept as attributes. This can for example be used when attributes have been #define d for portability. New in version 1.5. - cpp_paren_attributes A list of strings that the parser additionally should accept as attributes with one argument. That is, if my_align_as is in the list, then my_align_as(X) is parsed as an attribute for all strings X that have balanced brances ((), [], and {}). This can for example be used when attributes have been #define d for portability. New in version 1.5. Example of Configuration File # -*-'] Internationalization New in version 1.1. Complementary to translations provided for Sphinx-generated messages such as navigation bars, Sphinx provides mechanisms facilitating document translations in itself. See the intl-options for details on configuration. [image] Workflow visualization of translations in Sphinx. (The stick-figure is taken from an XKCD comic.).UNINDENT - Sphinx internationalization details Translating with sphinx-intl - Quick guide - Translating - Update your po files by new pot files - Using Transifex service for team translation - Contributing to Sphinx reference translation Sphinx internationalization details msgfmt for efficiency reasons. If you make these files discoverable with locale_dirs for your locale, so it ends up in ./locale/es/LC_MESSAGES/usage.mo in your source directory (where es is the language code for Spanish.) msgfmt "usage.po" -o "locale/es/LC_MESSAGES/usage.mo" - Set locale_dirs to ["locale/"]. - Set language to es (also possible via -D). - Run your desired build. Translating with sphinx-intl Quick guide sphinx-intl is a useful tool to work with Sphinx translation flow. This section describe an easy way to translate with sphinx-intl. - 1. Install sphinx-intl by pip install sphinx-intl or easy_install sphinx-intl. - 2. Add configurations to your conf.py: locale_dirs = ['locale/'] # path is example but recommended. gettext_compact = False # optional. This case-study assumes that locale_dirs is set to ‘locale/’ and gettext_compact is set to False (the Sphinx document is already configured as such). - 3. Extract document’s translatable messages into pot files: $ make gettext As a result, many pot files are generated under _build/gettext directory. - 4. Setup/Update your locale_dir: $ sphinx-intl update -p _build/gettext -l de -l ja Done. You got these directories that contain po files: - ./locale/de/LC_MESSAGES/ - ./locale/ja/LC_MESSAGES/ - 5. Translate your po files under ./locale/<lang>/LC_MESSAGES/. - 6. make translated document. You need a language parameter in conf.py or you may also specify the parameter on the command line (for BSD/GNU make): $ make -e SPHINXOPTS="-D language='de'" html command line (for Windows cmd.exe): > set SPHINXOPTS=-D .\make.bat html command line (for PowerShell): > Set-Item env:SPHINXOPTS "-D language='de'" > .\make.bat html Congratulations! You got the translated documentation in the _build/html directory. New in version 1.3: sphinx-build that is invoked by make command will build po files into mo files. If you are using 1.2.x or earlier, please invoke sphinx-intl build command before make command. Translating Translate po file under ./locale/de/LC_MESSAGES directory. The case of builders.po file for sphinx document: # a5600c3d2e3d48fc8c261ea0284db79b #: ../../builders.rst:4 msgid "Available builders" msgstr "<FILL HERE BY TARGET LANGUAGE>" Another case, msgid is multi-line text and contains reStructuredText syntax: # 302558364e1d41c69b3277277e34b184 #: ../../builders.rst:9 msgid "" "These are the built-in Sphinx builders. More builders can be added by " ":ref:`extensions <extensions>`." msgstr "" "FILL HERE BY TARGET LANGUAGE FILL HERE BY TARGET LANGUAGE FILL HERE " "BY TARGET LANGUAGE :ref:`EXTENSIONS <extensions>` FILL HERE." Please be careful not to break reST notation. Most po-editors will help you with that. Update your po files by new pot files If a document is updated, it is necessary to generate updated pot files and to apply differences to translated po files. In order to apply the updating difference of a pot file to po file, use the sphinx-intl update command. $ sphinx-intl update -p _build/locale Using Transifex service for team translation Transifex is one of several services that allow collaborative translation via a web interface. It has a nifty Python-based command line client that makes it easy to fetch and push translations. - 1. Install transifex-client You need tx command to upload resources (pot files). $ pip install transifex-client - SEE ALSO: Transifex Client documentation - 2. Create your transifex account and create new project for your document Currently, transifex does not allow for a translation project to have more than one version of the document, so you’d better include a version number in your project name. For example: - Project ID sphinx-document-test_1_0 - Project URL - 3. Create config files for tx command This process will create .tx/config in the current directory, as well as a ~/.transifexrc file that includes auth information. $ tx init Creating .tx folder... Transifex instance []: ... Please enter your transifex username: <transifex-username> Password: <transifex-password> ... Done. - 4. Upload pot files to transifex service Register pot files to .tx/config file: $ cd /your/document/root $ sphinx-intl update-txconfig-resources --pot-dir _build/locale \ --transifex-project-name sphinx-document-test_1_0 and upload pot files: $ tx push -s Pushing translations for resource sphinx-document-test_1_0.builders: Pushing source file (locale/pot/builders.pot) Resource does not exist. Creating... ... Done. - 5. Forward the translation on transifex - 6. Pull translated po files and make translated html Get translated catalogs and build mo files (ex. for ‘de’): $ cd /your/document/root $ tx pull -l de Pulling translations for resource sphinx-document-test_1_0.builders (...) -> de: locale/de/LC_MESSAGES/builders.po ... Done. Invoke make html (for BSD/GNU make): $ make -e SPHINXOPTS="-D language='de'" html That’s all! TIP: Translating locally and on Transifex If you want to push all language’s po files, you can be done by using tx push -t command. Watch out! This operation overwrites translations in transifex. In other words, if you have updated each in the service and local po files, it would take much time and effort to integrate them. Contributing to Sphinx reference translation The recommended way for new contributors to translate Sphinx reference is to join the translation team on Transifex. There is sphinx translation page for Sphinx (master) documentation. - 1. Login to transifex service. - 2. Go to sphinx translation page. - 3. Click Request language and fill form. - 4. Wait acceptance by transifex sphinx translation maintainers. - 5. (after acceptance) translate on transifex. Footnotes - [1] See the GNU gettext utilities for details on that software suite. - [2] Because nobody expects the Spanish Inquisition! HTML Theming Support # use it in your conf.py html_theme = "dotted" Builtin themes). - for its use. originally used by this documentation. It features a sidebar on the right side. There are currently no options beyond nosidebar and sidebarwidth. NOTE: The Sphinx documentation now uses an adjusted version of the sphinxdoc theme. As said, themes are either a directory or a zipfile (whose name is the theme name), containing the following: - A theme.conf file, config value will override this setting. - The pygments_style setting gives the name of a Pygments style to use for highlighting. This can be overridden by the user in the pygments_style config value. - The sidebars setting gives the comma separated list of sidebar templates for constructing sidebars. This can be overridden by the user in the html_sidebars config value. - The options section contains pairs of variable names and default values. These options can be overridden by the user in html_theme_options and are accessible from all templates as theme_<name>. New in version 1.7: sidebar settings Distribute your theme as a python package The guide to templating is helpful if you want to write your own templates. What is important to keep in mind is the order in which Sphinx searches for templates: - First, in the user’s templates_path directories. -. - [1] It is not an executable Python file, as opposed to conf.py, because that would pose an unnecessary security risk if themes are shared. Third Party Themes. Setuptools Integration Sphinx supports integration with setuptools and distutils through a custom command - BuildDoc. Using setuptools integration The Sphinx build can then be triggered from distutils, and some Sphinx options can be set in setup.py or setup.cfg instead of Sphinx’s own configuration file. For instance, from setup.py: # this is only necessary when not using setuptools/distribute from sphinx.setup_command import BuildDoc cmdclass = {'build_sphinx': BuildDoc} name = 'My project' version = '1.2' release = '1.2.0' setup( name=name, author='Bernard Montgomery', version=release, cmdclass=cmdclass, # these are optional and override conf.py settings command_options={ 'build_sphinx': { 'project': ('setup.py', name), 'version': ('setup.py', version), 'release': ('setup.py', release), 'source_dir': ('setup.py', 'doc')}}, ) - NOTE: If you set Sphinx options directly in the setup() command, replace hyphens in variable names with underscores. In the example above, source-dir becomes source_dir. Or add this section in setup.cfg: [build_sphinx] project = 'My project' version = 1.2 release = 1.2.0 source-dir = 'doc' Once configured, call this by calling the relevant command on setup.py: $ python setup.py build_sphinx Options for setuptools integration - fresh-env A boolean that determines whether the saved environment should be discarded on build. Default is false. This can also be set by passing the -E flag to setup.py. $ python setup.py build_sphinx -E - all-files A boolean that determines whether all files should be built from scratch. Default is false. This can also be set by passing the -a flag to setup.py: $ python setup.py build_sphinx -a - source-dir The target source directory. This can be relative to the setup.py or setup.cfg file, or it can be absolute. It defaults to ./doc or ./docs if either contains a file named conf.py (checking ./doc first); otherwise it defaults to the current directory. This can also be set by passing the -s flag to setup.py: $ python setup.py build_sphinx -s $SOURCE_DIR - build-dir The target build directory. This can be relative to the setup.py or setup.cfg file, or it can be absolute. Default is ./build/sphinx. - config-dir Location of the configuration directory. This can be relative to the setup.py or setup.cfg file, or it can be absolute. Default is to use source-dir. This can also be set by passing the -c flag to setup.py: $ python setup.py build_sphinx -c $CONFIG_DIR New in version 1.0. - builder The builder or list of builders to use. Default is html. This can also be set by passing the -b flag to setup.py: $ python setup.py build_sphinx -b $BUILDER Changed in version 1.6: This can now be a comma- or space-separated list of builders - warning-is-error A boolean that ensures Sphinx warnings will result in a failed build. Default is false. This can also be set by passing the -W flag to setup.py: $ python setup.py build_sphinx -W New in version 1.5. - project The documented project’s name. Default is ''. New in version 1.0. - version The short X.Y version. Default is ''. New in version 1.0. - release The full version, including alpha/beta/rc tags. Default is ''. New in version 1.0. - today How to format the current date, used as the replacement for |today|. Default is ''. New in version 1.0. - link-index A boolean that ensures index.html will be linked to the master doc. Default is false. This can also be set by passing the -i flag to setup.py: $ python setup.py build_sphinx -i New in version 1.0. The copyright string. Default is ''. New in version 1.3. - pdb A boolean to configure pdb on exception. Default is false. New in version 1.5.’s templates to produce HTML? No. You have several other options: - You can write a TemplateBridge subclass that calls your template engine of choice, and set the template_bridge configuration value accordingly. - You can write a custom builder that derives from StandaloneHTMLBuilder and calls your template engine of choice. - You can use the’s. - Inside templates you can set a couple of variables used by the layout template using the {% set %} tag: - reldelim1 The delimiter for the items on the left side of the related bar. This defaults to ' »' Each item in the related bar ends with the value of this variable. - Add additional script files here, like this: {% set script_files = script_files + ["_static/myscript.js"] %} Helper Functions Sphinx provides various Jinja functions as helpers in the template. You can use them to generate links or output multiply used elements. - pathto(document) Return the path to a Sphinx document as a URL. Use this to refer to built documents. - pathto(file, 1) Return the path to a file which is a filename relative to the root of the generated output. Use this to refer to static files. - hasdoc(document) Check if a document with the name document exists. - sidebar() Return the rendered sidebar. - relbar() Return the rendered relation bar. Global Variables These global variables are available in every template and are safe to use. There are more, but most of them are an implementation detail and might change in the future. - builder The name of the builder (e.g. html or htmlhelp). The value of copyright. - docstitle The title of the documentation (the value of html_title), except when the “single-file” builder is used, when it is set to None. - embedded True if the built HTML is meant to be embedded in some viewing application that handles navigation, not the web browser, such as for HTML help or Qt help formats. In this case, the sidebar is not included. - favicon The path to the HTML favicon in the static path, or ''. - file_suffix The value of the builder’s out_suffix attribute, i.e. the file name extension that the output files will get. For a standard HTML builder, this is usually .html. - has_source True if the reST document sources are copied (if html_copy_source is True). - language The value of language. - last_updated The build date. - logo The path to the HTML logo image in the static path, or ''. - master_doc The value of master_doc, for usage with pathto(). - pagename The “page name” of the current file, i.e. either the document name if the file is generated from a reST source, or the equivalent hierarchical name relative to the output directory ([directory/]filename_without_extension). - project The value of project. - release The value of release. - The value of html_short_title. - show_source True if html_show_sourcelink is True. - sphinx_version The version of Sphinx used to build. - style The name of the main stylesheet, as given by the theme or html_style. - title The title of the current document, as used in the <title> tag. - use_opensearch The value of html_use_opensearch. - version The value of version.: - body A string containing the content of the page in HTML form as produced by the HTML builder, before the theme is applied. - display_toc A boolean that is True if the toc contains more than one entry. - meta Document metadata (a dictionary), see metadata. - metatags A string containing the page’s HTML meta tags. The suffix of the file that was rendered. Since we support a list of source_suffix, this will allow you to properly link to the original source file. - parents A list of parent documents for navigation, structured like the next item. - prev Like next, but for the previous page. - sourcename The name of the copied source file for the current document. This is only nonempty if the html_copy_source value is True. This has empty value on creating automatically-generated files. - title The page title. - toc The local table of contents for the current page, rendered as HTML bullet lists. -. Latex Customization For details of the LaTeX/PDF builder command line invocation, refer to LaTeXBuilder. Basic customization The latex target does not benefit from prepared themes. Basic customization is obtained via usage of the latex-options. For example: # inside conf.py latex_engine = 'xelatex' latex_elements = { 'fontpkg': r''' \setmainfont{DejaVu Serif} \setsansfont{DejaVu Sans} \setmonofont{DejaVu Sans Mono} ''', 'preamble': r''' \usepackage[titles]{tocloft} \cftsetpnumwidth {1.25cm}\cftsetrmarg{1.5cm} \setlength{\cftchapnumwidth}{0.75cm} \setlength{\cftsecindent}{\cftchapnumwidth} \setlength{\cftsecnumwidth}{1.25cm} ''', 'fncychap': r'\usepackage[Bjornstrup]{fncychap}', 'printindex': r'\footnotesize\raggedright\printindex', } latex_show_urls = 'footnote' If the size of the 'preamble' contents becomes inconvenient, one may move all needed macros into some file mystyle.tex.txt of the project source repertory, and get LaTeX to import it at run time: 'preamble': r'\input{mystyle.tex.txt}', # or, if the \ProvidesPackage LaTeX macro is used in a file mystyle.sty 'preamble': r'\usepackage{mystyle}', It is then needed to set appropriately latex_additional_files, for example: latex_additional_files = ["mystyle.sty"] The LaTeX style file options Additional customization is possible via LaTeX options of the Sphinx style file. The sphinxsetup interface The 'sphinxsetup' key of latex_elements provides a convenient interface: latex_elements = { 'sphinxsetup': 'key1=value1, key2=value2, ...', } - some values may be LaTeX macros, then the backslashes must be Python-escaped, or the whole must be a Python raw string, - LaTeX boolean keys require lowercase true or false values, - spaces around the commas and equal signs are ignored, spaces inside LaTeX macros may be significant. If non-empty, it will be passed as argument to the \sphinxsetup macro inside the document preamble, like this: \usepackage{sphinx} \sphinxsetup{key1=value1, key2=value2,...} New in version 1.5. HINT: It is possible to insert further uses of the \sphinxsetup LaTeX macro directly into the body of the document, via the help of the raw directive. Here is how this present chapter in PDF is styled: .. raw:: latex \begingroup \sphinxsetup{% verbatimwithframe=false, VerbatimColor={named}{OldLace}, TitleColor={named}{DarkGoldenrod}, hintBorderColor={named}{LightCoral}, attentionborder=3pt, attentionBorderColor={named}{Crimson}, attentionBgColor={named}{FloralWhite}, noteborder=2pt, noteBorderColor={named}{Olive}, cautionborder=3pt, cautionBorderColor={named}{Cyan}, cautionBgColor={named}{LightCyan}} at the start of the chapter and: .. raw:: latex \endgroup at its end. The colors used in the above are provided by the svgnames option of the “xcolor” package: latex_elements = { 'passoptionstopackages': r'\PassOptionsToPackage{svgnames}{xcolor}', } The available styling options - hmargin, vmargin The dimensions of the horizontal (resp. vertical) margins, passed as hmargin (resp. vmargin) option to the geometry package. The default is 1in, which is equivalent to {1in,1in}. Example: 'sphinxsetup': 'hmargin={2in,1.5in}, vmargin={1.5in,2in}, marginpar=1in', Japanese documents currently accept only the one-dimension format for these parameters. The geometry package is then passed suitable options to get the text width set to an exact multiple of the zenkaku width, and the text height set to an integer multiple of the baselineskip, with the closest fit for the margins. HINT: For Japanese 'manual' docclass with pointsize 11pt or 12pt, use the nomag extra document class option (cf. 'extraclassoptions' key of latex_elements) or so-called TeX “true” units: 'sphinxsetup': 'hmargin=1.5truein, vmargin=1.5truein, marginpar=5zw', New in version 1.5.3. - marginpar The \marginparwidth LaTeX dimension, defaults to 0.5in. For Japanese documents, the value is modified to be the closest integer multiple of the zenkaku width. New in version 1.5.3. - verbatimwithframe default true. Boolean to specify if code-blocks and literal includes are framed. Setting it to false does not deactivate use of package “framed”, because it is still in use for the optional background colour. - verbatimwrapslines default true. Tells whether long lines in code-block’s contents should wrap. - literalblockcappos default t for “top”. Decides the caption position. Alternative is b (“bottom”). New in version 1.7. - verbatimhintsturnover default true. If true, code-blocks display “continued on next page”, “continued from previous page” hints in case of pagebreaks. New in version 1.6.3. Changed in version 1.7: the default changed from false to true. - verbatimcontinuedalign, verbatimcontinuesalign default c. Horizontal position relative to the framed contents: either l (left aligned), r (right aligned) or c (centered). New in version 1.7. - parsedliteralwraps default true. Tells whether long lines in parsed-literal’s contents should wrap. New in version 1.5.2: set this option value to false to recover former behaviour. - inlineliteralwraps default true. Allows linebreaks inside inline literals: but extra potential break-points (additionally to those allowed by LaTeX at spaces or for hyphenation) are currently inserted only after the characters . , ; ? ! /. Due to TeX internals, white space in the line will be stretched (or shrunk) in order to accomodate the linebreak. New in version 1.5: set this option value to false to recover former behaviour. - verbatimvisiblespace default \textcolor{red}{\textvisiblespace}. When a long code line is split, the last space character from the source code line right before the linebreak location is typeset using this. - verbatimcontinued A LaTeX macro inserted at start of continuation code lines. Its (complicated…) default typesets a small red hook pointing to the right: \makebox[2\fontcharwd\font`\x][r]{\textcolor{red}{\tiny$\hookrightarrow$}} Changed in version 1.5: The breaking of long code lines was added at 1.4.2. The default definition of the continuation symbol was changed at 1.5 to accomodate various font sizes (e.g. code-blocks can be in footnotes). - TitleColor default {rgb}{0.126,0.263,0.361}. The colour for titles (as configured via use of package “titlesec”.) - WARNING: Colours set via 'sphinxsetup' must obey the syntax of the argument of the color/xcolor packages \definecolor command. - InnerLinkColor default {rgb}{0.208,0.374,0.486}. A colour passed to hyperref as value of linkcolor and citecolor. - OuterLinkColor default {rgb}{0.216,0.439,0.388}. A colour passed to hyperref as value of filecolor, menucolor, and urlcolor. - VerbatimColor default {rgb}{1,1,1}. The background colour for code-blocks. The default is white. - VerbatimBorderColor default {rgb}{0,0,0}. The frame color, defaults to black. - VerbatimHighlightColor default {rgb}{0.878,1,1}. The color for highlighted lines. New in version 1.6.6. - NOTE: Starting with this colour key, and for all others coming next, the actual names declared to “color” or “xcolor” are prefixed with “sphinx”. - verbatimsep default \fboxsep. The separation between code lines and the frame. - verbatimborder default \fboxrule. The width of the frame around code-blocks. - shadowsep default 5pt. The separation between contents and frame for contents and topic boxes. - shadowsize default 4pt. The width of the lateral “shadow” to the right. - shadowrule default \fboxrule. The width of the frame around topic boxes. - noteBorderColor, hintBorderColor, importantBorderColor, tipBorderColor default {rgb}{0,0,0} (black). The colour for the two horizontal rules used by Sphinx in LaTeX for styling a note type admonition. - noteborder, hintborder, importantborder, tipborder default 0.5pt. The width of the two horizontal rules. - warningBorderColor, cautionBorderColor, attentionBorderColor, dangerBorderColor, errorBorderColor default {rgb}{0,0,0} (black). The colour for the admonition frame. - warningBgColor, cautionBgColor, attentionBgColor, dangerBgColor, errorBgColor default {rgb}{1,1,1} (white). The background colours for the respective admonitions. - warningBorder, cautionBorder, attentionBorder, dangerBorder, errorBorder default 1pt. The width of the frame. - AtStartFootnote default \mbox{ }. LaTeX macros inserted at the start of the footnote text at bottom of page, after the footnote number. - BeforeFootnote default \leavevmode\unskip. LaTeX macros inserted before the footnote mark. The default removes possible space before it (else, TeX could insert a linebreak there). New in version 1.5. - HeaderFamily default \sffamily\bfseries. Sets the font used by headings. LaTeX macros and environments Here are some macros from the package file sphinx.sty and class files sphinxhowto.cls, sphinxmanual.cls, which have public names thus allowing redefinitions. Check the respective files for the defaults. Macros text styling commands \sphinx<foo> with <foo> being one of strong, bfcode, email, tablecontinued, titleref, menuselection, accelerator, crossref, termref, optional. New in version 1.4.5: Use of \sphinx prefixed macro names to limit possibilities of conflict with LaTeX packages. more text styling: \sphinxstyle<bar> with <bar> one of indexentry, indexextra, indexpageref, topictitle, sidebartitle, othertitle, sidebarsubtitle, theadfamily, emphasis, literalemphasis, strong, literalstrong, abbreviation, literalintitle, codecontinued, codecontinues New in version 1.5: these macros were formerly hard-coded as non customizable \texttt, \emph, etc… New in version 1.6: \sphinxstyletheadfamily which defaults to \sffamily and allows multiple paragraphs in header cells of tables. New in version 1.6.3: \sphinxstylecodecontinued and \sphinxstylecodecontinues. by default the Sphinx style file sphinx.sty executes the command \fvset{fontsize=\small} as part of its configuration of fancyvrb.sty. This may be overriden for example via \fvset{fontsize=auto} which will let code listings use the ambient font size. Refer to fancyvrb.sty’s documentation for further keys. New in version 1.5. the table of contents is typeset via \sphinxtableofcontents which is a wrapper (whose definition can be found in sphinxhowto.cls or in sphinxmanual.cls) of standard \tableofcontents. Changed in version 1.5: formerly, the meaning of \tableofcontents was modified by Sphinx. - the \maketitle command is redefined by the class files sphinxmanual.cls and sphinxhowto.cls. Environments a figure may have an optional legend with arbitrary body elements: they are rendered in a sphinxlegend environment. The default definition issues \small, and ends with \par. New in version 1.5.6: formerly, the \small was hardcoded in LaTeX writer and the ending \par was lacking. for each admonition type <foo>, the used environment is named sphinx<foo>. They may be \renewenvironment ‘d individually, and must then be defined with one argument (it is the heading of the notice, for example Warning: for warning directive, if English is the document language). Their default definitions use either the sphinxheavybox (for the first listed directives) or the sphinxlightbox environments, configured to use the parameters (colours, border thickness) specific to each type, which can be set via 'sphinxsetup' string. Changed in version 1.5: use of public environment names, separate customizability of the parameters, such as noteBorderColor, noteborder, warningBgColor, warningBorderColor, warningborder, … the contents directive (with :local: option) and the topic directive are implemented by environment sphinxShadowBox. New in version 1.4.2: former code refactored into an environment allowing page breaks. Changed in version 1.5: options shadowsep, shadowsize, shadowrule. the literal blocks (via :: or code-block), are implemented using sphinxVerbatim environment which is a wrapper of Verbatim environment from package fancyvrb.sty. It adds the handling of the top caption and the wrapping of long lines, and a frame which allows pagebreaks. Inside tables the used environment is sphinxVerbatimintable (it does not draw a frame, but allows a caption). Changed in version 1.5: Verbatim keeps exact same meaning as in fancyvrb.sty (also under the name OriginalVerbatim); sphinxVerbatimintable is used inside tables. New in version 1.5: options verbatimwithframe, verbatimwrapslines, verbatimsep, verbatimborder. New in version 1.6.6: support for :emphasize-lines: option New in version 1.6.6: easier customizability of the formatting via exposed to user LaTeX macros such as \sphinxVerbatimHighlightLine. the bibliography uses sphinxthebibliography and the Python Module index as well as the general index both use sphinxtheindex; these environments are wrappers of the thebibliography and respectively theindex environments as provided by the document class (or packages). Changed in version 1.5: formerly, the original environments were modified by Sphinx. Miscellany - the section, subsection, … headings are set using titlesec’s \titleformat command. for the 'manual' docclass, the chapter headings can be customized using fncychap’s commands \ChNameVar, \ChNumVar, \ChTitleVar. File sphinx.sty has custom re-definitions in case of fncychap option Bjarne. Changed in version 1.5: formerly, use of fncychap with other styles than Bjarne was dysfunctional. - HINT: As an experimental feature, Sphinx can use user-defined template file for LaTeX source if you have a file named _templates/latex.tex_t in your project. New in version 1.5: currently all template variables are unstable and undocumented. Additional files longtable.tex_t, tabulary.tex_t and tabular.tex_t can be added to _templates/ to configure some aspects of table rendering (such as the caption position). New in version 1.6: currently all template variables are unstable and undocumented. Markdown Support Markdown is a lightweight markup language with a simplistic plain text formatting syntax. It exists in many syntactically different flavors. To support Markdown-based documentation, Sphinx can use recommonmark. recommonmark is a Docutils bridge to CommonMark-py, a Python package for parsing the CommonMark Markdown flavor. Configuration To configure your Sphinx project for Markdown support, proceed as follows: - 1. Install recommonmark: pip install recommonmark - 2. Add the Markdown parser to the source_parsers configuration variable in your Sphinx configuration file: source_parsers = { '.md': 'recommonmark.parser.CommonMarkParser', } You can replace .md with a filename extension of your choice. - 3. Add the Markdown filename extension to the source_suffix configuration variable: source_suffix = ['.rst', '.md'] - 4. You can further configure recommonmark to allow custom syntax that standard CommonMark doesn’t support. Read more in the recommonmark documentation. Sphinx Extensions, see dev-extensions. Builtin Sphinx extensions These extensions are built in and can be activated by respective entries in the extensions configuration value::: - .. autoclass:: - .. autoexception::: .. automodule:: noodle :members: will document all module members (recursively), and .. autoclass:: Noodle :members: will document all non-private member functions and properties (that is, those whose name doesn’t start with _). For modules, __all__ will be respected when looking for members unless you give the ignore-module-all flag option. Without ignore-module-all, the order of the members will also be the order in __all__. You can also give an explicit list of members; only these will then be documented: .. autoclass:: Noodle :members: eat, slurp - If you want to make the members option (or other flag options described below) the default, see autodoc_default_flags. Members without docstrings will be left out, unless you give the undoc-members flag option: .. automodule:: noodle :members: :undoc-members: “Private” members (that is, those named like _private or __private) will be included if the private-members flag option is given. New in version 1.1. Python “special” members (that is, those named like __special__) will be included if the special-members flag flag option, in addition to members: .. autoclass:: Noodle :members: :inherited-members: This can be combined with undoc-members to py:function etc. directives: no index entries are generated for the documented object (and all autodocumented members). New in version 0.4. automodule also recognizes the synopsis, platform and deprecated options that the standard py. In an automodule directive with the members option set, only module members whose __module__ attribute is equal to the module name as given to automodule will be documented. This is to prevent documentation of imported classes or functions. Set the imported-members option_imports to prevent import errors to halt the building process when some external dependencies are not importable at build time. New in version 1.3. - .. autofunction:: - .. autodata:: - .. automethod:: - .. autoattribute:: These work exactly like autoclass etc., but do not offer the options used for automatic member documentation. autodata and autoattribute support the annotation option. and autoattribute can now extract docstrings. Changed in version 1.1: Comment docs are now allowed on the same line after an assignment. Changed in version 1.2: autodata and autoattribute have an annotation option. This value is a list of autodoc directive flags that should be automatically applied to all autodoc directives. The supported flags are 'members', 'undoc-members', 'private-members', 'special-members', 'inherited-members', 'show-inheritance' and 'ignore-module-all'. If you set one of these flags in this config value, you can use a negated form, 'no-flag', in an autodoc directive, to disable it once. For example, if autodoc_default_flags is set to ['members', 'undoc-members'], and you write a directive like this: .. automodule:: foo :no-undoc-members: the directive will be interpreted as if only :members: was given. New in version 1.0. - autodoc_docstring_signature This value contains a list of modules to be mocked up. This is useful when some external dependencies are not met at build time and break the building process. You may only specify the root package of the dependencies themselves and omit the sub-modules: autodoc_mock_imports = ["django"] Will mock all imports under the django package. New in version 1.3. Changed in version 1.6: This config value only requires to declare the top-level modules that should be mocked. - autodoc_warningiserror This value controls the behavior of sphinx-build -W during importing modules. If False is given, autodoc forcely suppresses the error if the imported module emits warnings. By default, True. - autodoc_inherit_docstrings This value controls the docstrings inheritance. If set to True the cocstring for classes or methods, if not explicitly set, is inherited form parents. The default is True. New in version 1.7. Docstring preprocessing autodoc provides the following additional events: - autodoc-process-docstring(app, what, name, obj, options, lines) New in version 0.4. Emitted when autodoc has read and processed a docstring. lines is a list of strings – the lines of the processed docstring – that the event handler can modify in place - lines – the lines of the docstring, see above - autodoc-process-signature(app, what, name, obj, options, signature, return_annotation) New in version 0.5. Emitted when autodoc has formatted a signature for an object. The event handler can return a new tuple (signature, return_annotation) - signature – function signature, as a string of the form "(parameter_1, parameter_2)", or None if introspection didn’t succeed and signature wasn’t specified in the directive. - return_annotation – function return annotation as a string of the form " -> annotation", or None if there is no return annotation The sphinx.ext.autodoc module provides factory functions for commonly needed docstring processing in event autodoc-process-docstring: - sphinx.ext.autodoc.cut_lines(pre, post=0, what=None) autodoc allows the user to define a custom method for determining whether a member should be included in the documentation by using the following event: - autodoc-skip-member(app, what, name, obj, skip, options)-member event, autodoc will use the first non-None value returned by a handler. Handlers should return None to fall back to the skipping behavior of autodoc and other enabled extensions. - and noindex that are true if the flag option of same name was given to the auto directive sphinx.ext.autosectionlabel – Allow reference sections using its title - autosectionlabel_prefix_document True to prefix each section label with the name of the document it is in, followed by a colon. For example, index:Introduction for a section called Introduction that appears in document index.rst. Useful for avoiding ambiguity when the same section heading appears in different documents. sphinx.ext.autosummary – Generate autodoc summaries: - 1. There is an autosummary directive for generating summary listings that contain links to the documented items, and short summary blurbs extracted from their docstrings. - 2. Optionally, the convenience script sphinx-autogen or the new autosummary_generate config value can be used to generate short “stub” files for the entries listed in the autosummary directives. These files by default contain only the corresponding sphinx.ext.autodoc directive, but can be customized with templates. - .. autosummary:: Insert a table that contains links to documented items, and a short summary blurb (the first sentence of the docstring) for each of them. The autosummary directive can also optionally serve as a toctree entry for the included items. Optionally, stub .rst files and autodoc-process-signature hooks as autodoc. Options If you want the autosummary table to also serve as a toctree entry, use the toctree option, for example: .. autosummary:: :toctree: DIRNAME sphinx.environment.BuildEnvironment sphinx.util.relative_uri The toctree option to show function signatures in the listing, include the nosignatures option: .. autosummary:: :nosignatures: sphinx.environment.BuildEnvironment sphinx.util.relative_uri You can specify a custom template with the template option. For example, .. autosummary:: :template: mytemplate.rst sphinx.environment.BuildEnvironment would use the template mytemplate.rst in your templates_path to generate the pages for all entries listed. See Customizing templates below. New in version 1.0. sphinx-autogen – generate autodoc stub pages. For more information, refer to the sphinx-autogen documentation Generating stub pages automatically If you do not want to create stub pages with sphinx-autogen, you can also use this new config value: - autosummary_generate Jinja: - name Name of the documented object, excluding the module and class parts. - objname Name of the documented object, excluding the module parts. - fullname Full name of the documented object, including module and class parts. - module Name of the module the documented object belongs to. - class Name of the class the documented object belongs to. Only available for methods and attributes. - underline A string containing len(full_name) * '='. Use the underline filter instead. List containing names of all members of the module or class. Only available for modules and classes. - functions List containing names of “public” functions in the module. Here, “public” here means that the name does not start with an underscore. Only available for modules. - classes List containing names of “public” classes in the module. Only available for modules. - exceptions List containing names of “public” exceptions in the module. Only available for modules. - methods List containing names of “public” methods in the class. Only available for classes. - attributes List containing names of “public” attributes in the class. Only available for classes. Additionally, the following filters are available - escape(s) Escape any special characters in the text to be used in formatting RST contexts. For instance, this prevents asterisks making things bold. This replaces the builtin Jinja escape filter that does html-escaping. - underline(s, line='=') Add a title underline to a piece of text. For instance, {{ fullname | escape | underline }} should be used to produce the title of a page. NOTE: You can use the autosummary directive in the stub pages. Stub pages are generated also based on these directives. sphinx.ext.coverage – Collect doc coverage stats This extension features one additional builder, the CoverageBuilder. - class sphinx.ext.coverage.CoverageBuilder To use this builder, activate the coverage extension in your configuration file and give -b coverage on the command line. Todo Write this section. Several new configuration values can be used to specify what the builder should check: coverage_ignore_modules coverage_ignore_functions coverage_ignore_classes coverage_c_path coverage_c_regexes coverage_ignore_c_items - coverage_write_headline Set to False to not write headlines. New in version 1.1. - coverage_skip_undoc_in_source Skip objects that are not documented in the source with a docstring. False by default. New in version 1.1. The group argument below is interpreted as follows: if it is empty, the block is assigned to the group named default. If it is *, the block is assigned to all groups (including the default group). Otherwise, it must be a comma-separated list of group names. - .. testsetup:: [group] A setup code block. This code is not shown in the output for other builders, but executed before the doctests of the group(s) it belongs to. - .. testcleanup:: [group] A cleanup code block. This code is not shown in the output for other builders, but executed after the doctests of the group(s) it belongs to. New in version 1.1. - .. doctest:: [group] A doctest-style code block. You can use standard doctest flags for controlling how actual output is compared with what you give as output. The default set of flags is specified by the doctest_default_flags configuration option] A code block for a code-output-style test. This directive supports one option: - hide, a flag option, hides the code block in other builders. By default it is shown as a highlighted code block. - NOTE: Code in a testcode block is always executed all at once, no matter how many statements it contains. Therefore, output will not be generated for bare expressions – use print. Example: ..] The corresponding output, or the exception message, for the last testcode block. The doctest extension uses the following configuration values: - doctest_default_flags A list of directories that will be added to sys.path when the doctest builder is used. (Make sure it contains absolute paths.) - doctest_global_setup Python code that is treated like it were put in a testsetup directive for every file that is tested, and for every group. You can use this to e.g. import modules you will always need in your doctests. New in version 0.6. - doctest_global_cleanup Python code that is treated like it were put in a testcleanup directive for every file that is tested, and for every group. You can use this to e.g. remove any temporary files that the tests leave behind. New in version 1.1. - doctest_test_doctest_blocks, though you may set trim_doctest_flags to achieve that in all code blocks with Python console content. sphinx.ext.extlinks – Markup to shorten external links. sphinx.ext.githubpages – Publish HTML docs in GitHub Pages New in version 1.4. This extension creates .nojekyll file on generated HTML directory to publish the document on GitHub Pages. sphinx.ext.graphviz – Add Graphviz graphs New in version 0.6. This extension allows you to embed Graphviz graphs in your documents. It adds these directives: - .. graphviz::. - .. graph:: The command name with which to invoke dot. The default is 'dot'; you may need to set this to a full path if dot graphviz_dot=C:\graphviz\bin\dot.exe . _build/html - graphviz_dot_args Additional command-line arguments to give to dot, as a list. The default is an empty list. This is the right place to set global graph, node or edge attributes via dot’s -G, -N and -E options. - graphviz_output_format The output format for Graphviz when building HTML files. This must be either 'png' or 'svg'; the default is 'png'. If 'svg' is used, in order to make the URL links work properly, an appropriate target attribute. sphinx.ext.ifconfig – Include content based on configuration This extension is quite simple, and features only one directive: - .. ifconfig:: Include content of the directive only if the Python expression given as an argument is True, evaluated in the namespace of the project’s configuration (that is, all registered variables from conf.py are). sphinx.ext.imgconverter – Convert images to appropriate format for builders New in version 1.6. This extension converts images in your document to appropriate format for builders. For example, it allows you to use SVG images with LaTeX builder. As a result, you don’t mind what image format the builder supports. Internally, this extension uses Imagemagick to convert images. Configuration - image_converter A path to convert command. By default, the imgconverter uses the command from search paths. - image_converter_args Additional command-line arguments to give to convert, as a list. The default is an empty list []. sphinx.ext.inheritance_diagram – Include inheritance diagrams New in version 0.6. This extension allows you to include inheritance diagrams, rendered via the Graphviz extension. It adds this directive: - .. inheritance-diagram:: This directive has one or more arguments, each giving a module or class name. Class names can be unqualified; in that case they are taken to exist in the currently described module (see py:module). For each given class, and each class in each given module, the base classes are determined. Then, from all classes and their base classes, a graph is generated which is then rendered via the graphviz extension to a directed graph. This directive supports an option called. You can use caption option to give a caption to the diagram. Changed in version 1.1: Added private-bases option; previously, all bases were always included. Changed in version 1.5: Added caption option It also supports a top-classes option option to limit the scope of inheritance graphs. New config values are: - inheritance_graph_attrs A dictionary of graphviz graph attributes for inheritance diagrams. For example: inheritance_graph_attrs = dict(rankdir="LR", size='"6.0, 8.0"', fontsize=14, ratio='compress') - inheritance_node_attrs A dictionary of graphviz node attributes for inheritance diagrams. For example: inheritance_node_attrs = dict(shape='ellipse', fontsize=14, height=0.75, color='dodgerblue1', style='filled') - inheritance_edge_attrs A dictionary of graphviz edge attributes for inheritance diagrams. - inheritance_alias Allows mapping the full qualified name of the class to custom values (useful when exposing the underlying path of a class is not desirable, e.g. it’s a private class and should not be instantiated by the user). For example: inheritance_alias = {'_pytest.Magic': 'pytest.Magic'} sphinx.ext.intersphinx – Link to other projects’ documentation that contains a mapping from object names to URIs relative to the HTML set’s root. - Projects using the Intersphinx extension can specify the location of such mapping files in the intersphinx_mapping config re-downloaded The maximum number of days to cache remote inventories. The default is 5, meaning five days. Set this to a negative value to cache inventories for unlimited time. - intersphinx_timeout The number of seconds for timeout. The default is None, meaning do not timeout. NOTE: timeout is not a time limit on the entire response download; rather, an exception is raised if the server has not issued a response for timeout seconds. sphinx.ext.linkcode – Add external links to source code Module author: Pauli Virtanen New in version 1.2. This extension looks at your object descriptions (.. class::, .. function:: etc.) and adds external links to code hosted somewhere on the web. The intent is similar to the sphinx.ext.viewcode extension, but assumes the source code can be found somewhere on the Internet. In your configuration, you need to specify a linkcode_resolve function that returns an URL based on the object. - linkcode_resolve This is a function linkcode_resolve(domain, info), which should return the URL to source code corresponding to the object in given domain with given information. The function should return None if no link is to be added. The argument domain specifies the language domain the object is in. info is a dictionary with the following keys guaranteed to be present (dependent on the domain): - py: module (name of the module), fullname (name of the object) - c: names (list of names for the object) - cpp: names (list of names for the object) - javascript: object (name of the object), fullname (name of the item) Example: def linkcode_resolve(domain, info): if domain != 'py': return None if not info['module']: return None filename = info['module'].replace('.', '/') return "" % filename Math support in Sphinx autodoc, you either have to double all backslashes, or use Python raw strings (r"raw"). mathbase provides the following config values: - math_number_all Set this option to True if you want all displayed math to be numbered. The default is False. - math_eqref_format A string that are used for format of label of references to equations. As a special character, {number} will be replaced to equaition number. Example: 'Eq.{number}' is rendered as Eq.10 - math_numfig If True, displayed math equations are numbered across pages when numfig is enabled. The numfig_secnum_depth setting is respected. The eq, not numref, role must be used to reference equation numbers. Default is True. New in version 1.7. mathbase defines these new markup elements: - :math: Role for inline math. Use like this: Since Pythagoras, we know that :math:`a^2 + b^2 = c^2`. - .. math::} - :eq: Role for cross-referencing equations via their label. Example: .. math:: e^{i\pi} + 1 = 0 :label: euler Euler's identity, equation :eq:`euler`, was elected one of the most beautiful mathematical formulas. sphinx.ext.imgmath – Render math as images The output image format. The default is 'png'. It should be either 'png' or 'svg'. - imgmath_latex for that purpose. - imgmath_dvipng The command name with which to invoke dvipng. The default is 'dvipng'; you may need to set this to a full path if dvipng is not in the executable search path. This option is only used when imgmath_image_format is set to 'png'. - imgmath_dvisvgm The command name with which to invoke dvisvgm. The default is 'dvisvgm'; you may need to set this to a full path if dvisvgm is not in the executable search path. This option is only used when imgmath_image_format is 'svg'. - imgmath_latex_args Additional arguments to give to latex, as a list. The default is an empty list. - imgmath_latex_preamble is 'png'. - imgmath_dvisvgm_args Additional arguments to give to dvisvgm, as a list. The default value is ['--no-fonts']. This option is used only when imgmath_image_format is 'svg'. - imgmath_use_preview. Currently this option is only used when imgmath_image_format is 'png'. - imgmath_add_tooltips Default: True. If false, do not add the LaTeX code as an “alt” attribute for math images. - imgmath_font_size The font size (in pt) of the displayed math. The default value is 12. It must be a positive integer. sphinx.ext.mathjax – Render math via JavaScript New in version 1.1.. - mathjax_path The path to the JavaScript file to include in the HTML files in order to load MathJax. The default is the https:// URL. sphinx.ext.jsmath – Render math via JavaScript This extension works just as the MathJax extension does, but uses the older package jsMath. It provides this config value: - jsmath_path. sphinx.ext.napoleon – Support for NumPy and Google style docstrings Module author: Rob Ruana New in version 1.3. Napoleon - Marching toward legible docstrings ../extensions - 1. After setting up Sphinx to build your docs, enable napoleon in the Sphinx conf.py file: # conf.py # Add napoleon to the extensions list extensions = ['sphinx.ext.napoleon'] - 2. Use sphinx-apidoc to build your API documentation: $ sphinx-apidoc -f -o docs/source projectdir Docstrings Napoleon interprets every docstring that - Todo - Warning - Warnings (alias of Warning) - Warns - Yield (alias of Yields) -. SEE ALSO: For complete examples: - example_google - example_numpy Type Annotations True to parse Google style docstrings. False to disable support for Google style docstrings. Defaults to True. - napoleon_numpy_docstring True to parse NumPy style docstrings. False to disable support for NumPy style docstrings. Defaults to True. - napoleon_include_init_with_doc True to use the .. admonition:: directive for References sections. False to use the .. rubric:: directive instead. Defaults to False. SEE ALSO: napoleon_use_admonition_for_examples - napoleon_use_ivar sphinx.ext.todo – Support for todo items Module author: Daniel Bültmann New in version 0.5. There are two additional directives when using this extension: - .. todo:: Use this directive like, for example, note. It will only show up in the output if todo_include_todos is True. New in version 1.3.2: This directive supports an class option that determines the class attribute for HTML output. If not given, the class defaults to admonition-todo. - .. todolist:: This directive is replaced by a list of all todo directives in the whole documentation, if todo_include_todos is True. There is also an additional config value: - todo_include_todos If this is True, todo and todolist produce output, else they produce nothing. The default is False. - todo_emit_warnings If this is True, todo emits a warning for each Todo entries. The default is False. New in version 1.5. - todo_link_only If this is True, todolist produce output without file path and line, The default is False. New in version 1.4. autodoc provides the following an additional event: - todo-defined(app, node) New in version 1.5. Emitted when a todo is defined. node is the defined sphinx.ext.todo.todo_node node. sphinx.ext.viewcode – Add links to highlighted source code Module author: Georg Brandl New in version 1.0. This extension looks at your Python object descriptions (.. class::, .. function:: etc.). This extension works only on HTML related builders like html, applehelp, devhelp, htmlhelp, qthelp and so on except singlehtml. By default epub builder doesn’t support this extension (see viewcode_enable_epub). There is an additional config value: - viewcode_import If this is True, viewcode extension will follow alias objects that imported from another module such as functions, classes and attributes. As side effects, this option else they produce nothing. The default is True. WARNING: viewcode_import imports the modules to be followed real location. If any modules have side effects on import, these will be executed by viewcode when sphinx-build is run. If you document scripts (as opposed to library modules), make sure their main routine is protected by a if __name__ == '__main__' condition. New in version 1.3. - viewcode_enable_epub. WARNING: Not all epub readers support pages generated by viewcode extension. These readers ignore links to pages are not under toctree. Some reader’s rendering result are corrupted and epubcheck’s score becomes worse even if the reader supports. Third-party extensions You can find several extensions contributed by users in the Sphinx Contrib repository. It is open for anyone who wants to maintain an extension publicly; just send a short message asking for write permissions. There are also several extensions hosted elsewhere. The Sphinx extension survey contains a comprehensive list. If you write an extension that you think others will find useful or you think should be included as a part of Sphinx, please write to the project mailing list (join here). Where to put your own extensions?. Developing Extensions for Sphinx Since. Discovery of builders by entry point Tutorial: Writing a simple extension as attributes. It is an instance of Config. The config is available as app.config or env.config. Build Phases and todolist. - New document tree nodes to represent these directives, conventionally also called todo event, to replace the todo and todolist nodes, and one for env-purge-doc (the reason for that will be covered later). The Setup Function. NOTE: Many extensions will not have to create their own node classes and work fine with the nodes already provided by docutils and Sphinx.. Application API Each Sphinx extension is a Python module with at least a setup() function. This function is called at initialization time with one argument, the application object representing the Sphinx process. - class sphinx.application.Sphinx This application object has the public API described in the following. Extension setup These methods are usually called in an extension’s setup() function. Examples of using the Sphinx extension API can be seen in the sphinx.ext package. - Sphinx.setup_extension(name) Load the extension given by the module name. Use this if your extension needs the features provided by another extension. - Sphinx.add_builder(builder) Register a new builder. builder must be a class that inherits from Builder. - Sphinx.add_config_value(name, default, rebuild)) Make the given domain (which must be a class; more precisely, a subclass of Domain) known to Sphinx. New in version 1.0. - Sphinx.override_domain(domain) Make the given domain class known to Sphinx, assuming that there is already a domain with its .name. The new domain must be a subclass of the existing one. New in version 1.0. - Sphinx.add_index_to_domain(domain, index) Add a custom index class to the domain named domain. index must be a subclass of Index. New in version 1.0. - Sphinx.add_event(name) Register an event called name. This is needed to be able to emit it. - Sphinx.set_translator(name, translator_class) Register or override a Docutils translator class. This is used to register a custom output translator or to replace a builtin translator. This allows extensions to use custom translator and define custom nodes for the translator (see add_node()). New in version 1.3. - Sphinx.add_node(node, **kwds) and code-block are or docutils.nodes.title from the node as a title. Other keyword arguments are used for node visitor functions. See the Sphinx.add_node() for details. New in version 1.4. - Sphinx.add_directive(name, func, content, arguments, **options) -) - Sphinx.add_directive_to_domain(domain, name, directiveclass) Like add_directive(), but the directive is added to the domain named domain. New in version 1.0. - Sphinx.add_role(name, role) Register a Docutils role. name must be the role name that occurs in the source, role the role function (see the Docutils documentation on details). - Sphinx.add_role_to_domain(domain, name, role) Like add_role(), but the role is added to the domain named domain. New in version 1.0. - Sphinx.add_generic_role(name, nodeclass) xref-syntax). This method is also available under the deprecated alias add_description_unit. - Sphinx.add_crossref_type(directivename, rolename, indextemplate='', ref_nodeclass=None, objname='')) Add the standard docutils Transform subclass transform to the list of transforms that are applied after Sphinx parses a reST document. - Sphinx.add_post_transform(transform) Add the standard docutils Transform subclass transform to the list of transforms that are applied before Sphinx writes a document. - Sphinx.add_javascript(filename), alternate=None, title=None) Add filename to the list of CSS files that the default HTML template will include. Like for add_javascript(), the filename must be relative to the HTML static path, or a full URI with scheme. New in version 1.0. Changed in version 1.6: Optional alternate and/or title attributes can be supplied with the alternate (of boolean type) and title (a string) arguments. The default is no title and alternate = False (see this explanation). - Sphinx.add_latex_package(packagename, options=None)) Use lexer, which must be an instance of a Pygments lexer class, to highlight code blocks with the given language alias. New in version 0.6. - Sphinx.add_autodocumenter(cls)_parser(suffix, parser) Register a parser class for specified suffix. New in version 1.4. - Sphinx.add_html_theme(name, theme_path) Register a HTML Theme. The name is a name of theme, and path is a full path to the theme (refs: distribute-your-theme). New in version 1.6. - Sphinx.add_env_collector(collector) Register an environment collector class (refs: collector-api) New in version 1.6. - Sphinx.require_sphinx(version) Compare version (which must be a major.minor version string, e.g. '1.1') with the version of the running Sphinx, and abort the build when it is too old. New in version 1.0. - Sphinx.connect(event, callback) Register callback to be called when event is emitted. For details on available core events and the arguments of callback functions, please see Sphinx core events. The method returns a “listener ID” that can be used as an argument to disconnect(). - Sphinx.disconnect(listener_id) Unregister callback listener_id. - exception sphinx.application.ExtensionError All these methods raise this exception if something went wrong with the extension API. Emitting events - Sphinx.emit(event, *arguments) Emit event and pass arguments to the callback functions. Return the return values of all callbacks as a list. Do not emit core Sphinx events in extensions! - Sphinx.emit_firstresult(event, *arguments) Emit event and pass arguments to the callback functions. Return the result of the first callback that doesn’t return None. New in version 0.5. Producing messages / logging) Emit a warning. If location is given, it should either be a tuple of (docname, lineno) or a string describing the location of the warning as well as possible. type and subtype are used to suppress warnings with suppress_warnings. - Sphinx.info(message='', nonl=False) Emit an informational message. If nonl is true, don’t emit a newline at the end (which implies that more info output will follow soon.) - Sphinx.verbose(message, *args, **kwargs) Emit a verbose informational message. - Sphinx.debug(message, *args, **kwargs) Emit a debug-level informational message. - Sphinx.debug2(message, *args, **kwargs) Emit a lowlevel debug-level informational message. Sphinx runtime information The application object also provides runtime information as attributes. - sphinx.application.srcdir Source directory. - sphinx.application.confdir Directory containing conf.py. - sphinx.application.doctreedir Directory for storing pickled doctrees. - sphinx.application.outdir Directory for storing built document. Sphinx core events) Emitted when the builder object has been created. It is available as app.builder. - env-get-outdated(app, env, added, changed, removed)) Emitted when a doctree has been parsed and read by the environment, and is about to be pickled. The doctree can be modified in-place. - missing-reference(app, env, node, contnode). - Parameters - env – The build environment (app.builder.env). - node – The pending_xref node to be resolved. Its attributes reftype, reftarget, modname and classname attributes determine the type and target of the reference. - contnode – The node that carries the text and formatting inside the future reference and should be a child of the returned reference node. New in version 0.5. - doctree-resolved(app, doctree, docname)(env, docnames, other) extension. The implementation is often similar to that of env-purge-doc, only that information is not removed, but added to the main environment from the other environment. New in version 1.3. - env-updated(app, env)(env) Emmited when Consistency checks phase. You can check consistency of metadata for whole of documents. New in version 1.6: As a experimental event - html-collect-pages(app) Use this to adapt your extension to API changes in Sphinx. - sphinx.version_info A tuple of five elements; for Sphinx version 1.2.1 beta 3 this would be (1, 2, 1, 'beta', 3). New in version 1.2: Before version 1.2, check the string sphinx.__version__. The Config object - class sphinx.config.Config The config object makes the values of all config values available as attributes. It is available as the config attribute on the application and environment objects. For example, to get the value of language, use either app.config.language or env.config.language. The template bridge - class sphinx.application.TemplateBridge This class defines the interface for a “template bridge”, that is, a class that renders templates given a template name and a context. - init(builder, theme=None, dirs=None)() Called by the builder to determine if output files are outdated because of template changes. Return the mtime of the newest template file that was changed. The default implementation returns 0. - render(template, context) Called by the builder to render a template given as a filename with a specified context (a Python dictionary). - render_string(template, context) Called by the builder to render a template given as a string with a specified context (a Python dictionary). Exceptions - exception sphinx.errors.SphinxError). - category Description of the exception “category”, used in converting the exception to a string (“category: message”). Should be set accordingly in subclasses. - exception sphinx.errors.ConfigError Used for erroneous values or nonsensical combinations of configuration values. - exception sphinx.errors.ExtensionError Used for errors in setting up extensions. - exception sphinx.errors.ThemeError Used for errors to do with themes. - exception sphinx.errors.VersionRequirementError Raised when the docs require a higher Sphinx version than the current one. Build environment API - class sphinx.environment.BuildEnvironment Attributes - app Reference to the Sphinx (application) object. - config Reference to the Config object. - srcdir Source directory. - doctreedir Directory for storing pickled doctrees. - found_docs A set of all existing docnames. - metadata Dictionary mapping docnames to “metadata” (see metadata). - titles Dictionary mapping docnames to the docutils node for their main title. - docname Returns the docname of the document currently being parsed. Utility methods - warn(docname, msg, lineno=None, **kwargs) Emit a warning. This differs from using app.warn() in that the warning may not be emitted instantly, but collected for emitting all warnings after the update of the environment. - warn_node(msg, node, **kwargs) Like warn(), but with source information taken from node. - doc2path(docname, base=True, suffix=None)) Return paths to a file referenced from a document, relative to documentation root and absolute. In the input “filename”, absolute filenames are taken as relative to the source dir, while relative filenames are relative to the dir of the containing document. - note_dependency(filename) Add filename as a dependency of the current document. This means that the document will be rebuilt if this file changes. filename should be absolute or relative to the source directory. - new_serialno(category='') Return a serial number, e.g. for index entry targets. The number is guaranteed to be unique in the current document. - note_reread() Add the current document to the list of documents that will automatically be re-read at the next build. Builder API Todo Expand this. - class sphinx.builders.Builder This is the base class for all builders. These attributes should be set on builder classes: - name = '' The builder’s name, for the -b command line option. - format = '' The builder’s output format, or ‘’ if no document output is produced. - epilog = '' The message emitted upon successful build completion. This can be a printf-style template string with the following keys: outdir, project - supported_image_types = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. These methods are predefined and will be called from the application: - get_relative_uri(from_, to, typ=None) Return a relative URI between two source filenames. May raise environment.NoUri if there’s no way to return a sensible URI. - build_all() Build all source files. - build_specific(filenames) Only rebuild as much as needed for changes in the filenames. - build_update() Only rebuild what was changed or added since last build. - build(docnames, summary=None, method='update') Main build method. First updates the environment, and then calls write(). These methods can be overridden in concrete builder classes: - init() Load necessary templates and perform initialization. The default implementation does nothing. - get_outdated_docs() Return an iterable of output files that are outdated, or a string describing what an update build will build. If the builder does not output individual files corresponding to source files, return a string here. If it does, return an iterable of those files that need to be written. - get_target_uri(docname, typ=None) Return the target URI for a document name. typ can be used to qualify the link characteristic for individual builders. - prepare_writing(docnames) A place where you can add logic before write_doc() is run - write_doc(docname, doctree) Where you actually write something to the filesystem. - finish() Finish the building process. The default implementation does nothing. Environment Collector API - class sphinx.environment.collectors.EnvironmentCollector An EnvironmentCollector is a specific data collector from each document. It gathers data and stores BuildEnvironment as a database. Examples of specific data would be images, download files, section titles, metadatas, index entries and toctrees, etc. - clear_doc(app, env, docname) Remove specified data of a document. This method is called on the removal of the document. - get_outdated_docs(app, env, added, changed, removed) Return a list of docnames to re-read. This methods is called before reading the documents. - get_updated_docs(app, env) Return a list of docnames to re-read. This methods is called after reading the whole of documents (experimental). - merge_other(app, env, docnames, other) Merge in specified data regarding docnames from a different BuildEnvironment object which coming from a subprocess in parallel builds. - process_doc(app, doctree) Process a document and gather specific data from it. This method is called after the document is read. Docutils markup API This section describes the API for adding ReST markup elements (roles and directives). Roles Directives Directives are handled by classes derived from docutils.parsers.rst.Directive. They have to be registered by an extension using Sphinx.add_directive() or Sphinx.add_directive_to_domain(). - class docutils.parsers.rst.Directive The markup syntax of the new directive is determined by the follow five class attributes: - required_arguments = 0 Number of required directive arguments. - optional_arguments = 0 Number of optional arguments after the required arguments. - final_argument_whitespace = False May the final argument contain whitespace? - option_spec = None Mapping of option names to validator functions. Option validator functions take a single parameter, the option argument (or None if not given), and should validate it or convert it to the proper form. They raise ValueError or TypeError to indicate failure. There are several predefined and possibly useful validators in the docutils.parsers.rst.directives module. - has_content = False May the directive have content? New directives must implement the run() method: - run() This method must process the directive arguments, options and content, and return a list of Docutils/Sphinx nodes that will be inserted into the document tree at the point where the directive was encountered. Instance attributes that are always set on the directive are: - name The directive name (useful when registering the same directive class under multiple names). - arguments The arguments given to the directive, as a list. - options The options given to the directive, as a dictionary mapping option names to validated/converted values. - content The directive content, if given, as a ViewList. - lineno The absolute line number on which the directive appeared. This is not always a useful value; use srcline instead. - content_offset Internal offset of the directive content. Used when calling nested_parse (see below). - block_text The string containing the entire directive. - state - state_machine The state and state machine which controls the parsing. Used for nested_parse. ViewLists Domain API - class sphinx.domains.Domain(env) attribute. Otherwise, IOError is raised and the pickled environment is discarded. - add_object_type(name, objtype) Add an object type. - check_consistency() Do consistency checks (experimental). - clear_doc(docname) Remove traces of a document in the domain-specific inventories. - directive(name) Return a directive adapter class that always gives the registered directive its full name (‘domain:name’) as self.name. - get_full_qualified_name(node) Return full qualified name for given node. - get_objects() - get_type_name(type, primary=False) Return full name for given ObjType. - merge_domaindata(docnames, otherdata) Merge in data regarding docnames from a different domaindata inventory (coming from a subprocess in parallel builds). - process_doc(env, docname, document) Process a document after it is read by the environment. - process_field_xref(pnode) Process a pending xref created in a doc field. For example, attach information about the current scope. - resolve_any_xref(env, fromdocname, builder, target, node, contnode) is what resolve_xref() would return. New in version 1.3. - resolve_xref(env, fromdocname, builder, typ, target, node, contnode) ‘missing-reference’ event, and if that yields no resolution, replaced by contnode. The method can also raise sphinx.environment.NoUri to suppress the ‘missing-reference’ event being emitted. - role(name) Return a role adapter function that always gives the registered role its full name (‘domain:name’) as the first argument. - dangling_warnings = {} role name -> a warning message if reference is missing - data = None data value - data_version = 0 data version, bump this when the format of self.data changes - directives = {} directive name -> directive class - indices = [] a list of Index subclasses - initial_data = {} data value for a fresh environment - label = '' domain label: longer, more descriptive (used in messages) - name = '' domain name: should be short, but unique - object_types = {} type (usually directive) name -> ObjType instance - roles = {} role name -> role callable - class sphinx.domains.ObjType(lname, *roles, **attrs). Parser API - class sphinx.parsers.Parser()) Doctree node classes added by Sphinx Nodes for domain-specific object descriptions - class sphinx.addnodes.desc(rawsource='', *children, **attributes) Node for object descriptions. This node is similar to a “definition list” with one definition. It contains one or more desc_signature and a desc_content. - class sphinx.addnodes.desc_signature(rawsource='', text='', *children, **attributes) Node for object signatures. The “term” part of the custom Sphinx definition list. As default the signature is a single line signature, but set is_multiline = True to describe a multi-line signature. In that case all child nodes must be desc_signature_line nodes. - class sphinx.addnodes.desc_signature_line(rawsource='', text='', *children, **attributes) Node for a line in a multi-line object signatures. It should only be used in a desc_signature with is_multiline set. Set add_permalink = True for the line that should get the permalink. - class sphinx.addnodes.desc_addname(rawsource='', text='', *children, **attributes) Node for additional name parts (module name, class name). - class sphinx.addnodes.desc_type(rawsource='', text='', *children, **attributes) Node for return types or object type names. - class sphinx.addnodes.desc_returns(rawsource='', text='', *children, **attributes) Node for a “returns” annotation (a la -> in Python). - class sphinx.addnodes.desc_name(rawsource='', text='', *children, **attributes) Node for the main object name. - class sphinx.addnodes.desc_parameterlist(rawsource='', text='', *children, **attributes) Node for a general parameter list. - class sphinx.addnodes.desc_parameter(rawsource='', text='', *children, **attributes) Node for a single parameter. - class sphinx.addnodes.desc_optional(rawsource='', text='', *children, **attributes) Node for marking optional parts of the parameter list. - class sphinx.addnodes.desc_annotation(rawsource='', text='', *children, **attributes) Node for signature annotations (not Python 3-style annotations). - class sphinx.addnodes.desc_content(rawsource='', *children, **attributes) Node for object description content. This is the “definition” part of the custom Sphinx definition list. New admonition-like constructs - class sphinx.addnodes.versionmodified(rawsource='', text='', *children, **attributes) Node for version change entries. Currently used for “versionadded”, “versionchanged” and “deprecated” directives. - class sphinx.addnodes.seealso(rawsource='', *children, **attributes) Custom “see also” admonition. Other paragraph-level nodes - class sphinx.addnodes.compact_paragraph(rawsource='', text='', *children, **attributes) Node for a compact paragraph (which never makes a <p> node). New inline nodes - class sphinx.addnodes.index(rawsource='', text='', *children, **attributes) Node for index entries. This node is created by the index directive and has one attribute, entries. Its value is a list of 5-tuples of (entrytype, entryname, target, ignored, key). entrytype is one of “single”, “pair”, “double”, “triple”. key is categolziation characters (usually it is single character) for general index page. For the detail of this, please see also: glossary and issue #2320. - class sphinx.addnodes.pending_xref(rawsource='', *children, **attributes) Node for cross-references that cannot be resolved without complete information about all documents. These nodes are resolved before writing output, in BuildEnvironment.resolve_references. - class sphinx.addnodes.literal_emphasis(rawsource='', text='', *children, **attributes) Node that behaves like emphasis, but further text processors are not applied (e.g. smartypants for HTML output). - class sphinx.addnodes.abbreviation(rawsource='', text='', *children, **attributes) Node for abbreviations with explanations. - class sphinx.addnodes.download_reference(rawsource='', text='', *children, **attributes) Node for download references, similar to pending_xref. Special nodes - class sphinx.addnodes.only(rawsource='', *children, **attributes) Node for “only” directives (conditional inclusion based on tags). - class sphinx.addnodes.meta(rawsource='', *children, **attributes) Node for meta directive – same as docutils’ standard meta node, but pickleable. - class sphinx.addnodes.highlightlang(rawsource='', *children, **attributes) Inserted to set the highlight language and line number options for subsequent code blocks. You should not need to generate the nodes below in extensions. - class sphinx.addnodes.glossary(rawsource='', *children, **attributes) Node to insert a glossary. - class sphinx.addnodes.toctree(rawsource='', *children, **attributes) Node for inserting a “TOC tree”. - class sphinx.addnodes.start_of_file(rawsource='', *children, **attributes) Node to mark start of a new file, used in the LaTeX builder only. - class sphinx.addnodes.productionlist(rawsource='', *children, **attributes) Node for grammar production lists. Contains production nodes. - class sphinx.addnodes.production(rawsource='', text='', *children, **attributes) Node for a single grammar production rule. Logging API - sphinx.util.logging.getLogger(name) Returns a logger wrapped by SphinxLoggerAdapter with the specified name. Example usage: from sphinx.util import logging # Load on top of python's logging module logger = logging.getLogger(__name__) logger.info('Hello, this is an extension!') - class SphinxLoggerAdapter(logging.LoggerAdapter) error(level, msg, *args, **kwargs) critical(level, msg, *args, **kwargs) - warning(level, msg, *args, **kwargs) Logs a message on this logger with the specified level. Basically, the arguments are as with python’s logging module. In addition, Sphinx logger supports following keyword arguments: - type, *subtype* Categories of warning logs. It is used to suppress warnings by suppress_warnings setting. -. log(level, msg, *args, **kwargs) info(level, msg, *args, **kwargs) verbose(level, msg, *args, **kwargs) - debug(level, msg, *args, **kwargs). - pending_logging() Marks all logs as pending: with pending_logging(): logger.warning('Warning message!') # not flushed yet some_long_process() # the warning is flushed here - pending_warnings() Marks warning logs as pending. Similar to pending_logging(). Deprecated APIs. deprecated APIs - NOTE: On deprecating on public APIs (internal functions and classes), we also follow the policy as much as possible. Sphinx Web Support New in version 1.1. Sphinx provides a Python API to easily integrate Sphinx documentation into your web application. To learn more read the webs WebSupport class and call its build() method: from sphinxcontrib WebSupport object. Integrating Sphinx Documents Into Your Webapp Now that the data is built, it’s time to do something useful with it. Start off by creating a WebSupport object for your application: from sphinxcontrib.websupport import WebSupport support = WebSupport(datadir='/path/to/the/data', search='xapian') You’ll only need one of these for each set of documentation you will be working with. You can then call its is: {%- extends "layout.html" %} {%- block title %} {{ document.title }} {%- endblock %} {% block css %} {{ super() }} {{ document.css|safe }} <link rel="stylesheet" href="/static/websupport-custom.css" type="text/css"> {% endblock %} {%- block script %} {{ super() }} {{ document.script|safe }} {%- endblock %} {%- block relbar %} {{ document.relbar|safe }} {%- endblock %} {%- block body %} {{ document.body|safe }} {%- endblock %} {%- block sidebar %} {{ document.sidebar|safe }} {%- endblock %} Authentication To use certain features such as voting, it must be possible to authenticate users. The details of the authentication are left to your application. Once a user has been authenticated you can pass the user’s details to certain WebSupport methods using the username and moderator keyword arguments. The web support package will store the username with comments and votes. The only caveat is that if you allow users to change their username you must update the websupport package’s data: support.update_username(old_username, new_username) username should be a unique string which identifies a user, and moderator should be a boolean representing whether the user has moderation privileges. The default value for moderator is False. An example Flask function that checks whether a user is logged in and then retrieves a document is: from sphinxcontrib.websupport.errors import * @app.route('/<path:docname>') def doc(docname): username = g.user.name if g.user else '' moderator = g.user.moderator if g.user else False try: document = support.get_document(docname, username, moderator) except DocumentNotFoundError: abort(404) return render_template('doc.html', document=document) The first thing to notice is that the docname is just the request path. This makes accessing the correct document easy from a single view. If the user is authenticated, then the username and moderation status are passed along with the docname to get_document(). The web support package will then add this data to the COMMENT_OPTIONS that are used in the template. NOTE: This only works if your documentation is served from your document root. If it is served from another directory, you will need to prefix the url route with that directory, and give the docroot keyword argument when creating the web support object: support = WebSupport(..., docroot='docs') @app.route('/docs/<path:docname>') Performing Searches To use the search form built-in to the Sphinx sidebar, create a function to handle requests to the url ‘search’ relative to the documentation root. The user’s search query will be in the GET parameters, with the key q. Then use the get_search_results() method to retrieve search results. In Flask that would be like this: @app.route('/search') def search(): q = request.args.get('q') document = support.get_search_results(q) return render_template('doc.html', document=document) Note that we used the same template to render our search results as we did to render our documents. That’s because get_search_results() returns a context dict in the same format that get_document() does. Now that this is done it’s time to define the functions that handle the AJAX calls from the script. You will need three functions. The first function is used to add a new comment, and will call the web support method add_comment(): @app.route('/docs/add_comment', methods=['POST']) def add_comment(): parent_id = request.form.get('parent', '') node_id = request.form.get('node', '') text = request.form.get('text', '') proposal = request.form.get('proposal', '') username = g.user.name if g.user is not None else 'Anonymous' comment = support.add_comment(text, node_id='node_id', parent_id='parent_id', username=username, proposal=proposal) return jsonify(comment=comment) You’ll notice that both a parent_id and node_id are sent with the request. If the comment is being attached directly to a node, parent_id will be empty. If the comment is a child of another comment, then node_id will be empty. Then next function handles the retrieval of comments for a specific node, and is aptly named get_data(): @app.route('/docs/get_comments') def get_comments(): username = g.user.name if g.user else None moderator = g.user.moderator if g.user else False node_id = request.args.get('node', '') data = support.get_data(node_id, username, moderator) return jsonify(**data) The final function that is needed will call process_vote(), and will handle user votes on comments: @app.route('/docs/process_vote', methods=['POST']) def process_vote(): if g.user is None: abort(401) comment_id = request.form.get('comment_id') value = request.form.get('value') if value is None or comment_id is None: abort(400) support.process_vote(comment_id, g.user.id, value) return "success" Comment Moderation By default, all comments added through add_comment() are automatically displayed. If you wish to have some form of moderation, you can pass the displayed keyword argument: You can then create a new view to handle the moderation of comments. It will be called when a moderator decides a comment should be accepted and displayed: @app.route('/docs/accept_comment', methods=['POST']) def accept_comment(): moderator = g.user.moderator if g.user else False comment_id = request.form.get('id') support.accept_comment(comment_id, moderator=moderator) return 'OK' Rejecting comments happens via comment deletion. To perform a custom action (such as emailing a moderator) when a new comment is added but not displayed, you can pass callable to the WebSupport class when instantiating your support object: def moderation_callback(comment): """Do something...""" support = WebSupport(..., moderation_callback=moderation_callback) The moderation callback must take one argument, which will be the same comment dict that is returned by add_comment(). The WebSupport Class - class sphinxcontrib.websupport.WebSupport The main API class for the web support package. All interactions with the web support package should occur through this class. The class takes the following keyword arguments: - srcdir The directory containing reStructuredText source files. - builddir The directory that build data and static files should be placed in. This should be used when creating a WebSupport object that will be used to build data. - datadir The directory that the web support data is in. This should be used when creating a WebSupport object that will be used to retrieve data. - search This may contain either a string (e.g. ‘xapian’) referencing a built-in search adapter to use, or an instance of a subclass of BaseSearch. - storage This may contain either a string representing a database uri, or an instance of a subclass of StorageBackend. If this is not provided, a new sqlite database will be created. - moderation_callback A callable to be called when a new comment is added that is not displayed. It must accept one argument: a dictionary representing the comment that was added. - staticdir If static files are served from a location besides '/static', this should be a string with the name of that location (e.g. '/static_files'). - docroot If the documentation is not served from the base path of a URL, this should be a string specifying that path (e.g. 'docs'). Changed in version 1.6: WebSupport class is moved to sphinxcontrib.websupport from sphinx.websupport. Please add sphinxcontrib-websupport package in your dependency and use moved class instead. Methods - WebSupport.build() Build the documentation. Places the data into the outdir directory. Use it like this: support = WebSupport(srcdir, builddir, search='xapian') support.build() This will read reStructured text files from srcdir. Then it will build the pickles and search index, placing them into builddir. It will also save node data to the database. - WebSupport.get_document(docname, username='', moderator=False) Load and return a document from a pickle. The document will be a dict object which can be used to render a template: support = WebSupport(datadir=datadir) support.get_document('index', username, moderator) In most cases docname will be taken from the request path and passed directly to this function. In Flask, that would be something like this: @app.route('/<path:docname>') def index(docname): username = g.user.name if g.user else '' moderator = g.user.moderator if g.user else False try: document = support.get_document(docname, username, moderator) except DocumentNotFoundError: abort(404) render_template('doc.html', document=document) The document dict that is returned contains the following items to be used during template rendering. - raises DocumentNotFoundError if a document matching docname is not found. - Parameters docname – the name of the document to load. - WebSupport.get_data(node_id, username=None, moderator=False) Get the comments and source associated with node_id. If username is given vote information will be included with the returned comments. The default CommentBackend returns a dict with two keys, source, and comments. source is raw source of the node and is used as the starting point for proposals a user can add. comments is a list of dicts that represent a comment, each having the following items: - Parameters - node_id – the id of the node to get comments for. - username – the username of the user viewing the comments. - moderator – whether the user is a moderator. - WebSupport.add_comment(text, node_id='', parent_id='', displayed=True, username=None, time=None, proposal=None, moderator=False) Add a comment to a node or another comment. Returns the comment in the same format as get_comments(). If the comment is being attached to a node, pass in the node’s id (as a string) with the node keyword argument: If the comment is the child of another comment, provide the parent’s id (as a string) with the parent keyword argument: If you would like to store a username with the comment, pass in the optional username keyword argument: - Parameters - parent_id – the prefixed id of the comment’s parent. - text – the text of the comment. - displayed – for moderation purposes - username – the username of the user making the comment. - time – the time the comment was created, defaults to now. - WebSupport.process_vote(comment_id, username, value) Process a user’s vote. The web support package relies on the API user to perform authentication. The API user will typically receive a comment_id and value from a form, and then make sure the user is authenticated. A unique username must be passed in, which will also be used to retrieve the user’s past voting data. An example, once again in Flask: @app.route('/docs/process_vote', methods=['POST']) def process_vote(): if g.user is None: abort(401) comment_id = request.form.get('comment_id') value = request.form.get('value') if value is None or comment_id is None: abort(400) support.process_vote(comment_id, g.user.name, value) return "success" - Parameters - comment_id – the comment being voted on - username – the unique username of the user voting - value – 1 for an upvote, -1 for a downvote, 0 for an unvote. - WebSupport.get_search_results(q) Perform a search for the query q, and create a set of search results. Then render the search results as html and return a context dict like the one created by get_document(): document = support.get_search_results(q) - Parameters q – the search query Search Adapters To create a custom search adapter you will need to subclass the BaseSearch class. Then create an instance of the new class and pass that as the search keyword argument when you create the WebSupport object: support = WebSupport(srcdir=srcdir, builddir=builddir, search=MySearch()) For more information about creating a custom search adapter, please see the documentation of the BaseSearch class below. - class sphinxcontrib.websupport.search.BaseSearch Defines an interface for search adapters. Changed in version 1.6: BaseSearch class is moved to sphinxcontrib.websupport.search from sphinx.websupport.search. BaseSearch Methods The following methods are defined in the BaseSearch class. Some methods do not need to be overridden, but some (add_document() and handle_query()) must be overridden in your subclass. For a working example, look at the built-in adapter for whoosh. - BaseSearch.init_indexing(changed=[]) Called by the builder to initialize the search indexer. changed is a list of pagenames that will be reindexed. You may want to remove these from the search index before indexing begins. - Parameters changed – a list of pagenames that will be re-indexed - BaseSearch.finish_indexing() Called by the builder when writing has been completed. Use this to perform any finalization or cleanup actions after indexing is complete. - BaseSearch.feed(pagename, filename, title, doctree) Called by the builder to add a doctree to the index. Converts the doctree to text and passes it to add_document(). You probably won’t want to override this unless you need access to the doctree. Override add_document() instead. - Parameters - pagename – the name of the page to be indexed - filename – the name of the original source file - title – the title of the page to be indexed - doctree – is the docutils doctree representation of the page - BaseSearch.add_document(pagename, filename, title, text) Called by. - Parameters - pagename – the name of the page being indexed - filename – the name of the original source file - title – the page’s title - text – the full text of the page - BaseSearch.query(q) Called by the web support api to get search results. This method compiles the regular expression to be used when extracting context, then calls handle_query(). You won’t want to override this unless you don’t want to use the included extract_context() method. Override handle_query() instead. - Parameters q – the search query string. - BaseSearch.handle_query(q) Called by query() to retrieve search results for a search query q. This should return an iterable containing tuples of the following format: (<path>, <title>, <context>) path and title are the same values that were passed to add_document(), and context should be a short text snippet of the text surrounding the search query in the document. The extract_context() method is provided as a simple way to create the context. - Parameters q – the search query - BaseSearch.extract_context(text, length=240) Extract the context for the search query from the document’s full text. - Parameters - text – the full text of the document to create the context for - length – the length of the context snippet to return. Storage Backends To create a custom storage backend you will need to subclass the StorageBackend class. Then create an instance of the new class and pass that as the storage keyword argument when you create the WebSupport object: support = WebSupport(srcdir=srcdir, builddir=builddir, storage=MyStorage()) For more information about creating a custom storage backend, please see the documentation of the StorageBackend class below. - class sphinxcontrib.websupport.storage.StorageBackend Defines an interface for storage backends. Changed in version 1.6: StorageBackend class is moved to sphinxcontrib.websupport.storage from sphinx.websupport.storage. StorageBackend Methods - StorageBackend.pre_build() Called immediately before the build process begins. Use this to prepare the StorageBackend for the addition of nodes. - StorageBackend.add_node(id, document, source) Add a node to the StorageBackend. - Parameters - id – a unique id for the comment. - document – the name of the document the node belongs to. - source – the source files name. - StorageBackend.post_build() Called after a build has completed. Use this to finalize the addition of nodes if needed. - StorageBackend.add_comment(text, displayed, username, time, proposal, node_id, parent_id, moderator) Called when a comment is being added. - Parameters - text – the text of the comment - displayed – whether the comment should be displayed - username – the name of the user adding the comment - time – a date object with the time the comment was added - proposal – the text of the proposal the user made - node_id – the id of the node that the comment is being added to - parent_id – the id of the comment’s parent comment. - moderator – whether the user adding the comment is a moderator - StorageBackend.delete_comment(comment_id, username, moderator) Delete a comment. Raises UserNotAuthorizedError if moderator is False and username doesn’t match the username on the comment. - Parameters - comment_id – The id of the comment being deleted. - username – The username of the user requesting the deletion. - moderator – Whether the user is a moderator. - StorageBackend.get_data(node_id, username, moderator) Called to retrieve all data for a node. This should return a dict with two keys, source and comments as described by WebSupport’s get_data() method. - Parameters - node_id – The id of the node to get data for. - username – The name of the user requesting the data. - moderator – Whether the requestor is a moderator. - StorageBackend.process_vote(comment_id, username, value) Process a vote that is being cast. value will be either -1, 0, or 1. - Parameters - comment_id – The id of the comment being voted on. - username – The username of the user casting the vote. - value – The value of the vote being cast. - StorageBackend.update_username(old_username, new_username) If a user is allowed to change their username this method should be called so that there is not stagnate data in the storage system. - Parameters - old_username – The username being changed. - new_username – What the username is being changed to. - StorageBackend.accept_comment(comment_id) Called when a moderator accepts a comment. After the method is called the comment should be displayed to all users. - Parameters comment_id – The id of the comment being accepted. Sphinx FAQ This is a list of Frequently Asked Questions about Sphinx. Feel free to suggest new entries! How do I… - … create PDF files without LaTeX? rinohtype provides a PDF builder that can be used as a drop-in replacement for the LaTeX builder. Alternatively, you can use rst2pdf version 0.12 or greater which comes with built-in Sphinx integration. See the builders section for details. - … get section numbers? They are automatic in LaTeX output; for HTML, give a :numbered: option to the toctree directive where you want to start numbering. - … customize the look of the built HTML files? Use themes, see theming. - … add global substitutions or includes? Add them in the rst_epilog config value. - … display the whole TOC tree in the sidebar? Use the toctree callable in a custom layout template, probably in the sidebartoc block. - … write my own extension? See the extension tutorial. - … convert from my existing docs using MoinMoin markup? The easiest way is to convert to xhtml, then convert xhtml to reST. You’ll still need to mark up classes and such, but the headings and code examples come through cleanly. - … create HTML slides from Sphinx documents? See the “Hieroglyph” package at. For many more extensions and other contributed stuff, see the sphinx-contrib repository. following list gives some hints for the creation of epub files: - epub_post_files option. - The handling of the epub cover page differs from the reStructuredText procedure which automatically resolves image paths and puts the images into the _images directory. For the epub cover page put the image in the html_static_path directory and reference it with its full path in the epub_cover config option. kindlegen command can convert from epub3 resulting file to .mobi file for Kindle. You can get yourdoc.mobi under _build/epub after the following command: $ make epub $ kindlegen _build/epub/yourdoc.epub The kindlegen command doesn’t accept documents that have section titles surrounding toctree directive:: Displaying do (;). and strong are now displayed like `literal's. The standard formatting can be re-enabled by adding the following to your conf.py: texinfo_elements = {'preamble': """ @definfoenclose strong,*,* @definfoenclose emph,_,_ """} Glossary -ree directive. - object The basic building block of Sphinx documentation. Every “object directive” (e.g. function or object) creates such a block; and most objects can be cross-referenced to. - RemoveInSphinxXXXWarning The feature which is warned will be removed in Sphinx-XXX version. It usually caused from Sphinx extensions which is using deprecated. See also when-deprecation-warnings-are-displayed. - role A reStructuredText markup element that allows marking a piece of text. Like directives, roles are extensible. The basic syntax looks like this: :rolename:`content`. See inlinemarkup for details. - source directory The directory which, including its subdirectories, contains all source files for one Sphinx project. Sphinx Developer’s Guide Abstract This document describes the development process of Sphinx, a documentation system used by developers to document systems used by other developers to develop other systems that may also be documented using Sphinx. - Bug Reports and Feature Requests Contributing to Sphinx - Getting Started - Core Developers - Locale updates Coding Guide - Debugging Tips - Branch Model - Deprecating a feature - Deprecation policy - Unit Testing The Sphinx source code is managed using Git and is hosted on GitHub. git clone git://github.com/sphinx-doc/sphinx Community.INDENT 0.0 -. - 1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. - 2. If you feel uncomfortable or uncertain about an issue or your changes, feel free to email the sphinx-dev mailing list. - 3. Fork the repository on GitHub to start making your changes to the master branch for next major version, or X.Y branch for next minor version (see Branch Model). - 4. Write a test which shows that the bug was fixed or that the feature works as expected. - 5. Send a pull request and bug the maintainer until it gets merged and published. Make sure to add yourself to AUTHORS and the change to CHANGES. Getting Started These are the basic steps needed to start developing on Sphinx. - 1. - 2. Fork the main Sphinx repository (sphinx-doc/sphinx) using the GitHub interface. - 3. Clone the forked repository to your machine. git clone cd sphinx - 4. For changes that should be included in the next minor release (namely bug fixes), use the X.Y branch. git checkout X.Y For new features or other substantial changes that should wait until the next major release, use the master branch (see Branch Model for detail). - 5. Setup a virtual environment. This is not necessary for unit testing, thanks to tox, but it is necessary if you wish to run sphinx-build locally or run unit tests without the help of tox. virtualenv ~/.venv . ~/.venv/bin/activate pip install -e . - 6. Create a new working branch. Choose any name you like. git checkout -b feature-xyz - 7. Hack, hack, hack. For tips on working with the code, see the Coding Guide. - 8. can directory where necessary: - For bug fixes, first add a test that fails without your changes and passes after they are applied. - Tests that need a sphinx-build run should be integrated in one of the existing test modules if possible. New tests that to @with_app and then build_all for a few assertions are not good since the test suite should not take more than a minute to run. - 9. Please add a bullet point to CHANGES if. - 10. Push changes in the branch to your forked repository on GitHub. git push origin feature-xyz - 11. Submit a pull request from your branch to the respective branch (master or X.Y). - 12. Wait for a core developer to review your changes. Core Developers entry. Locale updates_messages to update the .pot template. - Use python setup.py update_catalog to update all existing language catalogs in sphinx/locale/*/LC_MESSAGES with the current messages in the template file. - Use python setup.py compile_catalog to compile the .po files to binary .mo files and .js files. - Try to use the same code style as used in the rest of the project. See the Pocoo Styleguide for more information. - For non-trivial changes, please update the CHANGES file. if it’s important enough. - Use the included utils/check_sources.py script to check for common formatting issues (trailing whitespace, lengthy lines, etc). - Add appropriate unit tests. Debugging Tips - Delete the build cache before building documents if you make changes in the code by running the command make clean or using the sphinx-build -E option. - Use the sphinx-build -P option to run pdb on exceptions. - Use node.pformat() and node.asdom().toxml() to generate a printable representation of the document structure. - Set the configuration variable keep_warnings to True so warnings will be displayed in the generated output. - Set the configuration variable nitpicky to True so Sphinx project uses following branches for developing. - master Used for main development. All improvement and refactoring, bug fixes are allowed. - X.Y Where X.Y is the MAJOR.MINOR release. Used to maintain current stable release. Only bug fixes and stable changes are allowed. Only the most recent stable release is currently retained. When a new version is released, the old release branch will be deleted and replaced by an equivalent tag. Deprecating a feature. Changes in Sphinx Release 1.7.6 (released Jul 17, 2018) Release 1.7.5 (released May 29, 2018) Bugs fixed - #4924: html search: Upper characters problem in any other languages - #4932: apidoc: some subpackage is ignored if sibling subpackage contains a module starting with underscore - #4863, #4938, #4939: i18n doesn’t handle node.title correctly t Release 1.7.4 (released Apr 25, 2018) Bugs fixed - #4885, #4887: domains: Crashed with duplicated objects - #4889: latex: sphinx.writers.latex causes recusrive import Release 1.7.3 (released Apr 23, 2018) Release 1.7.2 (released Mar 21, 2018) Release 1.7.1 (released Feb 23, 2018) Release 1.7.0 (released Feb 12, 2018) Dependencies 1.7.0b1 - Add packaging package Incompatible changes option is True. They are only emitted to stderr. - shebang line is removed from generated conf.py - #2557: autodoc: autodoc_mock_imports only and body_max_width. - #4771: apidoc: The exclude_patterns arguments are ignored if they are placed just after command line options 1.7.0b2 - #4467: html theme: Rename csss block to css Deprecated 1.7.0b1 - using a string value for html_sidebars is deprecated and only list values will be accepted at 2.0. - format_annotation() and formatargspec() is deprecated. Please use sphinx.util.inspect.Signature instead. - sphinx.ext.autodoc.AutodocReporter is replaced by sphinx.util.docutils. switch_source_input() and now deprecated. It will be removed in Sphinx-2.0. - sphinx.ext.autodoc.add_documenter() and AutoDirective._register is now deprecated. Please use app.add_autodocumenter() instead. - AutoDirective._special_attrgetters is now deprecated. Please use app.add_autodoc_attrgetter() instead. Features added 1.7.0b1 - C++, handle decltype(auto). - #2406: C++, add proper parsing of expressions, including linking of identifiers. - C++, add a cpp:expr role for inserting inline C++ expressions or types. - C++, support explicit member instantiations with shorthand template prefix. - C++, make function parameters linkable, like template params. - #3638: Allow to change a label of reference to equation using math_eqref_format Now suppress_warnings accepts for equation numbering by section (refs: #3991, #4080). Thanks to Oliver Jahn. - #4311: Let LaTeX obey numfig_secnum_depth for figures, tables, and code-blocks - #947: autodoc now supports ignore-module-all to ignore a module’s __all__ - #4332: Let LaTeX obey math_numfig for equation numbering - #4093: sphinx-build creates empty directories for unknown targets/builders - Add top-classes option for the sphinx.ext.inheritance_diagram extension to limit the scope of inheritance graphs. - #4183: doctest: :pyversion: option also follows PEP-440 specification - #4235: html: Add manpages_url to make manpage roles to hyperlinks - #3570: autodoc: Do not display ‘typing.’ module for type hints - #4354: sphinx-build now emits finish message. Builders can modify it through Builder.epilog attribute - #4245: html themes: Add language to javascript vars list - #4079: html: Add notranslate class and text_secnumber_suffix 1.7.0b2 Features removed 1.7.0b1 Configuration variables - html_use_smartypants - latex_keep_old_macro_names - latex_elements[‘footer’] utility methods of sphinx.application.Sphinx class - buildername (property) - _display_chunk() - old_status_iterator() - status_iterator() - _directive_helper() utility methods of sphinx.environment.BuildEnvironment class - currmodule (property) - currclass (property) - epub2 builder - prefix and colorfunc parameter for warn() - sphinx.util.compat module - sphinx.util.nodes.process_only_nodes() - LaTeX environment notice, use sphinxadmonition instead - LaTeX \sphinxstylethead, use \sphinxstyletheadfamily - C++, support of function concepts. Thanks to mickk-on-cpp. - Not used and previously not documented LaTeX macros \shortversion and \setshortversion Bugs fixed is not set 1.7.0b2 - 3 - #4019: inheritance_diagram AttributeError stoping1 - Add support for docutils 0.14 - Add tests for the sphinx.ext.inheritance_diagram extension. Release 1.6.7 (released Feb 04, 2018) tranformed Release 1.6.6 (released Jan 08, 2018) Features added - #4181: autodoc: Sort dictionary keys when possible - VerbatimHighlightColor is a new LaTeX ‘sphinxsetup’ key (refs: #4285) - Easier customizability of LaTeX macros involved in rendering of code-blocks - Show traceback if conf.py raises an exception (refs: #4369) - Add smartquotes to disable smart quotes through conf.py (refs: #3967) - Add smartquotes_action and ‘how: Release 1.6.5 (released Oct 23, 2017) latex_engine - #4090: [doc] latex_additional_files with extra LaTeX macros should not use .tex extension - Failed to convert reST parser error to warning (refs: #4132) Release 1.6.4 (released Sep 26, 2017) Features added = ‘gu ‘None’ string Release 1.6.3 (released Jul 02, 2017): ‘str object’ has no attribute ‘filename’ - Release 1.6.2 (released May 28, 2017) Incompatible changes - #3789: Do not require typing module for python>=3.5 Bugs fixed - #3754: HTML builder crashes if HTML theme appends own stylesheets - #3756: epub: Entity ‘mdash’#2857 issue, a workaround is obtained using some extra LaTeX code in Sphinx’s own: ‘ImportError’ in sphinx.ext.autodoc due to broken ‘sys Release 1.6.1 (released May 16, 2017) Dependencies on GNU/Linux and Mac OS X (refs: #3082) Incompatible changes 1.6b1 - #1061, #2336, #3235: Now generation of autosummary doesn’t contain imported members by default. Thanks to Luc Saffre. - LaTeX \includegraphics command isn’t overloaded: only \sphinxincludegraphics has the custom code to fit image to available width if oversized. - The subclasses of sphinx.domains.Index shouldinclude directive does not allow the combination of :diff: option and other options (refs: #3416) - LuaLaTeX engine uses fontspec like XeLaTeX. It is advised latex_engine = 'lualatex' be used only on up-to-date TeX installs (refs #3070, #3466) - latex_keep_old_macro_names default value has been changed from True to or xcolor packages should be used by extensions of Sphinx latex writer. (refs #3550) - Builder.env is not filled at instantiation - #3594: LaTeX: single raw directive has been considered as block level element - #3639: If html_experimental_html5_writer is not used and not loaded by Sphinx anymore - LaTeX package multirow is not used and not loaded by Sphinx anymore - Add line numbers to citation data in std domain 1.6 final - LaTeX package threeparttable is not used and not loaded by Sphinx anymore (refs #3686, #3532, #3377) Features removed Configuration variables - epub3_contributor - epub3_description - epub3_page_progression_direction - html_translator_class - html_use_modindex - latex_font_size - latex_paper_size - latex_preamble - latex_use_modindex - latex_use_parts - termsep node - defindex.html template - LDML format support in today, today_fmt and html_last_updated_fmt - :inline: option for the directives of sphinx.ext.graphviz extension - sphinx.ext.pngmath extension - sphinx.util.compat.make_admonition() Features added 1.6b1 - #3136: Add :name: option to the directives in sphinx.ext.graphviz - #2336: Add imported_members option to sphinx-autogen commandinclude directive (refs: #3416) - Use for LuaLaTeX same default settings as for XeLaTeX (i.e. fontspec and polyglossia). (refs: #3070, #3466) - Make 'extraclassoptions' key of latex_elements public (refs #3480) - #3463: Add warning messages for required EPUB3 metadata. Add default value to epub_description to avoid warning like other settings. - #3476: setuptools: Support multiple builders - latex: merged cells in LaTeX tables allow code-blocks, lists, blockquotes… as do normal cells (refs: #3435) - HTML builder uses experimental HTML5 writer if html_experimental_html5_writer variable for the Makefile in $BUILDDIR/latex to pass options to latexmk when executing make latexpdf (refs #3695, #3720) - Add a new event env-check-consistency to check consistency to extensions - Add Domain.check_consistency() to check consistency Bugs fixed 1.6b1 - literalinclude directive node to depart_admonition. - #2693: Sphinx latex style file wrongly inhibits colours for section headings for latex+dvi(ps,pdf,pdfmx) - C++, properly look up any references. - #3624: sphinx.ext.intersphinx couldn’t load inventories compressed with gzip - #3551: PDF information dictionary is lacking author and title data - #3351: intersphinx does not refers context like py:module, py:class and -pdflua Deprecated 1.6b1 -.6b2 - #3662: builder.css_files is deprecated. Please use add_stylesheet() API instead. 1.6 final - LaTeX \sphinxstylethead is deprecated at 1.6 and will be removed at 1.7. Please move customization into new macro \sphinxstyletheadfamily. Testing 1.6 final - #3458: Add sphinx.testing (experimental) Release 1.6 (unreleased) - not released (because of package script error) Release 1.5.6 (released May 15, 2017) Bugs fixed - Release 1.5.5 (released Apr 03, 2017) Bugs fixed - #3597: python domain raises UnboundLocalError if invalid name given - #3599: Move to new Mathjax CDN Release 1.5.4 (released Apr 02, 2017) latex_documents causes failed PDF build (refs #3551, #3567) Release 1.5.3 (released Feb 26, 2017): release is not escaped (refs: #3362) - #3364: sphinx-quickstart prompts overflow on Console with 80 chars width - since 1.5, PDF’s TOC and bookmarks lack an entry for general Index (refs: #3383) - #3392: 'releasename' in Release 1.5.2 (released Jan 22, 2017) parsed-literal are wrapped like in”) Release 1.5.1 (released Dec 13, 2016) Features added - #3214: Allow to suppress “unknown mimetype” warnings from epub builder using suppress_warnings. Bugs fixed - #3195: Can not build in parallel - #3198: AttributeError is raised when toctree has ‘self’ - . Release 1.5 (released Dec 5, 2016) Incompatible changes by TeX equivalent bp if found in width or height attribute of an image. - latex, if width or height attribute of an image is given with no unit, use px rather than ignore it. - latex: Separate stylesheets of pygments to independent .sty file - #2454: The filename of sourcelink is now changed. The value of html_sourcelink_suffix will theme instead of default one to improve readability. - latex: To provide good default settings to Japanese documents, Sphinx uses jreport and jsbook as docclass if language is ja. - sphinx-quickstart now allows a project version is empty - Fix :download: role on epub/qthelp builder. They ignore the role because they don’t support it. - sphinx.ext.viewcode doesn’t work on epub building by default. viewcode_enable_epub option - sphinx.ext.viewcode disabled on singlehtml builder. - Use make-mode of sphinx-quickstart by default. To disable this, use -M option - Fix genindex.html, Sphinx’s document template, link address to itself to satisfy xhtml standard. - Use epub3 builder by default. And the old epub builder is renamed to epub2. - Fix epub and epub3 builders that contained links to genindex even if epub_use_index = False. - html_translator_class is now deprecated. Use Sphinx.set_translator() API instead. - Drop python 2.6 and 3.3 support - Drop epub3 builder’s epub3_page_progression_direction option (use epub3_writing_mode). - #2877: Rename latex_elements['footer'] to latex_elements['atendofbody'] 1.5a2 - #2983: Rename epub3_description and epub3_contributor to epub_description and epub_contributor. - Remove themes/basic/defindex.html; no longer used - Sphinx does not ship anymore (but still uses) LaTeX style file fncychap - #2435: Slim down quickstarted conf.py - The sphinx.sty latex allows user customization if needed. - LaTeX target requires that option hyperfootnotes of package hyperref be left unchanged to its default (i.e. true) (refs: #3022) 1.5 final - #2986: themes/basic/defindex.html is now deprecated - Emit warnings that will be deprecated in Sphinx 1.6 by default. Users can change the behavior by setting the environment variable PYTHONWARNINGS. Please refer when-deprecation-warnings-are-displayed. - #2454: new JavaScript variable SOURCELINK_SUFFIX is added Deprecated These features are removed in Sphinx when-deprecation-warnings-are-displayed. Features added 1.5a1 - #2951: Add --implicit-namespaces PEP allows :align: option - Show warnings if unknown key is specified to latex_elements - Show warnings if no domains match with primary_domain (ref: #2001) - C++, show warnings when the kind of role is misleading for the kind of target it refers to (e.g., using the class role for a function). - latex, writer abstracts more of text styling into customizable macros, e.g. the visit_emphasis will output \sphinxstyleemphasis rather and \sphinxverbatimborder, - booleans \ifsphinxverbatimwithframe option to setup.py command - latex, make the use of \small for code listings customizable (ref #2721) - #2663: Add --warning-is-error option to setup.py command - Show warnings if deprecated latex options are used - Add sphinx.config.ENUM to check the config values is in candidates - math: Add hyperlink marker to each equations in HTML output - Add new theme nonav that doesn’t include any navigation links. This is for any help generator like qthelp. - #2680: sphinx.ext.todo now emits warnings if todo_emit_warnings enabled. Also, it emits an additional event named todo-defined to handle the Todo entries in 3rd party extensions. - Python domain signature parser now uses the xref mixin for ‘exceptions’, allowing exception classes to be autolinked. - #2513: Add latex_engine to.math emits missing-reference event if equation not found - #1210: eqref role now supports cross reference - #2892: Added -a (--append-syspath) option to sphinx-apidoc - #1604: epub3 builder: Obey font-related CSS when viewing in iBooks. - #646: option directive support ‘.’ character as a part of options - Add document about kindlegen and fix document structure for it. - #2474: Add intersphinx_timeout option to sphinx.ext.intersphinx - #2926: EPUB3 builder supports vertical mode (epub3_writing_mode option) - #2695: build_sphinx subcommand for setuptools handles exceptions as same as sphinx-build does - #326: numref role can also refer sections - #2916: numref role can also refer caption as an its linktext 1.5a2 - #3008: linkcheck builder ignores self-signed certificate URL - #3020: new 'geometry' key to latex_elements whose default uses LaTeX style file geometry.sty to set page layout - #2843: Add :start-at: and :end-at: options to literalinclude directive - #2527: Add :reversed: option to toctree directive - Add -t and -d option to sphinx-quickstart to support templating generated sphinx project. - #3028: Add {path} and {basename} to the format of figure_language_filename - new 'hyperref' key in the latex_elements dictionary --extensions to sphinx-quickstart to option to control if inline literal word-wraps in latex 1.5 final - #3095: Add tls_verify and tls_cacerts to support self-signed HTTPS servers in linkcheck and intersphinx - #2215: make.bat generated by sphinx-quickstart can be called from another dir. Thanks to Timotheus Kampik. - #3185: Add new warning type misc.highlighting_failure Bugs fixed 1.5a1 - ‘already registered’ warnings 1.5a2 - #2810: Problems with pdflatex in an Italian document - Use latex_elements.papersize to specify papersize of LaTeX in Makefile - #2988: linkcheck: retry with GET request if denied HEAD request - #2990: linkcheck raises “Can’t convert ‘bytes’b1 - #2432: Fix unwanted * between varargs and keyword only args. Thanks to Alex Grönholm. - #3062: Failed to build PDF using 1.5a2 (undefined \hypersetup for Japanese documents since PR#30 final - . Release 1.4.9 (released Nov 23, 2016) Bugs fixed - #2936: Fix doc/Makefile that can’t build man because doc/man exists - #3058: Using the same ‘caption’ attribute in multiple ‘toctree’ directives results in warning / error - #3068: Allow the ‘=’ Release 1.4.8 (released Oct 1, 2016) Bugs fixed - #2996: The wheel package of Sphinx got crash with ImportError Release 1.4.7 (released Oct 1, 2016) Bugs fixed - #2890: Quickstart should return an error consistently on all error conditions - #2870: flatten genindex columns’ heights. - #2856: Search on generated HTML site doesnt can detect genindex, search collectly. - automatially. - #2962: latex: missing label of longtable - #2968: autodoc: show-inheritance option breaks docstrings Release 1.4.6 (released Aug 20, 2016) identidy Release 1.4.5 (released Jul 13, 2016). Release 1.4.4 (released Jun 12, 2016) Bugs fixed - #2630: Latex sphinx.sty Notice Enviroment Release 1.4.3 (released Jun 5, 2016) Release 1.4.2 (released May 29, 2016) Features added Now Release 1.4.1 (released Apr 12, 2016). Release 1.4 (released Mar 28, 2016): ‘Thumbs.db’ and ‘: html_extra_path also copies dotfiles in the extra directory, and refers to todo_link_only to avoid file path and line indication on glossary-directive. - #2308: Define \tablecontinued macro to redefine the style of continued label for longtables. - Select an image by similarity if multiple images are globbed by .. image:: filename.* - #1921: Support figure substitutions by language and ‘signed char’ and ‘unsigned char’ as types. - C++, add missing support for ‘friend’ functions. - C++, add missing support for virtual base classes (thanks to Rapptz). - C++, add support for final classes. - C++, fix parsing of types prefixed with ‘enum’. - force ‘rootS html_last_updated_fmt. Thanks to Ralf Hemmecke. Release 1.3.6 (released Feb 29, 2016) Features added - #1873, #1876, #2278: Add page_source_suffix html context variable. This should be introduced with forcely if source directory has changed. - #2019: Fix the domain objects in search result are not escaped Release 1.3.5 (released Jan 24, 2016)) Release 1.3.4 (released Jan 12, 2016) unparse py@light:). Release 1.3.2 (released Nov 29, 2015) ‘inherit’.: ‘.’ as <module_path> for sphinx-apidoc cause an unfriendly error. Now ‘.’ ‘version’ and ‘release’. - #2102: On Windows + Py3, using |today| and non-ASCII date format will raise UnicodeEncodeError. - #1974: UnboundLocalError: local variable ‘domain’ ‘admonition-‘ when language is specified with non-ASCII linguistic area like ‘ru’ or ‘ja’. To fix this, now todo directive can use :class: option. - #2140: Fix footnotes in table has broken in LaTeX - #2127: MecabBinder for html searching feature doesn’t work with Python 3. Thanks to Tomoko Uchida. Release 1.3.1 (released Mar 17, 2015). Release 1.3 (released Mar 10, 2015) Incompatible changes - Roles ref, term and menusel now don’t generate source_suffix config value can now be a list of multiple suffixes. - Add the ability to specify source parsers by source suffix with the and literalinclude dirctives. - #1756: Incorrect section titles in search that was introduced from 1.3b3. - #1746: C++, fixed name lookup procedure, and added missing lookups in declarations. - #1765: C++, fix old id generation to use fully qualified names. Documentation - #1651: Add vartype field descritpion for python domain. Release 1.3b3 (released Feb 24, 2015): - ‘literal-block’ - ‘doctest-block’ - ‘raw’ - ‘image’ - Release 1.3b2 (released Dec 5, 2014) Incompatible changes - update bundled ez_setup.py for setuptools-7.0 that requires Python 2.6 or later. Features added - - PR#311: sphinx-quickstart does not work on python 3.4. - Fix ‘index’ node by default. Please set ‘index’ to gettext_enables to enable extracting index entries. - PR#307: and numfig_format. Also numref role#172, PR#266: The code-block and literalinclude directives now can have a caption option *.mo files from *.po files when gettext_auto_build is True (default) and *.po is newer than *.mo file. - #623: sphinx.ext.viewcode supports imported function/class aliases. - PR#275: sphinx.ext.intersphinx supports multiple target for the inventory. Thanks to Brigitta Sipocz. - PR#261: Added the env-before-read-docs event that can be connected to modify the order of documents before they are read by the environment. - #1284: Program options documented with option can now start with +. - PR#291: The caption of code-block is recognised as a title of ref target. Thanks to Takeshi Komiya. - PR#298: Add new API: add_latex_package(). Thanks to Takeshi Komiya. - #1344: add gettext_enables to enable extracting ‘index’ to gettext catalog output / applying translation catalog to generated documentation. - PR#301, #1583: Allow the line numbering of the directive literalinclude to match that of the included file, using a new lineno-match option. Thanks to Jeppe Pihl. - PR#299: http:// and pep roles mechanism to cd back and :doc: references. - #1686: ifconfig directive doesn’t care about default config values. - #1642: Fix only one search result appearing in Chrome. Documentation - Add clarification about the syntax of tags. (doc/markup/misc.rst) Release 1.2.3 (released Sep 1, 2014) Features added Bugs fixed - . Release 1.2.2 (released Mar 2, 2014) Bugs fixed - PR#211: When checking for existence of the html_logo file, check the full relative path and not the basename. - PR#212: Fix traceback with autodoc and __init__ methods without docstring. - PR#213: Fix a missing import in the setup command. - #1357: Option names documented by argument usage. Documentation - Extended the documentation about building extensions. extension. - #979, #1266: Fix exclude handling in sphinx-apidoc. - #1302: Fix regression in. (doc/tutorial.r ‘sphinxmanual’ and ‘sphinxhowto’. Now you can use your custom document class without ‘sphinx’ latex_additional_files now override TeX files included by Sphinx, such as sphinx.sty. - PR#124: the node generated by versionadded, versionchanged and deprecated directives now includes all added markup (such as “New in version X”) as child nodes, and no additional text must be generated by writers. - PR#99: the seealso directive now generates admonition nodes instead of the custom seealso node. Features added Markup - The latex_elements for customizing how transitions are displayed. Thanks to Jeff Klukas. - PR#114: The LaTeX writer now includes the “cmap” package by default. The 'cmappkg' item in latex_elements can be used to control this. Thanks to Dmitry Shachnev. - The 'fontpkg' item in latex_elements now defaults to '' when the language uses the Cyrillic script. Suggested by Dmitry Shachnev. - The latex_documents, texinfo_documents, and man_pages configuration values will be set to default values based on the master_doc if not explicitly set in#61,#703: Add support for non-ASCII filename handling. Other builders: - Added the Docutils-native XML and pseudo-XML builders. See XMLBuilder and PseudoXMLBuilder. - PR#45: The linkcheck builder now checks #anchors for existence. - PR#123, #1106: Add epub_use_index configuration value. If provided, it will be used instead of html_use_index for epub builder. - PR#126: Add epub_tocscope configuration value. The setting controls the generation of the epub toc. The user can now also include hidden toc entries. - PR#112: Add epub_show_urls configuration value. Extensions: - PR#52: special_members flag to autodoc now behaves like members. - PR#47: Added: Documentation - PR#88: Added the “Sphinx Developer’s Guide” (doc/devguide.rst) which outlines the basic development process of the Sphinx project. - Added a detailed “Installing Sphinx” document . Release 1.1.3 (Mar 10, 2012) - PR#40: Fix safe_repr function. Release 1.1.2 (Nov 1, 2011) – 1.1.1 is a silly version number anyway! - #809: Include custom fixers in the source distribution. Release 1.1.1 (Nov 1, 2011) - . Release 1.1 (Oct 9, 2011) index role, to make inline index entries. - #454: Added more index markup capabilities: marking see/seealso entries, and main entries for a given key. - #460: Allowed limiting the depth of section numbers for HTML using the toctree’s numbered option. - #586: Implemented improved glossary markup which allows multiple terms per definition. - #478: Added py:decorator directive to describe decorators. - C++ domain now supports array definitions. - C++ domain now supports doc fields (:param x: inside directives). - Section headings in env-get-outdated event. -. Release 1.0.6 (Jan 04, 2011) - . Release 1.0.4 (Sep 17, 2010) - . Release 1.0.3 (Aug 23, 2010) - . Release 1.0.1 (Jul 27, 2010) - : Markup: - The menuselection and guilabel roles now support ampersand accelerators. - New more compact doc field syntax is now recognized: :param type name: description. - Added tab-width option to literalinclude directive. - Added titlesonly option to toctree directive. - Added the prepend and append options to the literalinclude directive. - #284: All docinfo metadata is now put into the document metadata, not just the author. - The ref role toctree callable in templates now has a maxdepth keyword argument to control the depth of the generated tree. - The html-collect-pages. - Added needs_sphinx config value and require_sphinx() application API method. - #200: Added add_stylesheet() application API method. Extensions: - Added the viewcode extension. - Added the extension, thanks to Pauli Virtanen. - #309: The graphviz extension can now output SVG instead of PNG images, controlled by the graphviz_output_format config value. - Added alt option to graphviz extension directives. - Added exclude argument. Projects Using Sphinx This is an (incomplete) alphabetic list of projects that use Sphinx or are experimenting with using it for their documentation. If you like to be included, please mail to the Google group. I’ve grouped the list into sections to make it easier to find interesting examples. Documentation using the alabaster theme - Alabaster: - Blinker: - Calibre: - Click: (customized) - coala: (customized) - CodePy: - Fabric: - Fityk: - Flask: - Flask-OpenID: - Invoke: - Jinja: - Lino: (customized) - marbl: - MDAnalysis: (customized) - MeshPy: - PyCUDA: - PyOpenCL: - PyLangAcq: - pytest: (customized) - python-apt: - PyVisfile: - Requests: - searx: - Tablib: - urllib3: (customized) - Werkzeug: (customized) Documentation using the classic theme - Advanced Generic Widgets: (customized) - Apache CouchDB: (customized) - APSW: - Arb: - Bazaar: (customized) - Beautiful Soup: - Blender: - Bugzilla: - Buildbot: - CMake: (customized) - Chaco: (customized) - Cormoran: - DEAP: (customized) - Director: - EZ-Draw: (customized) - F2py: - Generic Mapping Tools (GMT): (customized) - Genomedata: - GetFEM++: (customized) - Glasgow Haskell Compiler: (customized) - Grok: (customized) - GROMACS: - GSL Shell: - Hands-on Python Tutorial: - Kaa: (customized) - Leo: - LEPL: (customized) - Mayavi: (customized) - MediaGoblin: (customized) - mpmath: - OpenCV: (customized) - OpenEXR: - OpenGDA: - Peach^3: (customized) - Plone: (customized) - PyEMD: - Pyevolve: - Pygame: (customized) - PyMQI: - PyQt4: (customized) - PyQt5: (customized) - Python 2: - Python 3: (customized) - Python Packaging Authority: (customized) - Ring programming language: (customized) - SageMath: (customized) - Segway: - simuPOP: (customized) - Sprox: (customized) - SymPy: - TurboGears: (customized) - tvtk: - Varnish: (customized, alabaster for index) - Waf: - wxPython Phoenix: (customized) - z3c: - zc.async: (customized) - Zope: (customized) Documentation using the sphinxdoc theme - cartopy: - Jython: - Matplotlib: - MDAnalysis Tutorial: - NetworkX: - PyCantonese: - Pyre: - pySPACE: - Pysparse: - PyTango: - Python Wild Magic: (customized) - Reteisi: (customized) - Sqlkit: (customized) - Turbulenz: Documentation using the nature theme - Alembic: - Cython: - easybuild: - jsFiddle: - libLAS: (customized) - Lmod: - MapServer: (customized) - Pandas: - pyglet: (customized) - Setuptools: - Spring Python: - StatsModels: (customized) - Sylli: Documentation using another builtin theme - Breathe: (haiku) - MPipe: (sphinx13) - NLTK: (agogo) - Programmieren mit PyGTK und Glade (German): (agogo, customized) - PyPubSub: (bizstyle) - Pylons: (pyramid) - Pyramid web framework: (pyramid) - Sphinx: (sphinx13) :-) - Valence: (haiku, customized) Documentation using sphinx_rtd_theme - Annotator: - Ansible: (customized) - Arcade: - aria2: - ASE: - Autofac: - BigchainDB: - Blocks: - bootstrap-datepicker: - Certbot: - Chainer: (customized) - CherryPy: - Chainer: - CodeIgniter: - Conda: - Corda: - Dask: - Databricks: (customized) - Dataiku DSS: - edX: - Electrum: - Elemental: - ESWP3: - Ethereum Homestead: - Fidimag: - Flake8: - GeoNode: - Godot: - Graylog: - GPAW: (customized) - HDF5 for Python (h5py): - Hyperledger Fabric: - Hyperledger Sawtooth: - IdentityServer: - Idris: - javasphinx: - Julia: - Jupyter Notebook: - Lasagne: - Linguistica: - Linux kernel: - MathJax: - MDTraj: (customized) - MICrobial Community Analysis (micca): - MicroPython: - Minds: (customized) - Mink: - Mockery: - mod_wsgi: - MoinMoin: - Mopidy: - MyHDL: - Nextflow: - NICOS: (customized) - Pelican: - picamera: - Pillow: - pip: - Paver: - peewee: - Phinx: - phpMyAdmin: - PROS: (customized) - Pweave: - PyPy: - python-sqlparse: - PyVISA: - Read The Docs: - Free your information from their silos (French): (customized) - Releases Sphinx extension: - Qtile: - Quex: - Satchmo: - Scapy: - SimPy: - SlamData: - Solidity: - Sonos Controller (SoCo): - Sphinx AutoAPI: - sphinx-argparse: - Sphinx-Gallery: (customized) - StarUML: - Sublime Text Unofficial Documentation: - SunPy: - Sylius: - Tango Controls: (customized) - Topshelf: - Theano: - ThreatConnect: - Tuleap: - TYPO3: (customized) - uWSGI: - Wagtail: - Web Application Attack and Audit Framework (w3af): - Weblate: - x265: - ZeroNet: Documentation using sphinx_bootstrap_theme - Bootstrap Theme: - C/C++ Software Development with Eclipse: - Dataverse: - e-cidadania: - Hangfire: - Hedge: - ObsPy: - Open Dylan: - Pootle: - PyUblas: - seaborn: Documentation using a custom theme or integrated in a website - Apache Cassandra: - Astropy: - Bokeh: - Boto 3: - CakePHP: - CasperJS: - Ceph: - Chef: - CKAN: - Confluent Platform: - Django: - Doctrine: - Enterprise Toolkit for Acrobat products: - Gameduino: - gensim: - GeoServer: - gevent: - GHC - Glasgow Haskell Compiler: - Guzzle: - H2O.ai: - Istihza (Turkish Python documentation project): - Kombu: - Lasso: - Mako: - MirrorBrain: - MongoDB: - Music21: - MyHDL: - nose: - ns-3: - NumPy: - ObjectListView: - OpenERP: - OpenCV: - OpenLayers: - OpenTURNS: - Open vSwitch: - PlatformIO: - PyEphem: - Pygments: - Plone User Manual (German): - PSI4: - PyMOTW: - python-aspectlib: (sphinx_py3doc_enhanced_theme) - QGIS: - qooxdoo: - Roundup: - SaltStack: - scikit-learn: - SciPy: - Scrapy: - Seaborn: - Selenium: - Self: - Substance D: - Sulu: - SQLAlchemy: - tinyTiM: - Twisted: - Ubuntu Packaging Guide: - WebFaction: - WTForms: Homepages and other non-documentation sites - Arizona State University PHY494/PHY598/CHM598 Simulation approaches to Bio- and Nanophysics: (classic) - Benoit Boissinot: (classic, customized) - Computer Networks, Parallelization, and Simulation Laboratory (CNPSLab): (sphinx_rtd_theme) - Deep Learning Tutorials: (sphinxdoc) - Loyola University Chicago COMP 339-439 Distributed Systems course: (sphinx_bootstrap_theme) - Pylearn2: (sphinxdoc, customized) - SciPy Cookbook: (sphinx_rtd_theme) - The Wine Cellar Book: (sphinxdoc) - Thomas Cokelaer’s Python, Sphinx and reStructuredText tutorials: (standard) - UC Berkeley ME233 Advanced Control Systems II course: (sphinxdoc) Books produced using Sphinx - “Die Wahrheit des Sehens. Der DEKALOG von Krzysztof Kieślowski”: - “Expert Python Programming”: - “Expert Python Programming” (Japanese translation): - “LassoGuide”: - “Learning Sphinx” (in Japanese): - “Mercurial: the definitive guide (Second edition)”: - “Pioneers and Prominent Men of Utah”: - “Pomodoro Technique Illustrated” (Japanese translation): - “Python Professional Programming” (in Japanese): - “The repoze.bfg Web Application Framework”: - “Simple and Steady Way of Learning for Software Engineering” (in Japanese): - “Software-Dokumentation mit Sphinx”: - “Theoretical Physics Reference”: - “The Varnish Book”: Theses produced using Sphinx - “A Web-Based System for Comparative Analysis of OpenStreetMap Data by the Use of CouchDB”: - “Content Conditioning and Distribution for Dynamic Virtual Worlds”: - “The Sphinx Thesis Resource”: Sphinx Authors Sphinx is written and maintained by Georg Brandl <georg@python.org>. Substantial parts of the templates were written by Armin Ronacher <armin.ronacher@active-4.com>. Other co-maintainers: - Takayuki Shimizukawa <shimizukawa@gmail.com> - Daniel Neuhäuser <@DasIch> - Jon Waltman <@jonwaltman> - Rob Ruana <@RobRuana> - Robert Lehmann <@lehmannro> - Roland Meister <@rolmei> - Takeshi Komiya <@tk0miya> - Jean-François Burnol <@jfbu> - Yoshiki Shibukawa <@shibu_jp> Other contributors, listed alphabetically, are: - Alastair Houghton – Apple Help builder - Alexander Todorov – inheritance_diagram tests and improvements - Andi Albrecht – agogo theme - Jakob Lykke Andersen – Rewritten C++ domain - Henrique Bastos – SVG support for graphviz extension - Daniel Bültmann – todo extension - Marco Buttu – doctest extension (pyversion option) - Etienne Desautels – apidoc module - Michael Droettboom – inheritance_diagram extension - Charles Duffy – original graphviz extension - Kevin Dunn – MathJax extension - Josip Dzolonga – coverage builder - Buck Evan – dummy builder - Matthew Fernandez – todo extension fix - Hernan Grecco – search improvements - Horst Gutmann – internationalization support - Martin Hans – autodoc improvements - Zac Hatfield-Dodds – doctest reporting improvements - Doug Hellmann – graphviz improvements - Tim Hoffmann – theme improvements - Timotheus Kampik - JS theme & search enhancements - Dave Kuhlman – original LaTeX writer - Blaise Laflamme – pyramid theme - Thomas Lamb – linkcheck builder - Łukasz Langa – partial support for autodoc - Ian Lee – quickstart improvements - Robert Lehmann – gettext builder (GSOC project) - Dan MacKinlay – metadata fixes - Martin Mahner – nature theme - Will Maier – directory HTML builder - Jacob Mason – websupport library (GSOC project) - Glenn Matthews – python domain signature improvements - Roland Meister – epub builder - Ezio Melotti – collapsible sidebar JavaScript - Bruce Mitchener – Minor epub improvement - Daniel Neuhäuser – JavaScript domain, Python 3 support (GSOC) - Christopher Perkins – autosummary integration - Benjamin Peterson – unittests - T. Powers – HTML output improvements - Jeppe Pihl – literalinclude improvements - Rob Ruana – napoleon extension - Stefan Seefeld – toctree improvements - Gregory Szorc – performance improvements - Taku Shimizu – epub3 builder - Antonio Valentino – qthelp builder, docstring inheritance - Filip Vavera – napoleon todo directive - Pauli Virtanen – autodoc improvements, autosummary extension - Stefan van der Walt – autosummary extension - Thomas Waldmann – apidoc module fixes - John Waltman – Texinfo builder - Barry Warsaw – setup command improvements - Sebastian Wiesner – image handling, distutils support - Michael Wilson – Intersphinx HTTP basic auth support - Matthew Woodcraft – text output improvements - Joel Wurtz – cellspanning support in LaTeX - Hong Xu – svg support in imgmath extension and various bug fixes - Stephen Finucane – setup command improvements and documentation - Daniel Pizetta – inheritance diagram improvements - modindex - glossary Author Georg Brandl 2007-2018, Georg Brandl and the Sphinx team Referenced By The man pages sphinx-all-2.7(1) and sphinx-all-3.6(1) are aliases of sphinx-all(1).
https://www.mankier.com/1/sphinx-all
CC-MAIN-2019-09
refinedweb
31,663
51.65
Closed Bug 577899 Opened 11 years ago Closed 10 years ago Provide NS _DEBUG _ONLY Categories (Core :: MFBT, defect) Tracking () People (Reporter: timeless, Assigned: cjones) References (Blocks 1 open bug) Details (Keywords: dev-doc-complete) Attachments (4 files, 2 obsolete files) there are a number of warnings which we can quiet by annotating that an assignment is limited to debug statements. In order to do this, I need a macro which supports: NS_DEBUG_ASSIGN(lhs) method(); Assignee: nobody → timeless Status: NEW → ASSIGNED Attachment #456726 - Flags: review?(benjamin) Comment on attachment 456726 [details] [diff] [review] declaration Excuse the drive-by comment... concerning this: >+#define NS_DEBUG_ASSIGN(x) PR_BEGIN_MACRO /* nothing */ PR_END_MACRO; it seems wrong to let the macro introduce a semicolon here. Not sure how I feel about the higher-level issue of whether this construct is desirable in the first place. Actually, the more I think about it, the less I like it. It seems to introduce a new opportunity to unintentionally create subtle debug-vs-release differences in our code. the semicolon is necessary because of the way PR_BEGIN_MACRO/PR_END_MACRO work. they result in: 192 #define PR_BEGIN_MACRO do { 193 #define PR_END_MACRO } while (0) so a ; is needed. you either get: do {} while (0); bar->Foo(); or: nsresult rv = bar->Foo(); I suppose using just "/* nothing */" would be better, as it'd enable: if (baz) NS_DEBUG_ASSIGN(rv) bar->Foo(); IMHO this should be 1 bug not ~20 This is ugly as sin. NS_DEBUG_ASSIGN(rv, bar->Foo()) looks much nicer to me. (In reply to comment #6) > This is ugly as sin. NS_DEBUG_ASSIGN(rv, bar->Foo()) looks much nicer to me. The point is that bar->Foo() needs to be evaluated in *both* debug & opt builds, and your suggested syntax in comment 6 would make that less clear, IMHO. If it's outside of the macro (as it is in timeless's suggested syntax here), it's clear that it always will be evaluated. (In reply to comment #7) > (In reply to comment #6) > > This is ugly as sin. NS_DEBUG_ASSIGN(rv, bar->Foo()) looks much nicer to me. Agreed, but.... > The point is that bar->Foo() needs to be evaluated in *both* debug & opt > builds, and your suggested syntax in comment 6 would make that less clear, > IMHO. ....also agreed. :( In either case, I'm still uncomfortable with the way this macro obscures a debug-vs-opt behavioral change that affects following code. Imagine a long function including T v = 0; .... NS_DEBUG_ASSIGN(v) foo->bar(); NS_WARN_IF_FALSE(v > 0, "expected v to be greater than 0"); .... So far so good. But later someone adds a call such as foo->baz(v); further down the function, without noticing that the contents of v at this point is dependent on the type of build. Of course it's possible to create such bugs already with conditionally-compiled fragments, but ISTM this macro would make it easier to inadvertently make such errors. Would it be preferable to provide a macro such as #define NS_UNUSED_IF_RELEASE __attribute__((unused)) and then append this to the variable declaration concerned? so, I think that it would be relatively hard to make that mistake based on the way the macro is written - it's *LOUD*. Anyone who wants to use a variable needs to decide why they want to use it, which means looking to see who assigned to it which value. Reviewers could also force people to make their variable declarations NS_DEBUG_DECL (this doesn't exist yet, but we could create it) or #ifdef DEBUG which should make it even harder. So far all of the changes I've made were of the form where the declaration was guarded by the macro - which means anyone trying to use it in a release build will immediately fall over because the variable isn't defined. I've been working on mozilla for over a decade mostly paying attention to quirks and strange logic/programming errors, and conditional compilation bugs are incredibly rare - I can't think of the last such instance. And it isn't because we have very little macro magic or because our code is absolutely straightforward. The primary macro class I can think of which does bite us is this: #define FOO(x) if (x < 1 || x > 3) FOO(x++) I don't think people will be confused by NS_DEBUG_ASSIGN. Attachment #456726 - Attachment is obsolete: true Attachment #456813 - Flags: review?(benjamin) Attachment #456726 - Flags: review?(benjamin) Yuck. I really don't like this solution, for a couple of reasons: 1) Adding strange macros makes the Mozilla code less approachable, especially at a time when we're trying to make it _more_ approachable. 2) Some of these patches seem like they're just wallpapering over the compiler warning instead of fixing the problem (say, by passing on the error or having the callee return void and assert internally). For example, in bug 577908 you basically have: NS_DEBUG_ASSIGN(ok) doSomething(); NS_ASSERTION(ok, "oops we failed") return NS_OK; How about #ifdef DEBUG #define NS_DEBUG_ONLY(x) x #else #define NS_DEBUG_ONLY(x) #endif Comment on attachment 456813 [details] [diff] [review] assign or void Yeah, I don't think this macro is intelligible. I don't mind NS_DEBUG_ONLY if necessary. Attachment #456813 - Flags: review?(benjamin) → review- Always give the macro a body, ((void)0) works, to avoid empty statement warnings from some compilers. /be so... NS_DEBUG_ONLY would look like this: #define NS_DEBUG_ONLY(lhs) lhs or #define NS_DEBUG_ONLY(lhs) (void) NS_DEBUG_ONLY(ok =) doSomething(); Summary: Provide NS_DEBUG_ASSIGN → Provide NS_DEBUG_ONLY No, that's not what I wrote, and people already barfed on macros whose bodies are not well-formed expressions or statements (dangling-else immune statements, see {PR,JS}_{BEGIN,END}_MACRO). What Neil wrote with the fix I suggested looks like this: #ifdef DEBUG #define NS_DEBUG_ONLY(x) x #else #define NS_DEBUG_ONLY(x) ((void)0) #endif /be that's not helpful. the problem case is that the assignment is only used in debug builds. the right hand side needs to be evaluated. (In reply to comment #16) > that's not helpful. See below. At issue is the non-syntactic macro being unsafe and unhelpful on balance. > the problem case is that the assignment is only used in debug builds. the right > hand side needs to be evaluated. I know -- I think (and thought others here agreed) that you should #ifdef DEBUG such declaration and left-hand side followed by =. This is what we do in SpiderMonkey. It's better to avoid non-syntactic magic macros when doing anything like this. Take the #ifdef pain, call the reader's attention to special case. Example from SpiderMonkey: #ifdef DEBUG PropertyCacheEntry *entry = #endif JS_PROPERTY_CACHE(cx).fill(cx, scopeChain, scopeIndex, protoIndex, pobj, (JSScopeProperty *) prop); JS_ASSERT(entry); /be If we are going to change the code as proposed in attachment 456746 [details] [diff] [review], I'll have to get a C preprocessor brain implant. I'd prefer the style shown in comment 17. Status: ASSIGNED → RESOLVED Closed: 11 years ago Resolution: --- → WONTFIX OK if NS_DEBUG_DECL doesn't fly, how about a variant of NS_ASSERTION, say NS_CHECK, where the condition is evaluated in non-DEBUG builds? (But nothing special happens if it fails.) Not reopening yet, but I really liked Jonathon's suggestion: #define NS_UNUSED_IF_RELEASE __attribute__((unused)) But nobody ever mentioned it again. It seems quite clean to me. There are three problems here, I think (1) Silence warnings for locals used only in debug builds (2) Don't allocate stack space for debug-only locals (3) Don't evaluate rhs's in assignment or initialization of debug-only locals if the rhs computation is unnecessary The last item is the opposite in a sense of the example in comment 17. AFAIK, the only way to guarantee all three is macro-ization, but I don't think anyone is too enthused about that. We can get pretty close with a template system like template<typename T> struct DebugOnly { #ifdef DEBUG /* ... */; T v; #else /* ... */ #endif }; in which - both variants of DebugOnly implement default-ctor, copy-ctor, operator= - non-DEBUG variant impls are no-ops - only the DEBUG impl exposes type-coercion operators etc., to access stored value This gets us (1), (2), and part of the way to (3). For an expression like DebugOnly<bool> a = ExpensiveSideEffecty(); the compiler won't be able to boil away the call. Simpler expressions could be boiled away. Maybe this isn't a bad thing. Another sort-of advantage to this scheme is somewhat readable errors from the compiler if debug-only locals are used in opt builds. For example bool nd = ExpensiveSideEffecty(); DebugOnly<bool> db = ExpensiveSideEffecty(); ASSERT(nd == db); // ^^^^ always OK if (nd == db) { /*...*/ } // In non-DEBUG builds, gives // error: no match for ‘operator==’ in ‘nd == db’ nd = db; // In non-DEBUG builds, gives // error: cannot convert ‘DebugOnly<bool>’ to ‘bool’ in assignment Thoughts? (In reply to comment #22) > This gets us (1) Um oops, not this; forgot my -Wall. We'd need some magic attribute for DebugOnly instances. Mmmm, I like comment 22. Just in case, I verified that gcc is actually able to avoid wasting stack space for empty structs and (at least for my simple recursive example), it seems to have no problem. (In reply to comment #21) > Not reopening yet, but I really liked Jonathon's suggestion: > #define NS_UNUSED_IF_RELEASE __attribute__((unused)) > > But nobody ever mentioned it again. It seems quite clean to me. Yeah, this seems reasonable to me. Except I'm worried that people might use it when they really mean for the entire statement rather than just the assignment to be #ifdef DEBUG. I'm not crazy about using five lines of height: #ifdef DEBUG nsresult rv = #endif do_something(); NS_ASSERTION(NS_SUCCEEDED(rv), "unexpected failure"); where it seems like two lines ought to do, but maybe it's the best solution. Then again, I think my review- on the layout patch that did that, on grounds of being way too ugly, might have been what prompted this in the first place... Actually, my suggestion (bug 577914 comment 4) was after this was filed, was never mentioned here, and I review+'d the patch (not review-). I'd suggested a macro that would give: NS_IF_DEBUG(nsIContent* propagatedScrollFrom =) PropagateScrollToViewport(); which I think is a little less magical than timeless's proposals. But plain old #ifdef DEBUG might still be better. I'll take a stab at a DebugOnly template after some higher-priority bugs. Assignee: timeless → jones.chris.g Status: RESOLVED → REOPENED Resolution: WONTFIX → --- dbaron: re comment 26, i think that's my offer in comment 14 which brendan didn't like in comment 15. Tentative rules - non-standard files added to mfbt are named LikeThis.h, because that's the style SM and Gecko have converged on - non-standard code added to mfbt is in the "mozilla" namespace - coding style follows SM, because Gecko coding style is ugly ;) - folks will probably know who's best to review code going into mfbt, but a module could be created if necessary It's not 100% clear how mfbt files will be distributed with SM source releases, but that doesn't seem like a difficult problem. Please let me know if I've missed folks who should review this. Attachment #519537 - Flags: superreview?(brendan) Attachment #519537 - Flags: review?(ted.mielczarek) Attachment #519537 - Flags: review?(luke) There are already bugs filed for some of these fixes, but I figured I'd include this for demonstration purposes. Comment on attachment 519537 [details] [diff] [review] part 1: Add mfbt, to contain code shared between SpiderMonkey and Gecko Guess I can't tag more than one sr. Attachment #519537 - Flags: review?(roc) Attachment #519537 - Flags: review?(benjamin) Comment on attachment 519538 [details] [diff] [review] part 2: Add a DebugOnly helper to mfbt, which only contains a value in debug builds Glad to see this idea landing! Attachment #519538 - Flags: review?(luke) → review+ Comment on attachment 519539 [details] [diff] [review] Example uses of DebugOnly If you want to spread your idea further and get the build-plumbing working for using mozilla/mfbt in js/src, :vim /#ifdef DEBUG.*\n.* = *$/ * points to 12 sites that are begging to be beautified. Comment on attachment 519538 [details] [diff] [review] part 2: Add a DebugOnly helper to mfbt, which only contains a value in debug builds >+ * DebugOnly instances can only be coerced to T in debug builds; in >+ * release builds, then don't have a value so type coercion is not >+ * well defined. I think this wants s/then/they/, right? (in "then don't have a value") Definitely! We've also got what looks to be 20 or so unused variable warnings in gecko that I'm looking to zap once this can land. (In reply to comment #35) > I think this wants s/then/they/, right? (in "then don't have a value") Oops yep, thanks. Comment on attachment 519538 [details] [diff] [review] part 2: Add a DebugOnly helper to mfbt, which only contains a value in debug builds We should probably also move the static analysis annotations to a shared location: this class should be NS_STACK_CLASS. Note that an empty class as a member will still have a sizeof(1) because that is necessary in order to satisfy C++ requirements about taking its address. In release builds I believe that it will be optimized away as a local variable, but we should probably check that.. Comment on attachment 519537 [details] [diff] [review] part 1: Add mfbt, to contain code shared between SpiderMonkey and Gecko ># HG changeset patch ># User Chris Jones <jones.chris.g@gmail.com> ># Date 1300229392 18000 ># Node ID a6be83c442390b44a9b90a2501b092dfdeaf7163 ># Parent 4866be78732f042ba9ffed96fc69a40942d16e26 >Bug 577899, part 1: Add mfbt, to contain code shared between SpiderMonkey and Gecko. r=luke,ted sr=brendan,bsmedberg,roc > >diff --git a/config/js/build.mk b/config/js/build.mk >--- a/config/js/build.mk >+++ b/config/js/build.mk >@@ -31,9 +31,9 @@ > # ***** > > TIERS += js >-tier_js_dirs = js/src >+tier_js_dirs = js/src mfbt This builds mfbt after js/src. Is that really what you want? >diff --git a/mfbt/Makefile.in b/mfbt/Makefile.in >new file mode 100644 >--- /dev/null >+++ b/mfbt/Makefile.in >+include $(topsrcdir)/config/config.mk >+include $(topsrcdir)/config/rules.mk You don't need to explicitly include config.mk (rules.mk does so). Attachment #519537 - Flags: review?(ted.mielczarek) → review+ (In reply to comment #38) > Comment on attachment 519538 [details] [diff] [review] > part 2: Add a DebugOnly helper to mfbt, which only contains a value in debug > builds > > We should probably also move the static analysis annotations to a shared > location: this class should be NS_STACK_CLASS. Yes, good idea. Centralizing the annotations would be biting off a fair amount more work, the foundation for which is being laid in bug 642381. We could block landing DebugOnly on that, but I would be a bit unhappy about that because DebugOnly itself doesn't depend on the deeper problems being worked out in 642381, and not landing DebugOnly will keep going the steady influx of ugly #ifdef DEBUG nsresult rv = #endif patches. As a compromise, how does adding a dummy #define NS_STACK_CLASS to Util.h plus the "real" struct NS_STACK_CLASS DebugOnly { suit? > In release builds I believe > that it will be optimized away as a local variable, but we should probably > check that. Yes, I checked that. Judging by comment 24, I believe Luke did too. (In reply to comment #39) >. This is being worked out in bug 642381. Parts 1 and 2 here are dancing around the build problems by having mfbt/ only contain headers. This is *not* avoiding the distribution problem, but I haven't heard that one is imminent. Basically, the patches here are deferring all the hard build work to bug 642381, and trying to get in a useful helper (to avoid more ugly DEBUG patches) while that stuff is being sorted out. (In reply to comment #40) > Comment on attachment 519537 [details] [diff] [review] > > TIERS += js > >-tier_js_dirs = js/src > >+tier_js_dirs = js/src mfbt > > This builds mfbt after js/src. Is that really what you want? For this bug it doesn't matter, but I found out in bug 642381 that, no, that is indeed not what I want :). Thanks. > You don't need to explicitly include config.mk (rules.mk does so). Removed. Comment on attachment 519537 [details] [diff] [review] part 1: Add mfbt, to contain code shared between SpiderMonkey and Gecko Not much to see here -- what am I missing. /be Attachment #519537 - Flags: superreview?(brendan) → superreview+ Reply/review ping. Comment on attachment 519537 [details] [diff] [review] part 1: Add mfbt, to contain code shared between SpiderMonkey and Gecko From in-person conversation, this should be built from within js/src, so that standalone JS can use it (from a build-ordering perspective). I would vaguely prefer all the files to live in js/mfbt, but I don't have a really strong opinion about it. Attachment #519537 - Flags: review?(benjamin) → review- Moved all build goop into js/src/Makefile.in. Much cleaner, thanks! Attachment #519537 - Attachment is obsolete: true Attachment #522917 - Flags: superreview?(benjamin) Comment on attachment 522917 [details] [diff] [review] part 1: Add mfbt, to contain code shared between SpiderMonkey and Gecko, v2 in js/src, $(topsrcdir)/mfbt is js/src/mfbt. Does this patch actually work? It was working locally because I had an old copy of Util.h in dist/include from the previous version of the patch. I accidentally pushed this to try and saw that it was busted for clobbers. The fix was just +VPATH += \ + $(srcdir)/../../mfbt \ + $(NULL) so I didn't think it was important enough to re-post. Comment on attachment 522917 [details] [diff] [review] part 1: Add mfbt, to contain code shared between SpiderMonkey and Gecko, v2 r=me the right way, then! Attachment #522917 - Flags: superreview?(benjamin) → superreview+ Status: REOPENED → RESOLVED Closed: 11 years ago → 10 years ago Resolution: --- → FIXED Added . Please let me know if something is unclear. Comment on attachment 522917 [details] [diff] [review] part 1: Add mfbt, to contain code shared between SpiderMonkey and Gecko, v2 >diff --git a/mfbt/Util.h b/mfbt/Util.h >new file mode 100644 >--- /dev/null >+++ b/mfbt/Util.h >@@ -0,0 +1,47 @@ >+ * Portions created by the Initial Developer are Copyrigght (C) 2011 >+ * the Initial Developer. All Rights Reserved. Copy-what? I cleaned up the doc cjones wrote and added it to the Firefox 5 for developers page. Also added a note about it to: Keywords: dev-doc-needed → dev-doc-complete Component: XPCOM → MFBT QA Contact: xpcom → mfbt
https://bugzilla.mozilla.org/show_bug.cgi?id=577899
CC-MAIN-2021-21
refinedweb
3,079
62.78
¤ Home » Programming » C Tutorial » Control Statements in C For executing a group of statements repetitively, C provides three types of loop constructs, viz. for, while, and do-while. These classes of statements are also referred as control statements. Let us understand each of these: ... <statement 1> while(<expression>) { <statement 2> } <statement 3> ... In the while loop construct as shown above, after executing <statement 1>, the C program will jump to evaluate <expression>. If <expression> evaluates to true (i.e. a non-zero value), the program will enter the loop and execute <statement 2> (this could be a set of statements enclosed within the curly braces). After execution of <statement 2>, program will again return to <expression> to re-evaluate it. The expression may contain certain variables whose values change each time <statement 2> is executed. On the second evaluation of <expression>, if it again evaluates to true, loop will be re-entered and <statement 2> will be executed again. After execution of <statement 2> again the program will return to <expression>. This process will go on until <expression> evaluates to false. When the expression evaluates to false, control will jump out of the loop to <statement 3> and the rest of the program will be executed in sequential order. ... <statement 1> do { <statement 2> } while(<expression>); <statement 3> ... In the do-while loop construct as shown above, after executing <statement 1>, the C program will jump to execute <statement 2> (this could be a set of statements enclosed within the curly braces). After execution of <statement 2>, program will evaluate <expression>. If <expression> evaluates to true (i.e. a non-zero value), the program will enter the loop again and re-execute <statement 2> After execution of <statement 2> again the program will jump to <expression>. This process will go on until <expression> evaluates to false. When the expression evaluates to false, control will jump out of the loop to <statement 3> and the rest of the program will be executed in sequential order. ... <statement 1> for(<expression1>; <expression2>; <expression3>) { <statement 2> } <statement 3> ... In the for loop construct, after executing <statement 1>, the C program will jump to execute <expression1>. This expression is executed only once, just before entering the loop for the first time. Thereafter, <expression2> is evaluated. If it evaluates to true, loop is entered and <statement 2> is executed. This could be a set of statements enclosed within the curly braces. After execution of <statement 2>, program will jump to <expression3>, execute it and then return back to <expression2>. If <expression2> evaluates to true again, the program will re-enter the loop and re-execute <statement 2> After execution of <statement 2> again the program will jump to <expression3> & then <expression2>. This looping process of expression2 - statement2 - expression3 will go on until <expression2> evaluates to false. When the expression2 evaluates to false, control will jump out of the loop to <statement 3> and the rest of the program will be executed in sequential order. Let us look at an example of the same logic implemented using the 3 loop constructs. Consider a program for computation of average. This program can be implemented using the 3 loop constructs as demonstrated below. The program will accept a number from the user in every pass. After all numbers are accepted, it will compute their average. #include <stdio.h> main() { int ntot, n=1; float num, avg, sum=0; printf("\nSpecify how many numbers you will feed: "); scanf("%d", &ntot); while(n <= ntot) { printf("Give Number %d: ",n); scanf("%f", &num); sum += num; n++; } avg = sum/ntot; printf("\nThe average is %f\n", avg); } #include <stdio.h> main() { int ntot, n=1; float num, avg, sum=0; printf("\nSpecify how many numbers you will feed: "); scanf("%d", &ntot); do { printf("Give Number %d: ",n); scanf("%f", &num); sum += num; n++; } while(n <= ntot); avg = sum/ntot; printf("\nThe average is %f\n", avg); } #include <stdio.h> main() { int ntot, n; float num, avg, sum=0; printf("\nSpecify how many numbers you will feed: "); scanf("%d", &ntot); for(n = 1; <= ntot; n++) { printf("Give Number %d: ",n); scanf("%f", &num); sum += num; } avg = sum/ntot; printf("\nThe average is %f\n", avg); } /* Program to check whether a given number is a palindrome or not */ #include <stdio.h> main() { int number, digit, reverse=0, store_num; printf("Give a Number:"); scanf("%d", &number); fflush(stdin); store_num = number; do { digit = number % 10; reverse = (reverse * 10) + digit; number /= 10; }while(number != 0); number = store_num; if(number == reverse) printf("The number is a palindrome.\n"); else printf("The number is not a palindrome.\n"); return; } This operator is used in a for statement to separate multiple statements in the expressions within for(<expression1>; <expression2>; <expression3>). Let us understand this through the below example. for(i=1,j=2; i<5,j<10; ++i,j++) { ... } In the above code snippet, <expression1> consists of two statements, viz. i=1 and j=2. Now normally in a C program you would separate statements with a semi-colon (;). However, in the for construct, since semi-colon itself acts as the separator to separate out the 3 expressions, introducing a semi-colon to also separate the statements within each expression would confuse the C compiler. To overcome this, C allows the statements within an expression in the for construct to be separated by comma. Note that the comma operator is only relevant in case of for loop construct, not for while and do-while. The break statement is used to jump out of a loop. You would have also noticed the usage of break earlier in the switch construct. The continue statement is used to bypass/skip the remaining statements in a loop and jump to the next pass. The break and continue statements can be used in all 3 types of loop constructs. We will see usages of these statements in various C programs as we move ahead in C, with articles posted in future. In a complex program it will often be necessary to nest one loop inside another loop. The structure of a nested loop is depicted below. /* begin loop1 */ { <statement 1>; /* begin loop2 */ { <statement 2>; } /* end of loop2 */ <statement 3>; } /* end of loop1 */ Loops 1 & 2 can be any of the 3 types of loop constructs. Suppose loop1 was designed to execute 5 times and loop2 was designed to execute 4 times. Then, for each pass of loop1, loop2 will run 4 passes. Since loop1 will run 5 passes, loop2 will effectively run 20 passes, 4 in each pass of loop1. The example below illustrates the usage of nested loops in computing average grade of students in different subjects. #include <stdio.h> #define no_of_students 30 main() { int no_of_courses_registered, grade, credit; int total_credits, course_no, i=1, j, sum; float average_grade; char student_name[61], subject[41]; printf("Begin AVERAGE GRADE COMPUTATION for %d students\n", no_of_students); /* begining of the outer loop */ while(i <= no_of_students) { printf("\nEnter Name of student%d and number of courses registered by him: ",i); scanf("%s %d",student_name,&no_of_courses_registered); fflush(stdin); sum = 0; total_credits = 0; if(no_of_courses_registered == 0) { printf("\nStudent %s has not registered in any course.\n", student_name); i++; continue; } printf("Processing grades of student %s\n", student_name); /* begining of the inner loop */ for(j=1; j <= no_of_courses_registered; j++) { printf("\nEnter Course No., Subject, Credit & Grade in course %d: ", j); scanf("%d %s %d %d", &course_no, subject_name, &credit, &grade); fflush(stdin); sum += credit * grade; total_credits += credit; } /* end of the inner loop */ average_grade = sum / total_credits; printf("\nAverage grade obtained by %s is %f\n", student_name, average_grade); i++; } /* end of outer loop */ printf("End of AVERAGE GRADE COMPUTATION.\n"); } The goto statement can be used to unconditionally alter the program execution sequence. This statement is written as goto label;. As a result of the goto statement, the program execution jumps to a new statement which is identified by the label. In the target statement the label must be followed by a colon (:). The labeled statement can be any statement inside the current function. You cannot jump across functions using goto. #include <stdio.h> main() { int a, b, sum; ... ... sum += (a + b); goto printf_statement; ... ... ... printf_statement : printf("sum is %d\n", sum); ... ... } Here after computation of sum, the program execution will jump to the statement having label print_statement and will print the value of sum. Although the usage of goto may at times be convenient to programmers, it is desirable that usage of such statement is avoided as far as possible. In fact structured programming approach forbids the usage of goto statement. An unrestricted usage of goto statement, makes program debugging very difficult and may at times introduce logical errors. (1) Enter compile and run the following program to understand the use of while and for statement with pre and post decrement operators. (a) #include <stdio.h> main() { int n= 0,a = 0; while (n) { a++; n--; printf("value of a is %d\n",a); a = 0; n = 10; a++; printf("value of a is %d\n",a); } } (b) #include <stdio.h> main() { int n, i, k; printf("Enter a positive value\n"); scanf("%d",&n); i = 10; k = 1; q = n/i; while(q != 0) { i = i * 10; k++; q = n/i; } printf("\n The no. of digits in %d is %d\n",n,k); } (c) #include <stdio.h> main() { char ch; ch = 'A'; while (ch <= 'Z') { putchar(ch); ++ch; } putchar ('\n'); ch = 'z'; while (ch >= 'a'); { putchar(ch); --ch; } } (d) #include <stdio.h> main() { int i, j, sum = 0, prod = 0, k = 0; for(i = 0; i <= 10; i ++) sum += i; printf("The sum up to 10 is %d\n",sum); for(i = 10; i == 0,j <= 10; i ==, j++) prod = prod + i * j; printf("The producer is %d\n",prod); //Note that in for below expression1 & expression 2 are not there //Yet ; is there to tell the compiler that i!=0 is expression 2 for(;i!=0;) { i = i/3; k++; } printf("This loop has executed %d times \n",k); } (e) #include <stdio.h> main() { char ch; for(ch = 'A'; ch <= 'Z'; ++ch) putchar(ch); putchar('\n'); for(ch = 'z'; ch>= 'a'; --ch) putchar(ch); putchar('\n'); } (2) Write a C program, which calculates the sum of every 5th integer starting with i=2, for all value of i that are less than 200. (Hint: Find the sum of 2 + 7 + 12 + 17 + ...) Write the iteration part, (a) using a while statement (b) using a do-while statement (c) using a for statement (3) Write a C program, which continuously accepts characters (within a loop) from the user (max. 80 times), and displays the corresponding ASCII value. Implement the loop using while, do-while and for constructs. (4) Consider a modification of the previous problem, in which the program should print: - how many characters read are letters, - how many are digits, - how many are whitespace characters, and - how many are of other types (Hint: make use of switch construct as well) (5) Write a C program to construct a pyramid of digits. The user provides the depth of the pyramid. For example if the user inputs 5, the pyramid to be contructed is as follows: 1 2 3 2 3 4 5 4 3 4 5 6 7 6 5 4 5 6 7 8 9 8 7 6 5 (6) Write a C program, which will print the maximum and the minimum numbers from a list of number entered by the user. (7) The Fibonacci number are members of a sequence in which each number is equal to the sum of the previous two numbers in the series. Thus, fi = (fi-1) + (fi-2), where fi is the i-th Fibonacci number. Write a program that will print Fibonacci numbers up to 100. Note: fo = f1 = 1 (8) A natural number is called a prime number if it is perfectly divisible (i.e. has no remainder when divided) only by 1 or by itself. Write a program to display the first 50 prime numbers. (9) For each student in a class, the following data is to be entered: roll no integer name string course string attendence_record float fees cleared char ('y' to indicate yes, 'n' to indicate no) A student is allowed to appear in the final examination if he/she has cleared the fees and has more than 80% attendance. Write a C program to accept student information from the user and print the Name and Roll number of the students who can attend the examination. The program should halt when the user indicates no further input. Logical constructs in C - if..else & switch..case statements Data Input and Output functions in C Preprocessor Directive.
http://www.how2lab.com/programming/c/control-statements.php
CC-MAIN-2018-47
refinedweb
2,112
61.56
Semantic MediaWiki Overview[edit | edit source] Currently this is only a collection of links with question that were recorded while tomaschwutz was looking at this topic in 2012. See also the Semantic MediaWiki category. Big pictures[edit | edit source] - What is it all about? - What is it good for? - Why is agreeing on common editing syntax advantages? - What are the benefits compared to using categories? - Skim through the theorethical background. Making use of the semantic data[edit | edit source] - What is the factbox? - What is a semantic browser - What is a semantic query? - example - Task: Find all people from Germany and their cities and states - property names can be found on e.g. on a user factbox - Semantic search Providing the semantic data[edit | edit source] - How do I edit the semantic data? - How to I specify the type of a property? - Properties and types - unfortunately does not work on wikiversity: Berlin Germany - How can you automaticall convert units? - What are Semantic templates good for? - e.g. California - background: m:Help:A quick guide to templates - See how easy and powerful Service links can be used. Semantic Forms[edit | edit source] - See how you can use Semantic Forms to - design Categories, Properties, Templates, and Forms - How can you use #arraymap to define multiple properties? - {{#arraymap:{{{author|}}}|,|x|[[Has author::x]]}} - Why to use a space ( ) when defining categories? - {{#arraymap:{{{categories|}}}|,|x|[[Category:x]]| }} - What is the syntax of form fields? - How do you use autocompleting? - How can you use a Category for autocompletion? - |values from category=Area of focus - How can you allow multiple inputs (seperated by commata) - |list - How can force the user to input values? - |mandatory - How can you have multiple instance of one template? - {{{for template|Occupation|multiple|add button text=Add another occupation}}} - How can the user select from a category tree? - mw:Extension:CategoryTree must be installed. More on semantic queries[edit | edit source] - Here you look closer on Semantic search - Selecting pages - Why is it important to specify a < directly after the double collon? - How do you compare text alphabetically? - Howe do you use the + wildcard symbol? - Pages of which namespace are selected by [[Help:+]]? - Does [[born in::!Boston]] query return results of pages that do not have the bon in property? - How do you use OR and ||? - What does [[Brazil||France||User:John Doe]] mean? - How do you use <q> and </q> for subqueries? - What does [[Category:Cities]] [[located in.member of::European Union]] mean? - Displaying information - ? does not restict results compared to query descriptions - use the empty format # do suppress all formatting and linking in subqueries - What are #cm, #-n, #-u and #ISO used for? - What are [output formats] fromat=count, csv, template, ul used for? - Inline queries - explain the meaning of the following {{#ask: [[Category:City]] [[located in::Germany]] | ?population | ?area#km² = Size in km² }} - use {{#show: Berlin | ?population}} to show a single value - What is the meaning of the following parameters? - limit, sort, order, align, default, - |limit=0 |searchLabel=Click to browse - How do you use Concepts - to define overview pages - to define dynamic categroies that can be used in further queries - How can you Query linked properties? Inferencing[edit | edit source] - deducing new knowledge from entered information - Subcategories and subproperties - Why is it important to describe the exact meaning of a category or a property very clearly? - :: returns subCategories, : not Practicing[edit | edit source] - scratchpad.referata - server often not reachable - twutz/reh
https://en.wikiversity.org/wiki/Semantic_MediaWiki
CC-MAIN-2020-45
refinedweb
573
50.73
Hi there, I am not quite understanding why the program described at Question11-1 from (Page 169) is working - I am expecting it not to work. Might somebody please explain why. The result should 0 after masking after masking the bits in the line 'if ((flags & DIRECT_CONNECT) != 0)', right? --- output of program --- % ./question11-1 High speed set Direct connect set % ---- snip ----- Code:#include <iostream> const int HIGH_SPEED = (1<<7); /* modem is running fast */ // we are using a hardwired connection const int DIRECT_CONNECT = (1<<8); char flags = 0; int main() { flags |= HIGH_SPEED; // we are running fast flags |= DIRECT_CONNECT; // because we are wired together if ((flags & HIGH_SPEED) != 0) std::cout << "High speed set\n"; if ((flags & DIRECT_CONNECT) != 0) std::cout << "Direct connect set\n"; return (0); }
https://cboard.cprogramming.com/cplusplus-programming/75345-understand-masking-bits.html
CC-MAIN-2017-22
refinedweb
124
63.29
Now that you understand the types of interactions that occur on LinkedIn, in this guide we'll take a look at how these are accessible through the targets provided. Targets and namespaces Each interaction received from LinkedIn has a large number of attributes you can use in your analysis. Targets are how interaction attributes are accessed in PYLON. As there are many targets available for LinkedIn the targets are grouped into heirarchical namespaces. Different interaction types populate different targets. For instance a share activity has text content, whereas a like engagement does not. In the next guide you'll see example interactions and which targets are populated for each. Interaction types and subtypes In the previous guide we explained that interactions fall into two groups; activities and events. This diagram shows more clearly how the types and subtypes of interactions are represented in the data model: You'll see that under interaction we have three types, accessible through the li.type target: activity- an activity click- a click event article_view- an article view event Under the activity type we have the following subtype, accessible through the li.subtype target: activity|share- a share activity activity|like- a like on a share, reshare or article in the newsfeed activity|comment- a comment on a share, reshare or article in the newsfeed activity|reshare- a reshare of a share, reshare or article in the newsfeed activity|follow- a member clicks a follow button on the newsfeed For events there are the following subtypes: click|expand- a member clicks a 'show more' link on the newsfeed click|view- a member clicks to view an article on the newsfeed article_view|article_view- a member views an article Notice that the subtypes are prefixed by their parent type. Key targets and namespaces Although there are many targets available you'll see that the namespacing system allows you to learn the important groups of targets you will use regularly in your analysis. Interaction authors and actors All activities and events are the result of an action carried out by a member, or a member acting as a company. Details of the member or company who triggered the event are found in the li.user.* set of targets. Interaction content A share activity, comment, and share engagement can contain text content. You cannot analyze this content, but you can filter by it. To see what content, brands and topics interactions relate to you can use the li.all.* set of targets. Note that the li.all.* target namespace covers all types of interactions. So if a share includes an article, the article details we be provided in li.all.articles.* for the share interaction. If a member then likes the share, then the article will again be provided in li.all.articles.*, as it is in the root share activity that is being engaged with. Essentially the li.all.* targets gather up content details regardless of the interaction type into one consistent set of targets. Root share activities and articles As explained in the previous guide clicks and engagements are hydrated with the root share activity, or article that is being engaged with. Any article that is related to the root activity is catered for in the li.all.* namespace as explained above. However, there are additional targets in the li.root.* namespaces which provide more context to the interaction. Note that none of the targets in the li.root.* namepspace are populated when the root is an article that was placed into the newsfeed by LinkedIn automatically. Next steps... It can be difficult to understand exactly how the targets fit with events and activities taking place on LinkedIn. Therefore, in the next guide we'll take a look at some concrete examples. Example LinkedIn interactions
http://dev.datasift.com/docs/products/pylon-lei/howto/developer-guide/understanding-linkedin-data-model
CC-MAIN-2017-26
refinedweb
628
54.93
XML::LibXML::Namespace - XML::LibXML Namespace Implementation use XML::LibXML; # Only methods specific to Namespace nodes are listed here, # see XML::LibXML::Node manpage for other methods my $ns = XML::LibXML::Namespace->new($nsURI); print $ns->nodeName(); print $ns->name(); $localname = $ns->getLocalName(); print $ns->getData(); print $ns->getValue(); print $ns->value(); $known_uri = $ns->getNamespaceURI(); $known_prefix = $ns->getPrefix(); $key = $ns->unique_key();. Note that in order to fix several inconsistencies between the API and the documentation, the behavior of some functions have been changed in 1.64. document or node, therefore you should not expect it to be available in an existing document. Returns the URI for this namespace. Returns the prefix for this namespace. print $ns->nodeName(); Returns "xmlns:prefix", where prefix is the prefix for this namespace. print $ns->name(); Alias for nodeName() $localname = $ns->getLocalName(); Returns the local name of this node as if it were an attribute, that is, the prefix associated with the namespace. print $ns->getData(); Returns the URI of the namespace, i.e. the value of this node as if it were an attribute. print $ns->getValue(); Alias for getData() print $ns->value(); Alias for getData() $known_uri = $ns->getNamespaceURI(); Returns the string "" $known_prefix = $ns->getPrefix(); Returns the string "xmlns" $key = $ns->unique_key(); This method returns a key guaranteed to be unique for this namespace, and to always be the same value for this namespace. Two namespace objects return the same key if and only if they have the same prefix and the same URI. The returned key value is useful as a key in hashes. Matt Sergeant, Christian Glahn, Petr Pajas 2.0113 2001-2007, AxKit.com Ltd. 2002-2006, Christian Glahn. 2006-2009, Petr Pajas. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://search.cpan.org/~shlomif/XML-LibXML-2.0113/lib/XML/LibXML/Namespace.pod
CC-MAIN-2017-04
refinedweb
302
55.64
In this blog post I’ll take a look at a real-world application of WebAssembly (WASM), the re-implementation of D3 force layout. The end result is a drop-in replacement for the D3 APIs, compiled to WASM using AssemblyScript (TypeScript). In my previous post on WASM I explored various different techniques for rendering Mandelbrot fractals. In some ways this is the perfect application for the technology, a computationally intensive operation, exposed via a simple interface that operates on numeric types. In this post, I want to start explore slightly less contrived applications of WASM. As someone who is a frequent user of D3, I thought I’d have a go at re-implementing the force layout component. My goal? - create a drop-in replacement for the D3 APIs, with all the ‘physics’ computation performed using WASM. Rather than implement the entire API, my aim was to port the popular Les Misérables example. Here is the force layout simulation for the above example: var simulation = d3.forceSimulation(graph.nodes) .force("link", d3.forceLink().links(graph.links).id(d => d.id)) .force("charge", d3.forceManyBody()) .force("center", d3.forceCenter(width / 2, height / 2)); And here is the WASM equivalent: var simulation = d3wasm.forceSimulation(graph.nodes, true) .force('link', d3wasm.forceLink().links(graph.links).id(d => d.id)) .force('charge', d3wasm.forceManyBody()) .force('center', d3wasm.forceCenter(width / 2, height / 2)) As you can see, they are identical. You can see the WASM force layout in action here. The sourcecode for this demo is also available on GitHub. AssemblyScript Typically WASM modules are created by compiling languages like C, C++, or Rust using Emscripten. However, in this instance I had a pre-existing JavaScript codebase, so AssemblyScript, which compiles TypeScript to WASM, seemed like a much better option. I was hoping that the migration process would simply involve taking the d3-force code, and sprinkling a few types into the mix. Unfortunately it was a little more complicated than that! Migration of the core algorithms, in this case a many-body, and ‘link’ force simulation, was quite straightforward. Here’s the original code for the link force simulation: function force(alpha) { for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) { link = links[i], source = link.source, target = link.target; x = target.x + target.vx - source.x - source.vx || jiggle(); y = target.y + target.vy - source.y - source.vy || jiggle(); l = Math.sqrt(x * x + y * y); l = (l - distances[i]) / l * alpha * strengths[i]; x *= l, y *= l; target.vx -= x * (b = bias[i]); target.vy -= y * b; source.vx += x * (b = 1 - b); source.vy += y * b; } } And here it is migrated to AssemblyScript: let distance: f64 = 30; export function linkForce(alpha: f64): void { for (let i: i32 = 0; i < linkArray.length; i++) { const link: NodeLink = linkArray[i]; let dx: f64 = link.target.x + link.target.vx - link.source.x - link.source.vx; let dy: f64 = link.target.y + link.target.vy - link.source.y - link.source.vy; const length: f64 = sqrt(dx * dx + dy * dy); const strength: f64 = 1 / min(link.target.links, link.source.links); const deltaLength: f64 = (length - distance) / length * strength * alpha; dx = dx * deltaLength; dy = dy * deltaLength; link.target.vx = link.target.vx - dx * link.bias; link.target.vy = link.target.vy - dy * link.bias; link.source.vx = link.source.vx + dx * (1 - link.bias); link.source.vy = link.source.vy + dy * (1 - link.bias); } } As you can see, this is very similar and the migration of algorithms was straightforward. By far the most complicated part of the migration process was actually getting the data (nodes and links) into the WASM code … WASM Module Interface You can export functions from WASM modules allowing them to be invoked by your JavaScript code, and you can also import JavaScript functions so that they can be invoked from WASM. Unfortunately WASM only supports four types (all numeric), so you cannot simply provide the force layout algorithm with an array of links and nodes. In order to pass more complex data types, you have to (1) write the data to the WASM module linear memory from the hosting JavaScript, then (2) read the data from your WASM code. As AssemblyScript is a subset of TypeScript it provides an interesting way of achieving this … The D3 force layout simulation manipulates an array of nodes. These can be represented as classes within AssemblyScript: export class Node { x: f64; y: f64; vx: f64; vy: f64; links: f64 = 0; static size: i32 = 4; static read(node: Node, buffer: Float64Array, index: i32): Node { node.x = buffer[index * Node.size]; node.y = buffer[index * Node.size + 1]; node.vx = buffer[index * Node.size + 2]; node.vy = buffer[index * Node.size + 3]; return node; } static write(node: Node, buffer: Float64Array, index: i32): Node { buffer[index * Node.size] = node.x; buffer[index * Node.size + 1] = node.y; buffer[index * Node.size + 2] = node.vx; buffer[index * Node.size + 3] = node.vy; return node; } } The above code defines a node with a location ( x, y), and velocity components ( vx, vy), it also defines static functions for reading / writing the node to a Float64Array. The following class handles reading / writing this array of nodes to module memory: class NodeArraySerialiser { array: Float64Array; count: i32; initialise(count: i32): void { this.array = new Float64Array(count * Node.size); this.count = count; } read(): Array<Node> { let typedArray: Array<Node> = new Array<Node>(this.count); for (let i: i32 = 0; i < this.count; i++) { typedArray[i] = Node.read(new Node(), this.array, i); } return typedArray; } write(typedArray: Array<Node>): void { for (let i: i32 = 0; i < this.count; i++) { Node.write(typedArray[i], this.array, i); } } } The module exports functions that allow the serialiser to be initialised from the hosting JavaScript code, allowing it to set the node array length (which initialises the Float64Array), obtain a reference to this array, and instruct the module to read from this array: let serializer = new NodeArraySerialiser(); let nodeArray: Array<Node>; export function setNodeArrayLength(count: i32): void { serializer.initialise(count); } export function getNodeArray(): Float64Array { return serializer.array; } export function readFromMemory(): void { nodeArray = serializer.read(); } The following code snippet shows how the JavaScript code that uses this module can pass the node data via this node array: import { Node } from '../wasm/force'; const nodes = [ {x: 34, y: 25}, {x: 12, y: 22}, ... ] // initialise the wasm module memory wasmModule.setNodeArrayLength(nodes.length); const nodeBuffer = wasmModule.getNodeArray(); // write the node data nodes.forEach((node, index) => Node.write(node as Node, nodeBuffer, index)); // instruct the wasm module to read the nodes wasmModule.readFromMemory(); Because AssemblyScript is valid TypeScript, the above code re-uses the Node class which has the static methods for reading / writing nodes to array buffers! To achieve this, the build compiles the WASM module code twice, once with the TypeScript compiler, and once with the AssemblyScript compiler (more on this later). The above code shows how nodes are passed from JavaScript to the WASM module. Once the WASM code has updated the nodes (positions and velocities) the same happens in reverse, i.e. WASM writes. The following utility function executes any WASM function, surrounding it in the required read / write of nodes: const executeWasm = (wasmCode) => { // write the nodes to the WASM linear memory let nodeBuffer = computer.getNodeArray(); nodes.forEach((node, index) => Node.write(node as Node, nodeBuffer, index)); // read the values form linear memory computer.readFromMemory(); wasmCode(); // write back any updates computer.writeToMemory(); // read back into the JS node array nodeBuffer = computer.getNodeArray(); nodes.forEach((node, index) => Node.read(node as Node, nodeBuffer, index)); }; Working with AssemblyScript AssemblyScript is a subset of TypeScript, which means it only supports a subset of the language features. As an example, it doesn’t support interfaces, or the declaration of functional types. AssemblyScript includes a number of built-in maths functions (min, sqrt, …) which are built-in WebAssembly operators. However, there are a number of omissions, e.g. PI, sin, cos. For these, you either have to explore JavaScript implementations to your AssemblyScript code (which feels quite messy), or implement them using AssemblyScript primitives. Another interesting notable difference between AssemblyScript and TypeScript is the array class. The AssemblyScript array interface implements a small subset of the TypeScript functionality. The reason for this is quite simple, WASM doesn’t have an array type. In order to provide this functionality AssemblyScript has a small standard library which implements these features. You can see the array implementation in the sourcecode, notice the use of malloc, which is part of the lightweight runtime for AssemblyScript that becomes part of the module. Compiling to TypeScript A really interesting feature of AssemblyScript is that you can run the same code through the TypeScript compiler. You do have to provide implementations of the AssemblyScript floating point operators. Thankfully, the JavaScript equivalents just slot straight in … window.sqrt = Math.sqrt; window.min = Math.min; ... One difference with the TypeScript output is that when you return a Float64Array from your module you actually get the array, whereas with WASM the compiled function returns an integer which indicates the location of the array in memory. In order to resolve the differences in the module interface when compiled to JavaScript or WASM, I created a simple proxy that adapted the WASM module, giving both the same interface: new Proxy(wasm, { get: (target, name) => { if (name === 'getNodeArray') { return () => { const offset = wasm.getNodeArray(); return new Float64Array(wasm.memory.buffer, offset + 8, wasm.getNodeArrayLength() * Node.size); }; } else if (name === 'getLinkArray') { return () => { const offset = wasm.getLinkArray(); return new Uint32Array(wasm.memory.buffer, offset + 8, wasm.getLinkArrayLength() * NodeLink.size); } } else { return target[name]; } } }) This converts the integer ‘pointers’ returned by WASM into typed arrays. Notice that the offset provided by the WASM module needs to have the magic number 8 added to it. This relates to the AssemblyScript array implementation, where the first few bytes are used to store the capacity and length before the array contents itself. Being able to run the same code as both JavaScript (via TypeScript) and WASM is great for debugging, I found quite a few errors that in my module code that would have been really hard to track down if I only had access to the compiled module. Although of course, there are further differences at runtime, for example, AssemblyScript types default to zero, whereas in TypeScript / JavaScript they default to undefined. Currently the choice between WASM or JavaScript is exposed as a boolean argument on the simulation. Setting it to false will run the JavaScript module: var simulation = d3wasm.forceSimulation(graph.nodes, false) Bundling One final thing I looked at was how WASM modules could be bundled. Most WASM examples load the WebAssembly binary over HTTP via the fetch API. This is not ideal for distribution of mixed WASM / JavaScript modules. In order to bundle the two together I wrote a simple rollup plugin that base64 encodes the WASM module, and embeds it as a string. With this plugin included in the rollup config, imported WASM modules are returned as a promise which returns the module instance: import wasmCode from '../../build/force.wasm'; export const loaded = wasmCode() .then(instance => { // do something: }); The reason they return promises is because WASM compilation is not performed on the main thread to avoid locking the UI. This does of course have an impact on consumers of this code, they too have to wait for the WASM code to be compiled. As a result, my force layout API exposes a loaded promise, which is used as follows: d3wasm.loaded .then(() => { const simulation = d3wasm.forceSimulation(graph.nodes, true) .force('charge', d3wasm.forceManyBody()) .force('center', d3wasm.forceCenter(width / 2, height / 2)) .force('link', d3wasm.forceLink().links(graph.links).id(d => d.id)); }); Conclusions Most people are currently focussing on the use of WebAssembly to bring performance critical code from other languages to the web. This is certainly a useful application of the technology. However, I think that AssemblyScript (and TurboScript, speedy.js) demonstrate that we could be doing a lot more with this technology. If at some point in the future you could easily compile your JavaScript code to WASM, and enjoy improved load / parse times and performance, why wouldn’t you? We’re clearly not there yet, porting JavaScript to AssemblyScript is not straightforward - however, this technology is very much in its infancy. Remember, the full sourcecode for this demo is available on GitHub.
https://blog.scottlogic.com/2017/10/30/migrating-d3-force-layout-to-webassembly.html
CC-MAIN-2019-04
refinedweb
2,059
57.27
View Complete Post This article discusses the Project Linker tool and other techniques to create applications that target both WPF and Silverlight from a single code base. Erwin van der Valk MSDN Magazine August 2009 The CLR team takes a look inside the System.Globalization namespace to explain how to handle data formats for proper localization and globalization. Melitta Andersen MSDN Magazine November?. I class Program Hello, I want to configure audit in SQL server. But want the audit activities to be inside the tables. I take a look of auditing in SQL server but it will add the audit into a file or even logs. I want audits to be on each table. So I create in each table 4 fields like (Created-by, modified-by, created-date, modified-date). I want those fields to be field automatically based on the logged in user and not on the application level. Is this possible? Your response is highly appreciated. Hi Is there a way to check the memory usage (consumption) of individual controls on a web form shown in a browser. Like Repeater Control, Multiline Text box etc. The reason is I am putting the repeater control in session and checking the status of controls, based on which I am doing further actions. Thanks gsalunkhe Hi i am editing a stored procedure using the SSMS (I have SQL Server 2008 SP1 - Windows 2003 Server Standard). At the begining everything is ok, but around of 3 or 4 minutes of work the ssms is becoming to slow, I open the Task Manager and I see that the process SSMS.exe is using 1.2GB of RAM Memory. I have open just one script (The stored procedure that I'm editing) but the script isnt running only editing. I dont understand that high memory because i'm not retreiving data of any query and im not running any thing on my ssms. Take a look of my task manager Other thing: When I minimize the ssms window the smss.exe process come back to a normal RAM memory usage. Please any help?? Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend
http://www.dotnetspark.com/links/1704-clr-inside-out-memory-usage-auditing-for.aspx
CC-MAIN-2018-05
refinedweb
365
65.52
I was recently re-evaluating our back-up procedures and discovered and found a nasty bug with the arcpy’s ListFeatureClasses request. If you have a feature class in a feature dataset with the same name, ListFeatureClasses may not find it or anything else in that feature dataset. Unfortunately, we recently made our daily backup a python-based system that uses ListFeatureClasses and got bit by this bug. After discovering missing data in our backups, I reconstructed what happened and found this bug. Below is arcpy code that iterates through the feature datasets in a geodatabase and lists the feature classes: import arcpy def copyAll(): for iFeatureClass in arcpy.ListFeatureClasses(): print(" Feature Class: {0}".format(iFeatureClass)) iFeatureClassFull = None testGDBname = "mgs_sandbox.sde" arcpy.env.workspace = testGDBname copyAll() for iFD in arcpy.ListDatasets("","Feature"): print("Feature Dataset {0}:".format(iFD)) arcpy.env.workspace = testGDBname+"/"+str(iFD) copyAll() And here is a screen shot of the contents of a test enterprise geodatabase, you’ll see it has a feature data set named “outcrops” that has a feature class also named “outcrops” within it: And the results list only the feature dataset: But if I rename the feature dataset (e.g. outcrop_fd), the results are what I would hope for: I found that the feature class does not even need to be within the feature dataset and also the problem does not always occur, I have had the code successfully run in some cases. Once I confirmed the problem, I did find this thread from almost three years ago that mentions the bug. One poster indicated the same thing occurs in ArcObjects which leads me to think something may not be getting registered right in the sde tables. I was not able to re-create this using either personal or file geodatabases. So I adopting the policy of not using the same name for a feature dataset as for a feature class.
http://milesgis.com/category/programming/arcobjects/
CC-MAIN-2017-51
refinedweb
318
59.94
Hi everyone, I'm a bit of a beginner to programming and was wondering whether anyone could help me with this snippet of some code I've been working on. I want it to play with a large array but at the moment, the program worked fine for smaller values of the num_nodes variable but is crashing completely at the creationg of the larger nodes[num_nodes] array. It's very frustrating, and no, as you can see from my very archaic debugging tools, I don't have the luxury of installing visual studio, and have been using gcc based dev-cpp (mingw version) compiler. The bizarre thing is that it works fine for larger values when compiled in Linux. Here's the code. wrote: #include <iostream> #include <fstream> using namespace std; int main(){ ofstream debug_file("debug.txt"); struct vertex { int element_id; int element_type; // could be a very large value int corner; }; struct element_aware_node { float x, y; int node_type; int row_below; int num_elements; vertex vertex_of[10]; int fem_pos; }; cout << "input the number of nodes to create..." << endl; int num_nodes= 0; while ((!(cin >> num_nodes)) || (num_nodes <= 0)){ cin.clear(); cin.ignore(1000, '\n'); //ignore first 1000- an arbitrary large value- characters or characters uptill the first carriage return, whichever occurs first. cout << "input the number of nodes to create, number must be a positive integer!" << endl; debug_file << "\nNumber of nodes entered by user is " << num_nodes << endl; } element_aware_node node1; vertex v; debug_file << "sizeof(vertex)= " << sizeof(v) << endl << endl; debug_file << "\nNow creating " << num_nodes << " nodes..." << endl; debug_file << "sizeof(a node)= " << sizeof(node1) << " or " << num_nodes << " nodes take up " << (num_nodes*sizeof(node1)) << " bytes." << endl; element_aware_node nodes[num_nodes]; debug_file << "\n\n" << num_nodes << " nodes were successfully created." << endl; return 1; } I'd appreciate any help. mem/c yields the following: wrote: Conventional Memory : Name Size in Decimal Size in Hex ------------- --------------------- ------------- MSDOS 12352 ( 12.1K) 3040 KBD 3296 ( 3.2K) CE0 HIMEM 1248 ( 1.2K) 4E0 COMMAND 3728 ( 3.6K) E90 KB16 6096 ( 6.0K) 17D0 FREE 112 ( 0.1K) 70 FREE 944 ( 0.9K) 3B0 FREE 627376 (612.7K) 992B0 Total FREE : 628432 (613.7K) Upper Memory : Name Size in Decimal Size in Hex ------------- --------------------- ------------- SYSTEM 196592 (192.0K) 2FFF0 MOUSE 12528 ( 12.2K) 30F0 MSCDEXNT 464 ( 0.5K) 1D0 REDIR 2672 ( 2.6K) A70 DOSX 34848 ( 34.0K) 8820 FREE 928 ( 0.9K) 3A0 FREE 79504 ( 77.6K) 13690 Total FREE : 80432 ( 78.5K) Total bytes available to programs (Conventional+Upper) : 708864 (692.3K) Largest executable program size : 627376 (612.7K) Largest available upper memory block : 79504 ( 77.6K) 1048576 bytes total contiguous extended memory 0 bytes available contiguous extended memory 941056 bytes available XMS memory MS-DOS resident in High Memory Area Is mem/c relevant? Because I've got 256 MB RAM, and those 692.3K are much closer to the small values of num_nodes causing the crash. Is the solution declaring the matrix array into dynamic memory? How do I do that ("new element_aware_nodes..." doesn't work) and how do I de-allocate it from memory? Thanks, everyone... J. PS: Sorry for the "[quote user=""]" cheat. What tags are allowed and where do I find them? Thread Closed This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.
http://channel9.msdn.com/Forums/TechOff/70804-Newbie-quite-possibly-problem-with-C
CC-MAIN-2015-06
refinedweb
554
68.36
This section details how to go about using the dynamic features of Groovy such as implementing the GroovyObject interface and using ExpandoMetaClass, an expandable MetaClass that allows adding of methods, properties and constructors. GroovyObject ExpandoMetaClass Compile-time metaprogramming is also available using Compile-time Metaprogramming - AST Transformations You can invoke a method even if you don't know the method name until it is invoked: class Dog { def bark() { println "woof!" } def sit() { println "(sitting)" } def jump() { println "boing!" } } def doAction( animal, action ) { animal."$action"() //action name is passed at invocation } def rex = new Dog() doAction( rex, "bark" ) //prints 'woof!' doAction( rex, "jump" ) //prints 'boing!' You can also "spread" the arguments in a method call, when you have a list of arguments: def max(int i1, int i2) { Math.max(i1, i2) } def numbers = [1, 2] assert max( *numbers ) == 2 This also works in combination of the invocation with a GString: someObject."$methodName"(*args)
http://docs.codehaus.org/plugins/viewsource/viewpagesrc.action?pageId=209322003
CC-MAIN-2014-42
refinedweb
154
53.1
UPDATE Feb 2, 2017: Also checkout the blog post of @Christoph Kraemer which introduces ReduxModel as an alternative (see my comment at the bottom for my own experiences with Redux vs MobX) Short Summary This blog post is about using the state management library MobX together with UI5 to manage state in complex UI5 applications (as alternative to UI5 JSONModel). The benefits of this approach are a better separation between UI and business logic, easier testable code, eventually less number of bugs and in some cases even better performance of your app. If you’ve heard the fancy term “(functional) reactive programming” before, you’ll be glad to hear that MobX is a library which applies a flavor of this and brings reactivity to UI5. However compared to other reactive programming libraries (for example RxJS) it hides a lot of the complexity and hence is much easier to learn and integrate into existing projects, teams or frameworks like UI5. In fact because mobx is so simple to learn and reason about, I won’t have to talk much about theories and reactive programming concepts in my blog post, but show you by example the benefits. For ui5 and mobx to work seamlessly together we’re going to use The approach was successfully applied for ui components in the product SAP Predictive Maintenance & Service: Introduction In the sections below I will show based on examples with increasing complexity the motivation behind the usage of MobX in a UI5 application. If you’re just interested in the usage of MobX directly (without reading “1. Motivation and limitations…”) you can go directly to section 2: “State management with MobX.” 1. Motivation and limitations of UI5 JSONModel As an experienced UI5 developer you will know that it is a good practice to put most of your state into the model (e.g. JSONModel, ODataModel) and bind your controls (e.g. a sap.m.Text) to certain in paths in that model. Whenever a user performs an action (like a button click) you update in the event handler the state of the model and the dependent controls will update / rerender automatically. The (discouraged bad-practice) alternative would be to not update the model but instead get a reference to the control to be updated by this.byId(controlId) and set the control property directly (e.g. myText.setText('new text') ) 1.1. Simple example with JSONModel Lets look at a simple example of the best practice using JSONModel, having 1 button and a text that should be changed once the user clicks the button. To create a comprehensive example with a minimum of boilerplate I’m using just fragments and a app.js with a pseudo-controller on the fragment instead of Views and real Controllers: app.fragment.xml: <VBox xmlns="sap.m"> <Button press=".onButtonPress" text="Press me!"/> <Text text="{/text}"/> </VBox> app.js: var state = { text: 'initial text' }; var model = new JSONModel(state); var fragment = sap.ui.xmlfragment('my.example.app', { onButtonPress: function() { model.setProperty('/text', 'changed text'); } }); fragment.setModel(model); You can see the running example here: Now what happens is very simple – once the user presses the button the onButtonPress event handler is invoked which then updates the value in the model via model.setProperty('/text', 'changed text'); and consequently the textfields’ text is changed to changed text. 1.2. Simple example with JSONModel in observation mode So far so simple. However, some of you might wonder, why can’t you simply change the text directly on the state object. via state.text = 'changed text'; ? Wouldn’t that be more simple and elegant? The problem is if you do that the JSONModel won’t get notified of this change and hence the textfield won’t get updated. However in recent UI5 versions a new feature called observation mode was introduced for the JSONModel. In order to activate it you have to pass true as the second param to the JSONModel constructor. When having observation mode enabled you can set the property directly on the state object and the model will still get notified. The way it works is by converting the state objects properties into ES5 getters and setters and then hooking into the setter function (this is also one of primitives MobX uses). However you don’t have to necessarily understand this magic trick in order to use it. Now lets use the observation mode in the example: app.js var state = { text: 'initial text' }; var model = new JSONModel(state, true); var fragment = sap.ui.xmlfragment('my.example.app', { onButtonPress: function() { state.text = 'changed text'; } }); fragment.setModel(model); running code: That’s already a bit simpler and elegant imho. Unfortunately there are a few limitations of the observation mode in the JSONModel, most notably it doesn’t notify the model when you have an array and add new items to it. For the model get notified I have to call model.refresh() after adding the new item. 1.3. Complex example with JSONModel in observation mode After having shown some very simple example of the status quo with JSONModel, let’s do a little bit more challenging example. 1.3.1 Requirements of example app The task is the following: We want an app which displays a list of (simplified) orders. Each order consists of an id, productName and quantity. E.g.: `{id: 5, productName: ‘Gummy bears’, quantity: 15}` – The app should provide the ability to add new orders, to remove the last order and to edit any order (change the product or quantity). So far not really challenging. However lets add some special requirements: – We want to display the total number of orders – We want to display the total number of items (order x quantity) – We want to display a summary of quantities grouped by product. So for each product we want to see how many instances of it have been ordered in the past in total. For example if I had 3 orders of Gummy bears, each with a quantity of 15, the summary should display a total of 45 gummy bears. – All of the totals and summaries should be updated immediately when I do any change operation to the list of orders (add, remove, edit). The final application (yep I won’t win a design award for this ;-)) should look like this: In red you can see the parts which contain the totals and summary and which are the challenging requirements. You can see the final code and running app here: 1.3.2 Implementation of the app’s basics Let’s analyze our requirements a bit. What is our state? In its pure form the application’s state consists only of: - The list of orders, which can be represented as an array of objects. E.g.: [{id: 5, productName: ‘gummy bears’, quantity: 15]. - The form state of the ‘new order’ form – productName and quantity in the form fields. This is somewhat temporary state, but still state. Those 2 things we would most likely put in the model and then bind controls against this state. We would initialize the state object like this: var state = { newOrder: { productName: 'my product', quantity: 1 }, orders: [], }; this is how I would bind the new order form and the order list agains this state model: new order form: <form:SimpleForm> <Label text="Product Name"/> <Input value="{/newOrder/productName}" /> <Label text="Quantity"/> <Input value="{/newOrder/quantity}"/> <Button press=".onOrderAdd" text="Add Order"/> </form:SimpleForm> order list: <Table> When someone clicks the “Add Order” button the onOrderAdd event handler will add a new item to the order array. However – and here’s already the first gotcha – in order for the JSONModel to get notified of adding a new array item I have to call `model.refresh()` after adding the item: var fragment = sap.ui.xmlfragment('my.example.app', { onOrderAdd: function() { state.orders.push({id: ++orderId, productName: state.newOrder.productName, quantity: state.newOrder.quantity}); model.refresh(); } }) Ok, that was not so difficult, even though you have to be already careful of not forgetting to call model.refresh() after adding the array item. 1.3.3 Implementation of the derived totals and summary Now, how about the totals and the summary? Obviously those are not state, but they can be completely derived from the list of orders state array. The issue with UI5 formatter functions As a seasoned UI5 developer you would now think, alright – no problem, let’s use a ui5 formatter function which computes those totals dynamically whenever anything in the underlying state changes. However in practice there are some problems with that, some of which make formatters not the right fit for the above use case. @maksim.rashchynski has already given some examples of the limitations of formatters here , but let’s repeat some of them quickly: - formatters have to explicitly specify their dependencies (which properties in the model they depend on) - those dependencies cannot be an array or objects as a whole, but only specific properties. You can for example not specify the lengthproperty of an array as dependency and expect the formatter to update automatically once someone adds a new item to that array. - you cannot use formatters to dynamically compute an array / object / aggregation like the list of summaryitems. you can only use them to dynamically compute a property value. In the case of arrays you can actually use “filters” and “sorters” to somewhat dynamically compute another array but those options are limited to specific transformations. besides there are a few annoyances when using lots of formatter functions: - even if you “reuse” a formatter function in multiple places in your view, you always have to specify the dependencies (path / parts) again and again, which can mean a lot of boilerplate / repetition in your view. - If you reuse formatters and have the situation that a reused formatter observes the exact same data (basically you want to show a value in multiple places on the UI), UI5 will evaluate the formatter function multiple times, even though it would be obviously more performance efficient to simply reuse the result of the first formatter evaluation and show it in multiple places. It is also not possible to build a hierarchy of formatters where one more formatters “reuses” the intermediate result of another formatter. All computations run separately for each usage in the UI. For many simple use cases this behaviour is a not a problem, but if you do complex calculations, iterate large arrays etc. performance can become an issue. - even if formatters are sometimes kind of business logic, you cannot easily define them directly on your model or state object, but they have to become a property of the controller. Because of those limitations, especially the ones with regards to having arrays as dependencies and computing another array we cannot really use formatters for the complex example above. Alternative to UI5 formatter functions – triggering recomputation of derived values manually So what can we do instead? In my example implementation with JSONModel I did the following. I introduced 2 new properties on the state object, one being summary and one being total. Also we will need the length property of the orders array, even though as mentioned earlier the binding will not automatically update once its changing. The enhanced state object looks like this: var state = { newOrder: { productName: 'my product', quantity: 1 }, orders: [], total: 0, summary: [] }; And this is how we bind the controls against it: <Label text="{= 'Total items: ' + ${/total}}" design="Bold"/> <VBox> <Label text="Summary by Product" design="Bold"/> <VBox items="{/summary}"> <Text text="{= ' - ' + ${productName} + ': ' + ${quantity}}"/> </VBox> </VBox> <Table headerText="{path: '/orders/length', formatter: '.headerText'}" items="{/orders}"> Notice how I’m using for the table header a formatter function and order.length as dependency, despite the fact that I know it won’t automatically update. As mentioned earlier the total and summary can be computed from the orders array. So let’s add some methods to do the computation to the fragment pseudo-controller: var fragment = sap.ui.xmlfragment('my.example.app', { ..., refreshTotal: function(){ state.total = state.orders.reduce(function(accumulator, order){ return accumulator + parseInt(order.quantity);}, 0); }, refreshSummary: function(){ var summaryMap = {}; state]}; }); state.summary = summary; } }); Well nice, we now have the logic which updates the summaries. Whats the problem then? The problem with manually triggering recomputation of derived values The problem is that this “refresh” logic won’t be called automatically when I add, remove or edit an order. In fact whenever I change anything in the orders array, I have to manually call afterwards the refreshTotal , refreshSummary and model.refresh() methods to ensure the summary, totals and list header are updated. In my example app this looks like the following: var fragment = sap.ui.xmlfragment('my.example.app', { onOrderAdd: function() { state.orders.push({id: ++orderId, productName: state.newOrder.productName, quantity: state.newOrder.quantity}); this.refreshSummary(); this.refreshTotal(); model.refresh(); }, onOrderRemove: function(){ state.orders.pop(); this.refreshSummary(); this.refreshTotal(); model.refresh(); }, onOrderChange: function(){ this.refreshSummary(); this.refreshTotal(); model.refresh(); }, Also I have to listen to the liveChange event of the input fields in the order table (when someone edits an existing order) and call the onOrderChange method: <ColumnListItem> <Text text="{='id: ' + ${id}}"/> <Input value="{productName}" liveChange="onOrderChange" valueLiveUpdate="true"/> <Input value="{quantity}" liveChange="onOrderChange" valueLiveUpdate="true"/> </ColumnListItem> Calling model.refresh() too often is possibly an expensive operation. It triggers the checkUpdate function of every binding created by the model, even if the bound data wasn’t affected by your state change directly or indirectly. The checkUpdate function does a deep equality comparison (which can become costly for large state trees) of the binding’s current value with the new value in the model. If you have a lot of controls and hence bindings in your app this can cause performance issues. If I forget to call any of the refresh methods in some places, my app won’t crash immediately but instead I will get subtle and hard to debug bugs because of inconsistent stale data. From my own experience I can say those bugs are the most annoying as they are harder to diagnose and reproduce – you typically won’t get a stacktrace etc. As your app grows and the more people work on it, the higher the chances that somebody changes the state but forgets to call any of the refresh methods and your displayed data is stale and inconsistent. This is exactly the situation I ran into in a recent project and which motivated me to reimplement the critical parts of that project using UI5 with MobX. If you’ve had the chance to checkout the github page of MobX you’d see its philosophy quoted as: Anything that can be derived from the application state, should be derived. Automatically. The last word Automatically is very important for us. If you were able to follow my code example, you’d note I also derived something from the application state. However I was triggering the recomputation manually, telling the app when to refresh the derived data, instead of letting the derivations run automatically whenever any of their dependencies change. Loosely said, in HANA the equivalent of what I was doing would be to have a table A with orders and a Table B which contains the summary aggregates of table A. Since B is a stateful table I have to manually ensure that table B is emptied and recomputed once something in A changes (the equivalent would be to call for example a stored procedure at certain trigger points). The better alternative would be to create a view C, which is automatically computed once someone is interested in the data (and only then) and cannot have stale aggregates. Also as long as none of the “table dependencies” used by the view (in our case table A) have changed the view C should not recompute for every consumer again, but instead return a cached version of it (in HANA there’s an aggregate cache which does something similar). This is somewhat the direction MobX brings us too, but actually even further. 2. State management with MobX and UI5 I hope my words and examples in the last section inspired your motivation to read on. MobX, slogan is “Simple, scalable state management.” and their philosophy is “Anything that can be derived from the application state, should be derived. Automatically.” In other words mobx helps you to maintain minimal actual state in your application and derive everything from that, meaning views, texts, items, state and visibility of controls, automatically. Automatically here means it will trigger the recomputation at the right point in time, avoid running the same computation twice for multiple consumers / observers, suspends computations if nobody is interested in it etc. It helps you to build a reactive application state machine. It’s not a UI rendering or control library, but instead would be used in conjunction with other libraries or frameworks. I won’t go too much into the internals of MobX itself, but I highly recommend you to quickly go through the “Gist” and “Concepts & Principles” section of mobx: 2.1 References MobX is not some fancy experiment, but a long standing, battle-tested library (nowadays in version 3) used in small to very big projects. It has more than 7000 stars on github and is the second most popular state management library in the React.js ecosystem after Redux (and in my opinion it’s the better of the two). The father of mobx is Michel Weststrate who works at mendix in the Netherlands. While a lot of the documentation and examples of mobx use ES6 + ES7 syntax and React it can be absolutely used with UI5 or any other UI framework (it can even be used server-side in node.js) and plain ES5 syntax. For that matter it also supports Internet Explorer 9 and higher. We used MobX recently for the development of some complex configuration UI’s (lots of forms etc.) in SAP Predictive Maintenance & Service, the product I’m working on: .The results were extremely positive, meaning less code, faster implementation, less bugs and it was a joy to use MobX in that context. 2.2. Simple MobX (without UI5) example In a nutshell, what mobx does its turning your JavaScript state object into an observable structure. That means interested parties can “subscribe” and “observe” changes that someone makes on this structure. For you as an application developer it’s actually not that important to know about the observability, subscriptions etc, as MobX does most of its magic automatically behind the scenes and in a very efficient manner. You can mutate your observable state structure mostly with normal javascript constructs like you would change any other object and dependents / observers are notified of your change. The following example demonstrates some of the basics. First, I create an initial state object which is passed to mobx.observable. Mobx will then create a copy that object but make it a sort of magic observable object on whose changes I can later subscribe. The first thing you will notice is that I defined a getter named ‘message’ on the state object. MobX will turns this into a “computed property”. Like all all the regular properties I can also subscribe to changes of computed properties. Whenever any of the dependencies of the computed property changes (in this case name and tasks.length) it will run the getter function, recompute the value and notify me in case the result of the getter has changed. It is actually smart enough to notify me only if the result of the getter function has changed, not just the dependencies. If you have a fairly complex calculation but it’s result is the same as the previous run, it will not notify it’s observer again. The next thing you’ll see is mobx.autorun. This simply runs the given function when any of the used dependencies inside the function change. In real application development you won’t use mobx.autorun that often. I use it mostly for debugging and to perform side effects on non-observable objects. After having set up my state and implicitly subscribed to changes in it (via mobx.autorun) I’m modifying my state object. Note how I can change the name and push array items and it will only re-run the autorun whose dependency has changed. var state = mobx.observable({ name: 'Frank', tasks: [], get message(){ return 'Hi ' + this.name + ' there are ' + this.tasks.length + ' pending tasks.'; } }); mobx.autorun(function() { console.log(state.name); }); mobx.autorun(function() { console.log(state.message) }); // prints 'Jane' // prints 'Hi Jane there are 0 pending tasks'; state.name = 'Jane'; // prints 'Hi Jane there are 1 pending tasks.' state.tasks.push('something'); // prints 'Hi Jane there are 2 pending tasks.' state.tasks.push('somethingelse'); (You have to open your browser console to see the log for this example, there’s no UI) 2.3 UI5 MobxModel For MobX to work nicely with UI5 I’ve built a custom model implementation which wraps an mobx observable and basically bridges from the mobx observable to ui5 controls and vice-versa. The implementation is based on reading the mobx documentation and the UI5 JSONModel source code. It can be found here: . In my example code I’m loading the MobxModel code directly from github, but if you want to consume it in your own (possibly private) project you can just copy the code into your project. You can then either register the namespace `sap.ui.mobx’ or change it to a namespace of your choice by changing the constant in namespace.js . In future when I have some time I might also release the code on npm and / or bower, just let me know if you have an urgent need for that. Once you’ve properly imported the MobxModel you can just instantiate it (very similar to JSONModel) like this: var state = mobx.observable({ foo: 'bar' }); var model = new MobxModel(state); this.getView().setModel(model); Once you’ve constructed the model and set it to the view or fragment, you most likely won’t interact with it directly not much anymore. When working with mobx, the idea is you work with the state object/s directly and just manipulate them. That means you will rarely or hopefully never have to call model.setProperty , model.getProperty or model.refresh`. instead you just manipulate your state object like state.foo = 'baz'. In fact using MobxModel your real model becomes the state object itself (we will add some business logic to the state object later). The MobxModel is merely an adapter of your observable real model to UI5. On a side note: I thought a long time whether I should name the class MobxModel or MobxUI5Adapter and I’m still undecided if it might be more adequate to change it’s name to MobxUi5Adapter (curious for your thoughts ;-)). If you use TwoWay binding, which is also supported via MobxModel, behind the scenes UI5 will still call model.setProperty, but you don’t have to worry about that and your state object will be automatically updated. 2.4 Rewriting the complex example in MobX If you’ve jumped directly to section 2 of my blog post I request you to read now at least the initial sections of 1.3. where I describe the “requirements” of my hypothetical app. The app that we’re now going to rewrite using mobx. As you’ve already seen in the simple mobx example, we can use mobx computed properties to dynamically compute complex values, including arrays and objects which update automatically. In our previous complex app example with JSONModel we had the requirement of providing a summary and total of the orders which required us to dynamically compute an array. Due to limitations of UI5 formatters we couldn’t use them to compute an array but instead had to introduce new state properties and keep them manually in sync with the orders array. Now with mobx we don’t have to keep them manually in sync anymore. Instead we can just define a mobx computed property via a getter and then mobx will ensure it’s always in sync with the orders array. The refresh<something> methods on the fragment controller, which were performing side-effects, can be turned into side-effect free and easier testable getters that are attached directly to the state object. The result looks like this:'; } } }); Note that the actual state now really is only the orders and the newOrder form states. All the other things are really just functions to derive values from the state. The cool thing is however you can bind your controls against those computed properties and they automatically notify their observers (e.g. MobxModel / UI5 controls) once any of their dependencies and the result of their computation have changed. To UI5’s binding / binding syntax those getters look like any other property. Because we moved all the computation to the mobx state object, our fragment controller now looks fairly small: var orderId = 0; var model = new MobxModel(state); var fragment = sap.ui.xmlfragment('my.example.app', { onOrderAdd: function() { state.orders.push({id: ++orderId, productName: state.newOrder.productName, quantity: state.newOrder.quantity}); }, onOrderRemove: function(){ state.orders.pop(); } }); fragment.setModel(model); and our view / fragment actually stayed almost the same (I just removed the formatter reference of the headerText). Note how I’m binding “/total” “/summary” and “/headerText” directly against the computed properties in my state object. No formatter functions or anything. <VBox xmlns="sap.m" xmlns: <form:SimpleForm> <Label text="Product Name"/> <Input value="{/newOrder/productName}" /> <Label text="Quantity"/> <Input value="{/newOrder/quantity}"/> <Button press=".onOrderAdd" text="Add Order"/> </form:SimpleForm> <Label text="{= 'Total items: ' + ${/total}}" design="Bold"/> <VBox> <Label text="Summary by Product" design="Bold"/> <VBox items="{/summary}"> <Text text="{= ' - ' + ${productName} + ': ' + ${quantity}}"/> </VBox> </VBox> <Table headerText="{/headerText}"> <HBox> <Button press=".onOrderRemove" text="Remove Last Order"/> </HBox> </VBox> The running application using mobx can be found here: It looks and works exactly like the JSONModel app before, but the code is a bit simpler. 2.5. more simplification of complex example When you develop with mobx you will quickly realize how you can move a lot of business logic out from the controllers. In fact you might have noticed that our state object currently doesn’t call any ui5 specific method anymore and has no external dependencies. So why not move it into a seperate file? In my example I moved the whole state object into a state.js file. The state object is now self contained and easily testable. It uses just plain javascript code and has no dependencies to DOM elements, controls, ui5 classes etc. Also it actually contains most of the apps logic and the fragment controller is almost empty. However there’s one more optimization we can do. If you look at the onOrderAdd and onOrderRemove event handlers they actually contain some business logic about the structure of an order item etc.. We can quickly fix that by moving the respective methods to the state object and simply delegate from the controller to them. The final app.js and state.js then looks like this: final app.js sap.ui.define(['sap/ui/mobx/MobxModel', './state'], function(MobxModel, state) { var model = new MobxModel(state); var fragment = sap.ui.xmlfragment('my.example.app', { onOrderAdd: state.addOrder.bind(state), onOrderRemove: state.removeLastOrder.bind(state) }); fragment.setModel(model); fragment.placeAt('main'); }); final state.js sap.ui.define([], function(){ var orderId = 0;'; } }, }); state.addOrder = function() { this.orders.push({id: ++orderId, productName: this.newOrder.productName, quantity: this.newOrder.quantity}); }; state.removeLastOrder = function(){ this.orders.pop(); }; return state; }); 2.6 Possible improvements to state.js and mobx best practices The app.js and the fragment already look quite clean now. However after moving everything to state.js the state.js itself looks a bit too messy and possibly deals with too many things at the same time. I won’t show any further optimizations in this blog post, but let’s briefly talk about them: First of all the state is a singleton which makes it hard to reset the state during a test run. So you should probably convert it into a class or factory function which produces fresh state objects. Furthermore in general it is a good practice to create different classes for your domain objects and so called domain object stores to manage collections of your objects of them. In our case a domain object would be the order . So we need an Order class. Furthermore we need an OrderStore to manage multiple orders. Also if you look the precisely the headerText computed property and the newOrder state are not really generic business logic, but are only needed in the context of the current application. Those you would typically separate into a uiState observable and or / model. With mobx you can make all the instances of your domain classes observable themselves. Also you can have multiple models where one model observes another etc. In fact I highly recommend you to read which gives some best practice that we followed successfully in our project. 3. Limitations I’ve shown how to use mobx with ui5, mostly as an alternative for ui5’s JSONModel. What remains to be discussed is how this compares for example to the ODataModel and how mobx can be used in the context of an odata application. Also there are a few limitations to the UI5 MobxModel implementation: – currently it only implements a subset of the UI5 Model interface. E.g. ContextBinding and TreeBinding won’t work. However this can be added as needed – I just haven’t yet had a use case in my projects for this together with mobx. – while I’ve successfully used mobx and MobxModel in a complex app (way more complex than the examples) there are probably a few edge cases in the UI5 binding API that MobxModel doesn’t support or implements currently incorrectly. I’ve added a couple of tests to the MobxModel repository but they don’t cover all possible usages of UI5 models. Last but not least I just want to stress that while I’m working for SAP, I’m not affiliated with the UI5 team and to-date MobxModel remains an unofficial UI5 model implementation. 4. Summary and Outlook I’ve shown how to use mobx with ui5 for complex, state driven applications. Even though I tried to show a fairly complex example, this just touches the surface of mobx possibilities’. One thing I’m in particular interested is how to put all your validation logic into your mobx domain classes. One approach I’ve implemented already on a small scale is to bind your Input fields against a valueState and valueStateMessage computed property in an observable ui state store. Furthermore you can also provide a setter ( set) for computed properties in mobx. I’ll probably share my experiences in another blog post once this topic reaches maturity. I hope you liked the approach and I’m excited for your feedback and questions. Best Regards Christian Interesting one Christian. Thanks for the blog. Awesome!! Where this reflux-like approach really shines IMHO is when the model is updated asynchronously from multiple sources (different service requests, controls). Great idea to wrap that all into a custom ui5 Model implementation. FYI, just read again this blog post which very well explains some of the fundamental principles of MobX, how its different to other reactive libraries or for example databinding in angular 1 and how it still achieves a very good level of predictability despite it’s “magic”: Thanks Christian for sharing. Really well written and explanatory example. This looks so much better than the current way to go with formatters in at least two respects: – Even more completely separating and hiding the application state into models, where they belong – No utility formatters needed. Performance is better and what is even more useful is that the bindings become more simple. No need for “parts”, “formatters”. Questions: Does the MobxModel work nicely with two-way binding types regarding parsing of user input? E.g. incorrectly formatted values are not updated into the model and errors are thrown? Does sorting and filtering still work on the binding with MobxModel? This is too good to pass on and I hope that we will get something similar integrated into UI5 sooner rather than later. It would make the already good UI5 binding system almost perfect. Hi Kimmo, thanks for your feedback. I also would be very glad if this gets official integration into UI5. Probably should ask for comment from the UI5 team Regarding your questions: 1. Yes, it still works nicely with two-way binding types (sap.ui.model.type etc…), including the automatic message processing that comes with it. ( ). In the project I was using MobX we also used those types in many places. However I will mid-term work on a different more mobx-native solution because I would prefer to put such (validation) logic also in a (view-)model instead of the binding or view. Also there are a few annoyances with using this type system. In my project I even had a very concrete bug because of this non-propagation behaviour. Simplified it was like this: There was a form which contained a field “productName”. The user opened the product “Gum” and went to edit mode. Then he would change the productName to an invalid name “Gum%”. This would trigger a validation error and mark the input field as red. Now the user “Cancels” / “Exits” the edit mode, because he doesn’t want to save it. My JS code would just retrieve the original product data and set it again to the model. Now what you would expect is that the productName field goes back to “Gum” and the validation error disappears. However what really happened is that the “Gum%” and the validation error stayed on the UI. The reason for this was basically because the “Gum%” never hit the model or the PropertyBinding. So when I retrieved and set the original values in the model again, the Binding would just think: “well “Gum” is same value as I already have (no change), so no need to notify the control that it should rerender”. In order to solve this issue I had to call `model.updateBindings(true)’ which triggers an expensive force update of all bindings. This issue is also not specific to MobxModel but also occurs with JSONModel and probably any other model implementation and is just due to the non-propagation of invalid values when using data types. As a rule of thump every visible and non-ephemeral change on the UI (including invalid entered domain values) should directly or indirectly result in (or originate from) a state change in your model. If you follow this strictly it is also relatively easy to introduce later time-travel and undo / redo actions in your app. If you want to prevent invalid values hitting your (core domain) model the best way to go about this is probably to have a Model and a ViewModel as in MVVM. The Model would be guaranteed to only have valid values but the ViewModel would be able to deal with invalid values and be a proxy to the Model. Also the ViewModel would handle turning validation errors into displayable messages etc. In mobx-utils there is a helper createViewModel which goes a bit in that direction and based upon this idea I’m aiming to come up with a validation pattern which “feels mobx” but still displays and propagates error messages to the global UI5 MessageProcessor like the normal UI5 types. I will also make sure that one can still use the logic of existing ui5 types – just that you would not set them on the binding but on the model / viewmodel. 2. No, UI5 sorters and filters that are directly applied to the binding currently won’t work with MobxModel. That’s not a general limitation, I just haven’t implemented the logic (yet) for this because I don’t like putting sorters and filters (which de-facto play the same role as formatters) onto the binding. Instead – just like formatters – I would make them part of the model. The set of UI5 filters and sorters are properties (=de facto they are state) of UI5 bindings that cannot be controlled via (meta) bindings and hence it’s hard to keep their values in sync with a model. So for example if you have a “search field” you probably want to have it’s search term in the model. Now, assuming MobxModel would have support for ui5 filters and sorters, and you want to have the search term in your model, you could propagate the search term from the model to the binding’s filter like this: However, if you really do it more in the mobx way and simply use computed properties it’ll look like this: You would just bind the table then against the ordersFilteredcomputed property instead of orders. This is imho a more elegant, easier to test and understand solution. You don’t need to use static id’s to retrieve the control and binding, your filter logic is just plain side-effect free JavaScript instead of some proprietary UI5 Filter and you don’t need to use mobx.autorunto bridge to imperative side-effect performing code. Your (hard-to-test) controller remains small. Because computed properties get automatically suspended if nobody observes them, you don’t need to manually dispose them to prevent memory leaks (unlike the mobx.autorun). For more info on the disposal topic see this: . Another UI5ish solution might be to listen to the change event of the searchTerm input field and set the filter there directly instead of going through the model at all. But then you would have problems to programmatically reset the search term for example (it’ll not fire the event handler). So altogether I believe you don’t have to (and should not) use UI5 filters and sorters when using the more powerful MobxModel. MobX computed properties are a generic solution which can replace formatters, sorters and filters all at the same time. Nevertheless I’ll add the UI5 Filter and Sorter support soon to MobxModel for compatibility reasons. Best Regards Christian Hi Christian, Thanks for a very detailed reply! 1. I’ve also similar generic form validation as in Robin’s blog post. It works pretty well. Cross field validation is unfortunately something that is difficult to handle with binding types. That is definitely something where having validation model’s responsibility would help. 2. Computed properties definitely look more elegant and easier to test way to handle sorting and filtering. Especially good if you need to have dynamic filters and sorters for a given table. Best regards, Kimmo
https://blogs.sap.com/2017/01/30/advanced-state-management-in-sapui5-via-mobx/
CC-MAIN-2017-47
refinedweb
6,475
53.61
12 November 2010 06:47 [Source: ICIS news] SINGAPORE (ICIS)--Japanese producer Sumitomo Chemical Co plans to shutdown its 90,000 tonne/year No. 3 methyl methacrylate (MMA) line on ?xml:namespace> The turnaround would take six to seven weeks and the line would be restarted in the middle of April 2011, he added. Meanwhile, the 53,000 tonne/year No. 1 and the 80,000 tonne/year No. 2 MMA lines at the same site would also be shut for a month-long maintenance in the second half of 2011, although not at the same time, the source said. Separately, another source close to Sumitomo Chemical said the company had been shunning spot purchases of methyl tertiary butyl ether (MTBE), although its MMA lines are operating at 100%. Sky-high MTBE prices were the cause, the source added. Sumitomo Chemical is a major MMA producer in MMA is used to produce polymethyl methacrylate (PMMA) polymer, cast sheets and acrylic resins for coatings and emulsions. Additional reporting by Junie Lin For more on MMA
http://www.icis.com/Articles/2010/11/12/9409711/sumitomo-chemical-plans-mma-turnaround-skips-spot-mtbe-buying.html
CC-MAIN-2013-48
refinedweb
174
71.85
I was trying to get the size of the multidimensional array and wrote code in c as shown below. #include <stdio.h> char b[3][4]; int main(void){ printf("Size of array b[3]=%d\n", sizeof(b[3])); printf("Size of array b[2]=%d\n", sizeof(b[2])); printf("Size of array b[5]=%d\n", sizeof(b[5])); return 0; } b is a 2D character array of rows 3 and columns 4. So, if you take sizeof(b) you will get 12. b[0] (and b[i] in general) has a type of a 1D character array of size 4. So. if you take sizeof (b[0]) you will get 4. b[0][0] (and b[i][j] in general) has a type of char. So if you take sizeof (b[0][0]) you will get 1. sizeof does not depend on the array index. The type remains the same even for b[0] and b[100], even though it might be out of range of the memory of the array.
https://codedump.io/share/Gv2ipq4bsDFO/1/size-of-multi-dimentional-array
CC-MAIN-2019-04
refinedweb
175
80.92
A Java Program To Find Duplicate Values In an Array In this post, we are going to write a program to find the duplicate values in an array. Suppose an array is holding these values {1,4,5,3,1,8,7,5,7} This program will print all the duplicates value of this array, those values are 1,5,7 Java program to get factorial of any number Java Program To Find Duplicate Values In an Array: import java.util.*; public class Codespeedy { public static void main(String[] args) { int[] array= {1,2,3,4,5,3,6,1,87,87}; int i;int k=0; List l1= new ArrayList(); for(i=0;i<array.length;i++) { int temp=array[i]; for(int j=i+1;j<array.length;j++) { if(temp==array[j]) { l1.add(k,temp); k++; } } } System.out.println(l1); } } Output: [1, 3, 87] Java Program To Check A Number is Palindrome or Not We used List l1= new ArrayList(); here, we could take integer array but we didn’t. Just because we are not sure about the number of duplicate values, we are going to find. Instead of taking array we used List here because in List it is not mandatory to define the size of the list. Easy to understand. Thanks for posting such a code
https://www.codespeedy.com/a-java-program-to-find-duplicate-values-in-a-array/
CC-MAIN-2019-47
refinedweb
222
63.9
Hi, I’m using the getPageCount() function. It returns ‘2’ despite the document has only one page. That makes problem when I want to save document to PDF, in the result file there is additional empty page. Is there any workaround fot this problem? I’m attaching problematic document. Thanks. Hi, Hi <?xml:namespace prefix = o Thanks for your request. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved. The problem occurs because there is floating table in your document. At the moment, Aspose.Words does not support positioning of floating tables. As a workaround, you can set “Text wrapping” of your table to “None”. Best regards, That works. Thank you very much for help. Hi Andrey, I have a similar problem, I have a word document that has 1156 pages, when I use thegetPageCount() method it returns 1, so the document is previously created, I am wondering how can I get all the tables of the document to set the “Text wrapping” to “None” in each table of the document? Thanks in advance Hello, Thank you for your request. It seems to me that you have not quite exact same problem that is described above. Could you please attach your original document to analyze. Just please tell the product version you are using. Please try to upgrade to the latest 10.0.1, which you can download here: Regarding your second question. You can use the class DocumentVisitor to cycle through all the cells in all tables. And set the property CellFormat.setWrapText(false); Thanks rumata, I’ve downloaded the last release of AsposeWords, all our problems transforming Word document to PDF seems to be solved in this release, we are requesting an upgrade of our license to test the full functionalities, Thanks again, Hello <?xml:namespace prefix = o It is perfect, that you already resolved the problem. Please let us know in case of any issues. We will be glad to help you. Best regards, The issues you have found earlier (filed as WORDSNET-1940) have been fixed in this .NET update and in this Java update. This message was posted using Notification2Forum from Downloads module by aspose.notifier. (96)
https://forum.aspose.com/t/document-getpagecount-returns-wrong-value/66775
CC-MAIN-2021-21
refinedweb
381
67.86
Sitecore pipelines are great. With them you can relatively easily add and remove functionality as you wish. Pipelines like httpRequestBegin, httpRequestProcessed and mvc.beginRequest are also really useful if you need some logic to run on a page load that shouldn’t really be part of a rendering. This could be anything from login checks to updating the way 404 pages are returned. However you do need to remember the big picture of what you are changing. Pipelines don’t just effect the processes of the website your building, Sitecore uses them too. That means when you add a new processor to the httpRequestBegin pipeline, that’s going to effect every request in the admin cms too. Just checking the context item also isn’t enough as some things. e.g. opening a node in a treeview, will have the context of the node you clicked on! Adding this snippet of code to the begining of your process should keep you safe though. using Sitecore.Diagnostics; using Sitecore.Pipelines.HttpRequest; using Sitecore; using Sitecore.SecurityModel; namespace CustomPiplelineNamespace { public class CustomPipeline : HttpRequestProcessor { public override void Process(HttpRequestArgs args) { //Check args isn't null Assert.ArgumentNotNull(args, "args"); //Check we have a site if (Context.Site == null) return; //Check the sites domain isn't one for sitecore if (Context.Site.Domain != DomainManager.GetDomain("sitecore")) return; //Check that we're not in a redirect if (args.Url.FilePathWithQueryString.ToUpperInvariant().Contains("redirected=true".ToUpperInvariant())) return; //Check that we're not in the page editor if (Context.PageMode.IsPageEditor) return; // DO CODE } } }
https://himynameistim.com/2017/05/03/pipelines-remember-the-big-picture/
CC-MAIN-2019-47
refinedweb
257
50.94
. We were intrigued by this approach. As we've blogged about before, we're really only interested in coding approaches that can be shared with other people. This functional approach would allow us to lower the barrier to adopting a given mixin. As much as we like the Composable class discussed in that earlier post, using mixins that way requires adoption of that class. It's not quite a framework — it's more of a kernel for a framework — but it's still a bit of shared library code that must be included to use that style of mixin. Here's an example of a mixin class using that Composable approach. This creates a subclass of HTMLElement that incorporates a TemplateStamping mixin. That mixin will take care of stamping a `template` property into a Shadow DOM shadow tree in the element's `createdCallback`. import Composable from 'Composable' import TemplateStamping from 'TemplateStamping'; class MyElement extends Composable.compose(HTMLElement, TemplateStamping) { get template() { return `Hello, world.`; } } That's pretty clean — but notice that we had to `import` two things: the Composable helper class, and the TemplateStamping mixin class. The functional approach implements the mixin as a function that applies the desired functionality. The mixin is self-applying, so we don't need a helper like Composable above. The example becomes: import TemplateStamping from 'TemplateStamping'; class MyElement extends TemplateStamping(HTMLElement) { get template() { return `Hello, world.`; } } That's even cleaner. At this point, we don't even really have a framework per se. Instead we have a convention for building components from mixin functions. The nice thing about that is that such a mixin could conceivably be used with custom elements created by other frameworks. Interoperability isn't guaranteed, but the possibility exists. We like this so much that we've changed out nascent core-component-mixins project to use mixin functions. Because there's so little involved in adopting this sort of mixin, there's a greater chance it will find use, even among projects that write (or claim to write) web components in plain javascript. Again, that should accelerate adoption. The most significant cost we discussed in making this change is that a mixin author needs to write their mixin methods and properties to allow for composition with a base class. The Composable class had provided automatic composition of methods and properties along the prototype chain according to a set of rules. In a mixin function, that work needs to be done manually by the mixin author. We've identified a series of composition rules that capture our thinking on how best to write a mixin function that can safely applied to arbitrary base classes. The rules are straightforward, but do need to be learned and applied. That said, only the authors of a mixin need to understand those, and that's a relatively small set of people. Most people will just need to know how to use a mixin — something that's now as easy as calling a function.
https://component.kitchen/blog/posts/implementing-web-component-mixins-as-functions
CC-MAIN-2017-43
refinedweb
497
54.93
Earlier this month, a Recurrent Neural Network with Keras SimpleRNN in Tensorflow. In this post we’ll use Keras and Tensorflow to create a simple RNN, and train and test it on the MNIST dataset. Here are the steps we’ll go through: - Creating a Simple Recurrent Neural Network with Keras - Importing the Right Modules - Adding Layers to Your Model - Training and Testing our RNN on the MNIST Dataset - Load the MNIST dataset - Compile the Recurrent Neural Network - Train and Fit the Model - Test the RNN Model To follow along, you’ll need to install tensorflow which you can do using the line in the terminal below. pip install tensorflow Creating a Simple Recurrent Neural Network with Keras Using Keras and Tensorflow makes building neural networks much easier to build. It’s much easier to build neural networks with these libraries than from scratch. The best reason to build a neural network from scratch is to understand how neural networks work. In practical situations, using a library like Tensorflow is the best approach. It’s straightforward and simple to build a neural network with Tensorflow and Keras, let’s take a look at how to do that. Importing the Right Modules The first thing we need to do is import the right modules. For this example, we’re going to be working with tensorflow. We don’t technically need to do the bottom two imports, but they save us time when writing so when we add layers, we don’t need to type tf.keras.layers. but can rather just write layers. import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers Adding Layers to Your Model The first thing we’re going to do is set up our model by adding layers. In this example we’ll be creating a three layer model. To start, we’ll set up a Sequential model. Sequential models are just your basic feedforward neural networks. After setting up the model we’ll add a SimpleRNN layer with 64 nodes, expecting an input of shape (None, 28) because that’s the input shape of the MNIST dataset. You’ll have to adjust your input_shape parameter based on your dataset. After our initial SimpleRNN layer, we’ll add a BatchNormalization layer. This layer normalizes its inputs. This layer only matters for inference tasks. Finally, we’ll add a Dense layer which is simply a fully connected layer. We’ll use a layer with 10 nodes because there are 10 possible outputs for the MNIST dataset. model = keras.Sequential() model.add(layers.SimpleRNN(64, input_shape=(None, 28))) model.add(layers.BatchNormalization()) model.add(layers.Dense(10)) print(model.summary()) Training and Testing our RNN on the MNIST Dataset At this point, we’ve set up our three layer RNN with a SimpleRNN layer, a BatchNormalization layer, and a fully connected Dense layer. Now that we have an RNN set up, let’s train it on the MNIST dataset. Load the MNIST dataset The first thing we’ll do is load up the MNIST dataset from Keras. We’ll use the load_data() function from the MNIST dataset to load a pre-separated training and testing dataset. After loading the datasets, we’ll normalize our training data by dividing by 255. This is due to the scale of 256 for RGB images. Finally, we’ll set aside a sample and sample label for testing later. mnist = keras.datasets.mnist (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train, x_test = x_train/255.0, x_test/255.0 sample, sample_label = x_test[0], y_test[0] Compile the Recurrent Neural Network Before we train our Recurrent Neural Network, we’ll have to compile it. Compiling a neural network in Keras just means setting up the hyperparameters. For our example, let’s pass in a loss function, an optimizer, and the metrics we want to judge by. model.compile( loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True), optimizer="sgd", metrics=["accuracy"], ) Train and Fit the Model Now that the model is compiled, let’s train the model. To train the model in Keras, we just call the fit function. To use the fit function, we’ll need to pass in the training data for x and y, the validation, the batch_size, and the epochs. For this example, we’ll just train for 1 epoch. model.fit( x_train, y_train, validation_data=(x_test, y_test), batch_size=64, epochs=1 ) Test the RNN Model We’ve set up the RNN, compiled it, and trained it. Now let’s run a test and see how it does. We’ll use that sample data we set aside earlier and run it through a predict function from the model. Then we’ll print out the result. result = tf.argmax(model.predict(tf.expand_dims(sample, 0)), axis=1) print(result.numpy(), sample_label) We get an accuracy of about 96% after 10 epochs of training the Simple RNN from Keras, that’s pretty good. Build a Simple RNN with Keras Summary That’s it, that’s all there is to build a simple RNN with Keras and Tensorflow. In this post we went over how to set up a model by adding different layers. Specifically, we used the SimpleRNN, BatchNormaliztion, and Dense layers. Then we went over how to compile a neural network in Keras by passing it a loss function, an optimizer, and metrics to judge on. Finally, we loaded up the MNIST dataset, fit the model to it, and ran a test on one point of sample data. Further Reading - Beginner’s Guide to Python Asyncio Loops - Long Short Term Memory (LSTM) in Keras - Dijkstra’s Algorithm in Python - Create a Neural Network from Scratch in Python 3 - War (Card Game) “Build a Simple Recurrent Neural Network with Keras”
https://pythonalgos.com/build-a-simple-recurrent-neural-network-with-keras/
CC-MAIN-2022-27
refinedweb
956
63.29
A Service Mesh for Kubernetes (Part 4): CD via Traffic Shifting A Service Mesh for Kubernetes (Part 4): CD via Traffic Shifting See how to use linkerd’s routing rules, called dtabs, to automatically alter traffic flow through your app at the end of a CI/CD pipeline. Join the DZone community and get the full member experience.Join For Free Beyond service discovery, top-line metrics, and TLS, linkerd also has a powerful routing language, called dtabs, that can be used to alter the ways that requests — even individual requests — flow through the application topology. In this article, we’ll show you how to use linkerd as a service mesh to do blue-green deployments of new code as the final step of a CI/CD pipeline. Note: this post was co-written with Kevin Lingerfelt. It is one of a series of articles about linkerd, Kubernetes, and service meshes. Other installments in this series include: - Top-line service metrics - Pods are great, until they’re not - Encrypting all the things - Continuous deployment via traffic shifting (this article) - Dogfood environments, ingress, and edge routing - a service mesh like linkerd to capture top-line service metrics and transparently add TLS to your application, without changing application code. In this article, we’ll show you an example of how to use linkerd’s routing rules, called dtabs, to automatically alter traffic flow through your application at the end of a CI/CD pipeline to perform a blue-green deployment between old and new versions of a service. Continuous deployment (CD) is an extension of continuous integration (CI), in which code is pushed to production on a continuous basis, tightly coupled to the development process. While it requires powerful automation, minimizing the time between development and deployment allows companies to iterate very rapidly on their product. For multi-service or microservice architectures, the final step of the CD process, the deployment itself, can be risky because so much runtime behavior is determined by the runtime environment, including the other services that are handling production traffic. In these situations, gradual rollouts such as blue-green deployments become increasingly important. Coordinating traffic shifting across multiple linkerds requires a centralized traffic control tool. For this we recommend namerd, a service with an API that serves routing rules backed by a consistent store. You can read more about how namerd integrates with production systems in our previous blog post covering routing in linkerd. We’ll demonstrate a blue-green deployment using an example app from the linkerd-examples GitHub repo. The example app is a contrived “hello world” microservice application, consisting a of “hello” service that handles incoming requests and calls a “world” service before returning a response. With Jenkins as our automation server, we’ll deploy a new version of the world service using the Jenkins Pipeline Plugin. A Service Mesh for Kubernetes Before we start continuously deploying, we’ll need to initially deploy the hello world app to Kubernetes, routing requests using linkerd and namerd. We can do this easily by using the Kubernetes configs in the linkerd-examples repo. Step 1: Install Namerd We’ll start by installing namerd, which will manage the dtabs that we use to orchestrate our blue-green deployments. Please note that our namerd configuration uses the ThirdPartyResource APIs, which requires a cluster running Kubernetes 1.2+ with the ThirdPartyResource feature enabled. To install namerd in the default Kubernetes namespace, run: kubectl apply -f You can confirm that installation was successful by viewing namerd’s admin page (note that it may take a few minutes for the ingress IP to become available): NAMERD_INGRESS_LB=$(kubectl get svc namerd -o jsonpath="{.status.loadBalancer.ingress[0].*}") open # on OS X The admin page displays all configured namerd namespaces, and we’ve configured two namespaces—“external” and “internal”. For the sake of continuous deployment, we’re mostly concerned with the “internal” namespace. In addition to the admin UI, we can also use the namerctl utility to talk directly to namerd. This utility will be used by the deploy script to start sending traffic to newly deployed services. To install it locally, run: go get -u github.com/linkerd/namerctl go install github.com/linkerd/namerctl The utility uses the NAMERCTL_BASE_URL environment variable to connect to namerd. In order to connect to the version of namerd that we just deployed to Kubernetes, set the variable as follows: export NAMERCTL_BASE_URL= And now try using namerctl to display the internal dtab: $ namerctl dtab get internal # version MjgzNjk5NzI= /srv => /#/io.l5d.k8s/default/http ; /host => /srv ; /tmp => /srv ; /svc => /host ; /host/world => /srv/world-v1 ; The last line of the dtab maps the logical name of the world service to the currently deployed version of the world service, world-v1. In a production system, versions could be shas, dates, or anything else that guarantees name uniqueness. We’ll use this dtab entry to safely introduce new versions of the world service into production. Step 2: Install Linkerd Next, we’ll install linkerd and configure it to resolve routes using namerd. To install linkerd as a DaemonSet (i.e., one instance per host) in the default Kubernetes namespace, run: kubectl apply -f You can confirm that installation was successful by viewing linkerd’s admin UI (note that it may take a few minutes for the ingress IP to become available): L5D_INGRESS_LB=$(kubectl get svc l5d -o jsonpath="{.status.loadBalancer.ingress[0].*}") open # on OS X We’ll use the admin UI to verify steps of the blue-green deploy. Step 3: Install the Sample Apps Now we’ll install the hello and world apps in the default namespace, by running: kubectl apply -f At this point, we actually have a functioning service mesh and an application that makes use of it. You can see the entire setup in action by sending traffic through linkerd’s external IP: $ curl $L5D_INGRESS_LB Hello (10.196.2.5) world (10.196.2.6)!! If everything is working, you’ll see a “Hello world” message similar to that above, with the IPs of the pods that served the request. Continuous Deployment We’ll now use Jenkins to perform blue-green deploys of the “world” service that we deployed in the previous step. Set Up Jenkins Let’s start by deploying the buoyantio/jenkins-plus Docker image to our Kubernetes cluster. This image provides the base jenkins image, along with the kubectl and namerctl binaries that we need, as well as additional plugins and a pre-configured pipeline job that we can use to run deployments. The pipeline job makes use of the Jenkins Pipeline Plugin and a custom Groovy script that handles each of the steps in the blue-green deploy for us. To deploy the Jenkins image to the default Kubernetes namespace, run: kubectl apply -f You can confirm that installation was successful by opening up the Jenkins web UI (note that it may take a few minutes for the ingress IP to become available): JENKINS_LB=$(kubectl get svc jenkins -o jsonpath="{.status.loadBalancer.ingress[0].*}") open # on OS X You should see a “hello_world” job in the UI. Committing Code Now it’s time to make some code changes to the world service, and have the Jenkins job deploy them to production for us. To do this, start by forking the linkerd-examples repo in the Github UI. Once you’ve created a fork, clone your fork locally: git clone cd linkerd-examples For the sake of this example, we’re going to change a text file that controls the output of the world service. By default, the world service outputs the string “world”: $ cat k8s-daemonset/helloworld/world.txt world Let’s spice that up a bit: echo "hal, open the pod bay doors" > k8s-daemonset/helloworld/world.txt And commit it: git commit -am "Improve the output of the world service" git push origin master Now it’s time to get this critical change into production. Running the Job With our change committed and pushed to our fork of the linkerd-examples repo, we can kick off the Jenkins “hello_world” pipeline job to safely deploy the change into production. Each of the 6 steps in the pipeline job is controlled by a custom Groovy script and described below in more detail. The deploy is fully automated, with the exception of three places in the pipeline where it pauses for human-in-the-loop verification of critical metrics before proceeding. Build With Parameters To start the deploy, click into the “hello_world” job in the Jenkins UI, and then click “Build with the parameters” in the sidebar. You’ll be taken to a page that lets you customize the deploy, and it will look something like this: Change the value of the gitRepo form field to point to your fork of the linkerd-examplesrepo, and then click the “Build” button. Note that if you pushed your changes to a separate branch in your fork, you should also change the value of the gitBranch form field to match your branch name. Clone The first step in the pipeline is to clone the git repo using the build parameters specified above. Pretty straightforward. Deploy The second step in the deploy pipeline is to actually deploy the new version of the world service to our cluster, without sending it any traffic. The script determines that the currently deployed version of the world service is world-v1, so it creates a new service called world-v2 and deploys that to our Kubernetes cluster. At this point you will see two different versions of the world service running simultaneously: $ kubectl get po | grep world world-v1-9eaxk 1/1 Running 0 3h world-v1-kj6gi 1/1 Running 0 3h world-v1-vchal 1/1 Running 0 3h world-v2-65y9g 1/1 Running 0 30m world-v2-d260q 1/1 Running 0 30m world-v2-z7ngo 1/1 Running 0 30m Even with the world-v2 version fully deployed, we still have not made any changes to production traffic! linkerd and namerd are still configured to route all world service traffic to the existing world-v1 version. Fully deploying a new version of the service before sending it any traffic is key to performing a blue-green deploy. Integration Testing Once the new version of our service is deployed, the script performs a test request to make sure the new version can be reached. If the test request succeeds, it pauses the deploy and waits for us to acknowledge that the newly deployed version looks correct before proceeding. At this point, we want to make sure that the new pods are running as expected—not just by themselves, but in conjunction with the rest of the production environment. Normally this would involve a deployment to a separate staging cluster, combined with some mechanism for sending or replaying production traffic to that cluster. Since we’re using linkerd, we can significantly simplify this operation by taking advantage of linkerd’s per-request routing to accomplish the same thing without a dedicated staging environment. At ingress, we can tag our request with a special header, l5d-dtab, that will instruct linkerd to route this request through the production cluster, but replace all service calls to world-v1 with calls to world-v2 instead for this request only. The Jenkins UI provides the dtab override that we need to route requests to the new version of our service, and using that information we can make our own test request: $ curl -H 'l5d-dtab: /host/world => /tmp/world-v2' $L5D_INGRESS_LB Hello (10.196.2.5) hal, open the pod bay doors (10.196.1.17)!! Success! Our request is being routed to the world-v2 service, which is returning the new world text that we added on our branch. Even though we can reach the new service, it’s worth noting that we still have not changed the behavior of any production traffic, aside from the request that we just made. We can verify that by omitting the l5d-dtab header and ensuring that we still get the world-v1 response: $ curl $L5D_INGRESS_LB Hello (10.196.2.5) world (10.196.2.6)!! If everything looks good, we can proceed to the next step in the pipeline by clicking the “Ok, I’m done with manual testing” button in the Jenkins UI. Shift Traffic (10%) After some manual testing, we’re ready to start the blue-green deployment by sending 10% of production traffic to the newly deployed version of the service. The script makes the change in routing policy and again pauses, asking us to confirm that everything looks OK with 10% traffic before proceeding. Note that if the user aborts on any pipeline step, the script assumes there was something wrong with the new service, and automatically reverts the routing change, sending all traffic back to the original service. Since we’re not tearing down instances of the old version of the service while shifting traffic, reverting traffic back can happen quickly, minimizing the impact of a bad deploy. We can verify that our service is taking 10% of requests by sending it 10 requests and hoping that the odds are in our favor: $ for i in {1..10}; do curl $L5D_INGRESS_LB; echo ""; done Hello (10.196.2.5) world (10.196.1.16)!! Hello (10.196.2.5) world (10.196.1.16)!! Hello (10.196.2.5) hal, open the pod bay doors (10.196.2.13)!! Hello (10.196.2.5) world (10.196.2.6)!! Hello (10.196.1.13) world (10.196.2.6)!! Hello (10.196.1.13) world (10.196.2.6)!! Hello (10.196.2.5) world (10.196.1.16)!! Hello (10.196.2.5) world (10.196.2.6)!! Hello (10.196.1.14) world (10.196.2.6)!! Hello (10.196.1.14) world (10.196.1.16)!! Looking good! Now is also a good time to check linkerd’s admin dashboard, to verify that the new service is healthy. If your application were receiving a small amount of steady traffic, then the dashboard would look like this: We can see right away that the world-v2 service is taking roughly 10% of traffic, with 100% success rate. If everything looks good, we can proceed to the next step by clicking the “Ok, success rates look stable” button in the Jenkins UI. Shift Traffic (100%) In this step, the script shifts additional traffic to the new version of our service. For a concise example, we’re moving immediately to 100% of traffic, but in a typical deployment, you could include additional intermediary percentages as separate steps in the pipeline. We can verify that the new service is serving traffic by sending it a request without a dtab override header: $ curl $L5D_INGRESS_LB Hello (10.196.2.5) hal, open the pod bay doors (10.196.2.13)!! Once we’re confidant that world-v2 is successfully handling 100% of production traffic, we can proceed to the final step by clicking the “Ok, everything looks good” button in the Jenkins UI. Cleanup In the final step, the script finalizes the deploy by making the routing rules to route traffic to the new version of the service permanent. It also tears down the previous version of the service that was still running in our cluster but not receiving any traffic. The final version of namerd’s dtab is now: $ namerctl dtab get internal # version MTIzMzU0OTE= /srv => /#/io.l5d.k8s/default/http ; /host => /srv ; /tmp => /srv ; /http/*/* => /host ; /host/world => /srv/world-v2 ; We can verify that the old service has been torn down by looking at the world service pods that are currently deployed to our cluster. $ kubectl get po | grep world world-v2-65y9g 1/1 Running 0 1h world-v2-d260q 1/1 Running 0 1h world-v2-z7ngo 1/1 Running 0 1h Everything looks good. Kicking off a subsequent pipeline job will deploy a world-v3version of the service, gradually shift traffic over, and then promote it to the current version when the deploy successfully completes. Conclusion In this post, we’ve shown a basic workflow incorporating linkerd, namerd, and Jenkins to progressively shift traffic from an old version to a new version of a service as the final step of a continuous deployment pipeline. We’ve shown how linkerd’s ability to do per-request routing actually lets us stage the new version of the service without needing a separate staging cluster, by using the l5d-dtab header to stitch the new service into the production topology just for that request. Finally, we’ve shown how percentage-based traffic shifting can be combined with a Jenkins input step to allow for human-in-the-loop verification of metrics as traffic moves from 0% to 100%. This was a fairly simple example, but we hope it demonstrates the basic pattern of using service mesh routing for continuous deployment and provides a template for customizing this workflow for your own organization. For help with dtabs or anything else about linkerd, feel free to stop by our linkerd community Slack, send a message to our mailing list, or contact us directly! Published at DZone with permission of Alex Leong , DZone MVB. See the original article here. Opinions expressed by DZone contributors are their own. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.linkDescription }}{{ parent.urlSource.name }}
https://dzone.com/articles/a-service-mesh-for-kubernetes-part-4-cd-via-traffic-shifting?fromrel=true
CC-MAIN-2019-18
refinedweb
2,909
57.2
On Mon, Mar 20, 2006 at 04:15:26PM +0100, Stefan Tibus wrote: > Hmm...ok, but it's quite unusual and not even consistent. Why can I > access a file which the listing says does not exist? To be consistent, > if "1" is named "sel" then "wmiir read /..../1" should fail. But it > is very useful to be able to access all areas/clients by number, so > it was kept. But then I think it should also be listed. > Currently, "sel" can be thought of being a temporary symlink (as > shorthand) to the selected area/client and I think it should be listed > as such then. "sel" always points to the selected object (its index can be still accessed but is not displayed if it is selected, because you can easily determine which index relates to "sel"). If "sel" is displayed, but no client exists, then it is simply a bug. "sel" and no index should be displayed if no client exists. But as far as I tested the behavior, it is not possible to have non-existing client namespace in /ws, except if you call wmiir from a tty in /tmp/ directly accessing the wmii socket (and in such a case the /ws/sel does not provide any clients inside). Regards, -- Anselm R. Garbe ><>< ><>< GPG key: 0D73F361Received on Tue Mar 21 2006 - 18:20:32 UTC This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:01:22 UTC
http://lists.suckless.org/wmii/0603/0850.html
CC-MAIN-2019-26
refinedweb
244
81.33
Note: Development of Ruby support ended with NetBeans IDE 6.9. However, the NetBeans Ruby community is strongly encouraged to take on development of NetBeans IDE Ruby and Rails support. See the NetBeans Ruby Community Wiki for information. Contributed by Brian Leonard, maintained by Chris Kutler June 2009 [Revision number: V6.7-1] In this tutorial, you use the Ruby support in the NetBeans IDE to create and run a simple database web application. By completing the steps in this tutorial, you learn how to do the following tasks: If you are new to the NetBeans IDE, you might want to complete the NetBeans IDE Ruby Quick Start Tutorial before you follow this tutorial so that you are more familiar with the UI. Contents To complete this tutorial, you need the following software and resources. You begin by creating a Ruby on Rails project. By default, the IDE creates the project. You must choose the built-in version of JRuby. root The IDE assumes these conditions by default. Click Next to configure the database access. Select the Specify Database Information Directly option, select the Database Adapter, and type the User Name and Password. Leave the Database Name set to rubyweblog_development. Click Finish to create the new project. The IDE creates the project directory with the same name as your project and opens the database.yml file in the editing area. Verify that the development section's adapter, database, user name, and password settings are correct for the development and test configurations, from the pop-up menu. migration file to add the posts table to the database. In the Projects window, right-click the rubyweblog project node, and choose Run/Debug Rake Task from the pop-up menu. Type db in the Filter text box to narrow the task list to just the db tasks, as shown in the following figure. Select db:create from the Matching Tasks list and click Finish. node for the migration class, which will have a name that begins with a date and time and ends with create_posts.rb.. This action updates the the database to include the posts table. The Output window indicates when the migration is complete, as shown in the following figure. Caution: Some users get an error that no rubyweblog_development database exists. It was not created by db:create despite a correct database.yml entry. The workaround is to create the rubyweblog_development database manually. You can use NetBeans IDE for this. In the Services window, right-click the node for your MySQL server and select Create Database. See Issue 167017.. Right-click the rubyweblog node and choose Run from the pop-up menu. This action starts the server and displays the following page in the browser.. Its name starts with a date and time and ends with field and drag the cursor to the position after the paragraph's ending </p> tag, then press Ctrl+Shift+Down Arrow to duplicate the lines. Edit the duplicated statements as shown in the following code. <h1>Editing post</h1> <% form_for(@post) do |f| %> <%= f.error_messages %> <p> <%= f.label :title %><br /> <%= f.text_field :title %> </p> <p> <%= f.label :body %> statements as shown in the following code. <h1>New post</h1> <% form_for(@post) do |f| %> <%= f.error_messages %> <p> <%= f.label :title %><br /> <%= f.text_field :title %> </p> <p> <%= f.label :body %>. Currently, users can add empty posts to the blog. Here you modify the application to prevent blank posts. First, you prepare the test database and write a unit test to verify that users cannot create a post unless it has a title and a body. Next you add code to the Post class to require that the users provide values for both the title and the body fields. Last, you run the unit test to verify that your modifications work as intended, and then you run the application. Caution: The db:create function does not work for some users. In this case, run the db:create:all function. See Issue 167017. Find and double-click the db:test:prepare entry. The IDE adds the Post table to your rubyweblog_test database. In the Projects window, expand Test Files > unit and double-click post_test.rb to open it in the editing area. Replace the contents of the file with the following code. require 'test_helper' class PostTest < ActiveSupport::TestCase def test_invalid_with_empty_attributes post = Post.new # An empty Post model should be invalid assert !post.valid? # The title field should have validation errors assert post.errors.invalid?(:title) # The body field should have validation errors assert post.errors.invalid?(:body) end end Right-click the rubyweblog project node and choose Test from the pop-up menu. The IDE runs all the project's unit tests and displays the output in the Ruby Test Results window, as shown in the following figure. Because the application allows empty posts, the unit test for the Post model fails. Next you modify the application to require values for the Text and Body columns. To retry your unit test to see if the changes create the desired effect, right-click the rubyweblog node and choose Test from the pop-up menu. The PostTest passes, but some of the PostController tests fail because of the validation changes that you made to the Posts model. You correct this problem in the next two steps. In the Ruby Test Results window, double-click the test_should_create_post node to open that test in the editing area. Replace post :create, :post => {} with the following code, which provides values for the title and the body. post :create, :post => { :title => "Nene", :body => "Nenes are Hawaiian Geese" } Scroll to the test_should_update_post method and change the put call to also pass in a title and a body, as shown in the following code. put :update, :id => posts(:one).id, :post => {:title => "Nene", :body => "Are rare birds." } To verify that the tests now pass, right-click in the editing area and choose Test File from the pop-up menu. The IDE runs the tests that are in the PostsControllerTest class and displays the output in the Ruby Test Results window. Return to the browser, click New post, and click Create. The application now reports that the title and body cannot be blank, as shown in the following figure..
http://netbeans.org/kb/69/ruby/rapid-ruby-weblog.html
crawl-003
refinedweb
1,040
67.04
Easy way to calculate d-prime with Python. In signal detection theory d-prime index is used as sensitivity index, a higher index indicates that the signal can be more readily detected. d-prime=0 is considered as pure guessing. d-prime=1 is considered as good measure of signal sensitivity/detectability. d-prime=2 is considered as awesome. Higher sensitivity rates are possible, but really rare in real life. hit rate H: proportion of YES trials to which subject responded YES = P("yes" | YES) false alarm rate F: proportion of NO trials to which subject responded YES = P("yes" | NO) The formula for d’ is as follows: d’ = z(H) – z(FA) where z(H) is z-score for hits and z(FA) is z-score for false alarms. Simple example of d-prime calculation: import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats # hit rates and false alarm rates hitP = 23/30 faP = 4/30 # z-scores hitZ = stats.norm.ppf(hitP) faZ = stats.norm.ppf(faP) # d-prime dPrime = hitZ-faZ print(dPrime) OUT: 1.8386849075184297 Extreme case with hit rate =0: IMPORTANT: hit rates and false alarm rates equal to 0 or 100 will give misleading values of d-prime and calculation should be adjusted by substructing extremely low values from these rates. This little trick will have almost no effect in normal cases. hitZ = stats.norm.ppf(0/30) faZ = stats.norm.ppf(22/30) print(hitZ-faZ) OUT: -inf
https://bratus.net/knowledgebase/d-prime-with-python/
CC-MAIN-2022-05
refinedweb
250
66.84
SDL_PushEvent (3) - Linux Man Pages SDL_PushEvent: Pushes an event onto the event queue NAMESDL_PushEvent - Pushes an event onto the event queue SYNOPSIS #include "SDL.h" int SDL_PushEvent(SDL_Event *event); DESCRIPTION The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push their own events onto it. event is a pointer to the event structure you wish to push onto the queue. - Note: Pushing device input events onto the queue doesn't modify the state of the device within SDL. RETURN VALUE Returns 0 on success or -1 if the event couldn't be pushed. EXAMPLES SEE ALSO SDL_PollEvent, SDL_PeepEvents, SDL_Event
https://www.systutorials.com/docs/linux/man/3-SDL_PushEvent/
CC-MAIN-2021-17
refinedweb
117
63.59
from __future__ import ... hack 2007-09-19Patrik Simons Re: from __future__ import ... hack Neil Schemenauer > I really wanted to use with statements in the .ptl files. Since > "from __future__ import with_statement" didn't work, I did this: I think this patch does the right thing. I'll test it for a while. If other people have success or failure, please shoot me an email. Neil === modified file 'quixote/ptl/ptl_compile.py' --- quixote/ptl/ptl_compile.py 2006-08-07 21:44:13 +0000 +++ quixote/ptl/ptl_compile.py 2007-10-01 22:53:14 +0000 @@ -59,12 +59,20 @@ 'quixote.html', [('TemplateIO', '_q_TemplateIO'), ('htmltext', '_q_htmltext')]) vars_imp = ast.From("__builtin__", [("vars", "_q_vars")]) - stmts = [ vars_imp, html_imp ] + ptl_imports = [ vars_imp, html_imp ] + stmts = [] for node in nodelist: if node[0] != token.ENDMARKER and node[0] != token.NEWLINE: self.com_append_stmt(stmts, node) - + # count __future__ statements + i = 0 + for stmt in stmts: + if isinstance(stmt, ast.From) and stmt.modname == '__future__': + i += 1 + else: + break + stmts[i:i] = ptl_imports return ast.Module(doc, ast.Stmt(stmts)) def funcdef(self, nodelist):
http://mail.mems-exchange.org/durusmail/quixote-users/5732/
crawl-001
refinedweb
171
63.25
IoU implementation in Keras What is IoU? IoU or Intersection over Union is a metric used to evaluate the accuracy of any trained model for a particular dataset. It is one of the common evaluation metrics used for semantic image segmentation. IoU is typically used for CNN object detectors which are basically algorithms that can have predicted bounding boxes for performance evaluation. IoU as the name suggests as the formula depiction as follows: IoU = (Intersection ) / (Union ) = ( Area of overlapped region) / ( Area of union region ) Why IoU is used? The expected output values as one-hot encoded are termed as y_true and the predicted softmax output values are termed as y_pred. Intersection = y_true * y_pred Union = y_true + y_pred – Intersection IoU is an excellent metric because, in most of the cases of class imbalance, high segmentation accuracy does not imply superior segmentation ability. There are chances that although the segmentation accuracy lies in the high range (~ 90%) but in reality, it has hardly segmented and detected any object. It accurately shows that those predicted bounding boxes that heavily overlap have higher scores than those bounding boxes with less overlap. More about IoU It lies between 0 and 1 (i.e. 0 and 100 %). IoU ∈ [0,1] If IoU is 0, then it means that there is no overlap area and it’s almost a garbage output. On the other hand, if IoU is 1, then it implies that it has a perfectly segmented output image. Although the exact match of x and y coordinates are difficult, there is a possibility to find a near accurate match. IoUmean is used for binary or multiclass segmentation. The following formula depicts IoUmean where IoUi is metric for each semantic class. IoUmean = (IoU1 + IoU2 + ………. + IoU)/N Algorithm for IoU implementation To implement Intersection over Union as a function in Keras, let’s first go over the following algorithm: - Return a single scalar absolute value product of y_true and y_pred as the intersection - Return a scalar value of region including y_true and y_pred but not the intersecting area as the union - Introduce a smoothening value to prevent division by zero error. - Calculate IoU by dividing Intersection and Union Implementation of IoU in Keras Following is the implementation of IoU in Keras with Python programming. I have taken reference from here. IoU is computed with respect to two segmentation masks using the NumPy library. import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import tensorflow as tf from keras import backend as K def IoU_coeff(y_true, y_pred): axes = (1,2) intersection = np.sum(np.abs(y_pred * y_true), axis=axes) mask = np.sum(np.abs(y_true), axis=axes) + np.sum(np.abs(y_pred), axis=axes) union = mask - intersection smooth = .001 iou = (intersection + smooth) / (union + smooth) return iou def mean_class(mask, metric): if drop_last: metric = metric[:,:-1] mask = mask[:,:-1] if mean_per_class: if naive: return np.mean(metric, axis=0) else: return (np.sum(metric * mask, axis=0) + smooth)/(np.sum(mask, axis=0) + .001) else: if naive: return np.mean(metric) else: class_count = np.sum(mask, axis=0) return np.mean(np.sum(metric * mask, axis=0)[class_count!=0]/(class_count[class_count!=0])) def metrics_np(y_true, y_pred, metric_name, metric_type='standard', drop_last = True, mean_per_class=False): soft = (metric_type == 'soft') naive = (metric_type == 'naive') num_classes = y_pred.shape[-1] drop_last = drop_last and num_classes>1 if not soft: if num_classes>1: y_pred = np.array([ np.argmax(y_pred, axis=-1)==i for i in range(num_classes) ]).transpose(1,2,3,0) y_true = np.array([ np.argmax(y_true, axis=-1)==i for i in range(num_classes) ]).transpose(1,2,3,0) else: y_pred = (y_pred > 0).astype(int) y_true = (y_true > 0).astype(int) iou=IoU_coeff(y_true, y_pred) metric = {'iou': iou}[metric_name] mask = np.not_equal(union, 0).astype(int) mean_class(mask, metric) def mean_iou(y_true, y_pred): return metrics_np(y_true, y_pred, metric_name='iou') def circle(xy=(0,0), r=4, factor=0.8): x0, y0 = xy max = factor * r**2 circle = np.minimum([1], np.maximum([0], r**2 - (x-x0)**2 - (y-y0)**2)/max) return circle fine_grid = np.meshgrid(np.arange(-7,7.1,0.05), np.arange(-7,7.1,0.05)) x,y = fine_grid fig, axes = plt.subplots(1,3, figsize = (13,4)) params = [((0,0), 4), ((2,0), 4, ), ((2,0), 2) ] y_true = circle(factor=0.01) for i in range(len(axes)): axes[i].scatter(0,0, c='g') axes[i].add_artist(plt.Circle((0, 0), 4.05, lw=2, edgecolor='b', facecolor=(0,0,0,0.3), zorder=1)) xy, r = params[i] axes[i].scatter(*xy, c='y') axes[i].add_artist(plt.Circle(xy, r, lw=2, ls='--', edgecolor='b', facecolor=(1,1,0,0.3), zorder=1)) smooth = 0.001 y_pred=circle(xy, r, 0.01) intersection = np.sum(np.logical_and(y_true, y_pred)) union = np.sum(np.logical_or(y_pred, y_true)) iou = np.mean((intersection)/union) axes[i].text(0,5, f'IoU={iou:1.2f}', ha='center') axes[i].set_axis_off() axes[i].set(aspect=1, xlim=(-5,6.1), ylim=(-5,6)) Output: As we can see from the output that the IoU metric is calculated based on the overlapping areas of the ground truth and predicted truth.
https://valueml.com/iou-implementation-in-keras/
CC-MAIN-2021-25
refinedweb
859
51.85
As a part of my academic project I need to parse a bunch of arbitrary sentences into a dependency graph. After a searching a lot I got the solution that I can use Malt Parser for parsing text with its pre trained grammer. I have downloaded pre-trained model (engmalt.linear-1.7.mco) from. BUt I don't know how to parse my sentences using this grammer file and malt parser (by the python interface for malt). I have downloaded latest version of malt parser (1.7.2) and moved it to '/usr/lib/' import nltk; parser =nltk.parse.malt.MaltParser() txt="This is a test sentence" parser.train_from_file('/home/rohith/malt-1.7.2/engmalt.linear-1.7.mco') parser.raw_parse(txt) Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> parser.raw_parse(txt) File "/usr/local/lib/python2.7/dist-packages/nltk-2.0b5-py2.7.egg/nltk/parse/malt.py", line 88, in raw_parse return self.parse(words, verbose) File "/usr/local/lib/python2.7/dist-packages/nltk-2.0b5-py2.7.egg/nltk/parse/malt.py", line 75, in parse return self.tagged_parse(taggedwords, verbose) File "/usr/local/lib/python2.7/dist-packages/nltk-2.0b5-py2.7.egg/nltk/parse/malt.py", line 122, in tagged_parse return DependencyGraph.load(output_file) File "/usr/local/lib/python2.7/dist-packages/nltk-2.0b5-py2.7.egg/nltk/parse/dependencygraph.py", line 121, in load return DependencyGraph(open(file).read()) IOError: [Errno 2] No such file or directory: '/tmp/malt_output.conll' Note that is answer is no longer working because of the updated version of the MaltParser API in NLTK since August 2015. This answer is kept for legacy sake. Please see this answers to get MaltParser working with NLTK: Disclaimer: This is not an eternal solutions. The answer in the above link (posted on Feb 2016) will work for now. But when MaltParser or NLTK API changes, it might also change the syntax to using MaltParser in NLTK. A couple problems with your setup: train_from_filemust be a file in CoNLL format, not a pre-trained model. For an mcofile, you pass it to the MaltParserconstructor using the mcoand working_directoryparameters. mcofile, so you'll have to tell java to use more heap space with the -Xmxparameter. Unfortunately this wasn't possible with the existing code so I just checked in a change to allow an additional constructor parameters for java args. See here. So here's what you need to do: First, get the latest NLTK revision: git clone (NOTE: If you can't use the git version of NLTK, then you'll have to update the file malt.py manually or copy it from here to have your own version.) Second, rename the jar file to malt.jar, which is what NLTK expects: cd /usr/lib/ ln -s maltparser-1.7.2.jar malt.jar Then add an environment variable pointing to malt parser: export MALTPARSERHOME="/Users/dhg/Downloads/maltparser-1.7.2" Finally, load and use malt parser in python: >>> import nltk >>> parser = nltk.parse.malt.MaltParser(>> graph = parser.raw_parse(txt) >>> graph.tree().pprint() '(This (sentence is a test))'
https://codedump.io/share/gNQdBcnwnQnc/1/how-to-use-malt-parser-in-python-nltk
CC-MAIN-2018-09
refinedweb
527
51.24
I have 3 files and want to print lines that are a combination of the same line from each file. The files can have any number of lines. How can I iterate over three files in parallel? protocol.txt http ftp sftp yahoo gmail 23 45 56 Protocol 'http' for website 'facebook' with port '23' Protocol 'ftp' for website 'yahoo' with port '45' Protocol 'sftp' for website 'gmail' with port '56' from time import sleep with open ("C:/Users/Desktop/3 files read/protocol.txt", 'r') as test: for line in test: with open ("C:/Users/Desktop/3 files read/website.txt", 'r') as test1: for line1 in test1: with open ("C:/Users/Desktop/3 files read/port.txt", 'r') as test2: for line2 in test2: print "Protocol (%s) for website (%s) with port (%d)" % line, line1, line2 Here is my version: import os.path directory = "C:/Users/balu/Desktop/3 files read" with open(os.path.join(directory, "protocol.txt"), 'r') as f1,\ open(os.path.join(directory, "website.txt"), 'r') as f2,\ open(os.path.join(directory, "port.txt"), 'r') as f3: for l1, l2, l3 in zip(f1, f2, f3): print "Protocol %s for website %s with port %d" % (l1.rstrip(), l2.rstrip(), int(l3)) I used the directory variable to simplify the code. Notice that I joined the elements using os.path.join(), which is safer than just putting a directory separator there. Using zip(), we iterate through the three file objects. Using zip() means that the loop will exit on the file with the fewer lines, if they are uneven. If you cannot guarantee that they all have the same number of lines, then you might need to put an extra check in there. By the way, at least some of this information is in the etc/services file.
https://codedump.io/share/KmVWOcwiuVoI/1/how-to-pick-each-line-from-3-files-in-parllel-and-print-in-single-line-using-python
CC-MAIN-2017-09
refinedweb
304
73.68
Hi!On Thu, Feb 20, 2003 at 10:30:37PM +0100, Oliver Graf wrote:> The problem: a multi device usb card reader is correctly detected with> its four subdevices with kernel 2.4.19(-acX). But any patch after this> fails to detect the subdevices.> > Verbose output with 2.4.19-ac4 shows:> usb-storage: GetMaxLUN command result is 1, data is 3> > 2.4.21-pre4 gives:> usb-storage: GetMaxLUN command result is -32, data is 128> usb-storage: clearing endpoint halt for pipe 0x80000880> > I tried to find the parts that changed between the version, but it seems> not to be rooted in usb-storage.> > The call to usb_control_msg seems to timeout with the newer kernel> (just a wild guess!).It is a timeout:usb-storage: New GUID 04831307fffe9ffffffffe97usb-uhci.c: interrupt, status 2, frame# 1765usb_control/bulk_msg: timeoutusb-storage: GetMaxLUN command result is -110, data is 128> Finally I did a desparate modification: I return 3 from> usb_stor_Bulk_max_lun just before the endpoint is cleared. This got my> card reader up and running again, but it's very very dirty und certainly> breaks other usb storage devices (I don't own).A patch which defines a new unusual_dev is appended. But it's stilldirty, cause it sets max_lun to 3 for this device. It should be seen asa workaround not as something that should go into the kernel.If someone more elaborate needs more debug output to find the realproblem, feel free to contact me.Regards, Oliver.--- linux-2.4.21-pre4/drivers/usb/storage/transport.h.orig 2003-02-25 07:49:43.000000000 +0100+++ linux-2.4.21-pre4/drivers/usb/storage/transport.h 2003-02-26 09:04:34.000000000 +0100@@ -75,6 +75,8 @@ #define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */ #endif +#define US_PR_TEV6IN1 0xf4+ /* * Bulk only data structures */--- linux-2.4.21-pre4/drivers/usb/storage/unusual_devs.h.orig 2003-02-25 07:51:12.000000000 +0100+++ linux-2.4.21-pre4/drivers/usb/storage/unusual_devs.h 2003-02-26 09:04:34.000000000 +0100@@ -90,6 +90,12 @@ "Nex II Digital", US_SC_SCSI, US_PR_BULK, NULL, US_FL_START_STOP), +/* Hack for the Tevion Card Reader 6in1 by Oliver Graf <ograf@rz-online.net> */+UNUSUAL_DEV( 0x0483, 0x1307, 0x0000, 0x9999,+ "Tevion",+ "Card Reader 6in1",+ US_SC_SCSI, US_PR_TEV6IN1, NULL, 0),+ /* Reported by Paul Stewart <stewart@wetlogic.net> * This entry is needed because the device reports Sub=ff */ UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001,--- linux-2.4.21-pre4/drivers/usb/storage/usb.c.orig 2003-02-25 07:50:12.000000000 +0100+++ linux-2.4.21-pre4/drivers/usb/storage/usb.c 2003-02-26 09:04:33.000000000 +0100@@ -849,6 +849,13 @@ ss->max_lun = usb_stor_Bulk_max_lun(ss); break; + case US_PR_TEV6IN1:+ ss->transport_name = "Bulk";+ ss->transport = usb_stor_Bulk_transport;+ ss->transport_reset = usb_stor_Bulk_reset;+ ss->max_lun = 3;+ break;+ #ifdef CONFIG_USB_STORAGE_HP8200e case US_PR_SCM_ATAPI: ss->transport_name = "SCM/ATAPI";
https://lkml.org/lkml/2003/2/26/28
CC-MAIN-2017-22
refinedweb
468
50.53
Back to index A 2 dimensional vector class, used as a helper class for implementing turtle graphics. May be useful for turtle graphics programs also. Derived from tuple, so a vector is a tuple! Provides (for a, b vectors, k number): a+b vector addition a-b vector subtraction a*b inner product k*a and a*k multiplication with scalar |a| absolute value of a a.rotate(angle) rotation Definition at line 236 of file turtle.py. Definition at line 274 of file turtle.py. 00274 00275 def __getnewargs__(self): return (self[0], self[1]) rotate self counterclockwise by angle Definition at line 267 of file turtle.py.
https://sourcecodebrowser.com/python3.2/3.2.2/classturtle_1_1_vec2_d.html
CC-MAIN-2017-51
refinedweb
109
57.57
Board index » C Language All times are UTC I suggest you #define NOP to zero and use that instead. However, note that in both cases the compiler may generate a warning such as "warning: statement with no effect". Ian Collier > > while(ready_to_go() != TRUE) > > NULL; /* wait until ready */ > Ugh! Don't we already have enough confusion about what NULL means? ;-) > I suggest you #define NOP to zero and use that instead. > However, note that in both cases the compiler may generate a warning such as > "warning: statement with no effect".! */ ****************************************************************** Transarc Corporation The Gulf Tower, 707 Grant Street Pittsburgh, PA 15219 (412) 338-4442 > while(ready_to_go() != TRUE) > ; /* wait until ready */ while ( !ready_to_go() ) continue; The comparison to TRUE is odious, and the continue keyword makes it obvious what's going on. -- #include <standard.disclaimer> _ Kevin D Quitt 91351-4454 96.37% of all statistics are made up >> while(ready_to_go() != TRUE) >> NULL; /* wait until ready */ >Ugh! Don't we already have enough confusion about what NULL means? ;-) Also it's really bad style to compare things to TRUE, since in C by convention anything nonzero is true, but x != TRUE will be false if eg. x = 2 or x = -1. >However, note that in both cases the compiler may generate a warning such as >"warning: statement with no effect". This should get past even the fussiest compilers without a warning, I think. Does anyone know of a compiler that would give a warning for the above code? -- Please correct me if I'm wrong (ooo, boy ... I'm opening myself up here), but isn't that a bit shaky? FALSE is pretty universally considered to be '0', but I've seen TRUE defined as everything from '1' to '!FALSE'. Moving from one compiler to another could cause problems. Besides, I saw plenty of examples in the book that went like: while(!fReadyToGo()) NULL; But, anyway ... > > I suggest you #define NOP to zero and use that instead. > > However, note that in both cases the compiler may generate a > warning such as > "warning: statement with no effect". A way around that would be to #define NOP as opposed to #define NOP 0 That would still work, _and_ avoid the compiler warning. However, things would get crazy if you forget the ';' after. -Scotty --------------------------------------------------------------------- Scott Walter | "I'm sorra, sir ... I kinna fit Gateway Administrator | anah muhr on th' floppy! Ye MinnTelligence On-Line (MOLe) | jes' kinna mess w' th' laws o' --------------------------------------------------------------------- "It's not a bug ... nor a feature ... it's an ENHANCEMENT!" * Origin: (1:3821/6) > >Why not just: > > while(ready_to_go() != TRUE) > > ; /* wait until ready */ > Why not: > while ( !ready_to_go() ) > continue; > The comparison to TRUE is odious, and the continue keyword makes it > obvious what's going on. There does seem to be a bit of confusion about what "Writing Solid Code" says on the topic. From many of the posts, it sounds as if WSC comes out and staunchly declares that there is One True Null Statement Workaround or that a specific compiler warning must produce a specific error message. WSC doesn't say either of those things. What "Writing Solid Code" does say is that to catch bugs more easily, programmers should enable every optional compiler warning that they have available. WSC does not promote specific warnings or warning messages; it merely urges programmers to use the warnings they have, and to be proactive about asking compiler and lint vendors for new warnings that would help in writing bug-free code. I think this is clear from Jim Van Zandt's original post: | I've been reading Steve Maguire's new book -- it's _great_. | He suggests programmers complain to their compiler suppliers | about inadequate warnings. Of course, reaching a consensus first would | help. Can we agree on what we would like? certainly not going to claim that NULL is the ideal way to silence the null statement warning, but then few workarounds to compiler warnings are ideal. I would gladly trade the NULL method for Jim Mann's "semicolon on its own line" method. Whether NULL is better or worse than Kevin D Quitt's "continue" method above, I'm not sure. I like NULL because it makes the "null-ness" explicit and hard to miss. I like "continue" because it feels less like a trick. Neither solution is appealing, but until Jim Mann's suggestion is implemented in a compiler that runs on my system, I'd rather use NULL (or continue, or any other less-than-ideal solution) than go without the warning. Besides, I can always write code without using null statements if I wish to cast aside the entire mess.... Anybody who has read WSC knows that I consistently trade a bit of size, speed, or readabilty for improved error detection or code robustness. I do it for the same reason I gladly accept the extra hassles, weight, and cost of seatbelts, airbags, and reinforced sidings in my car. In an ideal world I wouldn't need all that extra stuff, but in the real world I believe the tradeoffs make sense. - Steve ---------- or: microsoft!storm!stephenm Seattle WA, 98103 > > > while(ready_to_go() != TRUE) > > > NULL; /* wait until ready */ > Why not just: >! */ while(ready_to_go() != TRUE) { } The two-token empty compound is easier to see when scanning quickly than the semicolon. The semicolon-as-null was, IMO, a blemish on C. In C++, of course, it's required in the language for the for( ; ; ) statement. -- (This man's opinions are his own.) From mole-end Mark Terribile No arguments here, Steve. And, good job! The book _is_ excellent (I embarassingly admit I saw my own _former_ style in many chapters ;) |> > > while(ready_to_go() != TRUE) |> > > NULL; /* wait until ready */ | |> > while(ready_to_go() != TRUE) |> > ; /* wait until ready */ |> while ( !ready_to_go() ) |> continue; |I've just finished reading this thread and, as the author of "Writing |Solid Code," I'm pleased to see that people are talking about optional |compiler warnings. [ ... ] flabbergasted. Call me an animal or anything, but when I see something like the following: while (<condition>) <some_pacifier_for the compiler>; I get itchy feelings, because the empty statement is a perfectly legal statement, and because so, I just _want_ to see an empty statement, I don't want any compiler whining about it, I don't _want_ to pacify a compiler; the thing has to pacify me, by compiling my correct code correctly; (I know I'm rude here.) When I see something like: while (<condition>) NULL; deep in the back of my brains I see things like: while (<condition>) ((void*)0); or other horrible constructs and it gives me the shivers. BTW, if I would have been a compiler (;-) I would have whined about this construct, because I just would've detected a referential transparent, i.e. no side effects, expression. And if someone reasons `but this is more readable for the human being' I often recochet it as (and I know I'm awfully rude here): `Yeah, fine, and I find curly brackets hard to find and hard to read too, and do you want me to do things like `#define begin {' then, just to `add' (and mind the quotes here) readability?' And if somebody else tells me that this is bad programming style, I usually throw a fit by saying: `yeah fine, but do you want a compiler to whine to you, when you use an occasional `goto' statement, like: `foo.c: warning 42: you {*filter*}, {*filter*}, still love BASIC heh? Because most of the time this is considered bad programming style too.' I think (and this is all IMVHO of course) that a much better approach would be, to feed the C sources to some sort of `indent' or functionally equivalent program and tell the compiler about its configuration setup. Things like: while (<condition>); bar(); would result in a warning like: foo.c: warning 42: bar() is supposedly in the loop but it aint, while: while (<condition>) ; bar(); would make the compiler tell me what I want it to tell me: nothing. Another (infamous) example is: if (<lvalue>= <rvalue>) <statement>; I would love to have a compiler that I could tell: `hey silly thing, when I mean ` == ', I mean ` == ', i.e. I add spaces around the equality operator, and when I mean `= ', I mean `= ', i.e. I just append a space after any assignment operator. Got it?' (I know I'm more than rude here, but I'm just talking to my hypothetical compiler now ;-) And I know that adding a couple of more brackets would solve this exquisite little compiler inconvenience too, but I'm not programming LISP you know. Why should I add more brackets when _I_ know what I'm doing and the compiler does not? A lot of mathematicians know that a/b*c usually means a/(b*c), why doesn't the compiler whine about that? So, when I do things similar to the example above, I don't want any, in my humble opinion, spurious warnings, but when I do things I didn't tell the compiler about, being inconsistent to my own programming style, the thing can warn its head off to me. Maybe the following question explains why I feel flabbergasted: why do people praise the terseness of the C language, while in the mean time they come up with the most horrible constructs to get rid of this same terseness? I know I was very rude in my follow-up, but I don't want to be as rude by advising those people to program in another language. And please allow me to say this: I had no intention at all to be rude to any of the authors of the articles previous to this one, but I still feel flabbergasted about this topic. Call me an animal ... kind regards, --------------------------------------------------------------------------- Oh my gawd, I had your plastic, like and I didn't know? That's gross! -- Kelly Scott (always hunting for outfits) (while,) ('(',) ... (')',)(';',)(identifier,"bar")... Thus, to the compiler, both are the same thing, since by the time the information reaches the parser, all the comments, whitespace, and everything else is removed. If you wish to understand exactly how the blasted things called compilers are constructued, the first couple of chapters of Aho, Sethi, Ulmann _Compilers, second edition_ serves as a good overview. Although I think it is one of the sillier "features" in C which has the equality test and assignment looking so much the same. As for the algebraic order, this is because * and / have the same precidence, just as + and - do. This is a common convention. Personally, I prefer prefix (Lisp) or postfix (HP Calculator/postscript) arithmetic notation, because operation order doesn't matter. -- It is a tale, told by an idiot, full of sound and fury, .signifying nothing. I'm not paranoid. A paranoid only thinks that the world is out to get him. P. Hilfinger (Nicholas C. Weaver), responding to Jos Horsmeier writes (Weaver: ">"; Horsmeier: "> }") > Unfortnatly, this is impossible to do. The first step of the > compilers, lexical analysis, strips everything to a stream of tokens, while > removing the comments. .... Thus, to the compiler, both are the same > thing, since by the time the information reaches the parser, all > the comments, whitespace, and everything else is removed. |>>Why not just: |>> |>> while(ready_to_go() != TRUE) |>> ; /* wait until ready */ |>> |> |>Why not: |> |> while ( !ready_to_go() ) |> continue; |> |>The comparison to TRUE is odious, and the continue keyword makes it |>obvious what's going on. |> Given that this may well trigger a compiler's warnings, why not go for the simplest way to express it: boolean_t is_ready_to_go; do { is_ready_to_go = ready_to_go(); } while (!is_ready_to_go); This has all the semantics you're looking for, and while it introduces a variable, any 1/2 decent compiler will generate the same code. This also follows the principal of not using side-effect generating functions inside of conditions. You may not follow this religion, but there is a great deal of logic behind it. ------------------------------------------------------------------------ I'm saying this, not Digital. Don't hold them responsibile for it! Michael J. Grier Digital Equipment Corporation Stow, Mass, USA Mailstop OGO1-1/E16 > while ((*pbTo++ = *pbFrom++) != '\0') > NULL; while ((*pbTo++ = *pbFrom++) != '\0') ; (where I have put the ; its own line to show that I meant it), but which did NOT also issue a warning for #include <stdio.h> ... because the EXPRESSION STATEMENT "0;" or "(void*)0;" HAS NO EFFECT... then I would start looking for another compiler. An expression statement with no effect is much more likely to be a bug than a null statement in a place where null statements are commonly used. -- Mark Brader "C takes the point of view SoftQuad Inc., Toronto that the programmer is always right" This article is in the public domain. But undefined behavior in turn is simply behavior that the committee members have agreed to not agree upon. If they agree upon the behavior the behavior *would* be defined. I'm not sure, but I think the first definition would be completely removed byu the preprocessor (on *nix systems at least) and the statement would show up as empty (no effect). I haven't tested this of course - I'm doing what everyone else does and assume that they know their programming tools :-( -- =========================================================================== "Bad planning on your part does not constitue an emergency on mine." - Please attribute this quote. Thanx. 1. Compiler warnings when "Generating Code" 2. False C4702 warnings for "unreachable code" 3. Simple Code Produce "INTERNAL COMPILER ERROR" 4. Writing Solid Code & Code Complete 5. NetworkStream.Write writes "sometimes" 6. "Useless keyword..." warning 7. Q:warning "defined but not used" 8. "Noalias" warning and questions 9. lint warning "function actually returns double" 10. disable "first-chance exception.." warnings 11. "loss of precision" warnings 12. "warning C4786"...Problem -- Please help
http://computer-programming-forum.com/47-c-language/b6d035425c91db73.htm
CC-MAIN-2018-47
refinedweb
2,284
72.56
.Net framework is new platform for developers. It is a set of technologies which enables a robust and secure platform for developer so that they can build stunning & secure applications. It gives a language neutral platform so that developer should not be worried for his/her favorite language. If you knows C++, Java, VB you can enjoy the same experience with .Net Framework and if you don't know anything .Net welcomes you from the bottom of the heart. Presently it supports 22 languages and C# or C sharp & VB.Net is most favorite choice of .Net developers. You can build different types of applications such as windows, web, mobile & remoting applications. You can build web services also. Net framework is known as Managed Code. .Net framework is divided in two parts - CLR - Common Language Runtime - BCL - Base Class Libraries CLR: .Net Framework is based on CLR or you can say it is the core part of .framework. It have lots of features such as Memory Management, code execution, code access security, code verifications and many more. CLR is the foundation of everything. It directly interacts with OS. If you are a java programmer then you can compare CLR with JVM (Java Virtual Machine). BCL: Base Class Library contains classes for common functionality such as Data Connection, string operation, File handling etc. Microsoft introduces a set of library classes to expose the common functionality such as System.Data, system.io, system.security, system.math etc. You must know the namespace of each class before using. .Net introduced few common namespace which are specific to a particular application such as - To Building a Web Page - System.Web.UI - To Build a WCF application - System.Service.Model - To Build a Web Service - System.Web.Services - To Build a Win Form - System.Web.WinForms - To Build a windows Service - System.ServiceProcess Next: .Net Component Related Article: What is New Feature of .Net Framework 4
http://www.codinghub.net/2011/11/tutorial-what-is-net-framework.html
CC-MAIN-2015-06
refinedweb
321
60.01
import "go.dedis.ch/kyber/group/edwards25519" Package edwards25519 provides an optimized Go implementation of a Twisted Edwards curve that is isomorphic to Curve25519. For details see:. This code is based on Adam Langley's Go port of the public domain, "ref10" implementation of the ed25519 signing scheme in C from SUPERCOP. It was generalized and extended to support full kyber.Group arithmetic by the DEDIS lab at Yale and EPFL. Due to the field element and group arithmetic optimizations described in the Ed25519 paper, this implementation generally performs extremely well, typically comparable to native C implementations. The tradeoff is that this code is completely specialized to a single curve. const.go curve.go fe.go ge.go ge_mult_vartime.go point.go point_vartime.go scalar.go suite.go Curve represents the Ed25519 group. There are no parameters and no initialization is required because it supports only this one specific curve. NewKey returns a formatted Ed25519 key (avoiding subgroup attack by requiring it to be a multiple of 8). NewKey implements the kyber/util/key.Generator interface. NewKeyAndSeed returns a formatted Ed25519 key (avoid subgroup attack by requiring it to be a multiple of 8). It also returns the seed and the input used to generate the key. NewKeyAndSeedWithInput returns a formatted Ed25519 key (avoid subgroup attack by requiring it to be a multiple of 8). It also returns the input and the digest used to generate the key. Point creates a new Point on the Ed25519 curve. PointLen returns 32, the size in bytes of an encoded Point on the Ed25519 curve. Scalar creates a new Scalar for the prime-order subgroup of the Ed25519 curve. The scalars in this package implement kyber.Scalar's SetBytes method, interpreting the bytes as a little-endian integer, in order to remain compatible with other Ed25519 implementations, and with the standard implementation of the EdDSA signature. ScalarLen returns 32, the size in bytes of an encoded Scalar for the Ed25519 curve. Return the name of the curve, "Ed25519". SuiteEd25519 implements some basic functionalities such as Group, HashFactory, and XOFFactory. func NewBlakeSHA256Ed25519() *SuiteEd25519 NewBlakeSHA256Ed25519 returns a cipher suite based on package go.dedis.ch/kyber/v3/xof/blake2xb, SHA-256, and the Ed25519 curve. It produces cryptographically random numbers via package crypto/rand. func NewBlakeSHA256Ed25519WithRand(r cipher.Stream) *SuiteEd25519 NewBlakeSHA256Ed25519WithRand returns a cipher suite based on package go.dedis.ch/kyber/v3/xof/blake2xb, SHA-256, and the Ed25519 curve. It produces cryptographically random numbers via the provided stream r. func (s *SuiteEd25519) Hash() hash.Hash Hash returns a newly instanciated sha256 hash function. func (s *SuiteEd25519) New(t reflect.Type) interface{} New implements the kyber.Encoding interface func (s *SuiteEd25519) RandomStream() cipher.Stream RandomStream returns a cipher.Stream that returns a key stream from crypto/rand. func (s *SuiteEd25519) Read(r io.Reader, objs ...interface{}) error func (s *SuiteEd25519) Write(w io.Writer, objs ...interface{}) error func (s *SuiteEd25519) XOF(key []byte) kyber.XOF XOF returns an XOF which is implemented via the Blake2b hash. Package edwards25519 imports 17 packages (graph) and is imported by 1 packages. Updated 2020-08-26. Refresh now. Tools for package owners.
https://godoc.org/go.dedis.ch/kyber/group/edwards25519
CC-MAIN-2020-40
refinedweb
524
51.95
5.10. Networks with Parallel Concatenations (GoogLeNet)¶ During the ImageNet Challenge in 2014, a new architecture emerged that outperformed the rest. Szegedy et al., 2014 proposed a structure that combined the strengths of the NiN and repeated blocks paradigms. At its heart was the rather pragmatic answer to the question as to which size of convolution is ideal for processing. After all, we have a smorgasbord of choices, \(1 \times 1\) or \(3 \times 3\), \(5 \times 5\) or even larger. And it isn’t always clear which one is the best. As it turns out, the answer is that a combination of all the above works best. Over the next few years, researchers made several improvements to GoogLeNet. In this section, we will introduce the first version of this model series in a slightly simplified form - we omit the peculiarities that were added to stabilize training, due to the availability of better training algorithms. 5.10.1. Inception Blocks¶ The basic convolutional block in GoogLeNet is called an Inception block, named after the movie of the same name. This basic block is more complex in structure than the NiN block described in the previous section. Fig. 5.13 Structure of the Inception block. As can be seen in the figure above, there are four parallel paths in the Inception block. The first three paths use convolutional layers with window sizes of \(1\times 1\), \(3\times 3\), and \(5\times 5\) to extract information from different spatial sizes. The middle two paths will perform a \(1\times 1\) convolution on the input to reduce the number of input channels, so as to reduce the model’s complexity. The fourth path uses the \(3\times 3\) maximum pooling layer, followed by the \(1\times 1\) convolutional layer, to change the number of channels. The four paths all use appropriate padding to give the input and output the same height and width. Finally, we concatenate the output of each path on the channel dimension and input it to the next layer. The customizable parameters of the Inception block are the number of output channels per layer, which can be used to control the model complexity. In [1]: import gluonbook as gb from mxnet import gluon, init, nd from mxnet.gluon import nn nd.concat(p1, p2, p3, p4, dim=1) To understand why this works as well as it). 5.10.2. GoogLeNet Model¶ GoogLeNet uses an initial long range feature convolution, that avoids a stack of fully connected layers at the end. The architecture is depicted below. Fig. 5.14 Full GoogLeNet Model Let’s build the network piece by piece. The first block uses a 64-channel 7×7 convolutional layer. In [2]: b1 = nn.Sequential() b1.add(nn.Conv2D(64, kernel_size=7, strides=2, padding=3, activation='relu'), nn.MaxPool2D(pool_size=3, strides=2, padding=1)) The second block uses two convolutional layers: first, a 64-channel \(1\times 1\) convolutional layer, then a \(3\times 3\) convolutional layer that triples the number of channels. This corresponds to the second path in the Inception block. In [3]: b2 = nn.Sequential() b2.add(nn.Conv2D(64, kernel_size=1), nn.Conv2D(192, kernel_size=3, padding=1), nn.MaxPool2D(pool_size=3, strides=2, padding=1)) The third block. In [4]:. In [5]:. In [6]:. In [7]: X = nd.random.uniform(shape=) 5.10.3. Data Acquisition and Training¶ As before, we train our model using the Fashion-MNIST dataset. We transform it to \(96 \times 96\) pixel resolution before invoking the training procedure. In [8]: 2.1664, train acc 0.191, test acc 0.484, time 79.6 sec epoch 2, loss 0.8236, train acc 0.683, test acc 0.815, time 70.1 sec epoch 3, loss 0.4878, train acc 0.819, test acc 0.847, time 70.1 sec epoch 4, loss 0.3903, train acc 0.853, test acc 0.861, time 70.1 sec epoch 5, loss 0.3421, train acc 0.871, test acc 0.882, time 70.1 sec 5.10 data set. - GoogLeNet, as well as its succeeding versions, was one of the most efficient models on ImageNet, providing similar test accuracy with lower computational complexity. 5.10.5. Problems¶ - There are several iterations of GoogLeNet. Try to implement and run them. Some of them include the following: - Add a batch normalization layer, as described later in this chapter [2]. - Make adjustments to the Inception block [3]. - Use “label smoothing” for model regularization [3]. - Include it in the residual connection, as described later in this chapter ? 5.10.6. References¶ [1] Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., & Anguelov, D. & Rabinovich, A. (2015). Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 1-9). [2] Ioffe, S., & Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167. [3] Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., & Wojna, Z. (2016). Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 2818-2826). [4] Szegedy, C., Ioffe, S., Vanhoucke, V., & Alemi, A. A. (2017, February). Inception-v4, inception-resnet and the impact of residual connections on learning. In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 4, p. 12).
http://gluon.ai/chapter_convolutional-neural-networks/googlenet.html
CC-MAIN-2019-04
refinedweb
896
69.48
Calling C++ code from C simply requires a connecting interface. As part of that interface you pass around the this pointer, which in the C code is usually a void* (though I guess you could typedef for different classes). The C api mimics the class api with the first argument to each function being "this". extern "C" { char *func( void* this, ...) { return (myClass*)this->func(...).c_str(); } } Certainly basic logging for C can be achieved in this way if that is your goal and it should require very few shim functions. ----- Original Message ----- From: "Shuvalov, Andrew V" <Andrew.Shuvalov@gs.com> To: "'Log4CXX User'" <log4cxx-user@logging.apache.org> Sent: Friday, May 28, 2004 6:23 AM Subject: RE: Virtual LoggingEvent Hi Michael, The idea is that I need to provide NDC functionality in pure C code, so the C++ implementation in the ndc.cpp may not be used. The connection point between custom NDC and the rest of the library is only one - getNDC() in the Logging event. So I want it to go and execute my C code from it. In general, the ultimate task is to have some logging facilities that can be transparently used in C and C++, but I don't see an easy way to do that. Most likely C code will keep its own logging, but at least I can share NDC. Does it really break anything? Andrew -----Original Message----- From: Michael CATANZARITI [mailto:mcatan@free.fr] Sent: Friday, May 28, 2004 7:36 AM To: Log4CXX User Subject: Re: Virtual LoggingEvent Andrew, Yes it will be done in the next version but I keep thinking overriding LoggingEvent is not a good solution. For example, the SocketAppender will not work with a custom LoggingEvent. Moreover, if you override is no more compatible with the XML format of an event (see XMLLayout), the interoperability with Log4j Chainsaw will be broken. May be can you, explain what is your exact requirement about NDC, and why the implemented proposed in log4cxx does not suit ? Michaël Selon "Shuvalov, Andrew V" <Andrew.Shuvalov@gs.com>: > > > So can we do that? > > I mean, change spi/loggingevent.h to have: > > virtual ~LoggingEvent(); > > and > > virtual const String& getNDC() const; > > I'll be totally happy :-))) > Thanks! > > > > > Hi, > > > > I wonder if it makes sense to make the LoggingEvent class virtual. > > I'm > > overriding it, and everything is ok as long as I don't need to > > substitute a method or another. But it looks like I'd like to have > > this option. > > > > Explicitly, I want to be able to override the getNDC() method, > > because > > I want to substitute the NDC implementation from the package with my > > own implementation. I need this for better integration with C. I want > > some C libraries to use NDC and make it compatible with log4cxx. > > > > What do you think? > > Andrew > > > >
http://mail-archives.eu.apache.org/mod_mbox/logging-log4cxx-user/200405.mbox/%3C014301c444d3$5d88a140$a300000a@wirefu%3E
CC-MAIN-2019-35
refinedweb
471
64.91
This article assumes that you are familiar with what is in the following list (or have read Part 1 of this series on Salt in the December 2014 edition of Open Source For You). - Installing SaltStack - Setting up master and minion - Establishing a relationship between master and minion In this column, we will look at how to actually use Salt to do some basic configuration management. Basic Salt commands for documentation/help Salt provides a wide range of system level documentation on how to use any of its modules. salt * sys.doc (list all modules documentation for all minions) salt * sys.doc apache.fullversion (list module specific documentation for all minions) It offers a minion availability test, as follows: salt * test.ping (for all nodes) salt machine-name test.ping (for specific node) * is the target, which specifies all minions. You must specify the minion id/hostname if you want to target a specific minion. To install a package, type: salt * pkg.install dialog For user addition, type: salt * user.add osfy To query disk usage, type: salt myminion disk.percent myminion: ---------- /: 31% /boot: 25% /dev/shm: 0% /tmp: 29% /var/log: 8% Salt State Salt State is a component in SaltStack that holds the configuration data on the master, and which gets transferred to all minions, on demand. The collection of state files makes up the State Tree. The Salt file server must be set up first. So, edit the master configuration file /etc/salt/master and uncomment the following lines: file_roots: base: - /srv/salt The data will be stored in a simple serialisation format (YAML) in a master file server. YAML stands for YAML Aint Markup Language. We can set a different folder for the base in the master and also define separate folders under the base, depending on the environments that we support. For instance, if you have the dev, test and prod environments, then the directory structure might look like what is shown below: file_roots: base: - /srv/salt dev: - /srv/salt/dev test: - /srv/salt/test prod: - /srv/salt/prod We could keep common Salt States like user, group and sudo in the base structure, and other configurations, which might be specific to the environments, in their respective folders. A Salt State consists of identifiers, as well as state module and function declarations. It might also include function parameters. nginx: #Identifier pkg: #State Module - installed #State Function nginx: #Identifier pkg.installed #State Module and Function combined. /etc/nginx: file.directory: # State module and function - user:nginx #State function parameter The top file The top file contains the list of all the Salt States to be used. It maps the name with the SLS module that gets loaded on a certain minion via the state system. By default, it understands * as all minions. We can specify a set of minions or even a number of minions, using regular expressions or a grouping criterion, e.g., environment. The file will be within the folder that we mark as base. We could also keep a top file within each environment and refer these top files within the base top file. Lets prepare the SLS file to install the Nginx Web server. With the pkg module we can install packages using Salt. Create the nginx.sls file in the base folder as shown below. /srv/salt/nginx.sls: nginx: pkg: - installed If the top file were to use the above Nginx Salt State, then it would look like what follows: /srv/base/top.sls: base: *: - nginx Running the Salt State A Salt State can be run in two ways. - Salt Master could instruct the targeted minion to only run the selected module. The module is then downloaded, compiled and executed on the minion. Once completed, the minion will revert with a summary of all actions taken and all changes made. salt myminion state.sls nginx (Flow: nginx) - The master could instruct the targeted minion to run as state.highstate. When a minion executes a highstate call, it will download the top file and attempt to match the expressions within the top file. When it does match an expression, the modules listed for it will be downloaded, compiled and executed. Once completed, the minion will give a summary of all actions taken and all changes made. salt myminion state.highstate (Flow: top -> nginx -> top) The summary output looks like whats shown below: Summary -------------- Succeeded: 1 Failed: 0 -------------- Total: 1 Note: Instead of nginx.sls, we can also use nginx/init.sls, if we have other modules common to the Nginx module and if we want to call all or some of those modules within init. SLS namespace rules Salt has defined a few simple rules for .sls files. 1. The .sls is discarded (i.e., nginx.sls becomes nginx). 2. A file called init.sls in a sub-directory is referred to by the path of the directory. So, nginx/init.sls is referred to as nginx. 3. Sub-directories can be used for better organisation. a. Each sub-directory is represented by a dot. b. nginx/dev.sls is referred to as nginx.dev. 4. If both nginx.sls and nginx/init.sls happen to exist, nginx/init.sls will be ignored, and nginx.sls will be preferred over nginx/init.sls and read as nginx. To start a service, type: /srv/salt/nginx/init.sls: nginx: pkg: - installed service: - running - require: - pkg: nginx Now we have added a little more information about our preferences. - A check is done whether a package named Nginx is installed or not. If not, it will be installed. - If the package is installed, then a check is done to find out whether the Nginx service is running. If not, the service is started. For the service check to be done, the package installation is marked as a dependency. The word require, being a Requisite Statement, does just thatensuring that the pre-requisites are there. To add users and groups, type: nginx: pkg: - installed service: - running - enable: True - watch: - pkg: nginx - file: /etc/nginx/nginx.conf - user: nginx user.present: - uid: 151 - gid: 151 - home: /var/lib/nginx - shell: /bin/nologin - require: - group: nginx group.present: - gid: 151 - require: - pkg: nginx Watch and require We hope you noticed that we have used the watch word this time. The require word will make sure the user gets created after the group creation, which must happen only after the Nginx package is installed. The watch word checks for any changes to the watched states. The service state watcher will be activated in the following cases: - When the package is updated - When the configuration file is changed - If the user ID gets modified The service state watcher just restarts the service; so in this case, a change in the config file will also trigger a restart of the respective service. Users and groups User Nginx is created with: - userid and groupid 151 - Home folder /var/lib/nginx - No login shell - Requires a group called nginx Group Nginx is dependent on the package nginx being installed. Repository The Salt master could act as the repository for the Nginx configuration file. The file.managed module sends files to the minion and replaces the configuration file on the target system. /etc/nginx/nginx.conf: file.managed: - source: salt://nginx/files/nginx.conf - user: root - group: root - mode: 644 Source file The source file can be hosted either on the Salt master server or on a network accessible server. The file hosted on a network server (e.g., HTTP or FTP) requires the source_hash argument. We could also keep the data files along with init.sls but it is easier to maintain and manage these files if they are separated from the SLS configuration. If we do keep the data and configuration files within the same directory, the source statement and files could look like whats shown below: nginx/init.sls nginx/nginx.conf - source: salt://nginx/nginx.conf Debugging Once the rules in an SLS are ready, they should be tested to ensure they work properly. To invoke these rules, execute salt * state.highstate on the command line. If you get back only hostnames followed by a :, but no return, chances are that there is a problem with one or more of the SLS files. On the minion, use the command salt-call state.highstate -l debug to examine the output for errors. This should help to troubleshoot the issue. The minions can also be started in the foreground in debug mode: salt-minion -l debug. Connect With Us
http://opensourceforu.com/2015/04/use-salt-for-basic-configuration-management/
CC-MAIN-2017-26
refinedweb
1,428
65.83
Created on 2008-04-04 14:43 by jerome.chabod, last changed 2008-06-23 15:23 by draghuram. shutil generate a NameError (WindowsError) exception when moving a directory from an ext3 to a fat32 under linux To reproduce it: under linux, current path on an ext3 filesytem, try to enter following commands: mkdir toto #on an ext3 partition python import shutil shutil.move("toto", "/media/fat32/toto") # /media/fat32 is mounted on a fat32 filesystem You will produce following error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/shutil.py", line 196, in move copytree(src, dst, symlinks=True) File "/usr/lib/python2.5/shutil.py", line 132, in copytree except WindowsError: NameError: global name 'WindowsError' is not defined Tested on ubuntu Feisty and a newly installed Hardy-beta. This problem has been noticed as part of issue1545 and a patch with the fix has been proposed but has a small problem with it. Do you want to take a look? This is duplicate of 3134. I posted a patch there.
http://bugs.python.org/issue2549
crawl-002
refinedweb
180
64.2
In “Using Angular2 in Clojurescript” I showed how to get ClojureScript to run an Angular2 template. Basic hotswapping worked, but state was lost on each load. Tweaking the original demo allows for figwheel to swap in the template without losing client state. Here is a demo of hotswapping with state preservation: In this demo, we add three things to a list, then change the template that draws the list. The client state stays in the browser, while the template changes around it! Amazing! To get this working, follow the steps in the “Using Angular2 in Clojurescript” first post. Replace the env/dev/cljs/dev.cljs contents with this simpler reloader: (defn mount-component [] ((.. js/ng -platform -browser -bootstrap) (.-AppComponent (.-app js/window)))) (figwheel/watch-and-reload :websocket-url "ws://localhost:3449/figwheel-ws" :on-jsload mount-component) (defonce only-attach-listener-once (.addEventListener js/document "DOMContentLoaded" mount-component)) We now only re-mount the component on figwheel notification. The state is moved to an atom in the core namespace like so: (defn get-app [] (or (.-app js/window) (set! (.-app js/window) #js {}))) ;; keep state of the component in a defonce atom (defonce heroes (atom [])) (let [app (get-app) c (.Component (.-core js/ng) #js {:selector "my-app" :template (html [:div [:h1 " Demo"] [:div [:h2 "Hero List:"]] " - {{hero}} The site now will recompile and reload while preserving the state of the component. This pattern can be extended to allow certain state to be preserved while other state is reloaded. In this demo, the state in the #newHero field is not preserved, while the heroes list is. I don’t have a great story for using hiccups to generate the special angular tags like *ngFor , (click) , or (keyup.enter) . For this demo, I left that html as just a raw string.
http://colabug.com/861374.html
CC-MAIN-2017-47
refinedweb
300
57.06
Details - Type: New Feature - Status: Closed - Priority: Major - Resolution: Fixed - Affects Version/s: M4 - - Component/s: C++ Broker, C++ Client - Labels:None - Environment: Windows XP+ Description The recently added SSL support in the C++ side should be available to Windows as well. Not yet sure how much architectural work this may be. Activity - All - Work Log - History - Activity - Transitions Do you know when this feature will be available under windows ? For M5 release ? This feature is not currently scheduled for implementation, so which release it will appear in is unknown. This is in progress and nearly done; must be in 0.6 Why is this a blocking bug? It is a new feature - I don't see how a new feature could block a release. Patch for addition of SSL support on Windows. The major approach difference from the Linux/NSS mechanism is that on Windows Schannel (their SSL facility) the I/O is done by normal socket calls. The negotiation/token processing, as well as encrypt/decrypt operations, are function calls that are made with data to/from the socket. This is in contrast to the NSS way where there is a parallel set of SSL-enabled socket calls. Revised patch. At this point, the changes applied to the current trunk yield: - Windows <-> Windows, ok - Windows client -> Linux server, ok - Linux client -> Windows server, fail negotiation - certificate chain not trusted I assume the failure is more of a setup issue than a code correctness issue. I'd like to get interested people together for a review of the attached code. Naming: I think you should rename SslIoShim/ClientSslIoShim/ServerSslIoShim to reflect that these are actually all AsynchIO implementations: So maybe use names: SslAsynchIO/ClientSslAsynchIO etc. I like the implementation in SslProtocolFactory except separating the Client and Server IO is somewhat clunky. I really don't like the way that SslConnector works though, there's a lot of code just to put in place a few necessary interceptions. Also the Connectors were never intended to be inherited from just to implement an interface. I think this could be handled better by modifying TCPConnector to take an abstract factory that knows how to create AsynchIO/AsyncConnector objects that are relevant for the protocol. Then I'd say it'd be better to recast some of the logic in SslConnector as an implementation of AsynchConnector. Does that make sense? Of course this does mean a change in the protocol plugin API, but an improvement I think. Long term I'd like to eliminate the distinction between the ..Connector and ..ProtocolFactory plugins and be able to use just one for both client and server - this would likely be descended from the server code which already does both server and client ends. AsyncIOBufferBase::squish() this could be better named? And as you've added it, perhaps you could make the logic in AsynchIO::unread() use it? In the windows code: It is the general code convention that all system calls are explicitly called out by being explicitly in the global namespace, viz ::InitializeSecurityContext() to give the first example I came across. Personally I'd put both the Client "shim" and the Server "shim" code in the same implementation file (but that's mostly a my own preference) Re Andrew's comnments 21-Jan-2010: - I renamed the SslIoShim stuff to [Client|Server]SslAsynchIO as recommended; also moved to one file, SslAsynchIO. {h cpp} - I kind of like squish() as a name - it squishes the remaining bytes to the front. - I prefixed the windows API calls with :: - As we discussed on the phone with Gordon, the current SslConnector arrangement is better than just doing another copy-edit-drop of this code. There are already multiple variants of this code with slightly different features and fixes; another one is bad. When you get to the point where you want to actively work on a refactoring in this area, let me know and I'll do my best to help out. With that, code is committed to trunk r902318 This won't be done for M4.
https://issues.apache.org/jira/browse/QPID-1403
CC-MAIN-2016-50
refinedweb
679
60.14
Web Server Controls Web server controls provide a higher level of abstraction than HTML server controls because their object model matches closely with the .NET Framework, rather than matching with the requirements of HTML syntax. In the HTML source for your page, Web server controls are represented as XML tags rather than as HTML elements. But remember, the browser receives standard HTML in any case. Web server controls have a number of advanced features: Web server controls provide a rich object model that closely matches with the rest of the .NET Framework. Web server controls have built-in automatic browser detection capabilities. They can render their output HTML correctly for both uplevel and downlevel browsers. Some Web server controls have the capability to cause an immediate postback when users click, change, or select a value. Some Web server controls (such as the Calendar and AdRotator controls) provide richer functionality than is available with HTML controls. NOTE ASP.NET treats browsers as either uplevel or downlevel. Uplevel browsers support HTML 4.0 or later, the Microsoft Document Object Model (DOM), Cascading Style Sheets, and JavaScript 1.2 or later. Internet Explorer 4.0 or later is an example of an uplevel browser. Browsers with any lesser capabilities are considered to be down-level browsers. Web server controls are declared in HTML explicitly by prefixing the classname of the Web server control with asp: and of course including the. If you are using Visual Studio .NET, you can just drag and drop these controls on a Web Form using the Web Forms tab of the Visual Studio .NET Toolbox. Most of the Web server controls derive their functionality by inheriting from the WebControl class of the System.Web.UI.WebControls namespace. However, some Web server controls such as the Repeater and XML controls do not get their functionality from the WebControl class; they instead derive directly from the Control class of the System.Web.UI namespace. Table 3.1 lists some of the common properties that all Web server controls derive from the WebControl class. Table 3.1 Important Properties of the System.Web.UI.WebControls.WebControl Class Common Web Server Controls The following sections discuss some simple but commonly used controls. These controls have a small number of properties, and they are usually rendered as a single HTML element. The Label Control A Label control is used to display read-only information to the user. It is generally used to label other controls and to provide the user with any useful messages or statistics. It exposes its text content through the Text property. This property can be used to manipulate its text programmatically. The control is rendered as a <span> HTML element on the Web browser. The TextBox Control A TextBox control provides an area that the user can use to input text. Depending on how you set the properties of this Web server control, you can use it for single or multiline text input, or you can use it as a password box that masks the characters entered by the user with asterisks or bullets, depending on the browser. Thus, this server control can be rendered as three different types of HTML elements<input type="text">, <input type="password">, and <textarea>. Table 3.2 summarizes the important members of the TextBox class. Table 3.2 Important Members of the TextBox Class The Image Control The Image Web server control can display images from BMP, JPEG, PNG, and GIF files. The control is rendered as an <img> HTML element on the Web page. Table 3.3 summarizes the important properties of the Image class. Table 3.3 Important Members of the Image Class The CheckBox and RadioButton Controls A CheckBox control allows you to select one or more options from a group of options, and a group of RadioButton controls is used to select one out of several mutually exclusive options. The RadioButton controls that need to be set mutually exclusive should belong to the same group specified by the GroupName property. The check box and radio button Web server controls are rendered as <input type="checkbox"> and <input type="radio"> HTML elements on the Web page. The RadioButton class inherits from the CheckBox class, and both of them share the same members, except for the GroupName property available in the RadioButton class. Table 3.4 summarizes the important members of the CheckBox and RadioButton classes. Table 3.4 Important Members of the CheckBox and RadioButton Classes The Button, LinkButton, and ImageButton Controls There are three types of button Web server controls. Each of these controls is different in its appearance and is rendered differently on the Web page: ButtonThe Button control displays as a push button on the Web page and is rendered as an <input type="submit"> HTML element. LinkButtonThe LinkButton control displays as a hyperlink on the Web page and is rendered as an <a> HTML element. ImageButtonThe ImageButton control displays as an image button on the Web page and is rendered as an <input type="image"> HTML element. NOTE The LinkButton control works only if client-side scripting is enabled in the Web browser. All three of these controls post the form data to the Web server when they are clicked. Table 3.5 summarizes the important members that are applicable to the Button, LinkButton, and ImageButton classes. Table 3.5 Important Members of the Button, LinkButton, and ImageButton Classes All three button controls can behave in two different waysas a submit button or as a command button. By default, any type of button Web server control is a submit button. If you specify a command name via the CommandName property, the button controls also become a command button. A command button raises the Command event when it is clicked. The button passes the CommandName and CommandArgument encapsulated in a CommandEventArgs object to the event handlers. A command button is useful when you want to pass some event-related information to the event handler. Event Handling with Web Server Controls One key feature of many ASP.NET Web applications is the easy interactivity that they offer to the user. In most cases, handling events plays an important part in this interactivity. Although the user is working with the rendered HTML in his own browser, Web Server controls allow you to handle events with code that's executed on the server. Web server controls have a set of intrinsic events available to them. The name and number of these events depend on the type of the Web server control. By convention, all events in the .NET Framework pass two arguments to their event handlerthe object that raised the event and an object containing any event-specific information. Code on the server can't execute until the page is sent back to the server, which is known as postback. Some events are cached and are fired on the Web server at a later stage when the page is posted back as a result of a click event. Some Web server controls (for example, the DropDownList) have a property named AutoPostBack. When this property is set to True, it causes an immediate postback of the page when the value of the control is changed. Some advanced Web server controls such as the DataGrid control can also contain other controls such as a Button. DataGrid controls usually display dynamically generated data, and if each row of DataGrid contains a Button, you might end up having a variable number of Button controls. Writing an individual event handler for each Button control in this case is a very tedious process. To simplify event handling, controls such as DataGrid support bubbling of events in which all events raised at the level of child control are bubbled up to the container control, where the container control can raise a generic event in response to the child events. CAUTION For the most part, Web server control events are processed by server code. You can also use client code such as JScript to process Web server control events. To do so, you need to dynamically add the client code method name to the control. For example, the following code fragment attaches the someClientCode() client-side method to the onMouseOver event of the btnSubmit button. btnSubmit.Attributes.Add("onMouseOver", _ "someClientCode();") The List Controls The category of list controls consists of the DropDownList, ListBox, CheckBoxList, and RadioButtonList controls. These controls display a list of items from which the user can select. These controls inherit from the abstract base ListControl class. The class provides the basic properties, methods, and events common to all the list controls. Table 3.6 summarizes the important members of the ListControl class with which you should be familiar. Table 3.6 Important Members of the ListControl Class Although these controls inherit their basic functionality from the ListControl class, they display the list of items in different styles and support different selection modes. A DropDownList Web server control allows you to select only a single item from the drop-down list. The DropDownList Web server control is rendered as a <select> HTML element, and its items are added as <option> elements within the HTML <select> element. The default value of the SelectedIndex property is 0, which means that the first item is selected in the drop-down list. This overrides the default of the general ListControl class. A ListBox Web server control allows you to select single or multiple items from the list of items displayed in the list box. The ListBox Web server control is rendered as a <select> or <select multiple> HTML element, depending on whether single or multiple selections are allowed. The items are added as <option> elements within the HTML <select> element. The ListBox class adds two more properties to enable it to select multiple items: RowsThis property represents the number of rows to be displayed in the list box. The default value is 4. The value of this property must be between 1 and 2000. SelectionModeThis property indicates the mode of selection allowed in the list box. It can be one of the ListSelectionMode valuesMultiple or Single (default). The CheckBoxList and RadioButtonList Web server controls display lists of check boxes and radio buttons, respectively, where each check box or radio button represents a CheckBox or RadioButton Web server control. The CheckBoxList control allows you to select multiple check boxes in the list. The RadioButtonList control allows you to select only a single radio button from the list of radio buttons. CheckBoxList and RadioButtonList render each list item as <input type="checkbox"> and <input type="radio"> HTML elements, respectively. The list items are displayed in a table or without a table structure depending on the layout selected. NOTE The default value of the SelectedIndex property in a list control. CAUTION ListBox and CheckBoxList allow you to make multiple selections from the list controls. When these controls allow multiple selections, the SelectedIndex and SelectedItem properties return the index of the first selected item and the first selected item itself, respectively. You have to iterate through the Items collection and check that each item's Selected property is true to retrieve the items selected by the user. CAUTION The IsPostBack property can be used to ensure that code behind a Web Form only runs when the page is first loaded. IsPostBack is False when the page is first loaded and True whenever it is reloaded (for example, in response to the user clicking a command button). The PlaceHolder and Panel Controls A PlaceHolder Web server control allows you to hold an area on a Web page. The PlaceHolder control allows you to add controls dynamically in a Web page in the area reserved by the PlaceHolder control. This control inherits from the System.Web.UI.Control class and does not share the common properties shared by the Web server controls that inherit from the WebControl class. The control does not define any new properties, events, or methods. It does not render any HTML element for itself. A Panel Web server control acts as a container for other controls in the Web page. The Panel control can be used to organize controls in the Web page. It can be used to hide or show controls contained in the panel on the Web page. Controls can also be added programmatically to the panel control. The Panel Web server control is rendered as a <div> HTML element on the Web page. Table 3.7 summarizes the important members of the Panel class with which you should be familiar. Table 3.7 Important Members of the Panel Class The Panel control is especially useful when you want to create controls dynamically. To see how this works, follow these steps: Add a new Web Form to your Web Application. Place a TextBox control, a Button control, and a Panel control on the Web Form. Set the ID property of the TextBox control to txtCount. Set the ID property of the Button control to btnCreate. Set the ID property of the Panel control to pnlDynamic. Double-click the Button control. This will open the code view of the Web Form and display a blank event handler for the Button control's Click event. Add this code to the Click event: Click the Save button on the Visual Studio .NET toolbar to save the Web Form. Select Debug, Start to open the Web Form in a browser. Enter a numeral in the TextBox and click the Button control. The form will post back to the server. After a brief delay, the server will deliver the new page with the dynamic controls on it. Private Sub btnCreate_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles btnCreate.Click ' Parse the TextBox contents into an integer Dim intControls As Integer = _ Convert.ToInt32(txtCount.Text) ' Create that many TextBox controls Dim i As Integer Dim txt(intControls) As TextBox For i = 1 To intControls txt(i) = New TextBox() ' Set the id property of the textbox txt(i).ID = String.Format("DynamicBox{0}", i) ' Add the textbox to the panel ' if you omit this step, the textbox is ' created but not displayed pnlDynamic.Controls.Add(txt(i)) Next End Sub CAUTION When you dynamically create a control, you must remember to add it to one of the container controls on the Web page. If you just create a control but forget to add it to the container control, your control will not be rendered with the page. The Table, TableRow, and TableCell Controls You can use the Table, TableRow, and TableCell controls to build a table on the Web page. The Table control is rendered as a <table> HTML element on the Web page. Table 3.8 summarizes the important members of the Table class with which you should be familiar. Table 3.8 Important Members of the Table Class The TableRow class represents a row in a Table control. The TableRow class is rendered as a <tr> HTML element on the Web page. Table 3.9 summarizes the important members of the TableRow class with which you should be familiar. Table 3.9 Important Members of the TableRow Class The TableCell Web server control represents a cell in a Table control. The Table Web server control is rendered as a <td> HTML element on the Web page. Table 3.10 summarizes the important members of the TableCell class with which you should be familiar. Table 3.10 Important Members of the TableCell Class The AdRotator Control The AdRotator Web server control provides a convenient mechanism for displaying advertisements randomly selected from a list on a Web page. It fetches the images from a list stored in an Extensible Markup Language (XML) file and randomly loads an image in the AdRotator control every time the page is loaded. It allows you to specify a Web page whose contents will be displayed in the current window when the AdRotator control is clicked. The ad files used by the AdRotator control follow this format: <?xml version="1.0" ?> <Advertisements> <Ad> <ImageUrl>que.gif</ImageUrl> <NavigateUrl> </NavigateUrl> <AlternateText>Que Publishing</AlternateText> <Impressions>40</Impressions> <Keyword>Books</Keyword> </Ad> <Ad> ... </Ad> ... </Advertisements> The AdRotator control is rendered as an anchor HTML element, <a>, with an embedded image HTML element, <img>, to display the image on the Web page. The Calendar Control The Calendar Web server control displays a calendar on the Web page. It allows you to select a day, a week, a month, or even a range of days. You can customize the appearance of the control and even add custom content for each day. The control generates events when a selection changes or when the visible month is changed in the Calendar control. The Calendar control is rendered as a <table> HTML element on the Web page. Tables 3.11 and 3.12 summarize the important properties and events of the Calendar class, respectively.
https://www.informit.com/articles/article.aspx?p=101590&seqNum=3
CC-MAIN-2021-39
refinedweb
2,824
54.22
2013 Oklahoma Men's Basketball NCAA Tournament Guide The official source of information for the 2012-13 OU men's basketball team's postseason, beginning in Philadelphia. Game 32 | OU vs. SAN DIEGO STATE | Friday, March 22, 2013 | 8:20 p.m. CT | Philadelphia, Pa. | Wells Fargo Center (20,000) | TBS Mike Houck, Director of Media Relations McClendon Center for Intercollegiate Athletics 180 West Brooks, Suite 2525 | Norman, OK 73019 O: (405) 325-8227 | C: (405) 249-5892 | E: mhouck@ou.edu | Twitter: @SoonerHoops; @mhouckOU MEN’S BASKETBALL 27 NCAA Tournaments | 4 Final Fours | 14 Conference Championships | 30 All-Americans | 28 Postseason Appearances In The Last 32 Years Oklahoma Schedule/Results N2 N7 WASHBURN (Ex.) CENTRAL OKLAHOMA* (Ex.) ULM at UT Arlington vs. UTEP # vs. Gonzaga (17) # vs. West Virginia # at Oral Roberts NORTHWESTERN STATE at Arkansas vs. Texas A&M $ STEPHEN F. AUSTIN OHIO W W W W W L W W W L W L W W W W W L W L W L L W W L (OT) W W L (OT) W W L L 8:20 p.m. TBD TBD TBD 83-66 94-66 OKLAHOMA SOONERS Overall Record. .....................................20-11 Big 12 Record/Finish.......... 11-7/Fourth (tie) NCAA Tournament Seed. .................... No. 10 NCAA Tournament Appearances. .........27th NCAA Tournament Record...................36-26 Head Coach...................................Lon Kruger Alma Mater......................... Kansas State ’75 Career Record............... 514-331 (27th year) At Oklahoma. .....................35-27 (2nd year) Website..................... SAN DIEGO STATE AZTECS Overall Record. ....................................22-10 MWC Record/Finish............. 9-7/Fourth (tie) NCAA Tournament Seed. ......................No. 7 NCAA Tournament Appearances. ..........9th NCAA Tournament Record......................2-8 Head Coach..................................Steve Fisher Alma Mater......................... Illinois State ’67 Career Record..............464-252 (22nd year) At SDSU. ........................280-170 (14th year) Website........................... 85-51 63-59 68-61 47-72 77-70 63-62 69-65 78-81 64-54 55-56 74-63 72-42 67-57 77-68 81-63 60-69 73-67 54-67 74-71 50-52 64-83 72-66 75-48 79-84 86-71 90-76 86-92 86-69 83-70 67-70 66-73 TBS TBD CBS CBS NCAA Second and Third Rounds PROJECTED OKLAHOMA STARTERS TEXAS A&M-CORPUS CHRISTI* 22 AMATH M’BAYE • F PTS 10.1 6-9 • 208 • Jr. • Bordeaux, France University of Wyoming REB 5.2 FG% .464 MIN 25.0 NOTES: A third-team All-Big 12 selection and member of the league’s all-academic and all-rookie teams ... Has scored in double figures 15 times on the year ... Was 4-for-21 (19.0%) from 3-point range over first 24 games but is 8-for-19 (42.1%) in 7 games since ... Turned in 15-point, career-high 13-rebound, career-high 5-assist game Feb. 20 at Texas Tech (first doubledouble as a Sooner) ... One of 3 team captains (Osby, Fitzgerald are others). NOTES: A first-team All-Big 12 pick (OU’s first in 4 years) ... Averaging team highs of 15.8 points and 7.0 rebounds ... Averaging 21.5 points and 8.1 rebounds over last 8 games (55.3 FG%). ... In Big 12 play ranked 2nd in scoring (17.8), 5th in rebounding (7.3), 3rd in FG% (54.0) and 5th in FT% (77.6) ... Has 50.0 FG% or better in 19 of last 24 games ... Averaging 23.2 points over last 5 games (career-high 31 at Texas) ... Leads team with 21 charges taken. NOTES: Has started 7 games on year (last 6) ... His 3 highest scoring career performances (18, 23, 19) have come in last 8 games ... Averaging 12.4 points and 5.5 assists the last 8 contests ... Has 99 points the last 8 games after totaling 54 in his first 22 outings ... Leads the Big 12 with his 2.7 assist-toturnover ratio ... Started every game last year when he led league with 2.8 assist-to-turnover ratio and ranked 2nd with 6.0 assists per game. NOTES: A third-team All-Big 12 selection ... Ranks 2nd on team with his 11.8 scoring average ... Ranks 3rd in Big 12 with 2.3 treys per outing and 5th with 37.0% 3-point field goal mark ... Averaging 15.5 points the last 8 outings ... Is 28-for-64 (43.8%) from 3-point range over last 8 games after going 2-for-17 (11.8%) the previous 4 outings ... Ranks 2nd in OU history with 248 3-pointers and 14th with 1,389 points ... Has made 63 straight starts. NOTES: Has started 28 of 31 games ... Averaging 5.6 points, 2.7 rebounds, 1.7 assists and 1.0 steal per outing ... Shooting 34.2% from 3-point range (35.9% in Big 12 play) ... Has made 19 of his last 49 3-point attempts (38.8%) over the last 22 games ... Averaging 7.2 points over last 10 contests (scored 13 six games ago vs. Baylor)... A 4-star recruit ranked No. 102 nationally by Rivals.com last year (teammate of Baylor frosh Isaiah Austin). 24 PTS 15.8 ROMERO OSBY • F REB 7.0 6-8 • 232 • Sr. • Meridian, Miss. Mississippi State University FG% .522 MIN 28.5 1 PTS 5.1 SAM GROOMS • G REB 1.7 6-1 • 203 • Sr. • Greensboro, N.C. Chipola College (Fla.) AST 3.2 M2 IOWA STATE M6 WEST VIRGINIA M9 at TCU M14 vs. Iowa State ^ M22 vs. San Diego State % M24 NCAA Third Round % M28-31 NCAA Regionals A6-8 NCAA Final Four MIN 20.6 2 STEVEN PLEDGER • G 6-4 • 219 • Sr. • Chesapeake, Va. Atlantic Shores Christian School REB 3.3 PTS 11.8 3FG% .370 MIN 28.7 All times Central and subject to change * Field House Series (played at McCasland Field House) # Old Spice Classic (Orlando, Fla.) $ All-College Classic (Oklahoma City) ^ Phillips 66 Big 12 Championship (Kansas City, Mo.) % NCAA Championship (Philadelphia, Pa.) 5 No. JE’LON HORNBEAK • G 6-3 • 180 • Fr. • Arlington, Texas Grace Preparatory Academy REB 2.7 PTS 5.6 AST 1.7 MIN 22.6 Radio (Sooner Sports Network) TV (TBS) Play-by-Play............................................. Toby Rowland Analyst.........................................................Mike Houck Play-by-Play............................................... Kevin Harlan Analyst..........................................................Len Elmore Analyst...................................................... Reggie Miller Courtside Reporter.................................. Lewis Johnson OKLAHOMA’S TOP RESERVES Name Position Height Weight Class Points Rebounds Assists Minutes 3 21 4 11 15 Buddy Hield Cameron Clark Andrew Fitzgerald Isaiah Cousins Tyler Neal G G/F F G F 6-3 6-6 6-8 6-3 6-7 199 208 238 182 227 Fr. Jr. Sr. Fr. Jr. 8.0 6.5 5.9 2.5 1.2 4.2 3.3 3.5 1.9 1.4 1.9 0.5 0.4 1.5 0.2 25.2 17.3 15.9 15.7 6.7 PROJECTED SAN DIEGO STATE STARTERS No. Name Position Height Weight Class Points Rebounds Assists Minutes 20 23 2 21 22 JJ O’Brien DeShawn Stephens Xavier Thames Jamaal Franklin Chase Tapley F F G G G 6-7 6-8 6-3 6-5 6-3 225 225 190 205 195 So. Sr. Jr. Jr. Sr. 7.4 5.9 9.8 16.7 13.5 4.6 4.9 2.6 9.5 3.2 1.5 0.2 2.2 3.2 2.8 27.2 21.5 28.2 32.8 30.8 2012-13 OKLAHOMA MEN’S BASKETBALL Head Coach Lon Kruger Lon Kruger was named CHAMPIONSHIP INFORMATION Making its 27th NCAA Tournament appearance and first under second-year head coach Lon Kruger, Oklahoma (20-11 overall, 11-7 Big 12 Conference) enters Friday’s second-round game against San Diego State (22-10 overall, 9-7 Mountain West Conference) as the South Region’s No. 10 seed. The contest, which will be played at Wells Fargo Center in Philadelphia, Pa., will start at approximately 8:20 p.m. CDT. San Diego State is the region’s No. 7 seed. Should it advance to third-round play, Oklahoma will face the winner of Friday’s (No. 2 seed) Georgetown versus (No. 15 seed) Florida Gulf Coast University game on Sunday. The Hoyas sport a 25-6 record while the Eagles are 24-10. Also in Philadelphia participating in the Midwest Region are No. 2 seed Duke, No. 7 seed Creighton, No. 10 seed Cincinnati and No. 15 seed Albany. All of OU’s NCAA Tournament games will air live on the Sooner Radio Network (KOKC AM 1520 in Oklahoma City; KTBZ AM 1430 in Tulsa) with Toby Rowland (play-by-play) and Mike Houck (analyst) calling the action. Friday’s game will be televised nationally by TBS with Kevin Harlan, Len Elmore, Reggie Miller and Lewis Johnson announcing. It will also air on the Dial Global/ NCAA Radio Network with Scott Graham and John Thompson on the call. Statistical Comparison CATEGORY Oklahoma’s 14th head men’s basketball coach on April 1, 2011. Owns a 514-331 (.608) collegiate record over 27 years. The first Division I head coach to take five different programs to the NCAA Tournament. Earned his 500th collegiate victory Nov. 30 when OU beat Northwestern State. Also coached at Texas-Pan American (52-59 record from 1982-86), Kansas State (81-46 from 1986-90), Florida (104-80 from 1990-96), Illinois (81-48 from 1996-00) and UNLV (161-71 from 2004-11). Served as head coach of NBA’s Atlanta Hawks from 2000-03 (69-122 record) and was an assistant for New York Knicks (2003-04 season). Averaged 25.4 wins at UNLV over five years (four NCAA appearances and one NIT trip) and won at least 21 games each of those five seasons. Has taken teams to 14 NCAA Tournaments (14-13 record) and four NITs (4-5 record). Has coached all six of his college programs to at least one 20-win season. Coached Florida to the 1994 Final Four, Kansas State to the 1988 Elite Eight and UNLV to the 2007 Sweet 16. Is one of just three head coaches in Division I history (the only current one) to lead at least four different schools to at least one NCAA Tournament win. Is one of four coaches to lead three different schools to NCAA Sweet 16 appearances. Recipient of 2012 Coaches vs. Cancer Champion Award for his significant involvement in the program. KRUGER AND THE NCAA TOURNAMENT With this year’s berth, Lon Kruger is the first head coach in history to take five Division I programs to the NCAA Tournament (Kansas State, Florida, Illinois, UNLV and Oklahoma). Coaches who have taken four programs to the Big Dance are current mentors John Beilein, Rick Pitino and Tubby Smith, and former head men Lefty Driesell, Jim Harrick, Tom Penders and Eddie Sutton. Overall Record Points Per Game Opp. Points Per Game Scoring Margin Rebounds Per Game Opp. Rebounds Per Game Rebounding Margin Field Goal Pct. Opp. Field Goal Pct. 3-Point Pct. 3-Point Makes Per Game Opp. 3-Point Pct. Free Throw Pct. FT Makes Per Game Personal Fouls Per Game Assists Per Game Turnovers Per Game Turnover Margin Blocked Shots Per Game Steals Per Game 20-11 71.1 66.2 +4.9 36.7 34.9 +1.9 .436 .417 .326 5.0 .327 .760 15.8 17.3 12.4 11.8 +1.5 2.8 6.5 22-10 69.2 60.7 +8.6 36.8 33.4 +3.5 .438 .388 .324 5.9 .324 .676 14.1 14.8 12.3 11.9 +0.8 4.6 6.9 This marks Kruger’s 14th NCAA Tournament appearance as a head coach. He owns a 14-13 record and is 8-5 in first-round games (his teams have won five of their last seven tournament openers). In his last coaching stop at UNLV, Kruger took the Runnin’ Rebels to the NCAA Tournament in four of his final five seasons there. Kruger is one three coaches to ever direct four programs to at least one NCAA Tournament win. The others are Harrick and Sutton. Kruger has coached three programs to the Sweet 16 or beyond (only Pitino, Smith, John Calipari and Bill Self have also done it). He took Kansas State to the 1988 Elite Eight, Florida to the 1994 Final Four and UNLV to the 2007 Sweet 16. Kruger participated in the 1972 and ’73 NCAA Tournaments as a player at Kansas State and helped the Wildcats to regional final Lon Kruger Year by Year Year School Record 1982-83 Texas-Pan American 7-21 1983-84 Texas-Pan American 13-14 1984-85 Texas-Pan American 12-16 1985-86 Texas-Pan American 20-8 1986-87 * Kansas State 20-11 1987-88 * Kansas State 25-9 1988-89 * Kansas State 19-11 1989-90 * Kansas State 17-15 1990-91 Florida 11-17 1991-92 ^ Florida 19-14 1992-93 ^ Florida 16-12 1993-94 * Florida 29-8 1994-95 * Florida 17-13 1995-96 Florida 12-16 1996-97 * Illinois 22-10 1997-98 * Illinois 23-10 1998-99 Illinois 14-18 1999-00 * Illinois 22-10 2004-05 ^ UNLV 17-14 2005-06 UNLV 17-13 2006-07 * UNLV 30-7 2007-08 * UNLV 27-8 2008-09 ^ UNLV 21-11 2009-10 * UNLV 25-9 2010-11 * UNLV 24-9 2011-12 Oklahoma 15-16 2012-13 Oklahoma 20-11 Totals 27 Years 514-331 * NCAA Tournament ^ National Invitation Tournament Pct. .250 .481 .429 .714 .645 .735 .633 .531 .393 .576 .571 .784 .567 .429 .688 .697 .438 .688 .548 .567 .811 .771 .656 .735 .727 .483 .645 .608 (Elite Eight) appearances both seasons. K-State went 1-1 in 1972 when Kruger was the Big Eight sophomore of the year (beat Texas 66-55 before losing 72-65 to Louisville). The Wildcats again went 1-1 in 1973 when Kruger was the Big Eight player of the year (beat Louisiana-Lafayette 66-63 before falling 92-72 to Memphis). MASTER OF THE TURNAROUND Taking a truly unique career path, OU head coach Lon Kruger has positioned himself as perhaps the greatest change agent in college basketball history. What makes Kruger’s 500-plus career wins and NCAA Tournament trips with five different programs even more impressive than they may first seem is the condition of the six-71 (.622) in his second year, 91-64 (.587) in his third year and 115-49 (.697) in his fourth season. He directed all six programs to 20-win campaigns and took each of OKLAHOMA NUMERICAL ROSTER No. Name Position Height Weight Class 6-8 6-1 6-4 6-3 6-8 6-3 6-3 5-10 6-7 6-7 6-6 6-9 6-8 6-6 6-8 6-10 227 203 219 199 238 180 182 150 200 229 208 208 232 225 210 223 So. Sr. Sr. Fr. Sr. Fr. Fr. So. Fr. Jr. Jr. Jr. Sr. Fr. Jr. Sr. Blanchard, Okla. (Gonzaga University) Greensboro, N.C. (Chipola College [Fla.]) Chesapeake, Va. (Atlantic Shores Christian School) Freeport, Bahamas (Sunrise Christian Academy CC [Iowa]) Penryn, Calif. (Sierra College) * Letters earned at Oklahoma #Sitting out 2012-13 season due to NCAA transfer regulations % Redshirting 2012-13 season 2 2012-13 OKLAHOMA MEN’S BASKETBALL 2012-13 Big 12 Standings (Thru Monday; In order of Big 12 Championship seed) Team Kansas Kansas State Oklahoma State Oklahoma Iowa State Baylor Texas West Virginia Texas Tech TCU W 14 14 13 11 11 9 7 6 3 2 Big 12 L Pct. 4 .778 4 .778 5 .722 7 .667 7 .667 9 .500 11 .389 12 .333 15 .167 16 .111 W 29 27 24 20 22 18 16 13 11 11 Overall L Pct. 5 .853 7 .794 8 .750 11 .645 11 .667 14 .563 17 .485 19 .406 20 .355 21 .344 the last five to the NCAA Tournament or NIT by his second year. Here’s a look at what Kruger inherited at all six of his head coaching stops and the turnaround job he performed at each: TEXAS-PAN AMERICAN – Inherited a 5-20 team for his first head coaching Oklahoma and the NCAA Tournament OU is making its 27th NCAA Tournament position and by his fourth (and final) year led UTPA to a 20-12 record. KANSAS STATE – Hired by his alma mater after the Wildcats had not been to NCAA Tournament in four seasons, he coached all four of his K-State squads to the Big Dance. His second squad went 25-9 and advanced to the Elite Eight. FLORIDA – Inherited a seven-win team (program was also facing an FBI appearance (36-26 all-time record), 14th in the last 19 years and 23rd in the last 31 seasons (first since 2009). The Sooners have made four Final Four and NCAA probe) and led the Gators to four postseason appearances in his six seasons, including a Final Four trip in his fourth year (team finished 29-8). ILLINOIS – Took over an Illini program under NCAA sanctions and that had appearances (1939, 1947, 1988 and 2002). They played in the 1947 and 1988 national championship games. Oklahoma is 12-6 in its last six NCAA not won an NCAA Tournament game in seven years. Guided it to the second round of the event in three of his four seasons (all three of those teams won at least 22 games). UNLV – Inherited a program on NCAA probation and that had been to the Tournaments, with a Final Four showing in 2002 and Elite Eight appearances in 2003 and 2009. Romero Osby is the only active player NCAA Tournament just twice (no wins) in the previous 13 years. Took the Runnin’ Rebels to the NCAA Tourney four times in his final five seasons, including the Sweet 16 in his third year there when they went 30-7. OKLAHOMA – Took command of a program that had gone a combined 27-36 the previous two seasons and in his second year posted a 20-11 record and an NCAA Tournament appearance with a record fifth school. on OU’s roster who has NCAA Tournament experience. As a Mississippi State freshman in 2009, Osby finished with three points, two rebounds and a steal (12 minutes) in a 71-58 first-round loss to Washington. The Sooners are 3-2 as participants in the Oklahoma Quick Facts Official Name: University of Oklahoma Location: Norman, Okla. Founded: 1890 Enrollment: 30,753 Nickname: Sooners Colors: Crimson and Cream President: David L. Boren Athletics Director: Joe Castiglione Arena: Lloyd Noble Center (12,000) First Year of Basketball: 1907-08 NCAA Tournament Appearances: 26 NIT Appearances: 7 All-Time Record: 1,547-1,005 (.606) Regular Season Conference Championships: 14 (1928, 1929, 1939, 1940, 1942, 1944, 1947, 1949, 1979, 1984, 1985, 1988, 1989, 2005) Conference Tournament Championships: 7 (1979, 1985, 1988, 1990, 2001, 2002, 2003) Head Coach: Lon Kruger (Kansas State ‘75) Career Record: 514-331 (27th year) Oklahoma Record: 35-27 (second year) NCAA Appearances: 13 (most recent 2011) NIT Appearances: 4 (most recent 2009) Assistant Coaches: Chris Crutchfield (NebraskaOmaha ’92), Steve Henson (Kansas State ’90), Lew Hill (Wichita State ’88) Director of Operations: Mike Shepherd (Kansas State ’92) Strength and Conditioning Coach: Jozsef Szendrei (Oklahoma ’03) Video Coordinator: Scott Thompson Equipment Manager: Marco Griego Graduate Managers: Teddy Owens, Kellen McCoy Athletics Trainer: Alex Brown Team Physician: Dr. Brock Schnebel Official Website: SoonerSports.com OKLAHOMA AGAINST THE NCAA FIELD The Sooners played 11 games against 2013 NCAA Tournament teams and went 4-7. The wins came against No. 1 seed Kansas, No. 5 seed Oklahoma State, No. 10 seed Iowa State and No. 14 seed Northwestern State. The losses came to Kansas and fellow No. 1 seed Gonzaga, No. 4 seed Kansas State (twice), Oklahoma State and Iowa State (twice). Both Kansas and Northwestern State are in the South Regional with OU. South Region. They lost a 2001 first-round game to Indiana State (70-68 in OT in Memphis) and advanced to the Elite Eight in 2009 (lost to eventual national champion North Carolina, 72-60, in Memphis). OU VS. POSSIBLE PHILADELPHIA OPPONENTS Oklahoma is 3-0 all-time against San Diego State. The Sooners won the first meeting NCAA Tournament Appearances by Big 12 Schools Since 1983 Kansas Oklahoma Texas Oklahoma State Iowa State West Virginia Kansas State Texas Tech Baylor TCU 29 23 22 17 14 14 11 8 3 2 92-57 on Dec. 7, 1973, in the Creighton Cage Classic in Omaha, Neb. Tom Holland led OU with 20 points while future fourth overall NBA draft pick Alvan Adams contributed 14 points and nine rebounds. Just 29 days later (Jan. 5), the Sooners posted a 91-66 home victory over the Aztecs. Adams set a still-standing OU record by going 11-for-11 from the field and finished with 27 points and 16 boards. The following season, Oklahoma escaped with a 79-74 Jan. 2 overtime win at San Diego State. Adams, who paced OU with 27 points on the day, went a combined 30-for-43 (.698) from the field in the three games. Joe Ramsey served as OU head coach for just two seasons but was on the Sooner sideline for all three contests. OU has never met Georgetown or Florida Gulf Coast University in men’s basketball. 10 THINGS TO KNOW Oklahoma is making its 27th NCAA Tournament appearance but its first in the last Time Trailed in Last 10 Games (Out of 410 Minutes) Opponent Kansas TCU at Okla. State (OT) at Texas Tech Baylor at Texas (OT) Iowa State West Virginia at TCU vs. Iowa State Total Time 2:00 0:00 16:01 1:14 0:00 5:09 0:00 0:00 39:02 3:02 66:28 W/L W W L W W L W W L L four years (OU posted losing records in its last three seasons). This is the Sooners’ 14th appearance in the Big Dance in the last 19 years, and 23rd in the last 31 seasons. This marks OU’s 28th postseason appearance in the last 32 years (23 NCAA Tourna- ments, five NITs). The Sooners’ nation-leading streak of 25 consecutive postseason appearances came to an end in 2007. Oklahoma is 0-2 all-time as an NCAA Tournament No. 10 seed. The Sooners lost 61-43 to Temple in 1996 in Orlando, Fla. (Southeast Region), and dropped a 94-87 overtime decision to Indiana in 1998 in Washington, D.C. (East Region). OU is 6-4 in its last 10 games. In three of those four losses, the Sooners trailed for a total of 3 minutes and 2 seconds out 60 minutes of second-half action. They were never behind in the second half of overtime road losses to Oklahoma State (Feb. 16) and Texas (Feb. 27), and fell behind for the first time in last Thursday’s Big 12 quarterfinals game against Iowa State with 3:19 remaining. OU led by five with 3:10 to go in the second half at OSU, by 22 with 7:38 remaining in the second half at Texas, and by 12 with 7:25 left against Iowa State. It held double-digit second-half leads in all three contests. Over their last last 10 games, OU has trailed for a total of just 66 minutes and 28 seconds out of 410 total minutes (that’s 16 percent of game time). It trailed for 3 minutes and 2 seconds or less in seven of those 10 games and was never behind in four of them. In Big 12 play, OU ranked in the top four of the league in scoring offense (second at 73.6 ppg), field goal percentage (fourth at .451), 3 2012-13 OKLAHOMA MEN’S BASKETBALL OU’s NCAA Tournament History 1939 West Regional (Final Four) 1943 West Regional 1947 West Regional (Final Four) free throw percentage (first at .774, rebounding margin (second at +2.4) and turnover margin (third at +0.7). Four games ago against Iowa State, OU tied an NCAA record for most free throw OU 50, Utah State 39 Oregon 55, OU 37 OU 48, Washington 41 Wyoming 53, OU 50 OU 47, Saint Louis 41 OU 56, Oregon State 54 OU 55, Texas 54 Holy Cross 58, OU 47** OU 90, Texas 76 Indiana State 93, OU 72 OU 71, UAB 63 Indiana 63, OU 49 Dayton 89, OU 85 OU 96, North Carolina A&T 83 OU 75, Illinois State 69 OU 86, Louisiana Tech 84 (OT) Memphis State 63, OU 61 OU 80, Northeastern 74 DePaul 74, OU 69 OU 74, Tulsa 69 OU 96, Pittsburgh 93 Iowa 93, OU 91 (OT) OU 94, UT-Chattanooga 66 OU 107, Auburn 87 OU 108, Louisville 98 OU 78, Villanova 59 OU 86, Arizona 78 Kansas 83, OU 79** OU 72, East Tenn. State 71 OU 124, Louisiana Tech 81 Virginia 86, OU 80 OU 77, Towson State 68 North Carolina 79, OU 77 Southwestern La. 87, OU 83 Manhattan 77, OU 67 Temple 61, OU 43 Stanford 80, OU 67 Indiana 94, OU 87 (OT) OU 61, Arizona 60 OU 85, UNC Charlotte 72 Michigan State 54, OU 46 OU 74, Winthrop 50 Purdue 66, OU 62 Indiana State 70, OU 68 (OT) OU 71, Illinois-Chicago 63 OU 78, Xavier 65 OU 88, Arizona 67 OU 81, Missouri 75 Indiana 73, OU 64 OU 71, S. Carolina State 54 OU 74, California 65 OU 65, Butler 54 Syracuse 63, OU 47 OU 84, Niagara 67 Utah 67, OU 58 UW-Milwaukee 82, OU 74 OU 72, Saint Joseph’s 64 Louisville 78, OU 48 OU 82, Morgan State 54 OU 73, Michigan 63 OU 84, Syracuse 71 North Carolina 72, OU 60 OU’s All-Time NCAA Tournament Seeds Year 1939 1943 1947 1979 1983 1984 1985 1986 1987 1988 1989 1990 1992 1995 1996 1997 1998 1999 2000 2001 2002 2003 2005 2006 2008 2009 2013 Seed — — — 5 7 2 1 4 6 1 1 1 4 4 10 11 10 13 3 4 2 1 3 6 6 2 10 Record 1-1 1-1 2-1 1-1 1-1 0-1 3-1 1-1 2-1 5-1 2-1 1-1 0-1 0-1 0-1 0-1 0-1 2-1 1-1 0-1 4-1 3-1 1-1 0-1 1-1 3-1 attempts without a miss by going 34-for-34. The Sooners lead the Big 12 and rank 10th nationally with their .760 season free throw mark (school record is .767 in 2001-02) and shot a league-best .774 in Big 12 play. In Big 12 home games, OU shot a gaudy .857 from the foul line. The Sooners have led at halftime in nine of the last 10 games. The halftime advantages 1979 Midwest Regional (Sweet 16) 1983 Mideast Regional 1984 West Regional 1985 Midwest Regional (Elite Eight) in those nine games were 4 vs. Kansas, 25 vs. TCU, 8 at Oklahoma State, 8 at Texas Tech, 26 vs. Baylor, 15 at Texas, 12 vs. Iowa State, 11 vs. West Virginia and 8 vs. Iowa State. While head coach at UNLV from the 2004-05 through 2010-11 seasons, Lon Kruger posted a 5-13 record against San Diego State. First-team All-Big 12 selection Romero Osby has led the team (or tied for the lead) in scoring in 14 of its last 19 games and reached double figures in 18 of those 19. In Big 12 play, the senior forward led the league in field goals (109) while ranking second in scoring (17.8 ppg), third in field goal percentage (.540) and fifth in rebounding (7.3 rpg) and free throw percentage (.776). He has scored at least 17 points in each the last eight outings and is averaging 21.5 points and 8.1 rebounds during the stretch. 1986 East Regional 1987 West Regional (Sweet 16) 1988 Southeast Regional (Final Four) TEAM UPDATE The Sooners have scored at least 72 points in eight of their last 10 games and have registered at least 83 in five of their last seven. They are averaging 79.0 points over the last 10 contests after averaging 62.5 over the six games immediately prior to the stretch. OU finished its home schedule by going nearly a month without trailing at Lloyd Noble Center. The last time it was behind at home was Feb. 9 vs. Kansas (14-13 with 14:27 left in first half). In their final four home games, the Sooners never trailed against TCU, Baylor, Iowa State or West Virginia. They were ahead or tied for each of their final 194 minutes and 26 seconds at home. 1989 Southeast Regional (Sweet 16) 1990 Midwest Regional 1992 West Regional 1995 Southeast Regional 1996 Southeast Regional 1997 West Regional 1998 East Regional 1999 Midwest Regional (Sweet 16) 2000 West Regional 2001 South Regional 2002 West Regional (Final Four) Oklahoma has won six of its last 10 games, with all four of its defeats during the stretch occurring away from home. Two of the losses came in overtime (at Oklahoma State and at Texas; OU did not trail in the second half of either), a third by three points (at TCU) and a fourth in which it led by 12 with 7:25 remaining (vs. Iowa State in the Big 12 Championship quarterfinals). The Sooners shot better from the field than their opponent in 13 of 18 conference outings, including seven of the last nine games in the regular season. Oklahoma shot .437 from the field over its first 10 conference games but shot .470 over the final eight league contests. OU leads the Big 12 with its .760 season free throw percentage and shot a league-best .774 in conference play. The Sooners own four of the Big 12’s top six free throw performances of the year (1.000 [34-for-34] vs. Iowa State, 1.000 [14-for-14] vs. TCU, .947 vs. Texas A&M and .938 vs. Texas A&M-Corpus Christi). They are shooting .815 from the charity stripe over the last 10 outings. In its nine Big 12 home games, OU shot .857 from the free throw line and outscored its opponents by 10.8 points a game there. In nine Big 12 road games, OU shot .663 and was outscored by an average of 2.8 points at the stripe. Five of OU’s 11 losses have come to teams ranked in the top 17 of this week’s AP poll (Gonzaga, Kansas, Kansas State [twice] and Oklahoma State own a combined average record of 26-5). Four of the other six losses came by one point (Stephen F. Austin), three points (at Arkansas and at TCU) or in overtime (at Texas). Stephen F. Austin is 27-4 and leads the nation in scoring defense. OU’s 11 conference wins were more than it compiled over the two previous seasons combined (won five each of the last two years). Oklahoma has already won two more games away from home this year (eight) than it did over the last two seasons combined (six). OSBY, PLEDGER, M’BAYE NAMED ALL-BIG 12 Seniors Romero Osby and Steven Pledger, and junior Amath M’Baye were named to the 2013 All-Big 12 Team, with Osby earning first-team honors and Pledger and M’Baye earning third-team accolades. M’Baye was also named to the Big 12 All-Rookie Team. Osby, who leads OU in scoring (15.8 ppg), rebounding (7.0 rpg) and field goal percentage (.522) in 28.5 minutes a contest, is the 2003 East Regional (Elite Eight) 2005 Austin Regional 2006 Minneapolis Reg. 2008 East Regional 2009 South Regional (Elite Eight) program’s first first-team All-Big 12 selection since Blake Griffin in 2009. Projected to 40 minutes, the forward is averaging 22.2 points and 9.8 boards. In Big 12 play, he ranked first in the league with his 109 field goals, second with his 17.8 points per game, fifth with his 7.3 caroms per contest and third with his .540 field goal mark. Osby has shot 50 percent or better from the field in 19 of the last 24 games. He led the team (or tied for the team lead) in scoring in 13 of its 18 conference outings, and did it again in the Big 12 Championship quarterfinals against Iowa State (18 points). Osby has scored at least 17 points in each of the last eight games and is averaging 21.5 points on .553 shooting during the stretch. He has started 61 of OU’s 62 games the last two years since transferring from Mississippi State. Osby is the only player in the Big 12 who is shooting at least 50 percent from the field (.522), 50 percent from 3-point range (.500) and 79 percent from the foul line (.796). Pledger ranks second on the team by averaging 11.8 points in a team-high 28.7 minutes a game. After averaging 6.5 points on 2-for- ** Indicates national championship game 17 3-point shooting over a four-game span to start February, the guard is averaging 15.5 points on 28-for-64 (.438) 3-point shooting over the last eight outings and has scored at least 14 points in six of them. However, he is 1-for-10 from 3-point range over the last two games after going 27-for-54 (.500) over the previous six. He ranks third in the league with his 2.3 treys per contest and fifth with his .370 3-point percentage. The conference’s leading returning scorer from last year (16.2 ppg), he has scored in double figures in 18 of 4 2012-13 OKLAHOMA MEN’S BASKETBALL Coaches Who Have... LED AT LEAST FOUR SCHOOLS TO NCAA TOURNAMENT 5 4 4 4 4 4 4 4 Lon Kruger (Kansas State, Florida, Illinois, UNLV, OU) John Beilein (Canisius, Richmond, West Va., Michigan) Lefty Driesell (Davidson, Maryland, J. Madison, Ga. State) Jim Harrick (Pepperdine, UCLA, Rhode Island, Georgia) Tom Penders (Rhode Island, Texas, G. Washington, Texas) Rick Pitino (Boston, Providence, Kentucky, Louisville) Tubby Smith (Tulsa, Georgia, Kentucky, Minnesota) Eddie Sutton (Creighton, Arkansas, Kentucky, Okla. State) the last 24 outings. Pledger ranks second in OU history with 248 3-pointers (needs 11 to tie record) and 14th on OU’s all-time scoring chart with 1,389 points. He has started each of his last 63 games. M’Baye is averaging 10.1 points and 5.2 rebounds on the year (25.0 minutes per game) OU’s Career 3-Point Field Goal Leaders 1. Terry Evans (1990-93) 2. Steven Pledger (2010-) 259 248 to rank third and second on the team, respectively. The Preseason Big 12 Rookie of the Year and a two-time league rookie of the week (Nov. 26 and Dec. 31), M’Baye has scored in double figures in 15 games but not in any of the last three. On Feb. 20 at Texas Tech, he enjoyed perhaps his best overall outing as a Sooner, finishing with 15 points and career highs of 13 rebounds and five assists in just 25 minutes. He is 8-for-19 (.421) from 3-point range over the last seven games after starting the year 4-for-21 (.190). He shot .829 from the free throw line in Big 12 play. OU’s Career Scoring Leaders 1. Wayman Tisdale (1983-85) 2,661 12. Chucky Barnett (1980-83) 1,462 13. Harvey Grant (1987-88) 1,391 14. Steven Pledger (2010-) 1,389 30. Terry Stotts (1977-80) 1,104 31. Damon Patterson (1989-92) 1,099 32. Andrew Fitzgerald (2010-) 1,086 LED AT LEAST FOUR SCHOOLS TO NCAA TOURNEY WINS 4 Lon Kruger (Kansas State, Florida, Illinois, UNLV) 4 Jim Harrick (Pepperdine, UCLA, Rhode Island, Georgia) 4 Eddie Sutton (Creighton, Arkansas, Kentucky, Okla. State) ADDITIONAL PLAYER NOTES Senior point guard Sam Grooms started all 31 games last year, led the Big 12 in LED AT LEAST THREE SCHOOLS TO NCAA SWEET 16 (SINCE FIELD EXPANDED TO 64 TEAMS) 3 3 3 3 Lon Kruger (Kansas State, Florida, UNLV) Rick Pitino (Providence, Kentucky, Louisville) Bill Self (Tulsa, Illinois, Kansas) Tubby Smith (Tulsa, Georgia, Kentucky) assist-to-turnover ratio (2.8) and ranked second in assists (6.0 per game). He has come off the bench in 23 of his 30 games this season (started the last six), but has still racked up a team-high 97 assists (3.2 per game) against 36 turnovers for a league-leading 2.7 ratio. Grooms has turned in his three best scoring games of his career within the last eight outings: a then-career-high 18-point effort at Oklahoma State on Feb. 16 in which he was 9-for-11 from the field, a career-high 23-point showing versus Baylor on Feb. 23 in which he was 15-for-17 from the free throw line, and a 19-point outing four games ago against Iowa State. His 99 points the last eight games are 45 more than he totaled in his first 22 games of the year (54). Grooms is averaging 12.4 points and 5.5 assists over the last eight outings and is shooting .517 from the field and .767 from the free throw line (33-for-43). Freshman guard Buddy Hield sustained a fractured bone (fifth metatarsal) in his right foot in the second half of OU’s win over TCU LED FOUR SCHOOLS TO MULTIPLE NCAA TOURNEY WINS 4 Lon Kruger (Kansas State, Florida, Illinois, UNLV) 4 Jim Harrick (Pepperdine, UCLA, Rhode Island, Georgia) 4 Tubby Smith (Tulsa, Georgia, Kentucky, Minnesota) on Feb. 11, underwent successful surgery the next day and missed the next five games. Initially expected to be out 4-6 weeks, he returned in three weeks and played four minutes March 6 against West Virginia. In the regular season finale at TCU, Hield returned to form with 10 points, nine rebounds (eight offensive) two assists and three steals in 25 minutes off the bench. He did not score in the Big 12 Championship quarterfinals against Iowa State (played 15 minutes). A starter in each of the 13 games before his injury, Hield is now averaging 8.0 points, 4.2 rebounds, 1.9 assists and 1.2 steals per game on the season to rank fourth, third, second and first on the team, respectively. Freshman guard, Je’lon Hornbeak started the first 20 games, came off the bench the next three, but has started the last eight AP Top-25 Poll Monday, March 18 School 1. Gonzaga (45) 2. Louisville (20) 3. Kansas 4. Indiana 5. Miami (Fla.) 6. Duke 7. Ohio State 8. Georgetown 9. Michigan State 10. New Mexico Michigan Record 31-2 29-5 29-5 27-6 27-6 27-5 26-7 25-6 25-8 29-5 26-7 27-7 27-6 26-7 23-8 26-9 24-8 23-11 30-4 24-8 25-7 27-7 25-9 25-9 26-8 due in part to the injury to Hield. Hornbeak is averaging 7.2 points over the last 10 games after averaging 1.5 the previous four. He is shooting .342 from 3-point range on the year and is 19 for his last 49 (.388). He also ranks second on the team with his 53 assists. Junior guard/forward Cameron Clark, who started 60 of 63 games and averaged 8.9 points in 30.4 minutes per contest over his first two seasons, is averaging 6.5 points in 17.3 minutes an outing off the bench this year. After shooting .238 from the field (5-for-21) in the first four games of the season, he is shooting .562 in 27 games since (73-for-130). He is 34-for-55 (.618) over the last 12 games. He ranks second on the squad with his .517 season field goal mark. Clark is coming off a season-high-tying 17-point effort against Iowa State in which he was 5-for-7 from the field and 7-for-7 from the free throw line. A starter every game the previous two years, senior forward Andrew Fitzgerald has come off the bench in 30 of 31 games this season. On the year, he averages 5.9 points (.442 field goal shooting) and 3.5 rebounds in 15.9 minutes an outing. Fitzgerald recorded season highs of 13 points and 11 rebounds at TCU in the regular season finale for his third career double-double. On Jan. 26 at Kansas, he became the 39th member of OU’s 1,000-point club (he now ranks 33rd with 1,086 points). PREVIEWING SAN DIEGO STATE San Diego State tied for fourth place in the Mountain West Conference with a 9-7 league mark and enters NCAA Tournament play with a 22-10 overall record. The Aztecs went 1-1 in the MWC Tournament, beating Boise State 73-67 before losing 60-50 to New Mexico in the semifinals. They began the year 11-1 (won 11 in a row) and have gone 11-9 since. SDSU posted a 14-1 home record (lone loss was to UNLV by seven) and went 8-9 away from home. The Aztecs are making their school-record fourth straight NCAA Tournament appearance and ninth overall. They own a 2-8 record in the Big Dance. Both of their wins came two years ago when they advanced to the Sweet 16 (beat Northern Colorado and Temple before losing to Connecticut). Junior guard Jamaal Franklin leads the team with his 16.7 points, 9.5 rebounds, 3.2 assists and 1.5 steals per game. A two-time first-team All-Mountain West pick, he was the only player in the league to rank in the top three in scoring, rebounds and steals in the regular season. Franklin scored in double figures in all 16 conference games and has netted at least 20 points nine times on the year. He has attempted 220 free throws (the next highest total on the team is 95) and is shooting .771 at the line. Senior guard Chase Tapley was named to the All-Mountain West Third Team and averages 13.5 points, 3.2 rebounds, 2.8 assists and 1.4 steals. He has made a team-high 66 3-pointers on the year (2.1 per game) and is shooting a team-best .379 from behind the arc. Junior guard Xavier Thames averages 9.8 points and 2.2 assists. He ranks third on the team with his 35 3-point makes (shooting .361) and has teamed with Franklin and Tapley to can 139 of the squad’s 188 treys on the year (74%). OU opponents in bold Steve Fisher is in his 14th year as SDSU’s head coach and owns a 280-170 record. He is in his 22nd year overall and is 464-252 in his career. He coached Michigan to the 1989 national title (Oklahoma was a No. 1 seed that year but did not face the Wolverines). UP NEXT If Oklahoma wins two games in Philadelphia it will head to Arlington, Texas (Cowboys Stadium) for the South Regional semifinals (Sweet 16) on Friday, March 29. 5 2012-13 OKLAHOMA MEN’S BASKETBALL PLAYER NOTES 1 SAM GROOMS (6-1, 203, SENIOR, GUARD) Reserve point guard who averages 5.1 points and a team-high 3.2 assists (20.6 mpg). Averaging 12.4 points and 5.5 assists over the last 8 games (32.5 mpg). Has 99 points the last 8 games after totaling 54 over his first 22 games of the season. His 3 highest career scoring games have come over last 8 outings (18, 19 and 23). Has 97 assists and 36 turnovers on the season for a Big 12-best 2.7 ratio. Has made 7 starts this year (including last 6 games) after starting all 31 games last year. Averaged 6.7 points, 3.0 boards and 6.0 assists per game last season. Led Big 12 with 2.8 assist-to-turnover ratio (ranked 8th nationally) and ranked second in assists. Helped Highland Park HS to a 22-8 record and a District 10-4A championship as a senior. Voted by teammates as the Sooner who would make the best college head coach. Son of ESPN analyst and former college head coach Fran Fraschilla. 15 TYLER NEAL (6-7, 229, JUNIOR, FORWARD) An Academic All-Big 12 First Team selection (announced Feb. 14). Averaging 1.2 points and 1.4 rebounds in 6.7 minutes per game as a reserve. Eight of his 13 points in Big 12 play came against TCU on Feb. 11. Came off the bench to average 4.0 points and 2.5 boards in 13.1 minutes a game last year. Made 7 3-pointers over the final 7 games last year after making 1 in first 12 Big 12 games. Scored a career-high 18 points vs. Arkansas last season (career highs of 4 treys, 4 assists). Oklahoma state player of the year as a senior at Putnam City West High School in 2010. 2 STEVEN PLEDGER (6-4, 219, SENIOR, GUARD) A third-team All-Big 12 selection by the league’s head coaches. Averaging 11.8 points and 2.3 3-pointers per game (ranks 3rd in Big 12 Conference). Averaging 15.5 points over the last 8 games (has scored at least 14 in 6 of them). Is 28-for-64 (.438) from 3-point range last 8 games after going 2-for-17 (.118) in previous 4. Has scored in double figures in 18 of the last 24 outings. Has started his last 63 games. Ranks 14th in OU history with 1,389 points and 2nd with 248 3-point field goals. Big 12’s leading returning scorer from last season (16.2 ppg ranked 6th in league). Ranked 4th in Big 12 last year with his .416 3-point percentage and his 2.4 treys/game. Has made at least 3 treys in a game 41 times in his career (11 times this season). Scored a career-high 38 points in overtime win at Iowa State as a sophomore. 21 CAMERON CLARK (6-6, 208, JUNIOR, GUARD) Has played in all 94 of OU’s games during his career and made 60 starts (none of 31 this year). Averaging 6.5 points and 3.3 rebounds in 17.3 minutes a contest. Shooting .618 from the field over the last 12 games. Ranks second on team with .517 season field goal percentage. Started year 5-for-21 from field (.238) but is 73-for-130 in 27 games since (.562). Turned in season-high 17 point effort (8-for-12 FGs) in win over Texas A&M on Dec. 15. Averaged 8.5 points and 4.7 rebounds in 27.2 minutes per game last season. Ranked No. 32 as a high school senior by ESPN, No. 34 by Rivals.com and No. 39 by Scout.com. 3 BUDDY HIELD (6-3, 199, FRESHMAN, GUARD) Had surgery Feb. 12 to repair broken foot (sustained Feb. 11 vs. TCU); missed 5 games. Averaging 3.3 points and 3.3 rebounds in 3 games since his return (14.7 mpg); had 10 22 AMATH M’BAYE (6-9, 208, JUNIOR, FORWARD) Named to All-Big 12 Third Team and to Big 12 All-Rookie Team. An Academic All-Big 12 First Team selection (announced Feb. 14). Preseason Big 12 Newcomer of the Year and Nov. 26/Dec. 31 Big 12 Rookie of the Week. Averaging 10.1 points and 5.2 rebounds per game while shooting .464 from field. Has scored in double figures 15 times on the year but not in last 3 games. Had 15 points and career highs of 13 rebounds and 5 assists at Texas Tech 7 games ago. Turned in 20-point, 4-block effort (season highs) at Baylor (9-for-12 on FGs) on Jan. 30. Transferred from Wyoming where he played 2009-10 and 2010-11 seasons. Averaged 12.0 points and team-high 5.7 rebounds as a sophomore (started all 31 games). Averaged 18.5 points and 6.5 rebounds in 2 games vs. Lon Kruger’s UNLV team as a sophomore. Voted by OU teammates as squad’s best overall athlete, hardest worker, best dunker, most points, 9 rebounds [8 offensive], 2 assists and 3 steals 2 games ago at TCU. Averaging 8.0 points, 4.2 rebounds and 1.9 assists in 25.2 minutes a game on the year. Started each of last 13 games prior to injury (had 41 assists and 18 turnovers as a starter). Owns individual highs of 17 points, 11 rebounds, 7 assists and 4 steals on the season. A 4-star recruit by Rivals.com who was ranked 86th nationally last year. Averaged 22.7 points, 4.0 rebounds and 2.9 assists in 21.0 minutes per game as a HS senior. Born and raised in Freeport, Bahamas. 4 ANDREW FITZGERALD (6-8, 238, SENIOR, FORWARD) Started every game as a sophomore/junior but has come off bench in 30 of 31 games this year. Averaging 5.9 points and 3.5 rebounds in 15.9 minutes a contest. Had season highs of 13 points/11 rebounds in reg. season finale at TCU (3rd career dbl-dbl.). Shot .455 from free throw line in pre-conference play but is shooting .784 since. Ranks 33rd in school history with 1,086 career points. Scored a career-high 27 points vs. Iowa State last season in Norman (11-for-19 shooting). Averaged 12.1 points/5.0 boards last year (ranked 2nd/3rd on team in rebounding/scoring). Averaged 12.6 points and 5.0 rebounds per game as a sophomore (hon. mention All-Big 12). Arrived at OU in summer 2009 weighing 273 pounds but entered 2012-13 season at 238. likely to star in NBA and most competitive (tied with Romero Osby). A native of Bordeaux, France. 24 ROMERO OSBY (6-8, 232, SENIOR, FORWARD) A first-team All-Big 12 selection (OU’s first since Blake Griffin in 2008-09). Has started 61 of 62 games in his OU career. Averaging team highs of 15.8 points and 7.0 rebounds in 28.5 minutes per game. Tied for Big 12 lead with his 109 field goals in league play. In Big 12 play, ranked 2nd in scoring (17.8), 5th in rebounding (7.3) and 3rd in FG pct. (.540). Averaging 21.5 points and 8.1 rebounds over the last 8 outings on .553 field goal shooting. Has shot at least 50 percent from the field in 19 of the last 24 games. Averaged 19.0 points on .621 FG and .859 FT shooting in team’s 11 Big 12 wins. Averaging 23.2 points last 5 games (career-high 31 at Texas). Led OU in scoring (or tied for lead) in 13 of 18 league games (and in Big 12 Tourney game). Had streak of 36 free throw makes snapped Jan. 12 vs. Oklahoma State (school record is 37). Has taken a team-high 21 charges on the year (led Sooners with 16 taken last season). Named to Old Spice Classic all-tourney team (12.3 ppg, 7.0 rpg, .565 FG%). Big 12’s leading returning rebounder from last season (7.3 rpg). Averaged 12.9 points and team-high 7.3 boards last year (honorable mention All-Big 12). Played freshman and sophomore seasons at Mississippi State University. Rated No. 57 nationally by Rivals.com and No. 70 by Scout.com out of high school. 5 JE’LON HORNBEAK (6-3, 180, FRESHMAN, GUARD) Averaging 5.6 points, 2.7 boards, 1.7 assists and 1.0 steal in 22.6 minutes a game. Has started 28 of 31 games on the year, including the last 8. Recorded a 13-point, career-high-tying 5-rebound game against Baylor on Feb. 23. Owns a .342 3-point FG mark and ranks 2nd on team w/ 25 makes (14-for-39 in Big 12; .359). Scored 7 straight points in final 1:30 of Feb. 9 win over No. 5 Kansas. A 4-star recruit by Rivals.com who was ranked No. 102 nationally last year. Helped Grace Prep Academy (Arlington, Texas) to 57-10 record and state titles his last 2 years. 11 ISAIAH COUSINS (6-3, 182, FRESHMAN, GUARD) True freshman guard who has started 14 games on the year (has come off bench last 6). Averaging 2.5 points and 1.9 assists in 15.7 minutes per game on the year. Averaging 0.6 points last 6 games after averaging 7.3 previous 5 games. A 3-star recruit by Rivals.com who was New York’s Section 1 “Mr. Basketball” last year. Attended same high school (Mount Vernon HS) as OU assistant coach Lew Hill. 32 CASEY ARENT (6-10, 227, SENIOR, CENTER) Has played 31 total minutes in 6 games this season (averaging 0.7 points and 1.2 rebounds). Played 10 minutes Dec. 31 vs. Texas A&M-Corpus Christi and had 2 points and 2 rebounds. Averaged 1.2 points/1.8 boards in 6.1 minutes per game last year (played in 24 of 31 games). Rated as the nation’s 22nd-best juco player last year by JucoRecruiting.com. Earned first-team All-Big 8 and first-team all-state honors as a sophomore in 2010-11 at 13 JAMES FRASCHILLA (5-10, 150, SOPHOMORE, GUARD) Has scored 1 point in his 4 games this year (9 total minutes). A walk-on point guard from Dallas who totaled 3 points in his 10 appearances last year. Sierra College in Rocklin, Calif. Averaged 19.1 points and 11.4 rebounds per game as a sophomore (17 double-doubles). 6 Oklahoma Combined Team Statistics (as of Mar 14, 2013) All games 2012-13 OKLAHOMA MEN’S BASKETBALL HOME 12-2 8-1 4-1 RECORD: ALL GAMES CONFERENCE NON-CONFERENCE OVERALL 20-11 11-7 9-4 AWAY 5-7 3-6 2-1 NEUTRAL 3-2 0-0 3-2 SEASON STATISTICS (20-11) Total 3-Point fg% 3fg-fga 3fg% F-Throw ft-fta ft% off Rebounds def tot avg pf dq a to blk stl ## 02 Pledger, Steven 22 M'Baye, Amath 03 Hield, Buddy 24 Osby, Romero Player 21 Clark, Cameron 04 Fitzgerald, Andrew 05 Hornbeak, Je'lon 01 Grooms, Sam 15 Neal, Tyler 11 Cousins, Isaiah 32 Arent, Casey 13 Fraschilla, James Team Total.......... Opponents...... 31-30 31-31 31-31 26-13 31-0 31-1 31-28 30-7 31-14 26-0 6-0 5-0 31 31 gp-gs . 5 2 2 7-14 . 5 0 0 152-191 . 7 9 6 65 152 217 7.0 75 1 38 41 . 4 1 3 70-189 . 3 7 0 45-58 . 7 7 6 30 73 103 3.3 59 0 46 38 . 4 6 4 12-40 . 3 0 0 60-80 . 7 5 0 53 109 162 5.2 69 2 23 58 . 3 8 7 19-77 . 2 4 7 30-36 . 8 3 3 47 62 109 4.2 47 1 49 42 . 5 1 7 1-1 1.000 46-57 . 8 0 7 33 68 101 3.3 52 0 14 32 . 4 4 2 0-2 . 0 0 0 39-59 . 6 6 1 47 60 107 3.5 59 1 12 16 . 3 7 3 25-73 . 3 4 2 50-67 . 7 4 6 18 67 85 2.7 71 2 53 51 . 4 7 6 5-13 . 3 8 5 48-69 . 6 9 6 7 45 52 1.7 35 0 97 36 . 2 7 6 9-39 . 2 3 1 12-16 . 7 5 0 6 52 58 1.9 51 0 48 39 . 2 2 0 6-22 . 2 7 3 6-9 . 6 6 7 7 30 37 1.4 16 0 4 7 . 5 0 0 0-0 . 0 0 0 2-2 1.000 3 4 7 1.2 3 0 0 0 . 0 0 0 Oklahoma 0-2 . 0 0 0Men's 1-2 Basketball . 5 0 0 0 0 0 0.0 0 0 0 1 53 of48 101 6 Oklahoma Combined Team Statistics (as Mar 09, 2013) 6250 780-1789 . 4 3 6 154-472 . 3 2 6 491-646 . 7 6 0 369 770 1139 36.7 537 7 384 367 Conference games 6250 736-1763 . 4 1 7 199-609 . 3 2 7 381-555 . 6 8 6 352 729 1081 34.9 567 10 366 412 882 890 776 654 536 492 701 618 486 175 31 9 min avg fg-fga 28.5 28.7 25.0 25.2 17.3 15.9 22.6 20.6 15.7 6.7 5.2 1.8 165-316 126-305 121-261 79-204 78-151 72-163 50-134 50-105 29-105 9-41 1-2 0-2 27 4 24 7 4 12 7 0 2 0 0 0 19 31 22 32 18 13 31 8 22 4 0 0 489 367 314 207 203 183 175 153 79 30 4 1 pts 15.8 11.8 10.1 8.0 6.5 5.9 5.6 5.1 2.5 1.2 0.7 0.2 71.1 66.2 avg 87 200 2205 85 200 2052 TEAM STATISTICS OU OPP Date Opponent Score RECORD: OVERALL HOME AWAY NEUTRAL SCORING 2205 2052 W 85-51 11/11/12 ULM 3-6 ALL GAMES 11-7 8-1 0-0 Points per game CONFERENCE 71.1 66.2 11/16/12 at UT Arlington W 63-59 11-7 8-1 3-6 0-0 Scoring margin NON-CONFERENCE +4.9 # 11/22/12 vs UTEP W 68-61 0-0 0-0 0-0 0-0 FIELD GOALS-ATT 780-1789 736-1763 # 11/23/12 vs Gonzaga L 47-72 Field goal pct . 4 3 6 . 4 1 7 W 77-70 Total 3-Point # 11/25/12 F-Throw vs West Virginia Rebounds 3 POINT FG-ATT 154-472 199-609 W at Oral Roberts ## Player gp-gs min avg fg-fga fg% 3fg-fga 3fg% 11/28/12 ft-fta ft% off def tot avg pf dq a to 63-62 blk stl 3-point FG pct . 3 2 6 . 3 2 7 11/30/12 NORTHWESTERN STATE W 69-65 24 Osby, Romero 18-18 565 31.4 109-202 . 5 4 0 5-9 . 5 5 6 97-125 . 7 7 6 34 98 132 7.3 45 0 23 27 15 12 3-pt FG made per game 5.0 6.4 L 78-81 12/04/12 at Arkansas 02 Pledger, Steven 18-18 491-646 543 30.2 76-180 . 4 2 2 42-111 . 3 7 8 27-35 . 7 7 1 16 47 63 3.5 30 0 27 22 3 15 FREE THROWS-ATT 381-555 $ 12/15/12 vs Texas A&M W 64-54 Free throw pct . 7 6 0 72-163 . 6 8 6 22 M'Baye, Amath 18-18 478 26.6 . 4 4 2 12-30 . 4 0 0 12/18/12 34-41 . 8 2 9 27 60 87 4.8 47 2 14 12 10 L 32 55-56 STEPHEN F. AUSTIN F-Throws made per game 12.3 W 18 74-63 OHIO 03 Hield, Buddy 13-11 36615.8 28.2 42-104 . 4 0 4 6-37 . 1 6 2 12/29/12 16-19 . 8 4 2 22 36 58 4.5 30 1 33 3 17 REBOUNDS 1139 1081 % TEXAS A&M-CORPUS CHRISTI W 24 72-42 01 Grooms, Sam 18-6 398 22.1 39-80 . 4 8 8 5-10 . 5 0 0 12/31/12 38-53 . 7 1 7 6 30 36 2.0 20 0 67 0 7 Rebounds per game 36.7 34.9 * 1/5/13 at West Virginia W 21 Clark, Cameron 18-0 308 17.1 43-80 . 5 3 8 0-0 . 0 0 0 22-31 . 7 1 0 20 41 61 3.4 26 0 5 20 67-57 1 9 Rebounding margin +1.9 * 01/12/13 OKLAHOMA STATE W 77-68 04 Fitzgerald, Andrew 18-0 274 15.2 38-83 . 4 5 8 0-0 . 0 0 0 29-37 . 7 8 4 26 45 71 3.9 41 1 6 6 4 6 ASSISTS 384 366 * 01/16/13 TEXAS TECH W 81-63 05 Hornbeak, Je'lon 18-15 38812.4 21.6 24-7011.8 . 3 4 3 14-39 . 3 5 31-40 . 7 7 5 12 38 50 2.8 44 2 28 2 15 Assists per game * 9 1/19/13 at Kansas State L 29 60-69 TURNOVERS 11 Cousins, Isaiah 18-4 258 367 14.3 18-53 412 . 3 4 0 3-16 . 1 8 8 8-9 . 8 8 9 3 25 28 1.6 32 0 26 22 1 * 01/21/13 TEXAS W 73-6712 Turnovers per game * 9 01/26/13 at Kansas L 15 Neal, Tyler 14-0 6011.8 4.3 4-15 13.3 . 2 6 7 3-7 . 4 2 2-3 . 6 6 7 2 8 10 0.7 6 0 3 4 54-67 0 2 Turnover margin - 0 * 0 1/30/13 at Baylor W 13 Fraschilla, James 2-0 1+1.5 0.5 0-0 . 0 0 0-0 . 0 0 0-0 . 0 0 0 0 0 0 0.0 0 0 0 0 74-71 0 0 Assist/turnover ratio 1.0 0.9 * 02/02/13 KANSAS STATE L 32 Arent, Casey 3-0 11 3.7 0-0 . 0 0 0 0-0 . 0 0 0 0-0 . 0 0 0 1 2 3 1.0 2 0 0 0 50-52 0 0 STEALS 200 200 * 02/04/13 at Iowa State L 64-83 Team 31 28 59 3 Steals per game 6.5 6.5 * 02/09/13 KANSAS W 72-66 Total.......... 18 3650 87 465-1030 85 . 4 5 1 90-259 . 3 4 304-393 . 7 7 4 200 458 658 36.6 323 6 232 41 105 BLOCKS * 7 02/11/13 TCU W 207 75-48 Blocks per game Opponents...... 18 3650 2.8 438-10342.7 . 4 2 4 135-385 . 3 5 232-349 . 6 6 5 204 411 615 34.2 337 8 216 55 120 * 1 02/16/13 at Oklahoma State L o t 220 79-84 ATTENDANCE 138455 154602 * 02/20/13 at Texas Tech W 86-71 Home games-Avg/Game 14-9890 12-10329 * Date 02/23/13 BAYLOR W 90-76 TEAM STATISTICS OU OPP Opponent Score Neutral site-Avg/Game 5-6130 * 02/27/13 at Texas L o t 86-92 SCORING 1324 1243 * 1/5/13 at West Virginia W 67-57 * 03/02/13 IOWA STATE W 86-69 Points per game 73.6 69.1 * 01/12/13 OKLAHOMA STATE W 77-68 Score by Periods 1st 2nd OT Totals * 03/06/13 WEST VIRGINIA W 83-70 Scoring margin +4.5 * 01/16/13 TEXAS TECH W 81-63 Oklahoma 1055 1135465-1030 15 2205 * 03/09/13 at TCU L 67-70 FIELD GOALS-ATT 438-1034 * 1/19/13 at Kansas State L 60-69 Opponents 923 1103 26 2052 L 66-73 03/14/13 vs Iowa State Field goal pct . 4 5 1 . 4 2 4 * 01/21/13 TEXAS W 73-67 3 POINT FG-ATT 90-259 135-385 * 01/26/13 at Kansas L 54-67 # = Old Spice Classic (Orlando, Fla.) 3-point FG pct . 3 4 7 . 3 5 1 * 1/30/13 at Baylor W 74-71 $ = All-College Classic (Oklahoma City, Okla.) 3-pt FG made per game 5.0 7.5 * 02/02/13 KANSAS STATE L 50-52 % = Played at McCasland Field House on OU campus FREE THROWS-ATT 304-393 232-349 * 02/04/13 at Iowa State L 64-83 * = Conference game Free throw pct . 7 7 4 . 6 6 5 * 02/09/13 KANSAS W 72-66 F-Throws made per game 16.9 12.9 * 02/11/13 TCU W 75-48 REBOUNDS 658 615 * 02/16/13 at Oklahoma State L o t 79-84 Rebounds per game 36.6 34.2 * 02/20/13 at Texas Tech W 86-71 Rebounding margin +2.4 * 02/23/13 BAYLOR W 90-76 ASSISTS 232 216 * 02/27/13 at Texas L o t 86-92 Assists per game 12.9 12.0 * 03/02/13 IOWA STATE W 86-69 TURNOVERS 207 220 * 03/06/13 WEST VIRGINIA W 83-70 Turnovers per game 11.5 12.2 * 03/09/13 at TCU L 67-70 7 Turnover margin +0.7 Assist/turnover ratio 1.1 1.0 # = Old Spice Classic (Orlando, Fla.) BIG 12 CONFERENCE GAMES (11-7) Att. 8734 6421 2076 2205 4121 pts7219 avg 8915 320 17.8 12548 2214254 12.3 1908572 10.6 10036 106 8.2 1212751 6.7 12112 108 6.0 12695 105 5.8 9178 93 5.2 12528 47 2.6 10409 16300 13 0.9 06533 0.0 11882 0 0.0 13178 13490 13248948 73.6 1243 69.1 13611 8248 12199 Att. 9860 12112 10789 12695 9857 9178 5392 12528 17996 10409 16300 6533 11882 13178 13490 8948 13611 8248 12199 9860 10789 9857 5392 2012-13 OKLAHOMA MEN’S BASKETBALL SEASON RESULTS Date 11/11 11/16 Opponent ULM at UT Arlington vs. UTEP # vs. Gonzaga (17) # vs. West Virginia # at Oral Roberts Northwestern State at Arkansas vs. Texas A&M $ Stephen F. Austin Ohio Score 85-51 63-59 68-61 47-72 77-70 63-62 69-65 78-81 64-54 55-56 74-63 Texas A&M-Corpus Christi % 72-42 at West Virginia 67-57 Oklahoma State 77-68 Texas Tech 81-63 at Kansas State (16) 60-69 Texas 73-67 at Kansas (3) 54-67 at Baylor 74-71 Kansas State (18) 50-52 at Iowa State 64-83 Kansas (5) 72-66 TCU 75-48 at Oklahoma State (17) 79-84 at Texas Tech 86-71 Baylor 90-76 at Texas 86-92 Iowa State 86-69 West Virginia 83-70 at TCU 67-70 vs. Iowa State ^ 66-73 W/L W W W L W W W L W L W W W W W L W L W L L W W L (OT) W W L (OT) W W L L Attend. 8,734 6,421 2,076 2,205 4,121 7,219 8,915 12,548 4,254 8,572 10,036 2,751 12,112 12,695 9,178 12,528 10,409 16,300 6,533 11,882 13,178 13,490 8,948 13,611 8,248 12,199 9,860 10,789 9,857 5,392 17,996 Points Leader Pledger................................15 Hield....................................17 Osby....................................16 Osby....................................13 M’Baye................................19 M’Baye................................12 Osby ...................................11 Osby....................................22 Osby....................................19 Hornbeak, Pledger...............12 Pledger................................18 Pledger................................17 Osby....................................21 Osby....................................17 Osby....................................17 M’Baye, Osby.......................12 Osby....................................29 M’Baye, Osby.......................12 M’Baye, Pledger...................20 Osby....................................13 Fitzgerald............................12 Osby....................................17 M’Baye................................12 Grooms, Osby, Pledger.........18 Pledger................................22 Grooms................................23 Osby....................................31 Osby....................................22 Osby....................................26 Osby....................................19 Osby....................................18 Rebounds Leader M’Baye................................. 9 Osby................................... 10 Osby................................... 10 M’Baye, Osby........................ 5 M’Baye, Neal, Osby, Pledger..... 6 M’Baye................................. 9 M’Baye, Osby........................ 8 M’Baye, Osby........................ 6 Osby..................................... 7 Hield.................................. 11 M’Baye, Pledger................... 6 M’Baye, Osby........................ 6 Osby..................................... 9 Pledger................................ 9 Hield.................................... 7 Hield.................................. 10 Osby..................................... 8 Fitzgerald............................. 8 Osby..................................... 8 Osby..................................... 7 Fitzgerald............................. 7 Osby..................................... 8 Osby..................................... 7 Osby................................... 15 M’Baye............................... 13 Osby..................................... 8 Clark..................................... 6 Osby..................................... 9 Pledger................................ 8 Fitzgerald........................... 11 Osby..................................... 9 Assists Leader Cousins, Grooms, Hornbeak... 5 Clark, Grooms, Hornbeak....... 2 Cousins, Osby........................ 4 Grooms, Hornbeak................ 2 Grooms................................. 4 Cousins................................. 3 Cousins, Grooms.................... 4 Pledger................................. 3 Hornbeak.............................. 3 Hornbeak.............................. 3 Hield..................................... 7 Hornbeak.............................. 5 Hield..................................... 5 Hield..................................... 5 Grooms................................. 5 Grooms................................. 4 Grooms, Hield........................ 4 Cousins, Hield, H’Beak, Osby.... 2 Hornbeak.............................. 6 Cous., Hield, H’Beak, Grooms.... 2 Pledger................................. 3 Cousins................................. 4 Clark, Cousins, Hield, H’beak.... 2 Grooms................................. 4 Grooms, M’Baye.................... 5 Grooms................................. 4 Grooms................................. 6 Grooms................................. 6 Grooms............................... 10 Grooms................................. 6 Osby...................................... 4 Associated Press rankings in parentheses # Old Spice Classic (Orlando, Fla.) $ All-College Classic (Oklahoma City, Okla.) % Field House Series (played on OU campus at McCasland Field House) ^ Phillips 66 Big 12 Championship (Kansas City, Mo.) Record Summary All Games Big 12 Games Non-Conference Games Overall 20-11 11-7 9-4 Home 12-2 8-1 4-1 Away 5-7 3-6 2-1 Neutral 3-2 0-0 3-2 8 2012-13 OKLAHOMA MEN’S BASKETBALL POINTS, REBOUNDS, ASSISTS Date Opponent 1 2 GROOMS PLEDGER 3 4 5 11 13 14 HIELD FITZGERA LD H’BEAK COUSINS FRASCH. NWRYTA. 15 NEAL 21 CLARK 22 M’BAYE 24 OSBY 32 ARENT 11/11 11/18 Iowa State West Virginia at TCU vs. Iowa State ^ 2-0-5 0-1-2 2-2-2 0-1-2 2-1-4 4-3-1 3-0-4 5-1-2 2-0-2 DNP 2-1-2 2-2-1 2-4-2 6-3-3 0-4-5 4-4-4 7-0-4 2-1-1 0-0-0 7-1-2 2-1-1 0-1-3 0-2-1 18-1-4 12-2-5 23-2-4 3-5-6 19-2-6 8-1-10 8-2-6 8-4-3 15-1-0 9-3-1 12-2-1 7-2-0 8-6-3 9-1-2 9-3-2 12-3-3 10-2-2 12-5-1 18-6-1 17-2-1 12-4-0 11-9-2 11-3-0 10-1-3 5-3-0 10-1-0 20-1-5 2-1-0 5-6-3 15-6-2 4-2-1 18-1-2 22-4-2 19-5-1 18-3-3 14-4-3 23-8-0 2-1-0 8-4-2 9-3-1 17-4-0 7-5-0 5-2-0 8-3-1 11-6-1 5-2-0 6-2-1 12-4-1 9-11-1 5-3-7 7-5-3 8-7-5 15-4-5 16-7-3 8-10-3 12-4-4 9-2-2 9-5-3 4-4-2 5-3-1 2-3-1 8-0-2 DNP DNP DNP DNP DNP 0-0-0 10-9-2 0-1-0 12-6-0 4-2-1 9-5-1 4-1-1 9-3-0 5-3-1 8-3-1 4-1-0 2-3-1 6-2-0 4-3-0 9-2-0 0-1-0 1-1-0 12-4-0 6-2-0 0-1-0 4-8-1 8-5-2 4-6-0 12-7-1 6-2-0 9-3-0 4-4-0 2-4-0 4-2-0 5-2-0 10-3-1 5-5-1 13-11-0 2-2-0 10-5-5 7-2-1 5-1-1 0-2-2 14-5-1 5-3-0 7-1-0 5-2-1 2-4-3 12-3-3 5-2-2 3-3-5 4-2-1 8-3-1 2-1-0 5-2-3 3-1-3 1-4-2 2-5-6 0-3-2 3-2-1 7-2-2 9-2-2 10-3-0 2-0-1 13-5-0 5-5-0 2-6-1 9-2-3 8-2-0 7-2-1 2-3-5 0-1-0 5-2-4 10-1-1 0-2-2 0-4-3 9-5-4 2-3-1 0-3-1 1-1-0 0-0-1 3-3-0 6-0-1 0-2-0 6-2-2 2-3-2 0-3-1 0-0-2 0-0-2 6-2-2 10-3-2 7-4-4 6-3-2 0-1-1 0-1-1 2-1-0 0-2-3 2-1-1 0-0-0 0-0-0 0-2-0 1 9-4-0 0-3-0 2-2-0 0-1-0 3-6-0 0-0-0 3-5-0 0-3-0 0-0-0 0-1-0 0-0-0 0-2-1 0-0-1 0-0-0 0-0-0 0-1-0 0-0-0 DNP DNP DNP 3-3-1 0-0-0 8-4-0 DNP 2-0-0 0-0-0 0-0-0 0-1-1 0-1-0 0-0-0 DNP 2-5-1 9-6-2 2-4-0 3-2-0 6-0-2 6-1-0 6-1-0 8-3-2 17-4-0 4-2-0 8-4-1 7-4-1 7-6-0 4-4-0 10-3-1 1-1-0 2-2-0 4-2-0 4-1-0 7-4-0 10-2-0 10-3-0 8-3-2 5-7-0 10-5-0 5-3-1 8-6-0 6-3-0 5-3-1 2-3-0 17-4-0 12-9-2 7-9-2 8-4-1 5-5-0 19-6-0 12-9-1 8-8-0 14-6-2 0-0-0 3-4-0 16-6-0 14-6-1 7-4-2 15-5-0 7-5-0 12-4-0 15-5-0 12-7-0 20-7-1 7-5-0 8-6-0 8-3-0 12-3-1 6-5-1 15-13-5 7-4-1 16-4-2 11-4-1 7-2-0 5-1-0 6-3-0 9-7-1 10-10-0 16-10-4 13-5-0 8-6-0 11-3-0 11-8-1 22-6-2 19-7-1 8-3-1 16-5-0 8-6-1 21-9-0 17-3-2 17-6-2 12-8-0 29-8-0 12-6-2 11-8-1 13-7-0 6-6-2 17-8-3 11-7-0 18-15-1 21-9-3 17-8-0 31-5-3 22-9-3 26-6-0 19-4-0 18-9-4 2-2-0 DNP DNP 0-0-0 DNP DNP DNP DNP DNP DNP DNP 2-2-0 DNP DNP 0-1-0 DNP DNP DNP DNP DNP 0-1-0 DNP 0-1-0 DNP DNP DNP DNP DNP DNP DNP DNP Starters underlined Associated Press rankings in parentheses # Old Spice Classic (Orlando, Fla.) $ All-College Classic (Oklahoma City, Okla.) % Field House Series (played on OU campus at McCasland Field House) ^ Phillips 66 Big 12 Championship (Kansas City, Mo.) MISCELLANEOUS STATS Dunks Amath M’Baye......................21 Romero Osby.........................18 Cameron Clark.......................13 Buddy Hield............................5 Andrew Fitzgerald...................2 Isaiah Cousins..........................1 Tyler Neal................................1 Steven Pledger........................1 Charges Taken Romero Osby.........................21 Andrew Fitzgerald...................2 Sam Grooms............................2 Je’lon Hornbeak......................2 Cameron Clark.........................1 Amath M’Baye........................1 Tyler Neal................................1 9 2012-13 OKLAHOMA MEN’S BASKETBALL GAME-BY-GAME TEAM STATS ULM at Oklahoma Oklahoma FG-A 32-68 19-58 Pct. .471 .328 3FG-A 9-23 5-18 Pct. .391 .278 FT-A 12-16 20-32 Pct. .750 .625 O/D/T 16/33/49 15/33/48 PF 12 22 A 20 9 TO 12 18 B 7 3 S 7 8 1 38 38 2 47 25 TP 85 63 19-55 .345 3-16 .188 10-18 .556 8/22/30 16 9 14 0 9 22 29 51 at UT Arlington UTEP # vs. Oklahoma # Oklahoma # vs. Oklahoma # Oklahoma at Oklahoma Oklahoma 22-58 19-46 25-60 16-50 27-57 25-63 22-56 31-56 21-54 22-58 27-57 24-59 27-61 25-58 28-59 25-53 25-52 21-59 29-55 19-49 26-71 26-58 29-58 29-61 32-60 22-49 29-57 23-52 26-52 24-66 24-63 .379 .413 .417 .320 .474 .397 .393 .554 .389 .379 .474 .407 .443 .431 .475 .472 .481 .356 .527 .388 .366 .448 .500 .475 .533 .449 .509 .442 .500 .364 .381 3-18 4-10 6-18 5-16 4-15 2-10 5-12 6-15 4-16 3-14 3-12 9-26 4-15 8-13 3-11 3-11 2-6 3-12 5-14 3-14 3-16 7-20 3-11 6-15 8-17 7-14 9-18 6-18 .167 .400 .333 .313 .267 .200 .417 .400 .250 .214 .250 .346 .267 .615 .273 .273 12-21 19-24 12-20 10-15 19-25 11-16 20-28 10-14 18-19 8-11 17-23 15-16 9-11 19-21 22-26 7-15 21-27 9-14 11-17 9-14 9-17 .571 .792 .600 .667 .760 .688 .714 .714 .947 .727 .739 .938 .818 .905 .846 .467 8/30/38 7/25/32 15/23/38 17/34/51 18/20/38 10/23/33 11/27/38 9/17/26 12/23/35 17/20/37 5/25/30 5/19/24 21 18 24 18 10 11 14 10 8 13 6 6 18 17 11 14 8 3 5 5 5 6 8 7 28 26 38 22 31 35 30 25 59 61 68 72 70 vs. Gonzaga (17) # West Virginia # at Oral Roberts Northwestern State at Arkansas Texas A&M $ 27-59 21-58 26-55 22-58 30-57 20-50 24-61 25-53 17-58 18-60 22-56 25-59 22-50 27-61 24-55 28-75 21-56 28-55 25-54 16-53 27-62 24-58 26-70 29-58 22-51 27-51 27-50 26-61 .458 .362 .473 .379 .526 .400 .393 .472 .293 .300 .393 .424 .440 .443 .436 .373 .375 .509 .463 .302 .435 .414 .371 .500 .431 .529 .540 .426 6-22 4-14 3-13 6-18 9-22 5-11 3-14 8-26 3-14 .273 .286 .231 .333 .409 .455 .214 .308 .214 .367 .286 .227 .417 .316 .412 .222 .313 .407 .333 .238 .375 .462 .290 .400 .355 .476 12-19 24-34 7-9 15-18 12-16 9-12 5-6 5-7 5-8 .632 .706 .778 .833 .750 .750 .833 .714 .625 15/24/39 18/19/37 12/26/38 10/21/31 11/20/31 17/21/38 10/23/33 13/31/44 13/27/40 10/27/37 16/24/40 14/25/39 9/23/32 11/20/31 5/29/34 27 14 14 14 11 16 13 14 14 21 13 18 13 14 19 18 21 19 22 16 15 14 19 16 13 9 12 14 11 10 12 13 17 11 11 8 15 17 13 19 13 18 4 1 3 2 4 0 0 3 4 3 1 4 1 4 7 8 7 10 9 6 4 5 6 7 42 31 29 38 28 30 29 40 29 38 34 27 30 21 38 32 37 35 32 41 27 26 29 35 32 40 40 36 25 45 32 38 39 47 33 43 33 36 40 33 27 33 40 27 30 34 21 47 77 63 69 78 64 55 74 72 67 77 81 60 73 54 62 65 81 54 vs. Oklahoma $ 21 9 17 6 Stephen F. Austin at Oklahoma 13 11 13 10 13 3 1 4 2 1 4 2 6 2 5 10 5 12 7 7 8 7 1 8 7 8 56 63 Ohio at Oklahoma 14 14 12 13 13 16 12 10 20 16 3 5 Texas A&M-Corpus Christi % at Oklahoma % Oklahoma 12/23/35 18 2 5 21 42 at West Virginia Oklahoma State at Oklahoma 11-30 6-21 5-22 10-13 18-25 8-13 .769 .720 .615 17/22/39 12/24/36 14/18/32 6/19/25 13/21/34 10 18 23 12 11 9 14 15 14 8 15 3 3 2 3 7 8 35 29 29 22 39 34 57 68 Texas Tech at Oklahoma Oklahoma at Oklahoma Oklahoma at Kansas State (16) Texas at Kansas (3) Oklahoma 10-24 6-19 7-17 6-27 5-16 .333 .250 .357 .214 .188 .350 .273 .400 .471 .500 .500 .333 .556 .000 .167 15-22 7-11 12-19 9-17 5-7 .778 .643 .647 .643 .529 .813 1.000 .714 .700 .867 .704 1.000 .778 .704 .833 .682 .636 .632 .529 .714 15 20 17 10 9 16 13 11 16 63 4 3 7 7 35 26 34 41 69 67 12/29/41 24/23/47 9/25/34 13 19 18 15 12 11 14 14 10 6 0 2 8 29 26 28 38 45 24 67 at Baylor Kansas State (18) at Oklahoma Oklahoma at Iowa State Kansas (5) TCU at Oklahoma at Oklahoma Oklahoma Oklahoma 11-27 5-15 5-21 6-16 6-13 9-31 13-16 14-14 15-21 14-20 39-45 19-27 34-34 21-27 19-27 15-18 16-18 11-20 11-16 24-33 17-28 15-21 26-35 14-22 6-13 .889 .550 .688 .727 .607 .714 .743 .636 .462 10/28/38 21/21/42 10/25/35 7/27/34 9/32/41 9/30/39 7/26/33 10/25/35 13/22/35 10/26/36 10/19/29 14/23/37 11/23/34 4/23/27 6/30/36 12 17 18 15 23 24 15 17 15 19 19 32 20 20 21 8 12 15 11 9 17 18 11 7 14 9 11 10 13 7 9 1 2 1 1 1 2 8 10 4 5 6 9 2 6 74 50 64 72 75 79 6 1 7 5 23 31 38 36 35 44 44 34 27 33 34 71 52 39 32 37 83 66 48 84 71 76 16 5 3 4 3 7 11 27 at Oklahoma State (17) at Texas Tech Baylor at Texas Iowa State 11 6 11 14 8 13 46/11 * 42 39 38/6 * 13 at Oklahoma Oklahoma at Oklahoma 8-20 11-31 10-18 0-16 3-18 7/31/38 11/23/34 25 25 18 15 19 15 7 17 17 16 16 10 12 12 9 5 1 3 2 3 2 4 2 5 5 2 1 13 3 4 5 6 5 6 6 8 8 47 43 40 39 22 37 36 21 28 28 28 49/15 * 41 46 44 45 29 43 34/9 * 35 55 86 90 86 86 83 67 66 92 69 West Virginia at TCU Iowa State at Oklahoma Oklahoma vs. Oklahoma ^ 10-21 8-14 7-26 .571 .269 8-16 14-14 .500 1.000 14/19/33 18/17/35 12/19/31 9/16/25 9/27/36 14/29/43 23 15 15 8 10 20 17 11 8 5 13 5 42 70 70 73 16 11 3 1 3 3 44 29 26 44 Associated Press rankings in parentheses # Old Spice Classic (Orlando, Fla.) $ All-College Classic (Oklahoma City, Okla.) % Field House Series (played on OU campus at McCasland Field House) ^ Phillips 66 Big 12 Championship (Kansas City, Mo.) * Overtime points 10 2012-13 OKLAHOMA MEN’S BASKETBALL INDIVIDUAL HIGHS OKLAHOMA HIGHS Points 31, Romero Osby vs. Texas (2/27) Field Goals 9, Romero Osby vs. West Virginia (3/6) 9, Romero Osby vs. Texas (2/27) 9, Sam Grooms vs. Oklahoma State (2/16) 9, Amath M’Baye vs. Baylor (1/30) 9, Romero Osby vs. Texas (1/21) 9, Romero Osby vs. Arkansas (12/4) Field Goal Attempts 19, Romero Osby vs. Iowa State (3/14) Field Goal Pct. (min. 5 made) .833 (5-for-6), Amath M’Baye vs. West Virginia (11/25) 3-Point Field Goals 6, Steven Pledger vs. Texas Tech (2/20) 3-Point Field Goal Attempts 13, Steven Pledger vs. Texas Tech (2/20) 3-Point Field Goal Pct. (min. 4 made) .556 (5-for-9), Steven Pledger vs. ULM (11/11) Free Throws 15, Sam Grooms vs. Baylor (2/23) Free Throw Attempts 17, Romero OSby vs. Texas (2/27) 17, Sam Grooms vs. Baylor (2/23) Free Throw Pct. (min. 5 made) 1.000 (10-for-10), Romero Osby vs. Iowa State (3/2) Rebounds 15, Romero Osby vs. Oklahoma State (2/16) Assists 10, Sam Grooms vs. West Virginia (3/6) Turnovers 5, Romero Osby vs. Kansas State (1/19) Blocked Shots 4, Amath M’Baye vs. Baylor (1/30) Steals 4, Buddy Hield vs. Ohio (12/29) OKLAHOMA’S TOP INDIVIDUAL PERFORMANCES POINTS 31...........................................................................................Romero Osby vs. Texas (2/27) 29...........................................................................................Romero Osby vs. Texas (1/21) 26.................................................................................Romero Osby vs. West Virginia (3/6) 23..............................................................................Steven Pledger vs. West Virginia (3/6) 23.......................................................................................... Sam Grooms vs. Baylor (2/23) 22.....................................................................................Romero Osby vs. Iowa State (3/2) 22................................................................................ Steven Pledger vs. Texas Tech (2/20) 22.....................................................................................Romero Osby vs. Arkansas (12/4) 21................................................................................... Romero Osby vs. Texas Tech (2/20) 21.................................................................................Romero Osby vs. West Virginia (1/5) 20.......................................................................................Amath M’Baye vs. Baylor (1/30) 20...................................................................................... Steven Pledger vs. Baylor (1/30) REBOUNDS 15.......................................................................... Romero Osby vs. Oklahoma State (2/16) 13.................................................................................Amath M’ Baye vs. Texas Tech (2/20) 11......................................................................................Andrew Fitzgerald vs. TCU (3/9 ) 11....................................................................... Buddy Hield vs. Stephen F. Austin (12/18) 10................................................................................ Buddy Hield vs. Kansas State (1/19) 10......................................................................................... Romero Osby vs. UTEP (11/22) 10............................................................................. Romero Osby vs. UT Arlington (11/16) ASSISTS 10................................................................................. Sam Grooms vs. West Virginia (3/6) 7..............................................................................................Buddy Hield vs. Ohio (12/29) 6.................................................................................................. Sam Grooms vs. TCU (3/9) 6....................................................................................... Sam Grooms vs. Iowa State (3/2) 6..............................................................................................Sam Grooms vs. Texas (2/27) 6.......................................................................................Je’lon Hornbeak vs. Baylor (1/30) OPPONENT HIGHS Points 33, Marshawn Powell, Arkansas (12/4) Field Goals 11, Marshawn Powell, Arkansas (12/4) Field Goal Attempts 23, Pierre Jackson, Baylor (2/23) Field Goal Pct. (min. 5 made) .750 (6-for-8), Reggie Keely, Ohio (12/29) .750 (6-for-8), Karol Gruszecki, UT Arlington (11/16) 3-Point Field Goals 6, Tyrus McGhee, Iowa State (3/2) 6, Terry Henderson, West Virginia (1/5) 3-Point Field Goal Attempts 13, Tyrus McGhee, Iowa State (3/2) 13, Pierre Jackson, Baylor (2/23) 3-Point Field Goal Pct. (min. 4 made) 1.000 (4-for-4), Garlon Green, TCU (3/9) Free Throws 12, Myck Kabongo, Texas (2/27) 12, Sheldon McClellan, Texas (2/27) Free Throw Attempts 15, Myck Kabongo, Texas (2/27) Free Throw Pct. (min. 5 made) 1.000 (12-for-12), Sheldon McClellan, Texas (2/27) Rebounds 20, Isaiah Austin, Baylor (1/30) Assists 9, Korie Lucious, Iowa State (3/14) 9, Angel Rodriguez, Kansas State (1/19) 9, Hal Bateman, Stephen F. Austin (12/18) Turnovers 6, Garlon Green, TCU (3/9) 6, Will Nelson, Texas A&M-Corpus Christi (12/31) 6, Ivo Baltic, Ohio (12/29) 6, Charles Drew, UT Arlington (11/16) Blocked Shots 4, Jeff Withey, Kansas (1/26) 4, Taylor Smith, Stephen F. Austin (12/18 4, Jordan Reves, UT Arlington (11/16) Steals 5, David Stockton, Gonzaga (11/23) BLOCKED SHOTS 4.........................................................................................Amath M’Baye vs. Baylor (1/30) 3............................................................................................Romero Osby vs. ULM (11/11) STEALS 4..............................................................................................Buddy Hield vs. Ohio (12/29) 3........................................................................................................................ eight times 3-POINT FIELD GOALS 6..........................................................................................Steven Pledger vs. Texas (2/27) 6.................................................................................. Steven Pledger vs. Texas Tech (2/20) 5................................................................................Steven Pledger vs. West Virginia (3/6) 5.........................................................................................Steven Pledger vs. Ohio (12/29) 5......................................................................................... Steven Pledger vs. ULM (11/11) 4....................................................................................Steven Pledger vs. Iowa State (3/2) 4.................................................................................... Steven Pledger vs. Arkansas (12/4) FREE THROWS 15.......................................................................................... Sam Grooms vs. Baylor (2/23) 13...........................................................................................Romero Osby vs. Texas (2/27) 10.....................................................................................Romero Osby vs. Iowa State (3/2) 10...........................................................................................Romero Osby vs. Texas (1/21) 9.................................................................................. Romero Osby vs. Texas A&M (12/15) 9.................................................................... Romero Osby vs. Northwestern State (11/30) 9............................................................................ Amath M’Baye vs. West Virginia (11/25) 11 2012-13 OKLAHOMA MEN’S BASKETBALL SPECIALTY STATS Won Opening Tip Date Opponent Score W/L OU Opp. 11/11 ULM 85-51 W X 11/16 at UT Arlington 63-59 W X 11/22 vs. UTEP # 68-61 W X 11/23 vs. Gonzaga (17) # 47-72 L X 11/25 vs. West Virginia # 77-70 W X 11/28 at Oral Roberts 63-62 W X 11/30 Northwestern State 69-65 W X 12/4 at Arkansas 78-81 L X 12/15 vs. Texas A&M $ 64-54 W X 12/18 Stephen F. Austin 55-56 L X 12/29 Ohio 74-63 W X 12/31 Texas A&M-C.C. % 72-42 W X 1/5 at West Virginia 67-57 W X 1/12 Oklahoma State 77-68 W X 1/16 Texas Tech 81-63 W X 1/19 at Kansas State (16) 60-69 L X 1/21 Texas 73-67 W X 1/26 at Kansas (3) 54-67 L X 1/30 at Baylor 74-71 W X 2/2 Kansas State (18) 50-52 L X 2/4 at Iowa State 64-83 L X 2/9 Kansas (5) 72-66 W X 2/11 TCU 75-66 W X 2/16 at Oklahoma State (17) 79-84 L (OT) X 2/20 at Texas Tech 86-71 W X 2/23 Baylor 90-76 W X 2/27 at Texas 86-92 L (OT) X 3/2 Iowa State 86-69 W X 3/6 West Virginia 83-70 W X 3/9 at TCU 67-70 L X 3/14 vs. Iowa State 66-73 L X Totals 16 15 Associated Press rankings in parentheses # Old Spice Classic (Orlando, Fla.) $ All-College Classic (Oklahoma City, Okla.) % Field House Series (played on OU campus at McCasland Field House) ^ Phillips 66 Big 12 Championship (Kansas City, Mo.) Points in Paint OU Opp. 42 26 18 26 16 26 16 26 32 20 32 32 20 28 42 36 22 26 12 34 30 28 24 16 30 10 26 26 34 34 34 16 34 28 16 28 20 42 26 24 28 32 16 32 30 20 22 34 24 30 14 26 26 32 22 20 22 28 44 30 18 36 790 852 Points Off Turnovers OU Opp. 17 13 21 11 22 12 11 12 14 7 16 14 19 9 15 19 20 9 10 12 22 10 11 3 17 11 14 14 16 10 6 26 12 14 14 13 13 20 17 8 14 14 6 12 17 8 5 13 12 16 8 17 16 26 13 8 20 13 21 8 11 6 450 388 2nd Chance Points OU Opp. 16 6 11 6 11 8 4 17 15 16 17 10 7 9 16 14 14 14 15 16 10 2 19 5 15 8 12 9 12 13 20 5 10 16 14 9 6 24 9 13 23 9 11 14 11 6 9 9 6 6 15 11 10 7 6 5 23 8 22 9 11 18 400 322 Bench Points OU Opp. 37 14 30 29 22 22 12 27 28 23 26 0 25 38 41 22 33 13 19 10 14 23 23 6 15 4 11 21 28 18 13 7 9 44 10 12 12 2 24 18 38 25 23 11 34 11 27 12 26 23 11 10 13 32 18 36 10 20 25 19 19 13 677 565 12 2012-13 OKLAHOMA MEN’S BASKETBALL 1 PTS 5.1 SAM GROOMS GREENSBORO, N.C. (CHIPOLA JUNIOR COLLEGE [FLA.]) REB 1.7 2 MIN 20.6 STEVEN PLEDGER 6-4, 219, SENIOR, GUARD PTS 11.8 6-1, 203, SENIOR, GUARD CHESAPEAKE, VA. (ATLANTIC SHORES CHRISTIAN SCHOOL) REB 3.3 AST 3.2 3FG% .370 MIN 28.7 GROOMS 14 0-1 0-0 2-2 0-0-0 0 at UT Arlington 15 0-2 0-0 0-0 0-1-1 3 vs. UTEP 16 1-1 0-0 0-1 0-2-2 2 vs. Gonzaga (17) 14 0-0 0-0 0-0 0-1-1 1 vs. West Virginia 24 1-3 0-0 0-0 0-1-1 1 at Oral Roberts 15 2-3 0-0 0-0 0-3-3 0 Northwestern State 14 1-2 0-0 1-3 0-0-0 0 at Arkansas 25 2-3 0-0 1-1 0-1-1 0 vs. Texas A&M 14 1-2 0-0 0-0 0-0-0 1 Stephen F. Austin DNP – INJURED Ohio 20 1-2 0-1 0-1 1-0-1 2 Texas A&M-C.C. 17 0-0 0-0 2-2 0-2-2 2 at West Virginia 14 1-2 0-1 0-0 0-4-4 1 Oklahoma State 27 1-5 0-0 4-4 0-3-3 3 Texas Tech 20 0-2 0-0 0-0 1-3-4 1 at Kansas State (16) 25 2-3 0-0 0-1 0-4-4 0 Texas 17 1-2 0-0 5-8 0-0-0 0 at Kansas (3) 14 1-2 0-0 0-0 0-1-1 0 at Baylor 2 0-0 0-0 0-0 0-0-0 0 Kansas State (18) 12 3-5 1-2 0-1 0-1-1 0 at Iowa State *15 1-3 0-0 0-2 0-1-1 0 Kansas (5) 10 0-1 0-0 0-0 0-1-1 0 TCU 14 0-1 0-0 0-0 0-2-2 0 at Okla. State (17) 35 9-11 0-0 0-0 0-1-1 2 at Texas Tech 30 4- 8 0-0 4-7 1-1-2 2 Baylor *30 3-9 2-2 15-17 0-2-2 3 at Texas *31 0-4 0-1 3-4 2-3-5 4 Iowa State *31 7-13 1-2 4-4 1-1-2 2 West Virginia *36 3-3 1-1 1-1 1-0-1 2 at TCU *35 3-6 0-1 2-4 0-2-2 0 vs. Iowa State *32 2-6 0-2 4-6 0-4-4 3 A TO B 5 0 0 2 1 0 2 1 0 2 1 0 4 0 0 1 2 0 4 1 0 2 1 0 2 3 0 2 1 2 3 5 4 4 1 0 2 1 3 1 4 5 4 6 6 10 6 3 1 1 0 1 2 2 0 1 0 2 0 0 1 2 0 3 4 1 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 S TP 0 2 0 0 0 2 0 0 0 2 0 4 0 3 0 5 0 2 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 2 0 1 2 1 0 2 2 2 6 0 4 7 2 0 7 2 0 0 18 12 23 3 19 8 8 8 PLED *18 *31 *25 *24 *19 *24 *29 *32 *24 *32 *34 *20 *28 *29 *25 *28 *18 *29 *34 *20 *28 *35 *23 *42 *38 *36 *42 *31 *37 *20 *35 FG 5-10 3-9 3-8 3-8 1-8 4-7 3-6 4-9 2-4 6-14 7-16 6-15 5-12 2-7 3-11 3-6 2-5 4-8 6-12 1-4 2-9 6-14 2-8 7-15 8-15 7-9 6-15 4-9 7-14 1-7 3-11 3FG 5-9 2-7 3-6 1-5 1-7 1-2 1-2 4-7 2-3 0-6 2-8 5-10 2-8 2-5 2-6 2-4 0-2 2-4 3-7 0-3 0-4 2-7 0-3 3-6 6-13 3-4 6-12 4-9 5-10 0-4 1-6 FT 0-0 1-2 3-4 0-0 5-5 0-0 2-3 0-1 4-4 0-0 2-3 0-0 0-0 5-5 3-4 2-3 1-2 0-0 5-7 0-0 1-2 1-1 0-0 1-2 0-0 2-3 0-0 2-2 4-4 0-0 1-1 O-D-T 1-0-1 0-3-3 0-2-2 1-1-2 3-3-6 0-1-1 1-2-3 1-2-3 1-1-2 2-3-5 3-3-6 0-2-2 2-2-4 4-5-9 1-2-3 0-1-1 1-2-3 0-1-1 0-1-1 1-0-1 1-5-6 0-6-6 0-2-2 0-1-1 0-4-4 1-4-5 2-1-3 0-4-4 3-5-8 0-1-1 1-3-4 PF 4 3 3 0 4 2 1 2 3 1 1 3 1 2 1 2 3 1 1 0 1 1 1 2 2 4 4 2 2 0 2 A TO B 0 1 0 1 3 0 1 0 0 0 0 0 3 4 0 2 0 0 2 1 1 3 0 0 2 1 0 1 1 0 1 3 0 1 2 0 0 1 1 2 3 0 0 0 0 3 2 0 0 1 0 0 1 0 5 1 0 0 1 0 3 0 0 2 1 0 1 0 0 2 2 0 2 1 1 1 3 0 3 4 0 3 0 0 0 1 1 0 0 0 2 0 0 S 0 0 0 2 1 0 3 2 3 1 1 2 0 2 0 0 2 2 2 1 0 0 1 0 2 1 1 1 0 0 1 TP 15 9 12 7 8 9 9 12 10 12 18 17 12 11 11 10 5 10 20 2 5 15 4 18 22 19 18 14 23 2 8 * Starter * Starter GROOMS’ CAREER HIGHS Points.....................................................................................................23 vs. Baylor (2/23/13) Field Goals................................................................................9 vs. Oklahoma State (2/16/13) Field Goal Attempts........................................................................ 13 vs. Iowa State (3/2/13) 3-Point Field Goals...............................................................2 vs. Sacramento State (12/2/11) 3-Point Field Goal Attempts.....................................................................................3 (twice) Free Throws Made................................................................................15 vs. Baylor (2/23/13) Free Throw Attempts...........................................................................17 vs. Baylor (2/23/13) Rebounds. .....................................................................................6 vs. Idaho State (11/11/11) Assists. ...............................................................................................................10 (four times) Blocked Shots. ............................................................................................................1 (twice) Steals. ....................................................................................3 vs. Sacramento State (12/2/11) Minutes Played..............................................................................44 vs. Texas A&M (1/21/11) PLEDGER’S CAREER HIGHS Points.............................................................................................. 38 vs. Iowa State (1/29/11) Field Goals...................................................................................... 12 vs. Iowa State (1/29/11) Field Goal Attempts...................................................................... 20 vs. Iowa State (1/29/11) 3-Point Field Goals.......................................................................... 7 vs. Iowa State (1/29/11) 3-Point Field Goal Attempts..........................................................14 vs. Houston (11/26/09) Free Throws Made........................................................................... 7 vs. Iowa State (1/29/11) Free Throw Attempts.................................................................................................8 (twice) Rebounds. ........................................................................................10 vs. Houston (12/17/11) Assists. .........................................................................................................................6 (twice) Blocked Shots. ............................................................................................................2 (twice) Steals. .................................................................................................................... 3 (six times) Minutes Played.............................................................................. 44 vs. Iowa State (1/29/11) 13 2012-13 OKLAHOMA MEN’S BASKETBALL 3 PTS 8.0 BUDDY HIELD FREEPORT, BAHAMAS (SUNRISE CHRISTIAN ACADEMY [KAN.]) REB 4.2 4 MIN 25.2 ANDREW FITZGERALD BALTIMORE, MD. (BREWSTER ACADEMY [N.H.]) PTS 5.9 6-4, 199, FRESHMAN, GUARD 6-8, 238, SENIOR, FORWARD AST 1.9 REB 3.5 FG% .442 MIN 15.9 HIELD 22 4-7 1-3 0-0 1-2-3 0 at UT Arlington 19 6-10 2-4 3-4 3-1-4 2 vs. UTEP 28 2-7 1-4 2-2 4-1-5 3 vs. Gonzaga (17) 19 2-8 1-3 0-1 0-2-2 2 vs. West Virginia 21 3-9 0-3 2-2 1-2-3 0 at Oral Roberts 24 4-9 1-3 2-2 5-1-6 1 Northwestern State 15 2-6 1-2 0-0 1-1-2 2 at Arkansas 9 2-3 2-2 0-0 0-2-2 2 vs. Texas A&M 31 4-9 2-5 2-2 2-2-4 2 Stephen F. Austin 29 3-11 0-1 3-4 6-5-11 1 Ohio *34 2-7 1-2 0-0 0-3-3 0 Texas A&M-C.C. *22 3-10 1-6 0-0 2-3-5 1 at West Virginia *30 4-12 0-1 0-0 4-3-7 0 Oklahoma State *37 6-11 3-5 0-0 0-4-4 3 Texas Tech *36 4-9 1-4 7-7 1-6-7 3 at Kansas State (16) *31 4-9 0-3 0-1 2-8-10 4 Texas *32 5-8 0-0 2-2 1-3-4 4 at Kansas (3) *30 4-11 0-5 1-2 1-1-2 2 at Baylor *36 4-8 1-2 0-0 1-4-5 2 Kansas State (18) *33 1-7 0-3 2-2 2-2-4 2 at Iowa State *24 2-5 1-4 0-0 1-2-3 3 Kansas (5) *28 0-3 0-3 2-2 1-2-3 1 TCU *20 3-7 0-2 2-2 0-0-0 1 at Okla. State (17) DNP – INJURED at Texas Tech DNP – INJURED Baylor DNP – INJURED at Texas DNP – INJURED Iowa State DNP – INJURED West Virginia 4 0-0 0-0 0-0 0-0-0 0 at TCU 25 5-14 0-5 0-1 8-1-9 5 vs. Iowa State 15 0-4 0-2 0-0 0-1-1 1 A TO B 1 4 0 0 2 0 0 1 1 0 3 2 1 3 0 1 3 0 0 0 0 1 3 0 1 2 0 1 0 0 7 1 0 3 1 0 5 2 0 5 2 0 3 0 1 3 3 0 4 3 2 2 0 0 3 1 0 2 2 0 1 1 0 1 1 0 2 1 0 S 2 1 2 1 0 2 0 0 1 2 4 0 2 0 2 0 2 3 0 1 0 2 2 TP 9 17 7 5 8 11 5 6 12 9 5 7 8 15 16 8 12 9 9 4 5 2 8 FITZGERALD 15 19 22 23 23 19 19 *14 15 22 10 12 4 9 15 17 8 12 17 16 18 17 14 18 14 13 12 21 22 27 5 FG 6-10 2-6 3-11 2-5 4-6 2-10 3-7 2-4 1-5 3-5 1-4 4-4 0-0 0-2 5-7 3-6 0-2 2-4 4-7 1-3 5-11 3-7 3-6 0-1 1-1 0-2 2-3 1-3 2-6 6-12 1-3 0 2 0 1 1 1 0 0 1 0 0 3 10 0 0 3FG 0-1 FT O-D-T PF 0-0 3-3-6 1 0-1 0-2-2 2 3-5 4-1-5 1 0-2 0-1-1 2 1-2 2-1-3 4 1-2 3-0-3 0 2-2 2-1-3 1 0-2 1-0-1 2 0-0 1-2-3 0 0-0 1-1-2 2 2-4 1-2-3 0 1-2 2-0-2 0 0-0 0-1-1 4 1-2 1-0-1 2 2-3 2-2-4 2 0-0 0-2-2 2 0-0 0-1-1 0 0-0 3-5-8 2 0-0 2-3-5 2 2-3 0-6-6 2 2-3 5-2-7 5 0-0 0-2-2 3 3-3 1-2-3 1 4-4 1-3-4 3 0-0 2-2-4 4 4-4 0-2-2 2 1-2 0-2-2 1 8-8 0-3-3 1 1-3 5-0-5 2 1-2 4-7-11 3 0-0 1-1-2 3 A TO B 0 0 0 1 1 2 1 0 1 1 1 2 0 1 1 1 0 0 1 2 0 0 1 0 1 0 0 0 1 1 0 0 0 0 2 1 0 1 0 0 1 1 0 0 2 0 0 0 0 0 0 1 1 0 2 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 0 S 0 1 0 0 0 1 0 1 1 1 1 1 1 1 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 TP 12 4 9 4 9 5 8 4 2 6 4 9 0 1 12 6 0 4 8 4 12 6 9 4 2 4 5 10 5 13 2 * Starter * Starter HIELD’S CAREER HIGHS Points.........................................................................................17 vs. UT Arlington (11/16/12) Field Goals...................................................................................................................6 (twice) Field Goal Attempts...................................................................................14 vs. TCU (3/9/13) 3-Point Field Goals................................................................37 vs. Oklahoma State (1/12/13) 3-Point Field Goal Attempts.................................6 vs. Texas A&M-Corpus Christi (12/31/12) Free Throws Made............................................................................7 vs. Texas Tech (1/16/13) Free Throw Attempts.......................................................................7 vs. Texas Tech (1/16/13) Rebounds. ..........................................................................11 vs. Stephen F. Austin (12/18/12) Assists. ..................................................................................................... 7 vs. Ohio (12/29/12) Blocked Shots. .............................................................................................................. (twice) Steals. ...................................................................................................... 4 vs. Ohio (12/29/12) Minutes Played......................................................................37 vs. Oklahoma State (1/12/13) FITZGERALD’S CAREER HIGHS Points................................................................................................ 27 vs. Iowa State (2/4/12) Field Goals........................................................................................ 11 vs. Iowa State (2/4/12) Field Goal Attempts........................................................................ 19 vs. Iowa State (2/4/12) 3-Point Field Goals.......................................................................................................... None 3-Point Field Goal Attempts.......................................................................................... None Free Throws Made............................................................................. 8 vs. Iowa State (3/2/13) Free Throw Attempts.................................................................................................8 (twice) Rebounds. .................................................................................................................13 (twice) Assists. .....................................................................................................3 vs. Baylor (2/27/10) Blocked Shots. ..................................................................................3 vs. Texas Tech (1/18/11) Steals. ........................................................................... 5 vs. North Carolina Central (11/15/10) Minutes Played.........................................................................................................39 (twice) 14 2012-13 OKLAHOMA MEN’S BASKETBALL 5 JE’LON HORNBEAK ARLINGTON, TEXAS (GRACE PREPARATORY ACADEMY) PTS 5.6 11 PTS 2.5 ISAIAH COUSINS 6-3, 182, FRESHMAN, GUARD MOUNT VERNON, N.Y. (MOUNT VERNON HS) REB 1.9 6-3, 180, FRESHMAN, GUARD REB 2.7 AST 1.7 MIN 22.6 AST 1.5 MIN 15.7 HORNBE *28 4-10 1-5 *25 1-3 1-3 *21 2-3 1-2 *19 0-3 0-2 *22 5-9 2-3 *16 2-3 0-1 *24 2-5 1-2 *20 2-5 0-2 *32 0-6 0-4 *33 4-9 3-5 *20 1-2 0-1 *23 1-1 1-1 *25 1-2 1-1 *13 3-3 2-2 *20 0-3 0-1 *15 2-4 1-2 *32 1-3 1-2 *29 0-1 0-0 *30 0-6 0-3 *17 0-1 0-1 13 1-3 1-3 16 1-2 1-2 19 3-7 1-2 *31 3-6 3-6 *17 1-6 0-1 *22 4-6 1-3 *19 2-4 1-1 *27 0-4 0-2 *21 2-4 1-3 *22 0-5 0-4 *30 2-5 1-3 FT 1-2 4-8 0-0 0-0 2-2 1-1 2-3 1-2 2-2 1-1 3-4 0-0 1-2 0-0 2-2 0-0 0-0 1-2 2-3 0-0 0-2 4-6 2-2 1-2 0-0 4-4 0-1 2-2 4-4 8-8 2-2 O-D-T 1-4-5 0-2-2 0-1-1 1-1-2 2-3-5 0-3-3 0-1-1 0-2-2 0-4-4 0-3-3 0-2-2 0-3-3 0-2-2 0-3-3 1-0-1 1-1-2 0-1-1 1-3-4 0-5-5 0-3-3 2-0-2 1-1-2 0-2-2 1-2-3 0-0-0 1-4-5 1-4-5 1-5-6 1-1-2 1-1-2 2-0-2 PF 1 3 3 2 2 3 1 1 1 4 3 2 2 2 2 0 2 0 3 3 2 0 3 4 3 5 5 2 2 4 1 A TO B 5 0 1 1 4 0 1 1 0 2 1 0 1 1 1 0 2 0 0 0 0 1 4 1 3 4 1 3 2 1 2 1 0 5 1 0 1 2 0 1 4 0 0 1 1 3 1 0 3 3 0 2 3 1 6 3 0 2 3 0 1 2 0 2 0 0 2 3 0 0 0 0 1 0 0 0 1 0 0 2 0 1 0 0 3 1 0 0 0 0 1 1 0 S 2 3 1 1 2 1 0 2 1 0 0 2 1 1 1 0 1 0 1 0 0 1 2 1 0 1 2 0 1 2 1 TP 10 7 5 0 14 5 7 5 2 12 5 3 4 8 2 5 3 1 2 0 3 7 9 10 2 13 5 2 9 8 7 COUSINS *20 *15 *17 *26 *16 *25 *25 *14 *16 *16 11 19 17 11 16 16 17 8 8 20 25 *26 *26 *10 *10 9 19 9 5 6 8 FG 3FG 0-3 0-1 0-2 0-0 2-5 1-4 3-6 3-5 0-2 0-0 0-4 0-2 4-7 1-3 1-3 0-1 0-4 0-3 0-4 0-1 0-3 0-0 1-8 1-3 3-5 0-1 0-2 0-0 2-3 0-0 1-4 0-1 0-3 0-1 0-3 0-1 0-0 0-0 2-3 2-3 3-7 0-2 3-6 1-2 3-4 0-0 0-1 0-1 0-1 0-0 0-4 0-2 0-2 0-1 1-2 0-1 0-1 0-0 0-2 0-0 0-1 0-0 FT O-D-T 2-3 0-3-3 0-0 1-0-1 0-0 0-2-2 1-2 0-1-1 0-0 0-2-2 0-0 1-3-4 0-0 0-5-5 0-0 0-3-3 0-0 0-3-3 1-2 1-0-1 0-0 0-0-0 0-0 0-3-3 0-0 0-0-0 0-0 0-2-2 2-2 1-1-2 0-0 2-1-3 0-0 0-3-3 0-0 0-0-0 0-0 0-0-0 0-1 0-2-2 4-4 0-3-3 0-0 0-4-4 0-0 0-3-3 0-0 0-1-1 0-0 0-1-1 2-2 0-1-1 0-0 0-2-2 0-0 0-1-1 0-0 0-0-0 0-0 0-0-0 0-0 00-2-2 PF 1 3 3 2 3 2 2 0 0 1 2 0 3 1 1 3 1 0 4 1 3 2 2 2 1 4 2 2 0 0 0 A TO B 5 1 0 0 1 0 4 2 0 1 4 0 2 0 0 3 0 0 4 3 0 1 1 1 1 0 0 0 2 0 1 1 0 0 2 0 1 0 0 0 0 0 2 3 0 2 0 0 1 0 1 2 1 0 2 1 0 2 2 0 2 1 0 4 4 0 2 1 0 1 1 0 1 4 0 0 3 0 3 0 0 1 1 0 0 0 0 0 0 0 0 0 0 S TP 2 2 0 0 2 5 1 10 0 0 1 0 2 9 1 2 1 0 0 1 0 0 0 3 2 6 0 0 1 6 1 2 0 0 0 0 1 0 1 6 1 10 1 7 1 6 0 0 1 0 0 2 1 0 0 2 1 0 0 0 0 0 * Starter * Starter HORNBEAK’S CAREER HIGHS Points........................................................................................ 14 vs. West Virginia (11/25/12) Field Goals.................................................................................. 5 vs. West Virginia (11/25/12) Field Goal Attempts..............................................................................10 vs. ULM (11/11/12) 3-Point Field Goals.....................................................................................................3 (twice) 3-Point Field Goal Attempts..................................................6 vs. Oklahoma State (2/16/13) Free Throws Made........................................................................................8 vs. TCU (3/9/13) Free Throw Attempts.................................................................................................8 (twice) Rebounds. .......................................................................................... 6 vs. Iowa State (3/2/13) Assists. .....................................................................................................6 vs. Baylor (1/30/13) Blocked Shots. ...................................................................................................... 1 (six times) Steals. ..........................................................................................3 vs. UT Arlington (11/16/12) Minutes Played......................................................................................28 vs. ULM (11/11/12) COUSINS’ CAREER HIGHS Points.........................................................................................................................10 (twice) Field Goals........................................................................4 vs. Northwestern State (11/30/12) Field Goal Attempts...............................................8 vs. Texas A&M-Corpus Christi (12/31/12) 3-Point Field Goals...........................................................................3 vs. Gonzaga (11/23/12) 3-Point Field Goal Attempts...........................................................5 vs. Gonzaga (11/23/12) Free Throws Made............................................................................. 4 vs. Iowa State (2/4/13) Free Throw Attempts........................................................................ 4 vs. Iowa State (2/4/13) Rebounds. ........................................................................5 vs. Northwestern State (11/30/12) Assists. ......................................................................................................5 vs. ULM (11/11/12) Blocked Shots. ............................................................................................................1 (twice) Steals. ..................................................................................................................2 (four times) Minutes Played.........................................................................................................26 (twice) 15 2012-13 OKLAHOMA MEN’S BASKETBALL 13 JAMES FRASCHILLA DALLAS, TEXAS (HIGHLAND PARK HS) REB 0.0 15 PTS 1.2 TYLER NEAL 6-7, 229, JUNIOR, FORWARD OKLAHOMA CITY, OKLA. (PUTNAM CITY WEST HS) REB 1.4 5-10, 150, SOPHOMORE, GUARD PTS 0.3 AST 0.0 MIN 2.3 FT% .667 MIN 6.7 FRASCHILLA 2 0-0 0-0 1-2. 4 0-2 0-2 0-0 at West Virginia Oklahoma State Texas Tech 1 0-0 0-0 0-0 O-D-T 0 PF A TO B 0 0 0 0 0 0 1 0 S TP 0 1 0 0 NE 18 2-5 1-3 4-4 at UT Arlington 13 0-2 0-2 0-0 vs. UTEP 9 1-2 0-0 0-2 vs. Gonzaga (17) 5 0-1 0-0 0-0 vs. West Virginia 8 1-3 1-2 0-0 at Oral Roberts 8 0-0 0-0 0-0 Northwestern State 11 1-4 1-2 0-0 at Arkansas 15 0-3 0-2 0-0 vs. Texas A&M 3 0-0 0-0 0-0 Stephen F. Austin 10 0-1 0-1 0-0 Ohio 1 0-0 0-0 0-0 Texas A&M-C.C. 14 0-5 0-3 0-0 at West Virginia 6 0-2 0-2 0-0 Oklahoma State 3 0-1 0-0 0-0 Texas Tech 2 0-0 0-0 0-0 at Kansas State (16) 4 0-0 0-0 0-0 Texas 4 0-1 0-0 0-0 at Kansas (3) at Baylor Kansas State (18) at Iowa State 7 1-3 1-2 0-0 Kansas (5) 2 0-1 0-0 0-0 TCU 14 2-3 2-3 2-2 at Okla. State (17) at Texas Tech 9 1-2 0-0 0-1 Baylor 1 0-0 0-0 0-0 at Texas 1 0-0 0-0 0-0 Iowa State 2 0-0 0-0 0-0 West Virginia 2 0-1 0-0 0-0 at TCU 3 0-1 0-0 0-0 vs. Iowa State O-D-T 1-3-4 0-3-3 0-2-2 0-1-1 1-5-6 0-0-0 2-3-5 1-2-3 0-0-0 0-1-1 0-0-0 0-2-2 0-0-0 0-0-0 0-0-0 1-0-1 0-0-0 DNP DNP DNP 1-2-3 0-0-0 0-4-4 DNP 0-0-0 0-0-0 0-0-0 0-1-1 0-1-1 0-0-0 DNP PF 0 1 1 0 3 1 1 2 0 0 0 1 0 0 1 1 0 A TO B 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 2 0 S TP 0 9 1 0 1 2 0 0 0 3 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 3 0 8 2 0 0 0 0 0 FRASCHILLA’S CAREER HIGHS Points...............................................................................2 vs. South Carolina State (12/21/11) Field Goals.......................................................................1 vs. South Carolina State (12/21/11) Field Goal Attempts.......................................................2 vs. South Carolina State (12/21/11) 3-Point Field Goals.......................................................................................................... None 3-Point Field Goal Attempts.......................................................................................... None Free Throws Made......................................................................................................1 (twice) Free Throw Attempts.................................................................................................2 (twice) Rebounds. .......................................................................1 vs. South Carolina State (12/21/11) Assists. .............................................................................................................................. None Blocked Shots. ................................................................................................................. None Steals. ............................................................................................................................... None Minutes Played...................................................................................................2 (four times) NEAL’S CAREER HIGHS Points...............................................................................................18 vs. Arkansas (12/10/11) Field Goals.........................................................................................5 vs. Arkansas (12/10/11) Field Goal Attempts.........................................................................9 vs. Arkansas (12/10/11) 3-Point Field Goals...........................................................................4 vs. Arkansas (12/10/11) 3-Point Field Goal Attempts...........................................................8 vs. Arkansas (12/10/11) Free Throws Made..............................................................................6 vs. Virginia (11/23/10) Free Throw Attempts....................................................................................... 6 (three times) Rebounds. ......................................................................................................... 7 (three times) Assists. ...............................................................................................4 vs. Arkansas (12/10/11) Blocked Shots. ................................................................................. 2 vs. Iowa State (2/18/12) Steals. ..................................................................................................................2 (four times) Minutes Played.........................................................................................................28 (twice) 16 2012-13 OKLAHOMA MEN’S BASKETBALL 21 6.5 CAMERON CLARK SHERMAN, TEXAS (SHERMAN HS) REB 3.3 22 PTS 10.1 AMATH M’BAYE 6-9, 208, JUNIOR, FORWARD BORDEAUX, FRANCE (UNIVERSITY OF WYOMING) REB 5.2 6-6, 208, JUNIOR, GUARD/FORWARD PTS FG% .517 MIN 17.3 FG% .464 MIN 25.0 CLARK 17 1-6 0-0 17 2-5 0-0 13 1-5 0-0 14 1-5 0-0 18 3-4 0-0 15 2-5 0-0 13 3-5 0-0 20 3-4 0-0 26 8-12 0-0 18 1-4 0-0 18 4-7 0-0 19 1-2 1-1 13 3-7 0-0 15 2-6 0-0 22 5-6 0-0 14 0-3 0-0 10 1-4 0-0 15 2-3 0-0 9 1-3 0-0 19 3-4 0-0 15 5-8 0-0 14 4-7 0-0 17 4-6 0-0 19 1-3 0-0 25 5-6 0-0 23 1-4 0-0 26 3-5 0-0 21 1-2 0-0 18 1-2 0-0 13 1-1 0-0 20 5-7 0-0 FT 0-0 5-6 0-0 1-1 0-0 2-2 0-0 2-2 1-2 2-2 0-0 4-4 1-1 0-0 0-0 1-2 0-0 0-2 2-2 1-2 0-0 2-2 0-0 3-4 0-0 3-4 2-3 4-4 3-5 0-0 7-7 O-D-T 2-3-5 1-5-6 2-2-4 0-2-2 0-0-0 0-1-1 0-1-1 3-0-3 1-3-4 0-2-2 1-3-4 0-4-4 1-5-6 2-2-4 1-2-3 0-1-1 0-2-2 0-2-2 1-0-1 1-3-4 1-1-2 1-2-3 3-0-3 3-4-7 1-4-5 0-3-3 1-5-6 1-2-3 2-1-3 1-2-3 3-1-4 PF 3 1 1 3 3 1 0 3 4 2 3 1 0 3 0 0 0 1 3 0 0 2 0 1 3 2 4 2 2 3 1 A TO B 1 1 1 2 2 0 0 1 0 0 1 0 2 0 1 0 0 0 0 0 0 2 1 0 0 1 0 0 2 0 1 1 0 1 1 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 2 0 0 3 0 0 1 0 0 2 0 0 0 0 2 1 0 0 1 0 0 1 0 1 1 0 0 1 0 0 1 0 1 1 0 0 3 1 0 1 0 S 0 0 0 1 0 0 1 1 1 0 1 1 0 1 2 0 0 0 2 1 1 0 1 0 1 0 0 0 0 0 3 TP 2 9 2 3 6 6 6 8 17 4 8 7 7 4 10 1 2 4 4 7 10 10 8 5 10 5 8 6 5 2 17 M’BAYE *22 *24 *19 *24 *32 *28 *25 *25 *14 *22 *22 *21 *27 *25 *18 *27 *30 *30 *29 *29 *24 *23 *26 *30 *25 *35 *37 *24 *18 *21 *20 FG 6-9 1-7 4-8 2-8 5-6 6-13 2-6 6-10 0-3 1-2 6-8 7-11 3-8 5-9 3-8 5-9 6-9 4-11 9-12 3-10 4-12 3-9 4-8 3-9 5-10 1-6 7-11 3-8 2-7 2-7 3-7 3FG FT O-D-T 0-0 0-1 2-7-9 0-1 5-7 4-5-9 0-1 0-2 3-1-4 0-1 1-1 0-5-5 0-0 9-13 3-3-6 0-2 0-1 4-5-9 0-1 4-5 2-6-8 0-1 2-2 1-5-6 0-0 0-0 0-0-0 0-0 1-2 4-0-4 0-0 4-5 1-5-6 0-0 0-0 2-4-6 0-0 1-2 1-3-4 1-1 4-4 0-5-5 0-0 1-1 3-2-5 0-1 2-2 4-0-4 0-0 3-4 2-3-5 0-1 4-4 2-5-7 1-2 1-3 0-7-7 0-2 1-1 4-1-5 0-1 0-0 3-3-6 2-4 0-0 1-2-3 0-1 4-4 1-2-3 0-1 0-0 0-5-5 2-3 3-4 4-9-13 1-2 4-4 0-4-4 2-3 0-0 1-3-4 1-3 4-4 1-3-4 2-3 1-2 0-2-2 0-2 1-2 0-1-1 0-3 0-0 0-3-3 PF 2 1 3 3 3 2 1 1 0 1 2 2 1 3 0 2 2 4 1 3 2 5 2 5 4 3 3 3 2 2 1 A TO B 2 4 2 2 2 0 1 3 1 0 1 1 0 1 1 1 3 0 0 4 2 2 3 0 0 0 1 0 3 1 0 2 0 1 0 1 2 1 0 0 0 0 0 3 0 0 3 1 0 4 1 0 1 0 1 2 4 0 3 1 0 1 0 0 3 1 1 0 0 1 1 0 5 2 0 1 2 0 2 2 2 1 1 0 0 2 1 0 1 1 0 0 2 S 0 2 1 1 1 2 0 0 1 0 3 1 0 2 0 0 0 1 1 0 2 1 0 1 0 0 1 1 0 0 0 TP 12 7 8 5 19 12 8 14 0 3 16 14 7 15 7 12 15 12 20 7 8 8 12 6 15 7 16 11 7 5 6 * Starter CLARK’S CAREER HIGHS Points...................................................................................26 vs. Central Arkansas (12/30/10) Field Goals.................................................................................................................11 (twice) Field Goal Attempts...............................................................................19 vs. Baylor (2/2/11) 3-Point Field Goals...............................................................4 vs. Central Arkansas (12/30/10) 3-Point Field Goal Attempts...................................................................7 vs. Baylor (2/2/11) Free Throws Made.....................................................................6 vs. Oklahoma State (3/5/11) Free Throw Attempts................................................................7 vs. Oklahoma State (3/5/11) Rebounds. ....................................................................................................... 11 (three times) Assists. .........................................................................................................................4 (twice) Blocked Shots. ......................................................................3 vs. Sacramento State (12/2/11) Steals. ..........................................................................................................................3 (twice) Minutes Played.............................................................................. 44 vs. Iowa State (1/29/11) M’BAYE’S CAREER HIGHS Points............................................................................................... 27 vs. Air Force (2/23/11*) Field Goals....................................................................................... 11 vs. Air Force (2/23/11*) Field Goal Attempts...............................................................................................18 (twice*) 3-Point Field Goals........................................................................................... 2 (three times) 3-Point Field Goal Attempts.....................................................................................4 (twice) Free Throws Made..................................................................... 9 vs. West Virginia (11/25/12) Free Throw Attempts.............................................................. 13 vs. West Virginia (11/25/12) Rebounds. .......................................................................................13 vs. Texas Tech (2/20/13) Assists. ...............................................................................................5 vs. Texas Tech (2/20/13) Blocked Shots. ........................................................................................ 5 vs. Utah (2/27/10*) Steals. ....................................................................................................4 vs. Kean (11/13/10*) Minutes Played............................................................................................. 38 (three times*) *At Wyoming 17 2012-13 OKLAHOMA MEN’S BASKETBALL 24 PTS 15.8 ROMERO OSBY 6-8, 238, SENIOR, FORWARD REB 7.0 32 MIN 28.5 CASEY ARENT 6-10, 223, SENIOR, CENTER PENRYN, CALIF. (SIERRA COLLEGE) REB 1.2 MERIDIAN, MISS. (MISSISSIPPI STATE UNIVERSITY) FG% .522 PTS 0.7 FG% .500 MIN 5.2 OS *16 *22 *30 *28 *17 *26 *25 26 *25 *18 *30 *19 *36 *31 *22 *23 *32 *33 *35 *34 *28 *29 *22 *40 *32 *31 *38 *34 *37 *28 *35 FG 3-5 4-12 6-10 3-6 4-7 3-9 1-8 9-12 5-9 4-8 5-8 1-1 7-11 6-12 6-10 5-9 9-15 4-16 5-7 5-12 2-10 6-8 5-8 6-15 7-11 6-9 9-13 6-11 9-14 6-11 8-19 ARENT GAME BY GAME IN 2012-13 FT 2-2 2-4 4-4 7-8 0-1 5-8 9-12 4-4 9-9 0-0 6-6 6-6 6-6 5-6 5-7 2-6 10-11 3-4 1-2 3-4 2-4 4-5 1-1 6-9 7-8 5-7 13-17 10-10 7-8 7-10 1-2 O-D-T 2-5-7 3-7-10 2-8-10 1-4-5 3-3-6 2-1-3 3-5-8 3-3-6 4-3-7 0-3-3 1-4-5 2-4-6 3-6-9 0-3-3 2-4-6 1-7-8 1-7-8 4-2-6 1-7-8 1-6-7 4-2-6 5-3-8 1-6-7 2-13-15 1-8-9 2-6-8 2-3-5 0-9-9 2-4-6 2-2-4 5-4-9 PF 0 3 4 3 4 2 5 1 0 4 0 1 2 2 2 4 1 4 3 1 1 4 1 4 4 2 2 4 2 2 3 A TO B 1 1 3 0 0 1 4 1 2 0 1 0 0 0 0 0 1 1 1 0 0 2 3 0 1 0 2 1 2 0 0 1 1 1 3 1 0 2 1 2 1 0 2 0 0 1 5 1 0 0 2 2 1 1 1 4 1 0 0 0 2 1 2 3 2 0 0 0 1 1 1 1 3 3 1 0 1 1 3 3 0 3 1 2 0 1 1 0 1 0 4 1 1 S 1 0 1 0 0 0 2 0 1 1 1 0 1 0 0 0 3 1 0 0 0 1 2 0 1 2 0 1 0 0 0 TP 9 10 16 13 8 11 11 22 19 8 16 8 21 17 17 12 29 12 11 13 6 17 11 18 21 17 31 22 26 19 18 8 1-2 0-0 0-0. 10 0-0 0-0 2-2 at West Virginia Oklahoma State Texas Tech 3 0-0 0-0 0-0 at Kansas State (16) Texas at Kansas (3) at Baylor Kansas State (18) at Iowa State 3 0-0 0-0 0-0 Kansas (5) TCU 5 0-0 0-0 0-0 at Okla. State (17) at Texas Tech Baylor at Texas Iowa State West Virginia at TCU vs. Iowa State O-D-T 1-1-2 DNP DNP 0-0-0 DNP DNP DNP DNP DNP DNP DNP 1-1-2 DNP DNP 0-1-1 DNP DNP DNP DNP DNP 1-0-1 DNP 0-1-1 DNP DNP DNP DNP DNP DNP DNP DNP PF A TO B 0 0 0 0 0 0 0 0 S TP 0 2 0 0 3FG 1-1 0-1 0-1 0-0 0-0 0-0 0-0 0-0 0-0 0-0 0-0 0-0 1-1 0-0 0-0 0-0 1-1 1-1 0-0 0-0 0-0 1-2 0-0 0-1 0-0 0-1 0-0 0-1 1-1 0-0 1-2 1 0 0 0 0 0 0 0 0 0 2 0 0 2 0 0 0 0 0 0 0 0 0 0 * Starter OSBY’S CAREER HIGHS Points.......................................................................................................31 vs. Texas (2/27/13) Field Goals........................................................................................11 vs. Texas A&M (3/3/12) Field Goal Attempts................................................................17 vs. Oklahoma State (1/9/12) 3-Point Field Goals..............................................................................................2 (five times) 3-Point Field Goal Attempts.......................................................................... 3 (seven times) Free Throws Made..................................................................................13 vs. Texas (2/27/13) Free Throw Attempts.............................................................................17 vs. Texas (2/27/13) Rebounds. .....................................................................18 vs. South Carolina State (12/21/11) Assists. .................................................................................................................4 (four times) Blocked Shots. ..................................................................................5 vs. Texas Tech (1/17/12) Steals. ................................................................................................................ 3 (three times) Minutes Played..................................................................................................38 (five times) ARENT’S CAREER HIGHS Points...........................................................................................6 vs. Coppin State (11/18/11) Field Goals...................................................................................3 vs. Coppin State (11/18/11) Field Goal Attempts...................................................................5 vs. Coppin State (11/18/11) 3-Point Field Goals.......................................................................................................... None 3-Point Field Goal Attempts.......................................................................................... None Free Throws Made......................................................................................................2 (twice) Free Throw Attempts.................................................................................................2 (twice) Rebounds. ...................................................................................................................9 (twice) Assists. .........................................................................................1 vs. Coppin State (11/18/11) Blocked Shots. .................................................................................................. 1 (three times) Steals. ....................................................................................2 vs. Sacramento State (12/2/11) Minutes Played............................................................................15 vs. Saint Louis (11/27/11) 18 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 INDIVIDUAL CAREER STATS 1 SAM GROOMS Year 6-1 • 203 • SENIOR • GUARD • GREENSBORO, N.C. MP-Avg. FG-A Pct. 3G-A Pct. 2011-12 2012-13 Career 31-31 978-31.5 72-206 .350 8-40 .200 30-7 618-20.6 50-105 .476 5-13 .385 G-GS 55-83 .663 48-69 .696 FT-A Pct. Off-Def-Tot Avg. PF-D A TO B 17-75-92 7-45-52 3.0 58-0 185 65 1.7 35-0 97 36 2 28 207 6.7 0 8 153 5.1 5.9 S TP Avg. 61-38 1596-26.2 122-311 .392 13-53 .245 103-152 .678 24-120-144 2.4 93-0 282 101 2 36 360 2 STEVEN PLEDGER Year 6-4 • 219 • SENIOR • GUARD • CHESAPEAKE, VA. FG-A Pct. 3G-A Pct. 2009-10 2010-11 2011-12 2012-13 Career 30-3 32-26 30-30 31-31 G-GS MP-Avg. 567-18.9 60-161 .373 44-130 961-30.0 112-285 .393 62-177 987-32.9 170-370 .459 72-173 890-28.7 126-305 .413 70-189 .338 .350 .416 .370 22-26 63-74 75-90 45-58 FT-A Pct. Off-Def-Tot Avg. PF-D A TO B .846 .851 .833 .776 14-30-44 15-51-66 41-76-117 30-73-103 1.5 2.1 3.9 3.3 49-0 78-0 73-1 59-0 17 55 49 46 23 5 11 186 6.2 59 10 28 349 10.9 57 7 30 487 16.2 38 4 31 367 11.8 S TP Avg. 123-90 3405-27.7 468-1121 .417 248-669 .371 205-248 .827 100-230-330 2.7 259-1 167 177 26 100 1389 11.3 3 BUDDY HIELD Year 6-3 • 199 • FRESHMAN • GUARD • FREEPORT, BAHAMAS MP-Avg. FG-A Pct. 3G-A Pct. FT-A Pct. Off-Def-Tot Avg. PF-D A TO B 2012-13 Career 26-13 654-25.2 79-204 .387 19-77 .247 30-36 .833 47-62-109 4.2 47-1 49 42 26-13 654-25.2 79-204 .387 19-77 .247 30-36 .833 47-62-109 4.2 47-1 49 42 G-GS 7 32 207 8.0 7 32 207 8.0 S TP Avg. 4 ANDREW FITZGERALD Year 6-8 • 238 • SENIOR • FORWARD • BALTIMORE, MD. FG-A Pct. 3G-A Pct. 2009-10 2010-11 2011-12 2012-13 Career 26-11 32-32 31-31 31-1 G-GS MP-Avg. 407-15.7 48-94 .511 985-30.8 154-317 .486 869-28.0 159-339 .469 492-15.9 72-163 .442 0-0 0-0 0-0 0-2 .000 30-47 .638 .000 94-127 .740 .000 57-78 .731 .000 39-59 .661 FT-A Pct. Off-Def-Tot Avg. PF-D A TO B 22-29-51 66-94-160 74-80-154 47-60-107 2.0 5.0 5.0 3.5 40-0 116-6 92-2 59-1 13 23 18 12 17 7 9 126 4.8 76 21 34 402 12.6 40 15 20 375 12.1 16 12 13 183 5.9 S TP Avg. 120-75 2753-22.9 433-913 .474 0-2 .000 220-311 .707 209-263-472 3.9 308-9 66 149 55 76 1086 9.1 5 JE’LON HORNBEAK Year 6-3 • 180 • FRESHMAN • GUARD • ARLINGTON, TEXAS FG-A Pct. 3G-A Pct. FT-A Pct. Off-Def-Tot Avg. PF-D A TO B 2012-13 Career 31-28 701-22.6 50-134 .373 25-73 .342 50-67 .746 31-28 701-22.6 50-134 .373 25-73 .342 50-67 .746 G-GS MP-Avg. 18-67-85 2.7 71-2 53 51 18-67-85 2.7 71-2 53 51 7 31 175 5.6 7 31 175 5.6 S TP Avg. 11 ISAIAH COUSINS Year 6-3 • 182 • FRESHMAN • GUARD • MOUNT VERNON, N.Y. FG-A Pct. 3G-A Pct. 2012-13 Career 31-14 486-15.7 29-105 .276 31-14 486-15.7 29-105 .276 G-GS MP-Avg. 9-39 .231 12-16 .750 9-39 .231 12-16 .750 FT-A Pct. Off-Def-Tot Avg. PF-D A TO B 6-52-58 1.9 51-0 48 39 6-52-58 1.9 51-0 48 39 2 22 79 2.5 2 22 79 2.5 S TP Avg. 13 JAMES FRASCHILLA Year 5-10 • 150 • SOPHOMORE • GUARD • DALLAS, TEXAS FG-A Pct. 2011-12 2012-13 Career G-GS 10-0 5-0 MP-Avg. 12-1.2 9-1.8 1-2 .500 0-2 .000 1-4 .250 3G-A Pct. 0-0 .000 0-2 .000 0-2 .000 FT-A Pct. Off-Def-Tot Avg. PF-D A TO B 1-2 .500 1-2 .500 2-4 .500 1-0-1 0.1 0-0-0 0.0 1-0-1 0.1 3-0 0-0 3-0 0 0 0 1 0 0 0 0 0 S TP Avg. 3 0.3 1 0.2 0.3 15-0 21-1.4 0 1 0 4 15 TYLER NEAL Year 6-7 • 229 • JUNIOR • FORWARD • OKLAHOMA CITY, OKLA. MP-Avg. 2010-11 2011-12 2012-13 Career G-GS 26-6 325-12.5 31-0 407-13.1 26-0 175-6.7 32-75 .427 11-39 .282 35-43 .814 38-97 .392 23-68 .338 24-30 .800 9-41 .220 6-22 .273 6-9 .667 FG-A Pct. 3G-A Pct. FT-A Pct. Off-Def-Tot Avg. PF-D A TO B 13-48-61 18-59-77 7-30-37 2.3 46-1 13 17 2.5 39-1 18 34 1.4 16-0 4 7 3 4 110 4 14 123 0 4 30 S TP Avg. 4.2 4.0 1.2 83-6 907-10.9 79-213 .371 40-129 .310 65-82 .793 38-137-175 2.1 101-2 35 58 7 22 263 3.2 21 CAMERON CLARK Year 6-6 • 208 • JUNIOR • GUARD/FORWARD • SHERMAN, TEXAS FG-A Pct. 3G-A Pct. FT-A Pct. Off-Def-Tot Avg. PF-D A TO B S TP Avg. 2010-11 2011-12 2012-13 Career 32-32 1074-33.6 120-253 .474 25-67 .373 31-47 .660 39-106-145 4.5 47-0 34 33 12 25 296 31-28 844-27.2 107-259 .413 5-18 .278 46-69 .667 34-111-145 4.7 56-0 37 51 12 25 265 31-0 536-17.3 78-151 .517 1-1 1.000 46-57 .807 33-68-101 3.3 52-0 14 32 4 18 203 G-GS MP-Avg. 9.3 8.5 6.5 94-60 2454-26.1 305-663 .460 31-86 .360 123-173 .711 106-285-391 4.2 155-0 85 116 28 68 764 8.1 19 2012-13 OKLAHOMA MEN’S BASKETBALL INDIVIDUAL CAREER STATS 22 AMATH M’BAYE Year 6-9 • 208 • JUNIOR • FORWARD • BORDEAUX, FRANCE FG-A Pct. 3G-A Pct. 2009-10* 21-0 418-19.9 38-82 .463 2-18 .111 2010-11* 31-31 940-30.3 150-316 .475 8-49 .163 2012-13 31-31 776-25.0 121-261 .464 12-40 .300 G-GS MP-Avg. 40-73 .548 20-48-68 3.2 65-3 10 37 19 11 118 5.6 65-97 .670 51-125-176 5.7 89-3 22 76 29 22 373 12.0 60-80 .750 53-109-162 5.2 69-2 23 58 24 22 314 10.1 9.7 FT-A Pct. Off-Def-Tot Avg. PF-D A TO B S TP Avg. Career 83-62 2134-25.7 309-659 .469 22-107 .206 165-250 .660 124-282-406 4.9 223-8 55 171 72 55 805 * at Wyoming 24 ROMERO OSBY Year 6-8 • 232 • SENIOR • FORWARD • MERIDIAN, MISS. FG-A Pct. 3G-A Pct. FT-A Pct. Off-Def-Tot Avg. PF-D A TO B 2008-09* 36-0 452-12.6 51-118 .432 8-28 .286 39-58 2009-10* 35-3 457-13.1 55-119 .462 16-39 .410 26-41 2011-12 31-31 936-30.2 147-300 .490 7-18 .389 98-137 2012-13 31-30 882-28.5 165-316 .522 7-14 .500 152-191 G-GS MP-Avg. .672 28-66-94 2.6 .634 34-55-89 2.5 .715 80-147-227 7.3 .796 65-152-217 7.0 53-1 33-0 77-2 75-1 12 22 28 38 28 34 56 41 12 8 149 4.1 12 8 152 4.3 31 18 399 12.9 27 19 489 15.8 S TP Avg. Career 133-64 2727-20.5 418-853 .490 38-99 .384 315-427 .738 207-420-627 4.7 238-4 100 159 82 53 1189 * at Mississippi State 8.9 32 CASEY ARENT Year 6-10 • 223 • SENIOR • CENTER • PENRYN, CALIF. 147-6.1 31-5.2 12-30 .400 1-2 .500 13-32 .406 FG-A Pct. 3G-A Pct. FT-A Pct. Off-Def-Tot Avg. PF-D A TO B 2011-12 2012-13 Career G-GS 24-0 6-0 MP-Avg. 0-0 .000 0-0 .000 0-0 .000 4-4 1.000 2-2 1.000 6-6 1.000 19-23-42 1.8 30-0 3-4-7 1.2 3-0 1.6 33-0 1 15 0 0 3 6 28 1.2 0 0 4 0.7 6 32 1.1 S TP Avg. 30-0 178-5.9 22-27-49 1 15 3 20 2012-13 OKLAHOMA MEN’S BASKETBALL Official Basketball Box Score -- Game Totals -- Final Statistics ULM vs Oklahoma 11/11/12 2 p.m. CT at Norman, Okla. (Lloyd Noble Center) ULM 51 • 0-1 ## 01 23 03 05 10 04 14 15 24 35 Nov. 11, 2012 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 1: OU 85, ULM 51 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs UT Arlington 11/16/12 7 p.m. at Arlington, Texas (College Park Center) Oklahoma 63 • 2-0 ## 22 24 02 05 11 01 03 04 15 21 Nov. 16, 2012 • Arlington, Texas • College Park Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 2: OU 63, UT ARLINGTON 59 Player James, Jayon Brown, Millaun Hansberry, Marcelis Mackey, Trent Olatayo, Amos McCray, R.J. Eke, Ife Koszuta, Kyle Birchett, Taylor Lindsey, Trey Team Totals FG % 1st Half: 3FG % 1st Half: FT % 1st Half: 7-23 0-8 8-12 30.4% 0.0% 66.7% f f g g g 3-8 2-3 1-6 0-7 7-15 3-6 1-3 1-2 0-3 1-2 19-55 0-1 0-0 0-1 0-3 2-5 0-1 0-0 1-2 0-2 0-1 3-16 0-0 2-2 2-4 0-0 5-10 1-2 0-0 0-0 0-0 0-0 10-18 0 5 5 2 2 2 4 2 0 2 2 1 1 2 3 2 3 5 8 3 0 1 1 0 1 1 2 3 0 0 0 0 0 0 0 0 1 2 3 3 0 2 2 8 22 30 16 34.5% 18.8% 55.6% 6 6 4 0 21 7 2 3 0 2 51 4 0 0 2 1 0 0 2 0 0 4 0 4 2 2 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 2 1 0 3 0 0 1 0 0 29 32 23 24 31 25 8 8 4 16 Player 9 14 9 200 Deadball Rebounds 3 M'Baye, Amath Osby, Romero Pledger, Steven Hornbeak, Je'lon Cousins, Isaiah Grooms, Sam Hield, Buddy Fitzgerald, Andrew Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 14-36 3FG % 1st Half: 4-11 FT % 1st Half: 6-9 38.9% 36.4% 66.7% f f g g g 1-7 4-12 3-9 1-3 0-2 0-2 6-10 2-6 0-2 2-5 19-58 0-1 0-1 2-7 1-3 0-0 0-0 2-4 0-0 0-2 0-0 5-18 5-7 2-4 1-2 4-8 0-0 0-0 3-4 0-1 0-0 5-6 20-32 4 5 9 1 3 7 10 3 0 3 3 3 0 2 2 3 1 0 1 3 0 1 1 3 3 1 4 2 0 2 2 2 0 3 3 1 1 5 6 1 3 4 7 15 33 48 22 32.8% 27.8% 62.5% 7 10 9 7 0 0 17 4 0 9 63 2 0 3 4 1 1 2 1 1 2 1 9 18 2 0 1 1 0 2 0 1 0 2 0 1 0 0 0 0 0 2 0 0 3 2 0 0 3 0 0 1 1 1 0 24 22 31 25 15 15 19 19 13 17 8 200 Deadball Rebounds 6 2nd half: 12-32 2nd half: 3-8 2nd half: 2-6 37.5% 37.5% 33.3% Game: 19-55 Game: 3-16 Game: 10-18 2nd half: 5-22 2nd half: 1-7 2nd half: 14-23 22.7% 14.3% 60.9% Game: 19-58 Game: 5-18 Game: 20-32 Oklahoma 85 • 1-0 ## 22 24 02 05 11 01 03 04 13 15 21 32 UT Arlington 59 • 1-1 Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min ## 33 35 55 03 12 04 21 24 42: 15-36 3FG % 1st Half: 4-12 FT % 1st Half: 4-4 41.7% 33.3% 100.0% Player f f g g g 6-9 3-5 5-10 4-10 0-3 0-1 4-7 6-10 0-0 2-5 1-6 1-2 32-68 0-0 1-1 5-9 1-5 0-1 0-0 1-3 0-1 0-0 1-3 0-0 0-0 9-23 0-1 2-2 0-0 1-2 2-3 2-2 0-0 0-0 1-2 4-4 0-0 0-0 12-16 2 7 9 2 2 5 7 0 1 0 1 4 1 4 5 1 0 3 3 1 0 0 0 0 1 2 3 0 3 3 6 1 0 0 0 0 1 3 4 0 2 3 5 3 1 1 2 0 2 2 4 16 33 49 12 47.1% 39.1% 75.0% 12 9 15 10 2 2 9 12 1 9 2 2 2 1 0 5 5 5 1 0 0 0 1 0 4 1 1 0 1 0 4 0 0 0 1 0 2 3 0 1 0 0 0 0 0 0 1 0 7 0 1 0 2 2 0 2 0 0 0 0 0 22 16 18 28 20 14 22 15 2 18 17 8 Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min Gruszecki, Karol Edwards, Brandon Reves, Jordan Outler, Jamel White-Miller, Shaq Charles, Drew Gainey, Greg Butler, Kevin Rodgers, Deon Team Totals FG % 1st Half: 11-32 3FG % 1st Half: 2-9 FT % 1st Half: 4-6 34.4% 22.2% 66.7% f f c g g 6-8 3-6 2-6 0-9 2-7 2-4 3-6 4-12 0-0 22-58 2-4 1-2 0-0 0-6 0-2 0-1 0-0 0-3 0-0 3-18 1-2 0-1 0-2 0-0 0-1 3-3 2-2 6-10 0-0 12-21 0 2 2 4 2 5 7 2 3 7 10 3 0 1 1 2 0 3 3 4 0 2 2 0 0 2 2 4 2 5 7 2 0 1 1 0 1 2 3 8 30 38 21 37.9% 16.7% 57.1% 15 7 4 0 4 7 8 14 0 0 0 1 1 6 2 0 0 0 1 0 4 0 4 6 2 1 0 0 3 3 0 0 1 1 0 0 8 1 0 0 0 0 2 0 2 0 20 24 30 28 29 16 21 30 2 59 10 18 5 200 Deadball Rebounds 4 85 20 12 7 200 Deadball Rebounds 2 2nd half: 11-26 2nd half: 1-9 2nd half: 8-15 42.3% 11.1% 53.3% Game: 22-58 Game: 3-18 Game: 12-21 2nd half: 17-32 2nd half: 5-11 2nd half: 8-12 53.1% 45.5% 66.7% Game: 32-68 Game: 9-23 Game: 12-16 Officials: Tom Eades, Jeff Malham, Toby Martinez Technical fouls: Oklahoma-None. UT Arlington-None. Attendance: 6421 Score by periods Oklahoma UT Arlington Officials: James Breeding, Mark Schnur, Jon Stigliano Technical fouls: ULM-None. Oklahoma-None. Attendance: 8734 Estimated Attendance: 3456 Score by periods ULM Oklahoma 38 28 1st 2nd 25 31 Total 63 59 Points OU UTA In Paint 18 26 Off T/O 21 11 2nd Chance 11 6 Fast Break 4 6 Bench 30 29 22 38 1st 2nd 29 47 Total 51 85 Points ULM OU In Paint 26 42 Off T/O 13 17 2nd Chance 6 16 Fast Break 10 11 Bench 14 37 Last FG - OU 2nd-02:24, UTA 2nd-00:17. Largest lead - OU by 17 2nd-15:15, UTA by 9 1st-15:07. Score tied - 3 times. Lead changed - 2 times. Last FG - ULM 2nd-00:14, OU 2nd-03:58. Largest lead - ULM by 2 1st-19:26, OU by 36 2nd-02:01. Score tied - 2 times. Lead changed - 7 times. Official Basketball Box Score -- Game Totals -- Final Statistics UTEP vs Oklahoma 11/22/12 7 p.m. ET at HP Field House (Lake Buena Vista, Fla.) UTEP 61 • 1-2 ## 31 32 02 04 11 05 21 33 44 Nov. 22, 2012 • Orlando, Fla. • HP Field House • Old Spice Classic Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 3: OU 68, UTEP 61 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Gonzaga 11/23/12 7:30 p.m. ET at HP Field House (Lake Buena Vista, Fla.) Oklahoma 47 • 3-1 ## 22 24 02 05 11 01 03 04 13 15 21 32 Nov. 23, 2012 • Orlando, Fla. • HP Field House • Old Spice Classic Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 4: NO. 17/16 GONZAGA 72, OU 47 Player LANG, Cedrick WASHBURN, Chris RAGLAND, Jalen WASHBURN, Julian STREETER, Jacques COOPER, C.J. BOHANNON, John HOWARD, Twymond MOORE, Malcolm Team Totals FG % 1st Half: 3FG % 1st Half: FT % 1st Half: 9-24 2-7 6-8 37.5% 28.6% 75.0% f f g g g 1-2 3-8 1-7 3-10 4-5 2-5 4-6 0-2 1-1 19-46 0-0 0-1 1-3 0-1 2-2 1-3 0-0 0-0 0-0 4-10 0-0 6-9 0-0 5-6 1-1 2-2 0-0 2-2 3-4 19-24 1 1 2 4 1 5 6 2 0 2 2 0 0 6 6 4 0 1 1 0 0 0 0 0 1 5 6 5 1 2 3 0 1 1 2 3 2 2 4 7 25 32 18 41.3% 40.0% 79.2% 2 12 3 11 11 7 8 2 5 0 2 0 1 4 4 0 0 0 1 2 1 4 3 2 3 0 1 0 2 0 0 0 0 1 0 0 3 1 3 0 1 1 0 0 0 0 15 28 22 37 30 25 31 6 6 61 11 17 6 200 Deadball Rebounds 2 2nd half: 10-22 2nd half: 2-3 2nd half: 13-16 45.5% 66.7% 81.3% Game: 19-46 Game: 4-10 Game: 19-24: 3FG % 1st Half: FT % 1st Half: 7-27 2-9 6-10 25.9% 22.2% 60.0% Player f f g g g 2-8 3-6 3-8 0-3 3-6 0-0 2-8 2-5 0-0 0-1 1-5 0-0 16-50 0-1 0-0 1-5 0-2 3-5 0-0 1-3 0-0 0-0 0-0 0-0 0-0 5-16 9-23 3-7 4-5 1-1 7-8 0-0 0-0 1-2 0-0 0-1 0-2 0-0 0-0 1-1 0-0 10-15 0 5 5 3 1 4 5 3 1 1 2 0 1 1 2 2 0 1 1 2 0 1 1 1 0 2 2 2 0 1 1 2 0 0 0 0 0 1 1 0 0 2 2 3 0 0 0 0 2 0 2 5 19 24 18 32.0% 31.3% 66.7% 5 13 7 0 10 0 5 4 0 0 3 0 47 0 0 0 2 1 2 0 1 0 0 0 0 1 1 0 1 4 1 3 1 1 0 1 0 1 0 0 0 0 0 2 2 0 0 0 0 5 1 0 2 1 1 0 1 0 0 0 1 0 24 28 24 19 26 14 19 23 2 5 14 2 6 14 7 200 Deadball Rebounds 0 Oklahoma 68 • 3-0 ## 22 24 02 05 11 01-31 3FG % 1st Half: 3-6 FT % 1st Half: 1-4 54.8% 50.0% 25.0% Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min 2nd half: 2nd half: 2nd half: 39.1% 42.9% 80.0% Game: 16-50 Game: 5-16 Game: 10-15 f f g g g 4-8 6-10 3-8 2-3 2-5 1-1 2-7 3-11 1-2 1-5 25-60 0-1 0-1 3-6 1-2 1-4 0-0 1-4 0-0 0-0 0-0 6-18 0-2 4-4 3-4 0-0 0-0 0-1 2-2 3-5 0-2 0-0 12-20 3 1 4 3 2 8 10 4 0 2 2 3 0 1 1 3 0 2 2 3 0 2 2 2 4 1 5 3 4 1 5 1 0 2 2 1 2 2 4 1 0 1 1 15 23 38 24 41.7% 33.3% 60.0% 8 16 12 5 5 2 7 9 2 2 1 4 1 1 4 2 0 1 0 0 3 1 0 1 2 1 1 0 1 1 1 2 0 0 0 0 1 1 0 0 5 1 1 0 1 2 0 2 0 1 0 19 30 25 21 17 16 28 22 9 13 Gonzaga 72 • 5-0 ## 10 20 35 04 05 03 11 13 15 24 30 43 68 14 11 8 200 Deadball Rebounds 3 2nd half: 8-29 2nd half: 3-12 2nd half: 11-16 27.6% 25.0% 68.8% Game: 25-60 Game: 6-18 Game: 12-20 Officials: Mic Eades, Karl Hess, Brian O'Connell Technical fouls: UTEP-None. Oklahoma-None. Attendance: 2076 Game 3 of 2012 Old Spice Classic Score by periods UTEP Oklahoma EDI, Guy Landy HARRIS, Elias DOWER, Sam PANGOS, Kevin BELL JR., Gary DRANGINIS, Kyle STOCKTON, David OLYNYK, Kelly BAKAMUS, Rem KARNOWSKI, Przemek HART, Mike BARHAM, Drew Team Totals FG % 1st Half: 12-25 3FG % 1st Half: 2-10 FT % 1st Half: 6-12 48.0% 20.0% 50.0% Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min f f c g g 2-3 7-10 2-2 2-11 3-7 1-4 2-7 4-6 1-1 3-6 0-0 0-2 27-59 0-0 1-2 0-0 1-6 2-4 1-4 0-3 0-1 1-1 0-0 0-0 0-1 6-22 3-4 3-4 0-0 3-4 0-0 0-0 1-2 0-0 0-0 2-5 0-0 0-0 12-19 1 3 4 2 2 2 4 2 0 6 6 2 2 3 5 2 0 1 1 2 2 2 4 3 0 6 6 0 1 7 8 4 0 0 0 0 4 2 6 1 1 0 1 0 0 0 0 0 4 2 6 17 34 51 18 45.8% 27.3% 63.2% 7 18 4 8 8 3 5 8 3 8 0 0 1 1 1 2 1 2 0 2 0 0 0 0 2 1 1 2 0 0 2 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2 5 0 0 0 0 0 19 23 23 32 21 16 24 17 1 14 8 2 72 10 11 9 200 Deadball Rebounds 3 26 38 1st 2nd 35 30 Total 61 68 Points UTEP OU In Paint 26 16 Off T/O 12 22 2nd Chance 8 11 Fast Break 2 11 2nd half: 15-34 2nd half: 4-12 2nd half: 6-7 44.1% 33.3% 85.7% Game: 27-59 Game: 6-22 Game: 12-19 Bench 22 22 Last FG - UTEP 2nd-03:31, OU 2nd-01:03. Largest lead - UTEP None, OU by 20 2nd-14:37. Score tied - 0 times. Lead changed - 0 times. Officials: Technical fouls: Oklahoma-None. Gonzaga-None. Attendance: 2205 Game 8 of 2012 Old Spice Classic Score by periods Oklahoma Gonzaga 22 32 1st 2nd 25 40 Total 47 72 Points OU GON In Paint 16 26 Off T/O 11 12 2nd Chance 4 17 Fast Break 0 4 Bench 12 27 Last FG - OU 2nd-01:56, GON 2nd-00:23. Largest lead - OU None, GON by 25 2nd-09:16. Score tied - 0 times. Lead changed - 0 times. 21 2012-13 OKLAHOMA MEN’S BASKETBALL Official Basketball Box Score -- Game Totals -- Final Statistics West Virginia vs Oklahoma 11/25/12 4:30 p.m. ET at HP Field House (Lake Buena Vista, Fla.) West Virginia 70 • 1-3 ## 13 24 03 04 15 01 10 14 21 34 55 Nov. 25, 2012 • Orlando, Fla. • HP Field House • Old Spice Classic Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 5: OU 77, WEST VIRGINIA 70 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Oral Roberts 11/28/12 7 p.m. CT at Tulsa, Okla. (Mabee Center) Oklahoma 63 • 5-1 ## 22 24 02 05 11 01 03 04 15 21 Nov. 28, 2012 • Tulsa, Okla. • Mabee Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 6: OU 63, ORAL ROBERTS 62 Player Kilicli, Deniz Murray, Aaric Staten, Juwan Hinds, Jabarie Henderson, Terry Rutledge, Dominique Harris, Eron Browne, Gary Humphrey, Matt Noreen, Kevin Miles, Keaton Team Totals FG % 1st Half: 10-29 3FG % 1st Half: 3-6 FT % 1st Half: 14-18 34.5% 50.0% 77.8% f c g g g 6-12 3-7 5-8 3-10 1-6 0-1 0-2 1-6 0-2 0-1 2-3 21-58 0-0 0-0 0-0 2-4 0-2 0-0 0-1 1-4 0-2 0-0 1-1 4-14 1-4 2-4 5-6 1-2 0-0 2-3 0-0 10-11 0-0 0-0 3-4 24-34 2 2 4 4 6 3 9 4 0 2 2 1 2 1 3 0 2 3 5 0 1 3 4 4 1 0 1 1 1 3 4 2 0 0 0 0 0 0 0 2 2 2 4 3 1 1 2 18 20 38 21 36.2% 28.6% 70.6% 13 8 15 9 2 2 0 13 0 0 8 70 0 0 3 2 0 0 0 2 0 0 1 8 2 0 2 0 0 1 0 1 0 0 2 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 3 23 22 36 30 15 14 3 24 3 7 23 Player 6 200 Deadball Rebounds 5 M'Baye, Amath Osby, Romero Pledger, Steven Hornbeak, Je'lon Cousins, Isaiah Grooms, Sam Hield, Buddy Fitzgerald, Andrew Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 13-29 3FG % 1st Half: 0-4 FT % 1st Half: 5-7 44.8% 0.0% 71.4% f f g g g 6-13 3-9 4-7 2-3 0-4 2-3 4-9 2-10 0-0 2-5 25-63 0-2 0-0 1-2 0-1 0-2 0-0 1-3 0-0 0-0 0-0 2-10 0-1 5-8 0-0 1-1 0-0 0-0 2-2 1-2 0-0 2-2 11-16 4 5 9 2 2 1 3 2 0 1 1 2 0 3 3 3 1 3 4 2 0 3 3 0 5 1 6 1 3 0 3 0 0 0 0 1 0 1 1 1 3 1 4 18 19 37 14 39.7% 20.0% 68.8% 12 11 9 5 0 4 11 5 0 6 63 3 1 0 2 0 2 3 0 0 0 1 9 12 1 0 2 0 3 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 2 0 0 1 1 0 2 1 0 0 28 26 24 16 25 15 24 19 8 15 7 200 Deadball Rebounds 2 2nd half: 11-29 2nd half: 1-8 2nd half: 10-16 37.9% 12.5% 62.5% Game: 21-58 Game: 4-14 Game: 24-34 2nd half: 12-34 2nd half: 2-6 2nd half: 6-9 35.3% 33.3% 66.7% Game: 25-63 Game: 2-10 Game: 11-16 Oklahoma 77 • 4-1 ## 22 24 02 05 11 01 03 04 15 21 Oral Roberts 62 • 3-4 ##-34 3FG % 1st Half: 3-9 FT % 1st Half: 5-7 50.0% 33.3% 71 TP A TO Blk Stl Min 11 22 32 13 23 12 31 35 f f g g g 5-6 4-7 1-8 5-9 0-2 1-3 3-9 4-6 1-3 3-4 27-57 0-0 0-0 1-7 2-3 0-0 0-0 0-3 0-0 1-2 0-0 4-15 9-13 0-1 5-5 2-2 0-0 0-0 2-2 1-2 0-0 0-0 19-25 3 3 6 3 3 3 6 4 3 3 6 4 2 3 5 2 0 2 2 3 0 1 1 1 1 2 3 0 2 1 3 4 1 5 6 3 0 0 0 3 0 1 1 15 24 39 27 47.4% 26.7% 76.0% 19 8 8 14 0 2 8 9 3 6 0 0 3 1 2 4 1 0 0 2 1 0 4 1 0 0 3 1 0 0 1 0 0 1 0 0 0 1 0 1 4 1 0 1 2 0 0 0 0 0 0 32 17 19 22 16 24 21 23 8 18 GLOVER, Shawn ROUNDTREE, Steven BELL-HOLTER, Damen NILES, Warren BILLBURY, Korey JACKSON, D.J. KAUFMAN, Jorden MANGHUM, Mikey Team Totals FG % 1st Half: 14-27 3FG % 1st Half: 3-6 FT % 1st Half: 4-5 51.9% 50.0% 80.0% f f c g g 8-15 6-12 3-6 8-17 1-3 0-1 0-0 0-1 26-55 1-1 0-0 0-1 2-9 0-0 0-1 0-0 0-1 3-13 42.9% 0.0% 75.0% 0-0 2-4 2-2 3-3 0-0 0-0 0-0 0-0 7-9 1 2 3 2 5 3 8 5 1 6 7 4 2 3 5 3 0 3 3 2 0 2 2 2 0 1 1 1 0 0 0 0 1 3 4 10 23 33 19 47.3% 23.1% 77.8% 1 1 4 3 5 0 0 0 1 62 13 15 17 14 8 21 2 0 0 0 1 4 1 0 1 5 0 1 0 1 1 0 1 0 0 0 3 0 2 1 0 1 0 0 0 38 31 33 39 15 24 6 14 4 200 Deadball Rebounds 2 77 13 10 4 200 Deadball Rebounds 1 2nd half: 12-28 2nd half: 0-7 2nd half: 3-4 Game: 26-55 Game: 3-13 Game: 7-9 2nd half: 10-23 2nd half: 1-6 2nd half: 14-18 43.5% 16.7% 77.8% Game: 27-57 Game: 4-15 Game: 19-25 Officials: Doug Sirmons, Don Daily, Brent Meaux Technical fouls: Oklahoma-None. Oral Roberts-None. Attendance: 7219 Score by periods Oklahoma Oral Roberts Officials: Mike Eades, Bryan O'Connelly, Terry Wymer Technical fouls: West Virginia-None. Oklahoma-None. Attendance: 4121 Game 11 of 2012 Old Spice Classic Oklahoma finishes in third place Score by periods West Virginia Oklahoma 31 35 1st 2nd 32 27 Total 63 62 Points OU ORU In Paint 32 32 Off T/O 16 14 2nd Chance 17 10 Fast Break 4 0 Bench 26 0 37 42 1st 2nd 33 35 Total 70 77 Points WVU OU In Paint 20 32 Off T/O 7 14 2nd Chance 16 15 Fast Break 0 2 Last FG - OU 2nd-01:16, ORU 2nd-00:19. Largest lead - OU by 3 2nd-01:16, ORU by 10 2nd-09:08. Score tied - 4 times. Lead changed - 6 times. Bench 23 28 Last FG - WVU 2nd-00:18, OU 2nd-04:22. Largest lead - WVU by 5 1st-18:47, OU by 12 1st-06:03. Score tied - 1 time. Lead changed - 1 time. Official Basketball Box Score -- Game Totals -- Final Statistics Northwestern State vs Oklahoma 11/30/12 7 p.m. CT at Norman, Okla. (Lloyd Noble Center) Northwestern State 65 • 3-3 ## 10 35 40 03 44 12 22 32 33 34 Nov. 30, 2012 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 7: OU 69, NORTHWESTERN STATE 65 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Arkansas 12/04/12 6 p.m. CT at Fayetteville, Ark. (Bud Walton Arena) Oklahoma 78 • 6-2 ## 04 22 02 05 11 01 03 15 21 24 Dec. 4, 2012 • Fayetteville, Ark. • Bud Walton Arena Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 8: ARKANSAS 81, OU 78 Player Robinson, Patrick Evans, O.J. Frazier, Marvin Davis, Shamir Stewart, Gary West, Jalan White, Brison Hicks, DeQuan Hulbin, James Roberson, Gary Team Totals FG % 1st Half: 12-31 3FG % 1st Half: 4-10 FT % 1st Half: 4-5 38.7% 40.0% 80.0% f f f g g 2-5 1-2 1-2 2-8 2-7 4-10 3-7 1-5 4-8 2-4 22-58 0-2 0-0 0-0 0-2 1-4 3-5 1-2 0-0 1-2 0-1 6-18 0-0 0-0 1-2 6-8 3-3 2-2 0-0 2-2 0-0 1-1 15-18 0 2 2 3 1 4 5 4 2 3 5 2 1 2 3 2 0 1 1 0 0 1 1 1 2 0 2 1 2 3 5 2 0 4 4 4 1 1 2 3 2 6 8 11 27 38 22 37.9% 33.3% 83.3% 4 2 3 10 8 13 7 4 9 5 65 1 0 1 1 3 1 1 5 2 1 1 6 17 0 0 0 1 0 2 0 3 0 0 1 0 3 0 0 0 0 0 0 0 4 0 0 0 0 1 1 0 2 1 0 22 18 17 26 21 23 18 20 20 15 5 200 Deadball Rebounds 2 Fitzgerald, Andrew M'Baye, Amath Pledger, Steven Hornbeak, Je'lon Cousins, Isaiah Grooms, Sam Hield, Buddy Neal, Tyler Clark, Cameron Osby, Romero Team Totals FG % 1st Half: 15-31 3FG % 1st Half: 1-8 FT % 1st Half: 7-8 48.4% 12.5% 87.5% Player f f g g g 2-4 6-10 4-9 2-5 1-3 2-3 2-3 0-3 3-4 9-12 31-56 0-0 0-1 4-7 0-2 0-1 0-0 2-2 0-2 0-0 0-0 6-15 0-2 2-2 0-1 1-2 0-0 1-1 0-0 0-0 2-2 4-4 10-14 1 0 1 2 1 5 6 1 1 2 3 2 0 2 2 1 0 3 3 0 0 1 1 0 0 2 2 2 1 2 3 2 3 0 3 3 3 3 6 1 0 1 1 10 21 31 14 55.4% 40.0% 71.4% 4 14 12 5 2 5 6 0 8 22 0 2 3 1 1 2 1 0 2 2 1 3 0 4 1 1 3 0 1 3 0 0 0 1 1 0 0 0 0 0 2 1 0 2 2 1 0 0 0 1 0 14 25 32 20 14 25 9 15 20 26 78 14 17 7 200 Deadball Rebounds 2 2nd half: 10-27 2nd half: 2-8 2nd half: 11-13 37.0% 25.0% 84.6% Game: 22-58 Game: 6-18 Game: 15-18 2nd half: 16-25 2nd half: 5-7 2nd half: 3-6 64.0% 71.4% 50.0% Game: 31-56 Game: 6-15 Game: 10-14 Oklahoma 69 • 6-1 ## 22 24 02 05 11 01 03 04 15 21 Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF Arkansas 81 • 4-3 TP A TO Blk Stl Min ## 21 33 01 11 23 00 03 04 05 20 22 24 M'Baye, Amath Osby, Romero Pledger, Steven Hornbeak, Je'lon Cousins, Isaiah Grooms, Sam Hield, Buddy Fitzgerald, Andrew Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 10-28 3FG % 1st Half: 3-8 FT % 1st Half: 6-9 35.7% 37.5% 66.7% f f g g g 2-6 1-8 3-6 2-5 4-7 1-2 2-6 3-7 1-4 3-5 22-56 0-1 0-0 1-2 1-2 1-3 0-0 1-2 0-0 1-2 0-0 5-12 4-5 9-12 2-3 2-3 0-0 1-3 0-0 2-2 0-0 0-0 20-28 2 6 8 1 3 5 8 5 1 2 3 1 0 1 1 1 0 5 5 2 0 0 0 0 1 1 2 2 2 1 3 1 2 3 5 1 0 1 1 0 1 1 2 12 26 38 14 39.3% 41.7% 71.4% 4 0 1 0 3 1 0 2 1 0 1 69 12 13 8 11 9 7 9 3 5 8 3 6 0 1 2 0 4 4 0 1 0 0 2 0 1 0 0 0 0 0 0 0 3 0 2 3 0 2 0 0 0 0 1 25 25 29 24 25 14 15 19 11 13 8 200 Deadball Rebounds 3 2nd half: 12-28 2nd half: 2-4 2nd half: 14-19 42.9% 50.0% 73.7% Game: 22-56 Game: 5-12 Game: 20-28 MICKELSON, Hunter POWELL, Marshawn WADE, Mardracus YOUNG, BJ WAGNER, DeQuavious MADDEN, Rashad SCOTT, Rickey CLARKE, Coty BELL, Anthlon HAYDAR, Kikko WILLIAMS, Jacorey QUALLS, Michael Team Totals FG % 1st Half: 16-29 3FG % 1st Half: 5-12 FT % 1st Half: 4-5 55.2% 41.7% 80.0% Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min f f g g g 3-4 11-17 3-7 4-12 0-0 4-7 0-0 3-3 1-5 1-1 0-0 0-1 30-57 0-0 4-6 2-5 0-2 0-0 0-2 0-0 1-1 1-4 1-1 0-0 0-1 9-22 0-0 7-8 2-2 2-2 0-0 0-2 0-0 1-2 0-0 0-0 0-0 0-0 12-16 0 5 5 2 3 3 6 1 0 2 2 2 1 3 4 2 0 0 0 1 3 0 3 2 0 0 0 0 0 0 0 3 0 1 1 0 0 0 0 1 0 0 0 1 1 2 3 1 1 1 2 9 17 26 16 52.6% 40.9% 75.0% 6 33 10 10 0 8 0 8 3 3 0 0 0 5 0 8 2 2 1 1 0 1 0 1 1 2 1 1 1 3 0 2 1 0 1 0 2 0 0 0 0 0 0 1 0 0 0 0 3 0 0 1 0 0 2 0 1 0 1 0 1 19 32 30 35 6 32 6 18 8 4 1 9 81 21 13 6 200 Deadball Rebounds 1 Officials: John Higgins, Terry Moore, Randy Heimerman Technical fouls: Northwestern State-None. Oklahoma-Osby, Romero. Attendance: 8915 Estimated Attendance: 3420 Score by periods Northwestern State Oklahoma 2nd half: 14-28 2nd half: 4-10 2nd half: 8-11 50.0% 40.0% 72.7% Game: 30-57 Game: 9-22 Game: 12-16 32 29 1st 2nd 33 40 Total 65 69 Points NWLA OU In Paint 28 20 Off T/O 9 19 2nd Chance 9 7 Fast Break 4 10 Bench 38 25 Officials: Antinio Petty, Jamie Luckie, Mark Whitehead Technical fouls: Oklahoma-None. Arkansas-None. Attendance: 12548 Estimated Actual Attendance: 9,501 Score by periods Oklahoma Arkansas Last FG - NWLA 2nd-00:28, OU 2nd-00:54. Largest lead - NWLA by 6 2nd-05:35, OU by 7 1st-07:02. Score tied - 14 times. Lead changed - 10 times. 38 41 1st 2nd 40 40 Total 78 81 Points OU AR In Paint 42 36 Off T/O 15 19 2nd Chance 16 14 Fast Break 4 11 Bench 41 22 Last FG - OU 2nd-00:22, AR 2nd-00:15. Largest lead - OU by 4 1st-18:37, AR by 11 2nd-16:52. Score tied - 1 time. Lead changed - 3 times. 22 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Official Basketball Box Score -- Game Totals -- Final Statistics Texas A&M vs Oklahoma 12/15/12 1 p.m. CT at Oklahoma City, Okla. (Chesapeake Arena) Texas A&M 54 • 7-2 ## 32 35 11 21 31 00 04 12 13 42 Dec. 15, 2012 • Oklahoma City, Okla. • Chesapeake Energy Arena Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 9: OU 64, TEXAS A&M 54 Official Basketball Box Score -- Game Totals -- Final Statistics Stephen F. Austin vs Oklahoma 12/18/12 7 p.m. CT at Norman, Okla. (Lloyd Noble Center) Stephen F. Austin 56 • 8-1 ## 32 34 04 05 25 00 03 10 23 43 Dec. 18, 2012 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 10: STEPHEN F. AUSTIN 56, OU 55 Kourtney Roberson Ray Turner J'Mychal Reese Alex Caruso Elston Turner Andrew Young Keith Davis Fabyon Harris Jordan Green Jarod Jahns Team Totals FG % 1st Half: 10-24 3FG % 1st Half: 3-5 FT % 1st Half: 4-6 41.7% 60.0% 66.7% Player f f g g g 2-3 5-10 4-7 0-3 6-13 2-5 0-0 1-7 0-2 0-0 20-50 0-0 0-0 0-0 0-1 4-6 0-0 0-0 1-4 0-0 0-0 5-11 0-0 2-4 0-0 0-0 1-2 2-2 0-0 4-4 0-0 0-0 9-12 1 4 5 1 2 3 5 3 0 1 1 3 0 1 1 3 1 5 6 1 5 5 10 3 0 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 3 2 5 12 23 35 15 40.0% 45.5% 75.0% 4 12 8 0 17 6 0 7 0 0 54 1 0 0 6 1 0 0 1 0 0 1 2 4 4 5 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 2 1 2 1 0 0 1 0 0 19 30 26 19 34 19 9 30 11 3 9 19 7 200 Deadball Rebounds 1 Smith, Taylor Parker, Jacob Bateman, Hal Bostic, Antonio Haymon, Desmond Walkup, Thomas Walker, Deshaunt Pinkney, Trey Gajic, Nikola Asortse, Ice Team Totals FG % 1st Half: 12-27 3FG % 1st Half: 1-5 FT % 1st Half: 1-1 44.4% 20.0% 100.0% Player f f g g g 7-15 2-4 5-9 4-18 2-7 3-6 1-2 0-0 0-0 0-0 24-61 0-0 1-2 0-1 1-5 1-4 0-1 0-1 0-0 0-0 0-0 3-14 35.3% 22.2% 80.0% 0-1 0-0 3-3 0-0 0-0 2-2 0-0 0-0 0-0 0-0 5-6 2 5 7 3 2 4 6 3 1 4 5 4 2 2 4 2 1 2 3 1 4 0 4 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 3 8 17 20 37 14 39.3% 21.4% 83.3% 1 0 0 4 2 1 0 1 1 1 2 56 17 13 14 5 13 9 5 8 2 0 0 0 1 1 9 3 1 0 0 1 1 0 4 0 0 0 0 0 0 0 0 0 3 1 2 2 0 1 0 1 0 0 36 35 34 37 23 19 6 6 2 2 4 10 200 Deadball Rebounds 0 2nd half: 10-26 2nd half: 2-6 2nd half: 5-6 38.5% 33.3% 83.3% Game: 20-50 Game: 5-11 Game: 9-12 2nd half: 12-34 2nd half: 2-9 2nd half: 4-5 Game: 24-61 Game: 3-14 Game: 5-6 Oklahoma 64 • 7-2 ## 22 24 02 05 11 01 03 04 15 21 Oklahoma 55 • 7-3 Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min ## 22 24 02 05 11: 3FG % 1st Half: FT % 1st Half: 8-23 3-13 9-10 34.8% 23.1% 90.0% Player Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min f f g g g 0-3 5-9 2-4 0-6 0-4 1-2 4-9 1-5 0-0 8-12 21-54 0-0 0-0 2-3 0-4 0-3 0-0 2-5 0-1 0-0 0-0 4-16 0-0 9-9 4-4 2-2 0-0 0-0 2-2 0-0 0-0 1-2 18-19 0 0 0 0 4 3 7 0 1 1 2 3 0 4 4 1 0 3 3 0 0 0 0 1 2 2 4 2 1 2 3 0 0 0 0 0 1 3 4 4 2 2 4 11 20 31 11 38.9% 25.0% 94.7% 0 19 10 2 0 2 12 2 0 17 0 1 2 3 1 2 1 1 0 0 0 0 1 4 0 3 2 0 0 1 1 2 0 1 0 0 0 0 0 0 1 1 3 1 1 0 1 1 0 1 14 25 24 32 16 14 31 15 3 26 M'Baye, Amath Osby, Romero Pledger, Steven Hornbeak, Je'lon Cousins, Isaiah Hield, Buddy Fitzgerald, Andrew Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 12-29 3FG % 1st Half: 1-6 FT % 1st Half: 5-7 41.4% 16.7% 71.4% f f g g g 1-2 4-8 6-14 4-9 0-4 3-11 3-5 0-1 1-4 22-58 0-0 0-0 0-6 3-5 0-1 0-1 0-0 0-1 0-0 3-14 1-2 0-0 0-0 1-1 1-2 3-4 0-0 0-0 2-2 8-11 4 0 4 1 0 3 3 4 2 3 5 1 0 3 3 4 1 0 1 1 6 5 11 1 1 1 2 2 0 1 1 0 0 2 2 2 3 3 6 17 21 38 16 37.9% 21.4% 72.7% 3 8 12 12 1 9 6 0 4 55 0 1 1 3 0 1 0 0 0 3 2 1 2 2 0 1 0 2 1 0 0 1 0 0 1 0 0 3 0 1 1 0 0 2 1 0 0 22 18 32 33 16 29 22 10 18 6 13 5 200 Deadball Rebounds 2 64 11 11 4 10 200 Deadball Rebounds 0 2nd half: 13-31 2nd half: 1-3 2nd half: 9-9 41.9% 33.3% 100.0% Game: 21-54 Game: 4-16 Game: 18-19 2nd half: 10-29 2nd half: 2-8 2nd half: 3-4 34.5% 25.0% 75.0% Game: 22-58 Game: 3-14 Game: 8-11 Officials: Mark Whitehead, Doug Sirmons, John Hampton Technical fouls: Texas A&M-None. Oklahoma-None. Attendance: 4254 All-College Classic Score by periods Texas A&M Oklahoma Officials: Kipp Kissinger, Bryan Kersey, Ray Natili Technical fouls: Stephen F. Austin-None. Oklahoma-None. Attendance: 8572 Estimated Attendance: 3020 Score by periods Stephen F. Austin Oklahoma 27 28 1st 2nd 27 36 Total 54 64 Points TAMU OU In Paint 26 22 Off T/O 9 20 2nd Chance 14 14 Fast Break 4 11 Bench 13 33 26 30 1st 2nd 30 25 Total 56 55 Points SFA OU In Paint 34 12 Off T/O 12 10 2nd Chance 16 15 Fast Break 2 2 Bench 10 19 Last FG - TAMU 2nd-03:08, OU 2nd-04:00. Largest lead - TAMU by 6 1st-11:34, OU by 14 2nd-04:35. Score tied - 5 times. Lead changed - 3 times. Last FG - SFA 2nd-02:58, OU 2nd-02:28. Largest lead - SFA by 11 2nd-12:52, OU by 5 1st-00:54. Score tied - 8 times. Lead changed - 5 times. Official Basketball Box Score -- Game Totals -- Final Statistics Ohio vs Oklahoma 12/29/12 7 p.m. CT at Norman, Okla. (Lloyd Noble Center) Ohio 63 • 8-5 ## 30 03 05 15 20 01 13 21 22 23 Dec. 29, 2012 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 11: OU 74, OHIO 63 Official Basketball Box Score -- Game Totals -- Final Statistics Texas A&M-Corpus Christi vs Oklahoma 12/31/12 2 p.m. CT at Norman, Okla. (McCasland Field House) Texas A&M-Corpus Christi 42 • 1-10 ## 05 31 00 01 10 02 11 15 23 32 GAME 12: OU 72, TEXAS A&M-CORPUS CHRISTI 42 Dec. 31, 2012 • Norman, Okla. • McCasland Field House Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP Player KEELY, Reggie OFFUTT, Walter COOPER, D.J. KELLOGG, Nick JOHNSON, Ricardo GREEN, Kadeem HALL, T.J. SMITH, Jon TAYLOR, Stevie BALTIC, Ivo Team Totals FG % 1st Half: 11-24 3FG % 1st Half: 5-14 FT % 1st Half: 2-4 45.8% 35.7% 50.0% f g g g g 6-8 4-10 6-13 0-6 1-4 1-1 0-1 2-2 3-5 2-3 25-53 0-0 3-8 2-7 0-6 0-0 0-0 0-1 0-0 2-3 1-1 8-26 48.3% 25.0% 100.0% 1-1 0-2 0-0 0-0 0-0 0-0 0-0 0-0 0-0 4-4 5-7 1 7 8 1 0 0 0 2 0 2 2 1 0 1 1 2 2 3 5 3 1 0 1 0 0 1 1 2 0 3 3 3 0 0 0 1 0 3 3 4 1 5 6 5 25 30 19 47.2% 30.8% 71.4% 13 11 14 0 2 2 0 4 8 9 1 1 7 1 2 0 0 0 2 2 0 3 5 1 3 0 0 0 0 6 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 27 37 31 24 25 2 2 16 9 27 63 16 18 5 200 Deadball Rebounds 2 Nelson, Will Williamson, Joy Pye, Brandon Ali, Hameed Jordan, Johnathan Martinez, Cole Currie, Jelani Francis, Dale Maxey, Nate King, James Team Totals FG % 1st Half: 3FG % 1st Half: FT % 1st Half: 8-23 2-7 3-6 34.8% 28.6% 50.0% Player A TO Blk Stl Min f f g g g 2-12 5-13 2-5 3-9 3-11 0-1 0-1 0-1 2-5 0-0 17-58 1-3 1-5 1-2 0-1 0-2 0-1 0-0 0-0 0-0 0-0 3-14 9-35 1-7 2-2 25.7% 14.3% 100.0% 0-1 3-4 0-0 0-0 0-1 0-0 0-0 0-0 0-0 2-2 5-8 2 2 4 4 2 3 5 4 1 3 4 1 1 1 2 2 2 4 6 0 0 0 0 0 0 0 0 0 1 3 4 2 1 4 5 3 0 0 0 0 2 3 5 12 23 35 16 29.3% 21.4% 62.5% 5 14 5 6 6 0 0 0 4 2 42 6 4 1 1 5 0 0 0 0 0 1 3 18 1 0 0 0 1 0 1 0 0 0 2 0 0 0 0 0 0 0 0 0 2 1 2 0 0 2 0 0 0 0 0 26 30 25 29 34 2 3 28 21 2 5 200 Deadball Rebounds 1 2nd half: 14-29 2nd half: 3-12 2nd half: 3-3 Game: 25-53 Game: 8-26 Game: 5-7 2nd half: 2nd half: 2nd half: Game: 17-58 Game: 3-14 Game: 5-8 Oklahoma 74 • 8-3 ## 22 24 02 03 05 01 04 11 15 21 Oklahoma 72 • 9-3 Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min ## 22 24 02 03 05 01 04 11 13 15 21 32 Player M'Baye, Amath Osby, Romero Pledger, Steven Hield, Buddy Hornbeak, Je'lon Grooms, Sam Fitzgerald, Andrew Cousins, Isaiah Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 10-33 3FG % 1st Half: 0-8 FT % 1st Half: 9-12 30.3% 0.0% 75.0% f f g g g 6-8 5-8 7-16 2-7 1-2 1-2 1-4 0-3 0-0 4-7 27-57 0-0 0-0 2-8 1-2 0-1 0-1 0-0 0-0 0-0 0-0 3-12 4-5 6-6 2-3 0-0 3-4 0-1 2-4 0-0 0-0 0-0 17-23 1 5 6 2 1 4 5 0 3 3 6 1 0 3 3 0 0 2 2 3 1 0 1 2 1 2 3 0 0 0 0 2 0 0 0 0 1 3 4 3 2 1 3 10 23 33 13 47.4% 25.0% 73.9% 16 16 18 5 5 2 4 0 0 8 0 0 1 7 2 2 0 1 0 1 2 1 3 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 3 1 1 4 0 1 1 0 0 1 22 30 34 34 20 20 10 11 1 18 74 14 11 1 12 200 Deadball Rebounds 1 2nd half: 17-24 2nd half: 3-4 2nd half: 8-11 70.8% 75.0% 72.7% Game: 27-57 Game: 3-12 Game: 17-23-32 3FG % 1st Half: 6-13 FT % 1st Half: 8-8 40.6% 46.2% 100.0% Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min f f g g g 7-11 1-1 6-15 3-10 1-1 0-0 4-4 1-8 0-2 0-5 1-2 0-0 24-59 0-0 0-0 5-10 1-6 1-1 0-0 0-0 1-3 0-2 0-3 1-1 0-0 9-26 0-0 6-6 0-0 0-0 0-0 2-2 1-2 0-0 0-0 0-0 4-4 2-2 15-16 2 4 6 2 2 4 6 1 0 2 2 3 2 3 5 1 0 3 3 2 0 2 2 2 2 0 2 0 0 3 3 0 0 0 0 0 0 2 2 1 0 4 4 1 1 1 2 1 4 3 7 13 31 44 14 40.7% 34.6% 93.8% 14 8 17 7 3 2 9 3 0 0 7 2 1 1 1 3 5 1 0 0 0 1 1 0 0 3 2 1 1 1 2 2 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 4 1 0 2 0 2 0 1 0 0 0 1 0 21 19 20 22 23 17 12 19 4 14 19 10 72 14 13 7 200 Deadball Rebounds 0 Officials: Doug Sirmons, Andrew Walton, Bret Smith Technical fouls: Ohio-JOHNSON, Ricardo. Oklahoma-M'Baye, Amath. Attendance: 10036 Estimated Attendance: 4699 Score by periods Ohio Oklahoma 2nd half: 11-27 2nd half: 3-13 2nd half: 7-8 40.7% 23.1% 87.5% Game: 24-59 Game: 9-26 Game: 15-16 29 29 1st 2nd 34 45 Total 63 74 Points OHIO OU In Paint 28 30 Off T/O 10 22 2nd Chance 2 10 Fast Break 14 14 Bench 23 14 Officials: Rick Hartzell, Terry Davis, Roland Simmons Technical fouls: Texas A&M-Corpus Christi-None. Oklahoma-None. Attendance: 2751 Estimated Attendance: 2501 Score by periods Texas A&M-Corpus Christi Oklahoma Last FG - OHIO 2nd-00:02, OU 2nd-02:59. Largest lead - OHIO by 5 1st-17:10, OU by 17 2nd-02:59. Score tied - 4 times. Lead changed - 7 times. 21 40 1st 2nd 21 32 Total 42 72 Points AMCC OU In Paint 16 24 Off T/O 3 11 2nd Chance 5 19 Fast Break 4 11 Bench 6 23 Last FG - AMCC 2nd-01:40, OU 2nd-04:16. Largest lead - AMCC None, OU by 32 2nd-02:01. Score tied - 0 times. Lead changed - 0 times. 23 2012-13 OKLAHOMA MEN’S BASKETBALL Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs West Virginia 1/5/13 4 p.m. ET at Morgantown, W.Va. (WVU Coliseum) Oklahoma 67 • 10-3/1-0 ## 22 24 02 03 05 01 04 11 15 21 Jan. 5, 2013 • Morgantown, W.Va. • WVU Coliseum Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 13: OU 67, WEST VIRGINIA 57 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma State vs Oklahoma 01/12/13 2 p.m. CT at Norman, Okla. (Lloyd Noble Center) Oklahoma State 68 • 11-4, 1-2 ## 02 21 44 22 33 01 10 20 Jan. 12, 2013 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 14: OU 77, OKLAHOMA STATE 68-30 3FG % 1st Half: 2-6 FT % 1st Half: 1-2 43.3% 33.3% 50.0% Player f f g g g 3-8 7-11 5-12 4-12 1-2 1-2 0-0 3-5 0-2 3-7 27-61 0-0 1-1 2-8 0-1 1-1 0-1 0-0 0-1 0-2 0-0 4-15 1-2 6-6 0-0 0-0 1-2 0-0 0-0 0-0 0-0 1-1 9-11 1 3 4 1 3 6 9 2 2 2 4 1 4 3 7 0 0 2 2 2 0 4 4 1 0 1 1 4 0 0 0 3 0 0 0 0 1 5 6 0 2 1 3 13 27 40 14 44.3% 26.7% 81.8% 7 21 12 8 4 2 0 6 0 7 2 0 0 5 1 2 0 1 1 0 1 2 1 2 2 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 2 0 1 0 2 1 0 1 2 0 0 27 36 28 30 25 14 4 17 6 13 Player Nash, Le'Bryan Murphy, Kamari Jurick, Philip Brown, Markel Smart, Marcus Gardner, Kirby Forte, Phil Cobbins, Michael Team Totals FG % 1st Half: 11-27 3FG % 1st Half: 6-12 FT % 1st Half: 1-4 40.7% 50.0% 25.0% f f c g g 5-9 0-2 3-4 4-12 3-10 0-2 3-12 4-5 22-56 0-1 0-0 0-0 2-7 1-3 0-0 3-10 0-0 6-21 2-3 0-0 0-0 9-11 3-6 1-2 3-3 0-0 18-25 0 3 3 2 3 0 3 2 3 5 8 3 1 5 6 3 0 2 2 4 1 1 2 2 1 0 1 0 0 4 4 2 3 4 7 12 24 36 18 39.3% 28.6% 72.0% 12 0 6 19 10 1 12 8 2 0 0 2 3 2 2 0 4 0 2 4 4 0 1 0 0 0 0 1 0 0 0 2 3 1 0 0 1 3 0 2 0 36 11 16 38 27 11 36 25 68 11 15 7 200 Deadball Rebounds 2 67 12 10 7 200 Deadball Rebounds 1 2nd half: 14-31 2nd half: 2-9 2nd half: 8-9 45.2% 22.2% 88.9% Game: 27-61 Game: 4-15 Game: 9-11 2nd half: 11-29 2nd half: 0-9 2nd half: 17-21 37.9% 0.0% 81.0% Game: 22-56 Game: 6-21 Game: 18-25 Oklahoma 77 • 11-3, 2-0 ## West Virginia 57 • 7-6/0-1 ## 13 24 03 04 15 01 10 14 34 55 Kilicli, Deniz Murray, Aaric Staten, Juwan Hinds, Jabarie Henderson, Terry Rutledge, Dominique Harris, Eron Browne, Gary Noreen, Kevin Miles, Keaton Team Totals FG % 1st Half: 11-31 3FG % 1st Half: 9-19 FT % 1st Half: 4-6 35.5% 47.4% 66 22 TP A TO Blk Stl Min 24 02 03 05 01 04 11 15 21 f c g g g 1-4 2-7 4-9 3-7 7-14 0-2 1-8 0-8 0-0 0-1 18-60 0-0 2-4 0-0 2-4 6-11 0-0 1-6 0-4 0-0 0-1 11-30 7-29 2-11 6-7 1-2 2-2 2-2 3-3 1-2 0-0 1-2 0-0 0-0 0-0 10-13 3 3 6 1 2 2 4 4 1 4 5 0 0 3 3 1 2 0 2 2 2 2 4 0 0 0 0 0 3 2 5 0 1 4 5 1 0 0 0 1 3 2 5 17 22 39 10 30.0% 36.7% 76.9% 3 8 10 11 21 0 4 0 0 0 0 1 7 2 1 0 0 0 1 0 1 1 3 3 2 2 1 1 0 0 1 1 0 1 0 0 0 0 0 0 3 0 1 0 1 1 0 0 0 0 0 19 24 36 27 30 12 15 11 25: 14-32 3FG % 1st Half: 3-4 FT % 1st Half: 7-8 43.8% 75.0% 87.5% f f g g g 5-9 6-12 2-7 6-11 3-3 1-5 0-2 0-2 0-1 2-6 25-58 1-1 0-0 2-5 3-5 2-2 0-0 0-0 0-0 0-0 0-0 8-13 4-4 5-6 5-5 0-0 0-0 4-4 1-2 0-0 0-0 0-0 19-21 0 5 5 3 0 3 3 2 4 5 9 2 0 4 4 3 0 3 3 2 0 3 3 3 1 0 1 2 0 2 2 1 0 0 0 0 2 2 4 3 3 0 3 10 27 37 21 43.1% 61.5% 90.5% 15 17 11 15 8 6 1 0 0 4 0 2 2 5 1 3 0 0 0 0 0 1 3 2 4 1 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 2 0 2 0 1 0 1 0 1 1 25 31 29 37 13 27 9 11 3 15 77 13 13 8 200 Deadball Rebounds 1 57 12 14 3 200 Deadball Rebounds 1 2nd half: 2nd half: 2nd half: 24.1% 18.2% 85.7% Game: 18-60 Game: 11-30 Game: 10-13 2nd half: 11-26 2nd half: 5-9 2nd half: 12-13 42.3% 55.6% 92.3% Game: 25-58 Game: 8-13 Game: 19-21 Officials: Gerry Pollard, Rick Randall, Darron George Technical fouls: Oklahoma-None. West Virginia-None. Attendance: 12112 id-1185750 Score by periods Oklahoma West Virginia Officials: Mike Stuart, Don Daily, Andrew Walton Technical fouls: Oklahoma State-None. Oklahoma-None. Attendance: 12695 Estimated Attendance: 8696 Foul on OU #21 Clark at 12:42 of the second half was ruled a Flagrant 1 foul. Score by periods Oklahoma State Oklahoma 29 35 1st 2nd 38 22 Total 67 57 Points OU WVU In Paint 30 10 Off T/O 17 11 2nd Chance 15 8 Fast Break 2 0 Bench 15 4 29 38 1st 2nd 39 39 Total 68 77 Points OSU OU In Paint 26 26 Off T/O 14 14 2nd Chance 9 12 Fast Break 3 7 Bench 21 11 Last FG - OU 2nd-00:42, WVU 2nd-05:44. Largest lead - OU by 10 2nd-00:42, WVU by 12 2nd-17:58. Score tied - 6 times. Lead changed - 7 times. Last FG - OSU 2nd-00:26, OU 2nd-01:15. Largest lead - OSU None, OU by 14 1st-04:35. Score tied - 0 times. Lead changed - 0 times. Official Basketball Box Score -- Game Totals -- Final Statistics Texas Tech vs Oklahoma 01/16/13 7 p.m. CT at Norman, Okla. (Lloyd Noble Center) Texas Tech 63 • 8-7 (1-3) ## 11 32 02 05 23 04 10 12 20 30 35 Jan. 16, 2013 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 15: OU 81, TEXAS TECH 63 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Kansas State 1/19/13 3 p.m. CT at Manhattan, Kan. (Bramlage Coliseum) Oklahoma 60 • 12-4 (3-1) ## 22 24 02 03 05 01 04 11 15 21 Jan. 19, 2013 • Manhattan, Kan. • Bramlage Coliseum Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 16: KANSAS STATE 69, OU 60 Player Kravic, Dejan Tolbert, Jordan Hannahs, Dusty Gray, Josh Williams, Jamal Nurse, Ty Robinson, Daylen Tapsoba, Kader Gotcher, Toddrick Crockett, Jaye Lammert, Clark Team Totals FG % 1st Half: 11-27 3FG % 1st Half: 2-9 FT % 1st Half: 5-8 40.7% 22.2% 62.5% f f g g g 8-10 2-4 3-9 3-10 2-5 0-0 0-2 1-1 1-4 5-14 0-0 25-59 0-0 0-0 2-6 0-5 2-4 0-0 0-2 0-0 1-1 0-4 0-0 5-22 4-7 0-1 0-0 1-2 0-0 0-0 0-0 2-2 0-0 1-1 0-0 8-13 4 5 9 2 2 1 3 4 0 0 0 3 1 2 3 3 0 0 0 1 0 0 0 2 1 1 2 3 0 1 1 1 0 0 0 2 4 6 10 2 0 0 0 0 2 2 4 14 18 32 23 42.4% 22.7% 61.5% 20 4 8 7 6 0 0 4 3 11 0 63 0 1 0 1 2 0 1 0 1 3 0 4 3 2 1 0 1 1 0 0 2 0 0 0 0 0 0 0 0 2 0 0 0 2 1 0 0 3 1 0 1 0 2 0 0 26 16 33 24 25 5 18 10 14 29 0+ 9 14 8 200 Deadball Rebounds-26 3FG % 1st Half: 1-5 FT % 1st Half: 0-2 50.0% 20.0% 0.0% Player f f g g g 5-9 5-9 3-6 4-9 2-4 2-3 3-6 1-4 0-0 0-3 25-53 0-1 0-0 2-4 0-3 1-2 0-0 0-0 0-1 0-0 0-0 3-11 2-2 2-6 2-3 0-1 0-0 0-1 0-0 0-0 0-0 1-2 7-15 4 0 4 2 1 7 8 4 0 1 1 2 2 8 10 4 1 1 2 0 0 4 4 0 0 2 2 2 2 1 3 3 1 0 1 1 0 1 1 0 3 0 3 14 25 39 18 47.2% 27.3% 46.7% 12 12 10 8 5 4 6 2 0 1 0 1 3 3 3 4 0 2 0 0 3 5 2 3 1 2 0 0 0 0 1 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 1 0 0 27 23 28 31 15 25 17 16 4 14 60 16 16 1 200 Deadball Rebounds 3,1 2nd half: 14-32 2nd half: 3-13 2nd half: 3-5 43.8% 23.1% 60.0% Game: 25-59 Game: 5-22 Game: 8-13 2nd half: 12-27 2nd half: 2-6 2nd half: 7-13 44.4% 33.3% 53.8% Game: 25-53 Game: 3-11 Game: 7-15 Oklahoma 81 • 12-3 (3-0) ## 22 24 02 03 05 01 04 11 13 15 21 32 Kansas State 69 • 15-2 (4-0) ##-33 3FG % 1st Half: 1-5 FT % 1st Half: 7-7 39.4% 20 f f g g g 3-8 6-10 3-11 4-9 0-3 0-2 5-7 2-3 0-0 0-0 5-6 0-0 28-59 0-0 0-0 2-6 1-4 0-1 0-0 0-0 0-0 0-0 0-0 0-0 0-0 3-11 1-1 5-7 3-4 7-7 2-2 0-0 2-3 2-2 0-0 0-0 0-0 0-0 22-26 3 2 5 0 2 4 6 2 1 2 3 1 1 6 7 3 1 0 1 2 1 3 4 1 2 2 4 2 1 1 2 1 0 0 0 0 0 0 0 1 1 2 3 0 0 1 1 0 3 1 4 16 24 40 13 47.5% 27.3% 84.6% 7 17 11 16 2 0 12 6 0 0 10 0 0 2 0 3 0 5 0 2 0 0 1 0 3 0 0 0 1 2 0 3 0 0 0 0 9 0 0 0 1 1 0 2 0 0 0 0 0 4 0 0 0 2 1 1 0 1 0 0 2 0 18 22 25 36 20 20 15 16 1 2 22 3 42 01 13 22 55 03 11 20 21 Gipson, Thomas Southwell, Shane Rodriguez, Angel McGruder, Rodney Spradling, Will Irving, Martavious Williams, Nino Diaz, Adrian Henriquez, Jordan Team Totals FG % 1st Half: 12-28 3FG % 1st Half: 7-13 FT % 1st Half: 4-4 42.9% 53.8% 100.0% f g g g g 1-2 4-7 4-14 6-12 5-9 0-1 0-1 1-1 1-3 22-50 0-0 2-4 1-4 4-9 3-6 0-1 0-0 0-0 0-0 10-24 1-2 2-2 3-6 4-4 2-3 1-2 0-0 2-2 0-1 15-22 0 4 4 4 0 7 7 2 1 1 2 2 1 0 1 0 0 3 3 2 1 1 2 2 0 0 0 2 2 0 2 0 0 3 3 1 1 0 1 6 19 25 15 44.0% 41.7% 68.2% 3 12 12 20 15 1 0 4 2 0 0 9 3 1 3 0 0 1 1 1 1 1 0 3 0 0 1 8 0 1 0 0 0 0 0 0 3 4 0 1 3 1 0 1 0 0 1 18 29 32 40 34 16 7 4 20 69 17 7 200 Deadball Rebounds 3 81 13 7 200 Deadball Rebounds 1 2nd half: 10-22 2nd half: 3-11 2nd half: 11-18 45.5% 27.3% 61.1% Game: 22-50 Game: 10-24 Game: 15-22 2nd half: 15-26 2nd half: 2-6 2nd half: 15-19 57.7% 33.3% 78.9% Game: 28-59 Game: 3-11 Game: 22-26 Officials: Gerry Pollard, Randy Heimerman, Brent Meaux Technical fouls: Oklahoma-None. Kansas State-None. Attendance: 12528 Score by periods Oklahoma Kansas State Officials: Joe DeRosa, J.B. Caldwell, Kipp Kissinger Technical fouls: Texas Tech-None. Oklahoma-None. Attendance: 9178 Estimated Attendance: 4521 Score by periods Texas Tech Oklahoma 27 35 1st 2nd 33 34 Total 60 69 Points OU KS In Paint 34 16 Off T/O 6 26 2nd Chance 20 5 Fast Break 4 9 Bench 13 7 29 34 1st 2nd 34 47 Total 63 81 Points TTU OU In Paint 34 34 Off T/O 10 16 2nd Chance 13 12 Fast Break 4 6 Last FG - OU 2nd-00:37, KS 2nd-01:30. Largest lead - OU by 5 1st-14:05, KS by 14 2nd-08:51. Bench 18 28 Score tied - 1 time. Lead changed - 11 times. Last FG - TTU 2nd-03:13, OU 2nd-01:03. Largest lead - TTU by 3 1st-19:44, OU by 18 2nd-01:03. Score tied - 3 times. Lead changed - 1 time. 24 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Official Basketball Box Score -- Game Totals -- Final Statistics Texas vs Oklahoma 01/21/13 8:30 p.m. CT at Norman, Okla. (Lloyd Noble Center) Texas 67 • 8-10, 0-5 ## 10 33 55 03 14 01 02 05 21 44 Jan. 21, 2013 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 17: OU 73, TEXAS 67 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Kansas 01/26/13 3 p.m. CT at Lawrence, Kan. (Allen Fieldhouse) Oklahoma 54 • 13-5, 4-2 Big 12 ## 22 24 02 03 05 01 04 11 21 Jan. 26, 2013 • Lawrence, Kan. • Allen Fieldhouse Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 18: KANSAS 67, OU 54 Holmes, Jonathan Papapetrou, Ioannis Ridley, Cameron Felix, Javan Lewis, Julien McClellan, Sheldon Holland, Demarcus Bond, Jaylen Lammert, Connor Ibeh, Prince Team Totals FG % 1st Half: 12-27 3FG % 1st Half: 2-8 FT % 1st Half: 0-1 44.4% 25.0% 0.0% Player f f c g g 0-1 5-8 1-2 1-5 2-10 10-20 1-5 1-3 2-3 4-4 27-61 0-0 2-4 0-0 0-1 1-5 1-4 0-2 1-1 1-2 0-0 6-19 0-0 0-0 0-0 0-0 2-4 4-5 0-0 1-2 0-0 0-0 7-11 0 2 2 0 3 1 4 4 2 3 5 0 0 2 2 3 2 3 5 4 2 2 4 0 0 0 0 2 1 4 5 3 1 2 3 1 2 2 4 3 0 0 0 13 21 34 20 44.3% 31.6% 63.6% 2 2 0 3 2 3 1 1 0 0 1 67 10 15 0 12 2 2 7 25 2 4 5 8 1 0 0 3 2 2 1 1 0 0 0 0 2 0 0 0 0 0 0 1 3 1 0 0 1 2 2 0 0 1 0 8 17 12 32 33 31 17 20 14 16 Player 7 200 Deadball Rebounds 2: 8-28 2-7 3-6 28.6% 28.6% 50.0% f f g g g 4-11 4-16 4-8 4-11 0-1 1-2 2-4 0-3 2-3 21-59 0-1 1-1 2-4 0-5 0-0 0-0 0-0 0-1 0-0 3-12 4-4 3-4 0-0 1-2 1-2 0-0 0-0 0-0 0-2 9-14 2 5 7 4 4 2 6 4 0 1 1 1 1 1 2 2 1 3 4 0 0 1 1 0 3 5 8 2 0 0 0 0 0 2 2 1 0 0 0 11 20 31 14 35.6% 25.0% 64.3% 12 12 10 9 1 2 4 0 4 0 2 0 2 2 1 1 2 0 1 1 1 0 3 1 1 1 2 0 1 0 0 1 0 0 0 0 2 1 1 2 3 0 0 0 0 0 30 33 29 30 29 14 12 8 15 54 10 11 7 200 Deadball Rebounds 3 2nd half: 15-34 2nd half: 4-11 2nd half: 7-10 44.1% 36.4% 70.0% Game: 27-61 Game: 6-19 Game: 7-11 2nd half: 13-31 2nd half: 1-5 2nd half: 6-8 41.9% 20.0% 75.0% Game: 21-59 Game: 3-12 Game: 9-14 Oklahoma 73 • 13-4, 4-1 ## 22 24 02 03 05 01 04 11 15 21 Kansas 67 • 18-1, 6-0 Big 12 ## M'Baye, Amath Osby, Romero Pledger, Steven Hield, Buddy Hornbeak, Je'lon Grooms, Sam Fitzgerald, Andrew Cousins, Isaiah Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 12-28 3FG % 1st Half: 0-2 FT % 1st Half: 6-6 42.9% 0 40 05 15 23 24 01 02 31 34 f f g g g 6-9 9-15 2-5 5-8 1-3 1-2 0-2 0-3 0-1 1-4 25-52 0-0 1-1 0-2 0-0 1-2 0-0 0-0 0-1 0-0 0-0 2-6 3-4 10-11 1-2 2-2 0-0 5-8 0-0 0-0 0-0 0-0 21-27 2 3 5 2 1 7 8 1 1 2 3 3 1 3 4 4 0 1 1 2 0 0 0 0 0 1 1 0 0 3 3 1 0 0 0 0 0 2 2 0 4 1 5 9 23 32 13 48.1% 33.3% 77.8% 15 29 5 12 3 7 0 0 0 2 0 0 0 4 3 4 0 1 0 0 4 0 1 3 3 0 0 0 2 0 1 2 0 2 0 0 0 1 0 0 6 0 3 2 2 1 0 0 0 0 0 30 32 18 32 32 17 8 17 4 10 Young, Kevin Withey, Jeff Johnson, Elijah McLemore, Ben Releford, Travis Tharpe, Naadir Adams, Rio Traylor, Jamari Ellis, Perry Team Totals FG % 1st Half: 12-31 3FG % 1st Half: 1-6 FT % 1st Half: 4-7 38.7% 16.7% 57.1% f c g g g 3-7 6-11 3-8 5-10 4-10 1-5 0-1 1-1 1-2 24-55 0-0 0-0 2-6 3-5 1-4 1-2 0-0 0-0 0-0 7-17 0-0 1-4 0-0 5-5 1-2 5-6 0-0 0-2 0-0 12-19 2 3 5 3 5 4 9 1 0 1 1 4 2 5 7 1 0 5 5 1 0 0 0 1 0 0 0 1 0 3 3 1 2 3 5 0 1 5 6 12 29 41 13 43.6% 41.2% 63.2% 6 13 8 18 10 8 0 2 2 0 1 2 1 5 4 0 0 2 2 1 4 2 3 2 0 0 0 0 4 0 0 1 0 0 1 0 6 3 3 1 0 1 0 0 0 0 21 34 26 37 38 17 3 10 14 67 15 14 8 200 Deadball Rebounds 6 73 12 13 8 200 Deadball Rebounds 3 2nd half: 13-24 2nd half: 2-4 2nd half: 15-21 54.2% 50.0% 71.4% Game: 25-52 Game: 2-6 Game: 21-27 2nd half: 12-24 2nd half: 6-11 2nd half: 8-12 50.0% 54.5% 66.7% Game: 24-55 Game: 7-17 Game: 12-19 Officials: Paul Janssen, Doug Simmons, Don Daily Technical fouls: Texas-None. Oklahoma-None. Attendance: 10409 Estimated Attendance: 7335 Score by periods Texas Oklahoma Officials: Joe DeRosa, Gary Maxwell, Bert Smith Technical fouls: Oklahoma-None. Kansas-None. Attendance: 16300 Score by periods Oklahoma Kansas 26 30 1st 2nd 41 43 Total 67 73 Points UT OU In Paint 28 34 Off T/O 14 12 2nd Chance 16 10 Fast Break 4 10 21 29 1st 2nd 33 38 Total 54 67 Points OU KU In Paint 16 28 Off T/O 14 13 2nd Chance 14 9 Fast Break 6 10 Bench 10 12 Bench 44 9 Last FG - OU 2nd-00:19, KU 2nd-01:28. Largest lead - OU by 3 1st-17:47, KU by 15 2nd-05:16. Score tied - 0 times. Lead changed - 2 times. Last FG - UT 2nd-00:06, OU 2nd-03:18. Largest lead - UT by 5 1st-04:14, OU by 12 2nd-12:26. Score tied - 4 times. Lead changed - 3 times. Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Baylor 1/30/13 6 p.m. CT at Waco, Texas (Ferrell Center) Oklahoma 74 • 14-5,(5-2) ## 22 24 02 03 05 01 04 11 21 Jan. 30, 2013 • Waco, Texas • Ferrell Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 19: OU 74, BAYLOR 71 Official Basketball Box Score -- Game Totals -- Final Statistics Kansas State vs Oklahoma 02/02/13 5 p.m. CT at Norman, Okla. (Lloyd Noble Center) Kansas State 52 • 17-4, 6-2 ## 01 21 13 22 55 03 11 12 42 50 Feb. 2, 2013 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 20: KANSAS STATE 52, OU 50 Player M'Baye, Amath Osby, Romero Pledger, Steven Hield, Buddy Hornbeak, Je'lon Grooms, Sam Fitzgerald, Andrew Cousins, Isaiah Clark, Cameron Team Totals FG % 1st Half: 16-30 3FG % 1st Half: 4-10 FT % 1st Half: 2-3 53.3% 40.0% 66.7% f f g g g 9-12 5-7 6-12 4-8 0-6 0-0 4-7 0-0 1-3 29-55 1-2 0-0 3-7 1-2 0-3 0-0 0-0 0-0 0-0 5-14 1-3 1-2 5-7 0-0 2-3 0-0 0-0 0-0 2-2 11-17 0 7 7 1 1 7 8 3 0 1 1 1 1 4 5 2 0 5 5 3 0 0 0 0 2 3 5 2 0 0 0 4 1 0 1 3 0 2 2 5 29 34 19 52.7% 35.7% 64.7% 2 4 1 1 3 0 0 1 3 1 74 20 16 20 11 20 9 2 0 8 0 4 1 1 5 3 6 0 2 2 0 4 1 0 0 0 0 0 0 0 5 1 0 2 0 1 0 1 1 2 29 35 34 36 30 2 17 8 9 8 200 Deadball Rebounds 4 2nd half: 13-25 2nd half: 1-4 2nd half: 9-14 52.0% 25.0% 64.3% Game: 29-55 Game: 5-14 Game: 11-17 Southwell, Shane Henriquez, Jordan Rodriguez, Angel McGruder, Rodney Spradling, Will Irving, Martavious Williams, Nino Lawrence, Omari Gipson, Thomas Johnson, DJ Team Totals FG % 1st Half: 12-28 3FG % 1st Half: 4-10 FT % 1st Half: 0-0 42.9% 40.0% 0.0% Player f f g g g 1-7 4-9 1-6 2-8 5-8 4-9 0-1 1-1 3-7 0-0 21-56 0-4 0-0 0-3 1-2 2-4 2-3 0-0 0-0 0-0 0-0 5-16 9-28 1-6 5-7 32.1% 16.7% 71.4% 1-2 0-1 2-2 2-2 0-0 0-0 0-0 0-0 0-0 0-0 5-7 2 1 3 0 3 0 3 2 0 0 0 3 1 8 9 2 1 2 3 3 1 2 3 2 1 0 1 3 0 2 2 0 0 4 4 3 0 2 2 0 0 4 4 9 25 34 18 37.5% 31.3% 71.4% 3 8 4 7 12 10 0 2 6 0 4 0 3 1 0 1 0 1 1 0 1 1 2 2 0 3 0 0 1 0 0 1 0 0 0 0 0 0 0 1 3 1 1 1 1 0 1 0 1 1 27 13 31 27 25 22 14 11 26 4 52 11 10 2 10 200 Deadball Rebounds 0 Baylor 71 • 14-6,(5-2) ## 34 21 05 22 55 01 02 04 14 2nd half: 2nd half: 2nd half: Game: 21-56 Game: 5-16 Game: 5-7 Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF Oklahoma 50 • 14-6, 5-3 TP A TO Blk Stl Min Jefferson, Cory Austin, Isaiah Heslip, Brady Walton, A.J. Jackson, Pierre Rose, L.J. Gathers, Rico Franklin, Gary Bello, Deuce Team Totals FG % 1st Half: 10-32 3FG % 1st Half: 2-12 FT % 1st Half: 4-9 31.3% 16.7% 44.4% f c g g g 3-6 8-16 4-8 4-12 8-22 0-0 1-4 0-3 0-4 28-75 0-0 0-2 3-7 0-2 3-12 0-0 0-0 0-3 0-1 6-27 1-2 3-4 0-0 2-5 3-5 0-0 0-0 0-1 0-0 9-17 2 3 5 3 11 9 20 2 0 1 1 1 0 3 3 5 4 4 8 2 0 0 0 1 5 2 7 0 1 1 2 0 1 0 1 5 0 0 0 24 23 47 19 37.3% 22.2% 52.9% 1 1 2 4 2 0 1 1 1 1 71 12 14 7 19 11 10 22 0 2 0 0 0 1 1 2 6 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 1 0 1 0 17 34 22 33 38 3 16 29 8 ## 22 24 02 03 05 01 04 11 21 Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min 8 200 Deadball Rebounds 2 2nd half: 18-43 2nd half: 4-15 2nd half: 5-8 41.9% 26.7% 62.5% Game: 28-75 Game: 6-27 Game: 9-17: 9-25 1-8 4-6 36.0% 12.5% 66.7% f f g g g 3-10 5-12 1-4 1-7 0-1 3-5 1-3 2-3 3-4 19-49 0-2 0-0 0-3 0-3 0-1 1-2 0-0 2-3 0-0 3-14 1-1 3-4 0-0 2-2 0-0 0-1 2-3 0-1 1-2 9-14 4 1 5 3 1 6 7 1 1 0 1 0 2 2 4 2 0 3 3 3 0 1 1 0 0 6 6 2 0 2 2 1 1 3 4 0 1 4 5 10 28 38 12 38.8% 21.4% 64.3% 7 13 2 4 0 7 4 6 7 50 0 0 0 2 2 2 0 2 0 3 0 1 2 3 2 0 2 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 1 1 29 34 20 33 17 12 16 20 19 8 14 4 200 Deadball Rebounds 0 Officials: Mark Whitehead, Rick Crawford, Rodrick Dixon Technical fouls: Oklahoma-None. Baylor-Gathers, Rico. Attendance: 6533 Fouled Out: BU: #22 Walton 0:17; #14 Bello 0:08 Score by periods Oklahoma Baylor 2nd half: 10-24 2nd half: 2-6 2nd half: 5-8 41.7% 33.3% 62.5% Game: 19-49 Game: 3-14 Game: 9-14 38 26 1st 2nd 36 45 Total 74 71 Points OU BU In Paint 20 42 Off T/O 13 20 2nd Chance 6 24 Fast Break 2 4 Officials: John Higgins, Rick Randall, Keith Kimble Technical fouls: Kansas State-Irving, Martavious. Oklahoma-Hornbeak, Je'lon. Attendance: 11882 Estimated Attendance: 8559 Bench 12 2 Last FG - OU 2nd-01:06, BU 2nd-00:17. Largest lead - OU by 16 2nd-13:39, BU by 2 1st-18:41. Score tied - 3 times. Lead changed - 2 times. Score by periods Kansas State Oklahoma 28 23 1st 2nd 24 27 Total 52 50 Points KS OU In Paint 24 26 Off T/O 8 17 2nd Chance 13 9 Fast Break 6 4 Bench 18 24 Last FG - KS 2nd-02:58, OU 2nd-00:13. Largest lead - KS by 8 2nd-07:49, OU by 2 1st-18:09. Score tied - 7 times. Lead changed - 4 times. 25 2012-13 OKLAHOMA MEN’S BASKETBALL Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Iowa State 02/04/13 6 p.m. CT at Ames, Iowa (Hilton Coliseum) Oklahoma 64 • 14-7, 5-4 ## 01 02 03 22 24 04 05 11 15 21 32 Feb. 4, 2013 • Ames, Iowa • Hilton Coliseum Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 21: IOWA STATE 83, OU 64 Official Basketball Box Score -- Game Totals -- Final Statistics Kansas vs Oklahoma 02/09/13 3 p.m. CT at Norman, Okla. (Lloyd Noble Center) Kansas 66 • 19-4, 7-3 ## 40 05 15 23 24 01 04 31 34 Feb. 9, 2013 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 22: OU 72, KANSAS 66 Player Player Grooms, Sam Pledger, Steven Hield, Buddy M'Baye, Amath Osby, Romero Fitzgerald, Andrew Hornbeak, Je'lon Cousins, Isaiah Neal, Tyler Clark, Cameron Arent, Casey Team Totals FG % 1st Half: 14-38 3FG % 1st Half: 1-7 FT % 1st Half: 2-4 36.8% 14.3% 50.0% * * * * * 1-3 2-9 2-5 4-12 2-10 5-11 1-3 3-7 1-3 5-8 0-0 26-71 0-0 0-4 1-4 0-1 0-0 0-0 1-3 0-2 1-2 0-0 0-0 3-16 0-2 1-2 0-0 0-0 2-4 2-3 0-2 4-4 0-0 0-0 0-0 9-17 0 1 1 0 1 5 6 1 1 2 3 3 3 3 6 2 4 2 6 1 5 2 7 5 2 0 2 2 0 3 3 3 1 2 3 0 1 1 2 0 1 0 1 0 2 0 2 21 21 42 17 36.6% 18.8% 52.9% 2 5 5 8 6 12 3 10 3 10 0 1 3 1 0 2 1 1 2 1 0 0 0 0 1 1 1 1 2 1 0 2 0 9 0 0 0 0 2 0 0 0 0 0 0 2 0 0 0 2 0 1 0 1 0 1 0 15 28 24 24 28 18 13 25 7 15 3 Young, Kevin Withey, Jeff Johnson, Elijah McLemore, Ben Releford, Travis Tharpe, Naadir Wesley, Justin Traylor, Jamari Ellis, Perry Team Totals FG % 1st Half: 14-32 3FG % 1st Half: 2-10 FT % 1st Half: 4-6 43.8% 20.0% 66.7% f c g g g 4-7 5-8 3-11 6-10 3-7 3-5 0-0 1-2 0-4 25-54 0-1 0-0 2-6 1-4 1-2 1-2 0-0 0-0 0-0 5-15 0-2 4-5 2-4 2-2 1-4 0-0 0-0 0-1 2-2 11-20 2 2 4 5 3 3 6 3 0 3 3 3 2 1 3 1 1 8 9 1 0 1 1 3 0 2 2 0 0 0 0 0 0 2 2 1 2 3 5 10 25 35 17 46.3% 33.3% 55.0% 8 14 10 15 8 7 0 2 2 0 1 4 3 1 2 0 0 0 0 5 3 2 2 1 0 0 0 0 1 0 0 0 0 0 0 0 1 1 3 0 1 0 0 0 0 0 18 35 36 35 35 22 4 7 8 66 11 13 5 200 Deadball Rebounds 3 64 12 5 200 Deadball Rebounds 6,1 2nd half: 12-33 2nd half: 2-9 2nd half: 7-13 36.4% 22.2% 53.8% Game: 26-71 Game: 3-16 Game: 9-17 2nd half: 11-22 2nd half: 3-5 2nd half: 7-14 50.0% 60.0% 50.0% Game: 25-54 Game: 5-15 Game: 11-20 Oklahoma 72 • 15-7, 6-4 ## Iowa State 83 • 16-6, 6-3 ## 02 03 13 21 31 01 10 12 15 22 24 25 33 Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min 22 24 02 03 11 01 04 05 15 21 Babb, Chris Ejim, Melvin Lucious, Korie Clyburn, Will Niang, Georges Palo, Bubu Law, Aaron McBeth, Austin Long, Naz Booker, Anthony Gibson, Percy McGee, Tyrus Ellerman, Tyler Team Totals FG % 1st Half: 17-33 3FG % 1st Half: 8-16 FT % 1st Half: 2-3 51.5% 50.0% 66.7% * * * * * 4-6 4-7 2-6 7-10 4-6 1-2 0-1 0-0 0-0 1-3 2-5 3-9 0-0 28-55 4-5 1-3 2-5 1-3 1-1 0-0 0-1 0-0 0-0 0-1 0-0 2-8 0-0 11-27 0-0 3-3 0-0 4-4 0-1 4-4 0-0 0-0 2-2 0-0 0-0 3-4 0-0 16-18 0 4 4 1 2 5 7 4 0 1 1 1 4 1 5 1 0 6 6 4 0 2 2 1 0 0 0 0 0 0 0 1 0 1 1 0 0 1 1 1 0 1 1 0 0 2 2 1 0 0 0 0 1 2 3 7 26 33 15 50.9% 40.7% 88.9% 12 12 6 19 9 6 0 0 2 2 4 11 0 2 1 8 2 0 3 0 0 1 0 0 1 0 0 0 3 2 2 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 6 1 1 0 1 0 0 0 0 0 1 1 2 0 27 25 24 35 17 18 2 2 3 9 13 23 2 M'Baye, Amath Osby, Romero Pledger, Steven Hield, Buddy Cousins, Isaiah Grooms, Sam Fitzgerald, Andrew Hornbeak, Je'lon Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 15-27 3FG % 1st Half: 4-9 FT % 1st Half: 4-4 55.6% 44.4% 100.0% Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min f f g g g 3-9 6-8 6-14 0-3 3-6 0-1 3-7 1-2 0-1 4-7 26-58 2-4 1-2 2-7 0-3 1-2 0-0 0-0 1-2 0-0 0-0 7-20 0-0 4-5 1-1 2-2 0-0 0-0 0-0 4-6 0-0 2-2 13-16 1 2 3 5 5 3 8 4 0 6 6 1 1 2 3 1 0 4 4 2 0 1 1 0 0 2 2 3 1 1 2 0 0 0 0 0 1 2 3 2 1 2 3 10 25 35 18 44.8% 35.0% 81.3% 8 17 15 2 7 0 6 7 0 10 0 3 2 1 4 3 0 2 0 0 3 2 1 1 4 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 2 1 0 0 1 0 0 23 29 35 28 26 10 17 16 2 14 72 15 11 6 200 Deadball Rebounds 0 2nd half: 11-31 2nd half: 3-11 2nd half: 9-12 35.5% 27.3% 75.0% Game: 26-58 Game: 7-20 Game: 13-16 83 18 10 7 200 Deadball Rebounds 0 2nd half: 11-22 2nd half: 3-11 2nd half: 14-15 50.0% 27.3% 93.3% Game: 28-55 Game: 11-27 Game: 16-18 Officials: Tom Eades, Paul Janssen, Gerry Pollard Technical fouls: Kansas-None. Oklahoma-None. Attendance: 13490 Estimated Attendance: 10503 Score by periods Kansas Oklahoma Officials: Mike Stuart, David Hall, Duke Edsall Technical fouls: Oklahoma-None. Iowa State-None. Attendance: 13178 Fouled Out: OU #4 Fitzgerald (3:05) Score by periods Oklahoma Iowa State 34 38 1st 2nd 32 34 Total 66 72 Points KU OU In Paint 32 16 Off T/O 12 6 2nd Chance 14 11 Fast Break 0 4 Bench 11 23 31 44 1st 2nd 33 39 Total 64 83 Points OU ISU In Paint 28 32 Off T/O 14 14 2nd Chance 23 9 Fast Break 0 8 Last FG - KU 2nd-00:18, OU 2nd-01:29. Largest lead - KU by 3 1st-18:00, OU by 9 2nd-10:06. Bench 38 25 Score tied - 2 times. Lead changed - 3 times. Last FG - OU 2nd-00:16, ISU 2nd-00:37. Largest lead - OU by 4 1st-18:05, ISU by 25 2nd-14:30. Score tied - 2 times. Lead changed - 1 time. Official Basketball Box Score -- Game Totals -- Final Statistics TCU vs Oklahoma 02/11/13 6 p.m. CT at Norman, Okla. (Lloyd Noble Center) TCU 48 • 10-14, 1-10 ## 02 23 33 05 21 00 03 11 24 25 Feb. 11, 2013 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 23: OU 75, TCU 48 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Oklahoma State 02/16/13 12:45 p.m. at Stillwater, Okla. (Gallagher-Iba Arena) Oklahoma 79 • (16-8, 7-5) ## 22 24 02 05 11 01 04 13 21 Feb. 16, 2013 • Stillwater, Okla. • Gallagher-Iba Arena Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 24: OKLAHOMA STATE 84, OU 79 (OT) Crossland, Connell Abron, Devonta Green, Garlon Anderson, Kyan Butler Lind, Nate Hill Jr., Charles Smith III, Clyde Montigel, Thomas McKinney, Adrick Zurcher, Chris Team Totals FG % 1st Half: 3FG % 1st Half: FT % 1st Half: 4-24 1-9 2-6 16.7% 11.1% 33.3% Player f f f g g 3-7 4-5 2-9 4-19 0-3 2-4 0-1 0-0 1-3 0-2 16-53 0-0 0-0 0-4 3-9 0-2 2-3 0-1 0-0 0-0 0-2 5-21 4-6 4-4 0-0 0-0 0-0 0-0 0-0 0-0 3-6 0-0 11-16 2 6 8 3 5 4 9 4 1 2 3 4 0 3 3 2 0 4 4 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 2 0 1 1 0 5 0 5 13 22 35 15 30.2% 23.8% 68.8% 10 12 4 11 0 6 0 0 5 0 48 3 1 1 3 2 0 1 0 0 3 2 7 16 1 0 1 1 2 0 1 0 0 1 1 0 1 0 1 0 0 0 0 0 3 1 0 1 0 0 0 0 1 0 0 39 29 32 35 21 10 5 2 16 11 Player 3 200 Deadball Rebounds 2 M'Baye, Amath Osby, Romero Pledger, Steven Hornbeak, Je'lon Cousins, Isaiah Grooms, Sam Fitzgerald, Andrew Fraschilla, James Clark, Cameron Team Totals FG % 1st Half: 13-33 3FG % 1st Half: 3-8 FT % 1st Half: 6-8 39.4% 37.5% 75.0% f f g g g 3-9 6-15 7-15 3-6 0-1 9-11 0-1 0-0 1-3 29-61 0-1 0-1 3-6 3-6 0-1 0-0 0-0 0-0 0-0 6-15 0-0 6-9 1-2 1-2 0-0 0-0 4-4 0-0 3-4 15-21 OT: OT: OT: 0 5 5 5 2 13 15 4 0 1 1 2 1 2 3 4 0 1 1 2 0 1 1 2 1 3 4 3 0 0 0 0 3 4 7 1 2 2 4 9 32 41 23 2-5 0-2 2-2 40.0% 0.0% 100.0% 6 18 18 10 0 18 4 0 5 79 1 1 2 0 1 4 0 0 0 9 1 1 2 0 1 2 0 0 1 1 9 0 1 0 0 0 0 0 0 0 1 47.5% 40.0% 71.4% 1 0 0 1 0 0 0 0 0 30 40 42 31 10 35 18 0+ 19 2 225 Deadball Rebounds 3 2nd half: 12-29 2nd half: 4-12 2nd half: 9-10 41.4% 33.3% 90.0% Game: 16-53 Game: 5-21 Game: 11-16 2nd half: 14-23 2nd half: 3-5 2nd half: 7-11 60.9% 60.0% 63.6% Game: 29-61 Game: 6-15 Game: 15-21 Oklahoma 75 • 16-7, 7-4 ## 22 24 02 03 11 01 04 05 15 21 32 Oklahoma State 84 • (19-5, 9 M'Baye, Amath Osby, Romero Pledger, Steven Hield, Buddy Cousins, Isaiah Grooms, Sam Fitzgerald, Andrew Hornbeak, Je'lon Neal, Tyler Clark, Cameron Arent, Casey Team Totals FG % 1st Half: 15-30 3FG % 1st Half: 3-7 FT % 1st Half: 3-3 50.0% 42.9% 100.0% f f g g g 4-8 5-8 2-8 3-7 3-4 0-1 3-6 3-7 2-3 4-6 0-0 29-58 0-1 0-0 0-3 0-2 0-0 0-0 0-0 1-2 2-3 0-0 0-0 3-11 4-4 1-1 0-0 2-2 0-0 0-0 3-3 2-2 2-2 0-0 0-0 14-14 1 2 3 2 1 6 7 1 0 2 2 1 0 0 0 1 0 3 3 2 0 2 2 0 1 2 3 1 0 2 2 3 0 4 4 2 3 0 3 0 0 1 1 2 1 3 4 7 27 34 15 50.0% 27.3% 100.0% 12 11 4 8 6 0 9 9 8 8 0 1 0 1 2 2 1 0 2 0 2 0 0 0 0 1 1 1 0 3 0 1 0 7 0 1 0 0 0 0 0 0 0 0 0 1 0 2 1 2 1 0 0 2 0 1 0 26 22 23 20 26 14 14 19 14 17 5 02 20 44 22 33 01 04 13 21 Nash, Le'Bryan Cobbins, Michael Jurick, Philip Brown, Markel Smart, Marcus Gardner, Kirby Williams, Brian Forte, Phil Murphy, Kamari Team Totals FG % 1st Half: 3FG % 1st Half: FT % 1st Half: 9-29 3-10 6-9 31.0% 30.0% 66.7% f f c g g 9-18 2-4 0-1 5-13 7-14 0-0 0-3 3-6 1-3 27-62 0-1 0-0 0-0 1-5 3-4 0-0 0-1 2-5 0-0 6-16 8-11 0-0 0-0 3-6 11-14 0-0 0-0 2-2 0-0 24-33 OT: OT: OT: 1 4 5 3 1 3 4 4 2 2 4 2 1 5 6 4 2 5 7 1 0 0 0 0 0 1 1 1 0 3 3 2 2 2 4 2 1 1 2 10 26 36 19 4-8 0-1 3-4 50.0% 0.0% 75.0% 26 4 0 14 28 0 0 10 2 3 0 0 3 4 0 0 1 0 0 0 0 0 3 0 0 0 2 5 0 3 0 0 1 0 0 0 0 4 43.5% 37.5% 72.7% 0 0 0 3 2 0 1 1 0 34 40 5 38 40 5 15 33 15 84 11 Game: 27-62 Game: 6-16 Game: 24-33 7 225 Deadball Rebounds 2 75 11 9 200 Deadball Rebounds 0 2nd half: 14-25 2nd half: 3-5 2nd half: 15-20 56.0% 60.0% 75.0% 2nd half: 14-28 2nd half: 0-4 2nd half: 11-11 50.0% 0.0% 100.0% Game: 29-58 Game: 3-11 Game: 14-14 Officials: Mark Whitehead, Kelly Self, Terry Oglesby Technical fouls: TCU-None. Oklahoma-None. Attendance: 8948 Estimated Attendance: 4372 Score by periods TCU Oklahoma Officials: Joe DeRosa, Duke Edsall, J.B. Caldwell Technical fouls: Oklahoma-None. Oklahoma State-None. Attendance: 13611 Fouled Out: OU-#22 M'Baye (01:32) Score by periods Oklahoma Oklahoma State 35 27 1st 2nd 38 46 6 11 OT Total 11 36 1st 2nd 37 39 Total 79 84 Points OU OSU In Paint 22 34 Off T/O 5 13 2nd Chance 9 9 Fast Break 5 13 Bench 27 12 48 75 Points TCU OU In Paint 20 30 Off T/O 8 17 2nd Chance 6 11 Fast Break 3 8 Bench 11 34 Last FG - OU OT-02:03, OSU OT-00:37. Largest lead - OU by 11 2nd-17:31, OSU by 11 1st-11:50. Score tied - 12 times. Lead changed - 8 times. Last FG - TCU 2nd-01:07, OU 2nd-00:53. Largest lead - TCU None, OU by 36 2nd-13:20. Score tied - 0 times. Lead changed - 0 times. 26 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Texas Tech 02/20/13 6 p.m. CT at Lubbock, Texas (United Spirit Arena) Oklahoma 86 • 17-8, 8-5 ## 02 05 11 22 24 01 04 15 21 Feb. 20, 2013 • Lubbock, Texas • United Spirit Arena Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 25: OU 86, TEXAS TECH 71 Official Basketball Box Score -- Game Totals -- Final Statistics Baylor vs Oklahoma 02/23/13 4 p.m. CT at Norman, Okla. (Lloyd Noble Center) Baylor 76 • 16-11, 7-7 ## 34 21 05 22 55 01 02 04 14 35 Feb. 23, 2013 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 26: OU 90, BAYLOR 76 Player Pledger, Steven Hornbeak, Je'lon Cousins, Isaiah M'Baye, Amath Osby, Romero Grooms, Sam Fitzgerald, Andrew Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 16-27 3FG % 1st Half: 6-10 FT % 1st Half: 6-8 59.3% 60.0% 75.0% * * * * * 8-15 1-6 0-1 5-10 7-11 4-8 1-1 1-2 5-6 32-60 6-13 0-1 0-0 2-3 0-0 0-0 0-0 0-0 0-0 8-17 0-0 0-0 0-0 3-4 7-8 4-7 0-0 0-1 0-0 14-20 0 4 4 2 0 0 0 3 0 1 1 1 4 9 13 4 1 8 9 4 1 1 2 2 2 2 4 4 0 0 0 1 1 4 5 3 0 1 1 9 30 39 24 53.3% 47.1% 70.0% 1 0 4 2 3 0 0 1 1 1 86 17 13 22 2 0 15 21 12 2 2 10 2 1 1 5 3 5 0 0 0 1 0 0 0 1 0 0 0 0 2 2 0 1 0 1 0 0 1 1 38 17 10 25 32 30 14 9 25 6 200 Deadball Rebounds 6 2nd half: 16-33 2nd half: 2-7 2nd half: 8-12 48.5% 28.6% 66.7% Game: 32-60 Game: 8-17 Game: 14-20 Jefferson, Cory Austin, Isaiah Heslip, Brady Walton, A.J. Jackson, Pierre Rose, L.J. Gathers, Rico Franklin, Gary Bello, Deuce Prince, Taurean Team Totals FG % 1st Half: 3FG % 1st Half: FT % 1st Half: 8-31 3-14 2-4 25.8% 21.4% 50.0% Player f c g g g 3-6 7-17 4-10 2-7 8-23 0-0 0-1 1-2 0-1 1-3 26-70 0-0 1-5 3-9 0-1 3-13 0-0 0-0 1-2 0-0 1-1 9-31 0-0 0-0 0-0 2-4 9-11 1-2 0-0 3-4 0-0 0-0 15-21 4 2 6 1 1 3 4 4 1 1 2 2 1 3 4 4 1 3 4 3 0 2 2 2 0 2 2 3 0 0 0 5 1 3 4 3 2 2 4 5 3 2 5 14 23 37 32 37.1% 29.0% 71.4% 6 15 11 6 28 1 0 6 0 3 1 2 0 0 8 0 0 0 0 0 1 2 0 1 4 2 0 0 1 1 1 3 0 0 0 1 0 0 0 0 5 2 0 1 3 0 0 0 1 0 1 24 24 26 34 37 7 7 22 12 7 76 11 12 8 200 Deadball Rebounds 5 Texas Tech 71 • 9-15, 2-11 ## 02 05 11 23 32 10 12 13 20 30 35 2nd half: 18-39 2nd half: 6-17 2nd half: 13-17 46.2% 35.3% 76.5% Game: 26-70 Game: 9-31 Game: 15-21 Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF Oklahoma 90 • 18-8, 9-5 TP A TO Blk Stl Min Hannahs, Dusty Gray, Josh Kravic, Dejan Williams, Jamal Tolbert, Jordan Robinson, Daylen Tapsoba, Kader Adams, Luke Gotcher, Toddrick Crockett, Jaye Lammert, Clark Team Totals FG % 1st Half: 12-28 3FG % 1st Half: 4-7 FT % 1st Half: 8-13 42.9% 57.1% 61.5% * * * * * 3-9 10-22 1-1 0-3 3-9 0-1 0-0 0-0 0-0 5-11 2-2 24-58 1-3 0-1 0-0 0-2 0-0 0-0 0-0 0-0 0-0 3-5 2-2 6-13 2-2 6-9 0-0 1-3 4-9 0-0 0-1 2-2 0-0 2-2 0-0 17-28 1 2 3 2 1 3 4 4 0 2 2 0 0 1 1 2 4 3 7 3 0 0 0 1 0 2 2 2 0 0 0 0 0 0 0 0 3 4 7 4 1 2 3 1 0 0 0 10 19 29 19 41.4% 46.2% 60.7% 9 26 2 1 10 0 0 2 0 15 6 71 1 5 0 0 0 0 0 0 0 0 0 0 1 2 0 2 1 1 0 0 2 1 0 0 1 0 1 0 0 0 0 0 0 2 0 4 1 0 0 0 1 0 0 2 0 37 36 14 28 23 4 4 6 10 28 10 ## 22 24 01 02 05 04 11 15 21 Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min 6 10 8 200 Deadball Rebounds 5 M'Baye, Amath Osby, Romero Grooms, Sam Pledger, Steven Hornbeak, Je'lon Fitzgerald, Andrew Cousins, Isaiah Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 13-29 3FG % 1st Half: 6-10 FT % 1st Half: 15-17 44.8% 60.0% 88.2% f f g g g 1-6 6-9 3-9 7-9 4-6 0-2 0-4 0-0 1-4 22-49 1-2 0-1 2-2 3-4 1-3 0-0 0-2 0-0 0-0 7-14 4-4 5-7 15-17 2-3 4-4 4-4 2-2 0-0 3-4 39-45 0 4 4 3 2 6 8 2 0 2 2 3 1 4 5 4 1 4 5 5 0 2 2 2 0 1 1 4 0 0 0 0 0 3 3 2 3 5 8 7 31 38 25 44.9% 50.0% 86.7% 7 17 23 19 13 4 2 0 5 90 1 0 4 1 0 0 0 0 1 2 1 3 3 1 1 3 1 1 0 1 0 0 0 0 0 0 0 1 0 2 2 1 1 0 0 0 0 35 31 30 36 22 13 9 1 23 7 16 6 200 Deadball Rebounds 3 2nd half: 12-30 2nd half: 2-6 2nd half: 9-15 40.0% 33.3% 60.0% Game: 24-58 Game: 6-13 Game: 17-28 2nd half: 9-20 2nd half: 1-4 2nd half: 24-28 45.0% 25.0% 85.7% Game: 22-49 Game: 7-14 Game: 39-45 Officials: Darron George, Ray Natili Technical fouls: Oklahoma-None. Texas Tech-None. Attendance: 8248 Score by periods Oklahoma Texas Tech Officials: Mark Whitehead, Paul Janssen, Keith Kimble Technical fouls: Baylor-None. Oklahoma-None. Attendance: 12199 Estimated Attendance: 7834 OU #21 Clark was charged with a Flagrant 1 foul at 9:56 of the 2nd Half Score by periods Baylor Oklahoma 44 36 1st 2nd 42 35 Total 86 71 Points OU TTU In Paint 24 30 Off T/O 12 16 2nd Chance 6 6 Fast Break 2 8 Bench 26 23 21 47 1st 2nd 55 43 Total 76 90 Points BU OU In Paint 26 14 Off T/O 17 8 2nd Chance 11 15 Fast Break 8 2 Bench 10 11 Last FG - OU 2nd-00:27, TTU 2nd-00:18. Largest lead - OU by 17 2nd-00:27, TTU by 2 1st-10:44. Score tied - 3 times. Lead changed - 4 times. Last FG - BU 2nd-00:24, OU 2nd-01:52. Largest lead - BU None, OU by 26 1st-00:02. Score tied - 1 time. Lead changed - 0 times. Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs Texas 02/27/13 8 p.m. at Austin, Texas (Erwin Center) Oklahoma 86 • 18-9, 9-6 ## 22 24 01 02 05 04 11 15 21 Feb. 27, 2013 • Austin, Texas • Frank Erwin Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 27: TEXAS 92, OKLAHOMA 86 (OT) Official Basketball Box Score -- Game Totals -- Final Statistics Iowa State vs Oklahoma 03/02/13 12:45 p.m. at Norman, Okla. (Lloyd Noble Center) Iowa State 69 • 19-10,9-7 ## 03 31 02 13 21 01 11 15 22 24 25 March 2, 2013 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 28: OU 86, IOWA STATE 69 Player M'Baye, Amath Osby, Romero Grooms, Sam Pledger, Steven Hornbeak, Je'lon Fitzgerald, Andrew Cousins, Isaiah Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 17-24 3FG % 1st Half: 7-9 FT % 1st Half: 2-5 70.8% 77.8% 40.0% f f g g g 7-11 9-13 0-4 6-15 2-4 2-3 0-2 0-0 3-5 29-57 2-3 0-0 0-1 6-12 1-1 0-0 0-1 0-0 0-0 9-18 0-0 13-17 3-4 0-0 0-1 1-2 0-0 0-0 2-3 19-27 OT: OT: OT: 1 3 4 3 2 3 5 2 2 3 5 4 2 1 3 4 1 4 5 5 0 2 2 1 0 2 2 2 0 0 0 0 1 5 6 4 2 0 2 11 23 34 25 2-5 1-2 4-6 40.0% 50.0% 66.7% 16 31 3 18 5 5 0 0 8 2 3 6 3 0 0 3 0 0 2 3 4 4 2 0 0 0 1 2 0 0 0 0 1 0 0 0 3 50.9% 50.0% 70.4% 1 0 0 1 2 1 1 0 0 37 38 31 42 19 12 19 1 26 Player 86 17 16 Game: 29-57 Game: 9-18 Game: 19-27 6 225 Deadball Rebounds 2 2nd half: 10-28 2nd half: 1-7 2nd half: 13-16 35.7% 14.3% 81.3% Ejim, Melvin Niang, Georges Babb, Chris Lucious, Korie Clyburn, Will Palo, Bubu Okoro, Nkereuwem Long, Naz Booker, Anthony Gibson, Percy McGee, Tyrus Team Totals FG % 1st Half: 3FG % 1st Half: FT % 1st Half: 9-26 4-16 6-6 34.6% 25.0% 100.0% f f g g g 2-5 3-9 0-4 3-7 1-5 4-5 0-0 0-1 0-1 1-1 8-13 22-51 2-4 2-6 0-3 1-4 0-3 0-0 0-0 0-1 0-1 0-0 6-9 11-31 4-4 2-2 0-2 0-1 4-6 4-7 0-0 0-0 0-0 0-0 0-0 14-22 0 4 4 4 0 5 5 2 0 2 2 2 0 1 1 4 0 3 3 2 1 3 4 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 3 0 2 2 1 3 3 6 4 23 27 20 43.1% 35.5% 63.6% 10 10 0 7 6 12 0 0 0 2 22 69 0 0 0 2 2 2 0 1 0 0 1 8 1 1 0 2 3 1 0 0 0 0 1 9 2 0 0 0 0 0 0 0 0 0 0 2 2 0 0 0 0 0 0 1 0 0 0 32 31 21 27 30 19 1 4 3 5 27 3 200 Deadball Rebounds 3 Texas 92 • 13-15, 5-10 ## 10 21 02 12 33 01 03 05 44 55 Holmes, Jonathan Lammert, Connor Holland, Demarcus Kabongo, Myck Papapetrou, Ioannis McClellan, Sheldon Felix, Javan Bond, Jaylen Ibeh, Prince Ridley, Cameron Team Totals FG % 1st Half: 11-24 3FG % 1st Half: 3-8 FT % 1st Half: 3-8 45.8% 37.5% 37.5% Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF 2nd half: 13-25 2nd half: 7-15 2nd half: 8-16 52.0% 46.7% 50.0% Game: 22-51 Game: 11-31 Game: 14-22 TP A TO Blk Stl Min Oklahoma 86 • 19-9, 10-6 ## 22 24 01 02 05 04 11 15 21 f f g g g 1-4 3-7 4-8 9-13 3-6 2-7 3-7 2-3 2-2 0-1 29-58 0-0 1-3 2-4 2-4 1-2 1-2 1-4 0-1 0-0 0-0 8-20 0-0 0-2 0-0 11-14 2-2 13-13 0-0 0-2 0-0 0-2 26-35 OT: OT: OT: 1 1 2 1 2 3 5 0 0 2 2 0 0 8 8 3 0 2 2 5 3 5 8 3 0 0 0 0 3 0 3 5 1 1 2 1 0 1 1 2 1 0 1 11 23 34 20 4-4 2-2 5-8 100.0% 100.0% 62.5% 2 7 10 31 9 18 7 4 4 0 1 0 2 6 0 3 2 0 0 0 0 0 2 4 1 2 1 0 0 2 0 1 1 0 0 1 0 1 1 0 1 0 2 4 2 2 1 0 0 1 15 31 32 37 24 35 19 16 8 8 Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min 92 14 12 Game: 29-58 Game: 8-20 Game: 26-35 5 13 225 50.0% 40.0% 74.3% Deadball Rebounds 4 2nd half: 14-30 2nd half: 3-10 2nd half: 18-19 46.7% 30.0% 94.7% M'Baye, Amath Osby, Romero Grooms, Sam Pledger, Steven Hornbeak, Je'lon Fitzgerald, Andrew Cousins, Isaiah Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 16-31 3FG % 1st Half: 4-8 FT % 1st Half: 4-4 51.6% 50.0% 100.0% f f g g g 3-8 6-11 7-13 4-9 0-4 1-3 1-2 0-0 1-2 23-52 1-3 0-1 1-2 4-9 0-2 0-0 0-1 0-0 0-0 6-18 4-4 10-10 4-4 2-2 2-2 8-8 0-0 0-0 4-4 34-34 1 3 4 3 0 9 9 4 1 1 2 2 0 4 4 2 1 5 6 2 0 3 3 1 0 1 1 2 0 1 1 0 1 2 3 2 2 1 3 6 30 36 18 44.2% 33.3% 100.0% 11 22 19 14 2 10 2 0 6 1 3 6 3 1 1 1 1 0 1 1 1 0 0 0 1 0 1 5 0 2 0 0 0 0 0 0 0 2 1 1 1 1 0 0 0 0 0 24 34 31 31 27 21 9 2 21 86 17 4 200 Deadball Rebounds 0 Officials: David Hall, Rick Crawford, J.B. Caldwell Technical fouls: Oklahoma-None. Texas-None. Attendance: 9860 Turnstile - 5,385 Score by periods Oklahoma Texas 2nd half: 7-21 2nd half: 2-10 2nd half: 30-30 33.3% 20.0% 100.0% Game: 23-52 Game: 6-18 Game: 34-34 43 28 1st 2nd 34 49 9 15 OT Total 86 92 Points OU UT In Paint 26 32 Off T/O 16 26 2nd Chance 10 7 Fast Break 12 17 Officials: Don Daily, Gerry Pollard, Jeff Malham Technical fouls: Iowa State-None. Oklahoma-None. Attendance: 10789 Estimated Attendance: 6712 Bench 13 33 Last FG - OU OT-01:19, UT OT-00:15. Largest lead - OU by 22 2nd-07:54, UT by 7 OT-00:15. Score tied - 4 times. Lead changed - 12 times. Score by periods Iowa State Oklahoma 28 40 1st 2nd 41 46 Total 69 86 Points ISU OU In Paint 20 22 Off T/O 8 13 2nd Chance 5 6 Fast Break 2 3 Bench 36 18 Last FG - ISU 2nd-00:59, OU 2nd-02:04. Largest lead - ISU None, OU by 26 2nd-03:40. Score tied - 1 time. Lead changed - 0 times. 27 2012-13 OKLAHOMA MEN’S BASKETBALL Official Basketball Box Score -- Game Totals -- Final Statistics West Virginia vs Oklahoma 03/06/13 8 p.m. CT at Norman, Okla. (Lloyd Noble Center) West Virginia 70 • 13-17, 6-11 ## 13 21 34 03 10 01 04 14 15 24 55 March 6, 2013 • Norman, Okla. • Lloyd Noble Center Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 29: OU 83, WEST VIRGINIA 70 Official Basketball Box Score -- Game Totals -- Final Statistics Oklahoma vs TCU 03/09/13 4 p.m. CT at Fort Worth, TX (Daniel-Meyer Coliseum) Oklahoma 67 • 20-10 (11-7) ## 22 24 01 02 05 03 04 11 15 21 March 9, 2013 • Fort Worth, Texas • Daniel-Meyer Coliseum Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 30: TCU 70, OU 67 Player Kilicli, Deniz Humphrey, Matt Noreen, Kevin Staten, Juwan Harris, Eron Rutledge, Dominique Hinds, Jabarie Browne, Gary Henderson, Terry Murray, Aaric Miles, Keaton Team Totals FG % 1st Half: 11-28 3FG % 1st Half: 3-10 FT % 1st Half: 3-8 39.3% 30.0% 37.5% f f f g g 9-13 1-1 1-1 0-2 8-17 0-0 2-4 1-1 1-3 4-8 0-1 27-51 0-0 1-1 0-0 0-0 5-10 0-0 0-1 1-1 1-3 2-5 0-0 10-21 2-8 1-2 1-1 0-0 2-2 0-0 0-0 0-0 0-0 0-0 0-0 6-13 1 3 4 4 1 0 1 0 1 1 2 3 0 4 4 1 2 2 4 2 0 0 0 2 0 0 0 1 0 0 0 2 0 0 0 1 1 3 4 4 0 0 0 1 3 3 6 9 16 25 21 52.9% 47.6% 46.2% 20 4 3 0 23 0 4 3 3 10 0 2 0 1 4 1 0 1 1 1 2 0 2 1 1 1 3 1 1 1 0 2 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 0 1 0 1 1 0 0 0 0 34 7 16 28 34 9 13 13 20 20 6 Player 70 13 13 5 200 Deadball Rebounds 3 M'Baye, Amath Osby, Romero Grooms, Sam Pledger, Steven Hornbeak, Je'lon Hield, Buddy Fitzgerald, Andrew Cousins, Isaiah Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 10-30 3FG % 1st Half: 0-8 FT % 1st Half: 2-6 33.3% 0.0% 33.3% f f g g g 2-7 6-11 3-6 1-7 0-5 5-14 6-12 0-2 0-1 1-1 24-66 0-2 0-0 0-1 0-4 0-4 0-5 0-0 0-0 0-0 0-0 0-16 1-2 7-10 2-4 0-0 8-8 0-1 1-2 0-0 0-0 0-0 19-27 0 1 1 2 2 2 4 2 0 2 2 0 0 1 1 0 1 1 2 4 8 1 9 5 4 7 11 3 0 0 0 0 0 0 0 0 1 2 3 3 2 0 2 18 17 35 19 36.4% 0.0% 70.4% 5 19 8 2 8 10 13 0 0 2 67 0 0 6 0 0 2 0 0 0 0 8 1 1 2 0 0 1 0 0 0 3 8 1 0 0 0 0 0 0 0 0 1 2 0 0 1 0 2 3 0 0 0 0 21 28 35 20 22 25 27 6 3 13 6 200 Deadball Rebounds 5 2nd half: 16-23 2nd half: 7-11 2nd half: 3-5 69.6% 63.6% 60.0% Game: 27-51 Game: 10-21 Game: 6-13 2nd half: 14-36 2nd half: 0-8 2nd half: 17-21 38.9% 0.0% 81.0% Game: 24-66 Game: 0-16 Game: 19-27 Oklahoma 83 • 20-9, 11-6 ## 22 24 01 02 05 03 04 11 15 21 TCU 70 • 11-20 (2-16) ## M'Baye, Amath Osby, Romero Grooms, Sam Pledger, Steven Hornbeak, Je'lon Hield, Buddy Fitzgerald, Andrew Cousins, Isaiah Neal, Tyler Clark, Cameron Team Totals FG % 1st Half: 11-23 3FG % 1st Half: 5-7 FT % 1st Half: 12-14 47.8% 71.4% 85.7% Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min 02 24 33 05 21 00 23 25 f f g g g 2-7 9-14 3-3 7-14 2-4 0-0 2-6 0-1 0-1 1-2 26-52 2-3 1-1 1-1 5-10 1-3 0-0 0-0 0-0 0-0 0-0 10-18 1-2 7-8 1-1 4-4 4-4 0-0 1-3 0-0 0-0 3-5 21-27 0 2 2 2 2 4 6 2 1 0 1 2 3 5 8 2 1 1 2 2 0 0 0 0 5 0 5 2 0 0 0 0 0 1 1 1 2 1 3 2 0 5 5 14 19 33 15 50.0% 55.6% 77.8% 7 0 26 0 8 10 23 0 9 3 0 0 5 1 0 0 0 0 5 1 2 1 3 1 1 1 1 0 0 1 1 1 0 1 0 0 0 0 0 0 3 0 0 2 0 1 0 1 1 0 0 18 37 36 37 21 4 22 5 2 18 Crossland, Connell McKinney, Adrick Green, Garlon Anderson, Kyan Butler Lind, Nate Hill Jr., Charles Abron, Devonta Zurcher, Chris Team Totals FG % 1st Half: 19-31 3FG % 1st Half: 5-7 FT % 1st Half: 1-2 61.3% 71.4% 50.0% Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min f f f g g 6-10 2-6 6-10 4-8 2-4 5-9 1-2 1-1 27-50 0-0 0-0 4-4 1-4 0-1 3-5 0-0 0-0 8-14 8-19 3-7 7-14 1-2 0-0 2-2 2-3 1-5 0-0 2-4 0-0 8-16 4 3 7 5 0 2 2 3 1 4 5 1 0 1 1 3 1 5 6 2 0 5 5 4 1 5 6 4 0 0 0 1 2 2 4 9 27 36 23 54.0% 57.1% 50.0% 2 1 6 1 1 2 0 1 2 70 20 16 13 4 18 11 5 13 4 2 2 1 1 7 2 4 3 0 1 0 0 0 1 1 0 0 3 0 1 0 1 0 0 1 0 22 19 37 38 35 28 19 2 3 200 Deadball Rebounds 5 83 15 11 5 200 Deadball Rebounds 2 2nd half: 2nd half: 2nd half: 42.1% 42.9% 50.0% Game: 27-50 Game: 8-14 Game: 8-16 2nd half: 15-29 2nd half: 5-11 2nd half: 9-13 51.7% 45.5% 69.2% Game: 26-52 Game: 10-18 Game: 21-27 Officials: Duke Edsall, Brent Meaux, Bret Smith Technical fouls: Oklahoma-None. TCU-None. Attendance: 5392 Score by periods Oklahoma TCU Officials: Tom O'Neill, John Higgins, Terry Oglesby Technical fouls: West Virginia-Henderson, Terry. Oklahoma-None. Attendance: 9857 Estimated Attendance: 5426 Score by periods West Virginia Oklahoma 22 44 1st 2nd 45 26 Total 67 70 Points OU TCU In Paint 44 30 Off T/O 21 8 2nd Chance 22 9 Fast Break 2 6 Bench 25 19 28 39 1st 2nd 42 44 Total 70 83 Points WVU OU In Paint 28 22 Off T/O 13 20 2nd Chance 8 23 Fast Break 6 4 Bench 20 10 Last FG - OU 2nd-00:08, TCU 2nd-00:18. Largest lead - OU None, TCU by 25 2nd-19:26. Score tied - 1 time. Lead changed - 0 times. Last FG - WVU 2nd-01:31, OU 2nd-01:20. Largest lead - WVU None, OU by 17 1st-10:46. Score tied - 0 times. Lead changed - 0 times. Official Basketball Box Score -- Game Totals -- Final Statistics Iowa State vs Oklahoma 03/14/13 11:30 a.m. at Kansas City, Mo. (Sprint Center) Iowa State 73 • 22-10, 11-7 ## 03 31 02 13 21 01 22 24 25 March 14, 2013 • Kansas City, Mo. • Sprint Center • Big 12 Quarterfinals Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min GAME 31: IOWA STATE 73, OU 66 Player Ejim, Melvin Niang, Georges Babb, Chris Lucious, Korie Clyburn, Will Palo, Bubu Booker, Anthony Gibson, Percy McGee, Tyrus Team Totals FG % 1st Half: 11-31 3FG % 1st Half: 1-12 FT % 1st Half: 6-6 35.5% 8.3% 100.0% f f g g g 8-13 4-9 4-6 0-8 6-14 0-0 1-1 1-2 2-8 26-61 0-2 2-4 2-4 0-5 2-5 0-0 0-0 0-0 1-6 7-26 7-7 0-0 0-0 0-0 3-3 0-0 2-2 0-0 2-2 14-14 5 7 12 2 3 2 5 2 0 6 6 1 0 2 2 0 3 5 8 4 0 1 1 3 1 1 2 1 1 0 1 0 1 3 4 2 0 2 2 14 29 43 15 42.6% 26.9% 100.0% 23 10 10 0 17 0 4 2 7 3 0 1 9 1 1 0 0 2 1 3 0 2 2 2 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 0 32 24 35 29 31 10 8 7 24 73 17 11 3 200 Deadball Rebounds 1 2nd half: 15-30 2nd half: 6-14 2nd half: 8-8 50.0% 42.9% 100.0% Game: 26-61 Game: 7-26 Game: 14-14 Oklahoma 66 • 20-11, 11-7 ## 22 24 01 02 05 03 04 11 21 Player Total 3-Ptr FG-FGA FG-FGA FT-FTA Rebounds Off Def Tot PF TP A TO Blk Stl Min M'Baye, Amath Osby, Romero Grooms, Sam Pledger, Steven Hornbeak, Je'lon Hield, Buddy Fitzgerald, Andrew Cousins, Isaiah Clark, Cameron Team Totals FG % 1st Half: 16-35 3FG % 1st Half: 2-8 FT % 1st Half: 3-3 45.7% 25.0% 100.0% f f g g g 3-7 8-19 2-6 3-11 2-5 0-4 1-3 0-1 5-7 24-63 0-3 1-2 0-2 1-6 1-3 0-2 0-0 0-0 0-0 3-18 0-0 1-2 4-6 1-1 2-2 0-0 0-0 0-0 7-7 15-18 0 3 3 1 5 4 9 3 0 4 4 3 1 3 4 2 2 0 2 1 0 1 1 1 1 1 2 3 0 2 2 0 3 1 4 1 0 0 0 12 19 31 15 38.1% 16.7% 83.3% 6 18 8 8 7 0 2 0 17 0 4 3 2 1 0 0 0 0 0 1 0 0 1 1 1 0 1 5 2 1 0 0 0 1 0 0 0 4 0 0 0 1 1 0 0 0 3 20 35 32 35 30 15 5 8 20 66 10 5 200 Deadball Rebounds 1,1 2nd half: 8-28 2nd half: 1-10 2nd half: 12-15 28.6% 10.0% 80.0% Game: 24-63 Game: 3-18 Game: 15-18 Officials: Joe DeRosa, Don Daily, Terry Oglesby Technical fouls: Iowa State-None. Oklahoma-None. Attendance: 17996 Phillips 66 Big 12 Championship - Quarterfinals Score by periods Iowa State Oklahoma 29 37 1st 2nd 44 29 Total 73 66 Points ISU OU In Paint 36 18 Off T/O 6 11 2nd Chance 18 11 Fast Break 4 4 Bench 13 19 Last FG - ISU 2nd-00:36, OU 2nd-08:10. Largest lead - ISU by 7 2nd-00:07, OU by 14 1st-03:41. Score tied - 3 times. Lead changed - 1 time. 28 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 NCAA TOURNAMENT SINGLE-GAME RECORDS u OKLAHOMA INDIVIDUAL Points: 37, Stacey King vs. Auburn, March 19, 1988 Field Goals: 14, Blake Griffin vs. Michigan, March 21, 2009; Mookie Blaylock vs. Louisiana Tech, March 18, 1989; Harvey Grant vs. Louisville, March 24, 1988; Stacey King vs. Auburn, March 19, 1988; Wayman Tisdale vs. Illinois State, March 16, 1985 Field Goal Attempts: 28, Mookie Blaylock vs. Louisiana Tech, March 18, 1989 3-Point Field Goals: 7, Dave Sieger vs. Kansas, April 4, 1988; Tim McCalister vs. Iowa, March 20, 1987 3-Point Field Goal Attempts: 13, Dave Sieger vs. Kansas, April 4, 1988 Free Throws: 12, Wayman Tisdale vs. Dayton, March 17, 1984 Free Throw Attempts: 14, David Johnson vs. Northeastern, March 13, 1986 Rebounds: 17, Blake Griffin vs. Michigan, March 21, 2009; Harvey Grant vs. Tulsa, March 13, 1987 Assists: 11, Terrell Everett vs. UW-Milwaukee, March 16, 2006; John Ontjes vs. Manhattan, March 16, 1995; John McCullough vs. Texas, March 10, 1979 Turnovers: 8, Ray Whitley vs. Indiana State, March 5, 1979 Blocks: 5, Al Beal vs. Texas, March 10, 1979 Steals: 7, Mookie Blaylock vs. Kansas, April 4, 1988; Ricky Grace vs. Iowa, March 20, 1987 u OKLAHOMA TEAM Points: 124, vs. Louisiana Tech, March 18, 1989 Field Goals: 48, vs. Louisiana Tech, March 18, 1989 Field Goal Attempts: 98, vs. Louisiana Tech, March 18, 1989 Field Goal Percentage: .660 (35-53), vs. Illinois State, March 16, 1987 3-Point Field Goals: 13, vs. UNC Charlotte, March 14, 1999 3-Point Field Goal Attempts: 28, vs. Syracuse, March 30, 2003; vs. UNC Charlotte, March 14, 1999 3-Point Field Goal Percentage (min. 10 attempts): .556 (10-for-18) vs. South Carolina State, March 20, 2003 Free Throws: 24 vs. Missouri, March 23, 2002; vs. Xavier, March 17, 2002 Free Throw Attempts: 36 vs. Louisville, March 24, 1988 Free Throw Percentage (min. 10 attempts): .900 (18-for-20), vs. North Carolina A&T, March 14, 1985 Rebounds: 62, vs. Louisiana Tech, March 18, 1989 Assists: 31, vs. Auburn, March 19, 1988 Turnovers: 21 vs. Manhattan, March 16, 1995 Blocks: 10, vs. Texas, March 10, 1979 Steals: 16, vs. Louisiana Tech, March 18, 1989; vs. Auburn, March 19, 1988 u OPPONENT INDIVIDUAL Points: 41, Roosevelt Chapman, Dayton, March 17, 1984 Field Goals: 13, Danny Manning, Kansas, April 4, 1988; Sean Elliott, Arizona, April 2, 1988; Roosevelt Chapman, Dayton, March 17, 1984 Field Goal Attempts: 34, Reggie Lewis, Northeastern, March 13, 1986 3-Point Field Goals: 6, David Moss, Tulsa, March 13, 1987 3-Point Field Goal Attempts: 13, Reggie Holmes, Morgan State, March 19, 2009 Free Throws: 15, Roosevelt Chapman, Dayton, March 17, 1984 Free Throw Attempts: 19, Roosevelt Chapman, Dayton, March 17, 1984 Rebounds: 22, Karl Malone, Louisiana Tech, March 21, 1985 Assists: 12, Andre Turner, Memphis State, March 24, 1985 Turnovers: 10, Morris Lyons, UT-Chattanooga, March 17, 1988 Blocks: 5, David West, Xavier, March 17, 2002 Steals: 7, Ted Ellis, Manhattan, March 16, 1995 u OPPONENT TEAM Points: 98, Louisville, March 24, 1988 Field Goals: 40, Louisville, March 24, 1988 Field Goal Attempts: 84, Auburn, March 19, 1988 Field Goal Pct.: .636 (35-55), Kansas, April 4, 1988 3-Point Field Goals: 10, Michigan, March 21, 2009 3-Point Field Goal Attempts: 28, Niagara, March 17, 2005 3-Point Field Goal Percentage (min. 10 attempts): .700 (7-for-10), North Carolina, March 17, 1990 Free Throws: 27, Virginia, March 23, 1989 Free Throw Attempts: 36, Virginia, March 23, 1989 Free Throw Percentage (min. 10 attempts): .938 (15-for-16), North Carolina, March 29, 2009 Rebounds: 57, Auburn, March 19, 1988 Assists: 26, Louisiana Tech, March 21, 1985 Turnovers: 29, Louisiana Tech, March 18, 1989 Blocks: 8, Indiana, March 30, 2002 Steals: 13, Syracuse, March 30, 2003; Manhattan, March 16, 1995 29 2012-13 OKLAHOMA MEN’S BASKETBALL NCAA TOURNAMENT INDIVIDUAL HIGHS OKLAHOMA u POINTS OPPONENTS u POINTS 1. 37, Stacey King vs. Auburn, 3/19/88 2. 36, Wayman Tisdale vs. Dayton, 3/17/84 3. 34, Mookie Blaylock vs. Louisiana Tech, 3/18/89 34, Harvey Grant vs. Louisville, 3/24/88 5. 33, Blake Griffin vs. Michigan, 3/21/09 6. 29, Blake Griffin vs. Syracuse, 3/27/09 29, Wayman Tisdale vs. Illinois State, 3/16/85 8. 28, Tony Crocker vs. Syracuse, 3/27/09 28, Blake Griffin vs. Morgan State, 3/19/09 28, Stacey King vs. East Tennessee State, 3/16/89 28, Stacey King vs. Villanova, 3/26/88 28, Tim McCalister vs. Pittsburgh, 3/15/87 28, Wayman Tisdale vs. North Carolina A&T, 3/14/85 1. 41, Roosevelt Chapman, Dayton, 3/17/84 2. 35, Reggie Lewis, Northeastern, 3/13/86 3. 31, Danny Manning, Kansas, 4/4/88 31, Sean Elliott, Arizona, 4/2/88 5. 30, Kurk Lee, Towson State, 3/15/90 6. 29, Larry Bird, Indiana State, 3/15/79 7. 28, Romain Sato, Xavier, 3/17/02 28, Bryant Stith, Virginia, 3/23/89 9. 27, Brian Wethers, California, 3/22/03 10. 26, Boo Davis, UW-Milwaukee, 3/16/06 26, Andrae Patterson, Indiana (OT), 3/12/98 26, Kevin Gamble, Iowa (OT), 3/20/87 u REBOUNDS u REBOUNDS 1. 17, Blake Griffin vs. Michigan, 3/21/09 17, Harvey Grant vs. Tulsa, 3/13/87 3. 16, Blake Griffin vs. North Carolina, 3/29/09 4. 15, Taj Gray vs. Utah, 3/19/05 15, Eduardo Najera vs. UNC Charlotte, 3/14/99 15, Stacey King vs. Louisiana Tech, 3/18/89 7. 14, Blake Griffin vs. Syracuse, 3/27/09 14, William Davis vs. North Carolina, 3/17/90 14, David Johnson vs. Northeastern, 3/13/86 10. 13, Blake Griffin vs. Morgan State, 3/19/09 13, Taj Gray vs. Niagara, 3/17/05 13, Eduardo Najera vs. Arizona, 3/12/99 13, Wayman Tisdale vs. Memphis State, 3/24/85 1. 18, Danny Manning, Kansas, 4/4/88 2. 16, Karl Malone, Louisiana Tech (OT), 3/21/85 3. 15, Juan Mendez, Niagara, 3/17/05 15, Greg Dennis, East Tennessee State, 3/16/89 15, Reggie Lewis, Northeastern, 3/13/86 15, Larry Bird, Indiana State, 3/15/79 7. 14, Justin Hawkins, Utah, 3/19/05 14, Brent Dabbs, Virginia, 3/23/89 14, Pervis Ellison, Louisville, 3/24/88 14, Keith Lee, Memphis State, 3/24/85 u ASSISTS u ASSISTS 1. 11, Terrell Everett vs. UW-Milwaukee, 3/16/06 11, John Ontjes vs. Manhattan, 3/16/95 11, John McCullough vs. Texas, 3/10/79 4. 9, Mookie Blaylock vs. Chattanooga, 3/16/89 9, Mookie Blaylock vs. Auburn, 3/19/88 9, Linwood Davis vs. Northeastern, 3/13/86 9, Tim McCalister vs. Dayton, 3/17/84 8. 8, Alex Spaulding vs. UNC Charlotte, 3/14/99 8, Michael Johnson vs. Arizona, 3/12/99 8, Ricky Grace vs. Arizona, 4/2/88 8, Ricky Grace vs. Louisville, 3/24/88 8, Ricky Grace vs. Auburn, 3/19/88 8, Dave Sieger vs. Tennessee-Chattanooga, 3/17/88 8, Ricky Grace vs. Iowa (OT), 3/20/87 8, Linwood Davis vs. North Carolina A&T, 3/14/85 1. 12, Andre Turner, Memphis State, 3/24/85 2. 10, Brevin Knight, Stanford, 3/14/97 10, B.J. Armstrong, Iowa (OT), 3/20/87 4. 8, Luke Walton, Arizona, 3/21/02 8, Levan Alston, Temple, 3/15/96 8, John Crotty, Virginia, 3/23/89 8, William Howard, Auburn, 3/19/88 8, Alan Davis, Louisiana Tech (OT), 3/21/85 8, Wayne Smith, Louisiana Tech (OT), 3/21/85 8, Larry Schellenberg, Dayton, 3/17/84 30 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 NCAA TOURNAMENT TEAM HIGHS OKLAHOMA u POINTS 1. 124 vs. Louisiana Tech, 1989 2. 108 vs. Louisville, 1988 3. 107 vs. Auburn, 1988 4. 96 vs. Pittsburgh, 1987 96 vs. North Carolina A&T, 1985 u FIELD GOALS 1. 48 vs. Louisiana Tech, 1989 2. 41 vs. Auburn, 1988 41 vs. Texas, 1979 4. 39 vs. Louisville, 1988 39 vs. North Carolina A&T, 1985 u FIELD GOAL ATTEMPTS 1. 98 vs. Louisiana Tech, 1989 2. 82 vs. Pittsburgh, 1987 3. 76 vs. Auburn, 1988 4. 74 vs. Niagara, 2005 74 vs. Louisville, 1988 74 vs. North Carolina A&T, 1985 u FIELD GOAL PERCENTAGE 1. .660 vs. Illinois State, 1985 2. .622 vs. Texas, 1979 3. .604 vs. Morgan State, 2009 4. .576 vs. UT-Chattanooga, 1988 5. .571 vs. Saint Joseph’s, 2008 u 3-POINT FIELD GOALS 1. 13 vs. UNC Charlotte, 1999 2. 10 vs. South Carolina State, 2003 10 vs. Arizona, 2002 10 vs. Winthrop, 2000 10 vs. Arizona, 1999 10 vs. Indiana (OT), 1998 10 vs. Louisiana Tech, 1989 10 vs. Kansas, 1988 10 vs. Louisville, 1988 u 3-POINT FG ATTEMPTS 1. 28 vs. Syracuse, 2003 28 vs. UNC Charlotte, 1999 3. 27 vs. Temple, 1996 4. 25 vs. Arizona, 2002 25 vs. Arizona, 1999 u 3-POINT FG PCT. (MIN. 10 ATTEMPTS) 1. .556 (10-for-18) vs. S.C. State, 2003 2. .538 (7-for-13) vs. California, 2003 3. .529 (9-for-17) vs. Auburn, 1988 4. .526 (10-for-19) vs. Louisville, 1988 5. .500 (7-for-14) vs. Missouri, 2002 .500 (7-for-14) vs. Iowa (OT), 1987 .500 (7-for-14) vs. Pittsburgh, 1987 u FREE THROWS 1. 24 vs. Missouri, 2002 24 vs. Xavier, 2002 3. 22 vs. UNC Charlotte, 1999 22 vs. Arizona, 1988 5. 21 vs. Southwestern Louisiana, 1992 u FREE THROW ATTEMPTS 1. 36 vs. Louisville, 1988 2. 34 vs. Arizona, 1988 3. 32 vs. Morgan State, 2009 32 vs. Missouri, 2002 5. 31 vs. UNC Charlotte, 1999 u FREE THROW PCT. (MIN. 10 ATTEMPTS) 1. .900 (18-for-20) vs. N. C. A&T, 1985 2. .889 (16-for-18) vs. Arizona, 2002 3. .867 (13-for-15) vs. Niagara, 2005 4. .857 (24-for-28) vs. Xavier, 2002 .857 (12-for-14) vs. Winthrop, 2000 u REBOUNDS 1. 62 vs. Louisiana Tech, 1989 2. 48 vs. Niagara, 2005 3. 47 vs. Illinois-Chicago, 2002 4. 46 vs. Towson State, 1990 46 vs. Dayton, 1984 u ASSISTS 1. 31 vs. Auburn, 1988 2. 28 vs. Texas, 1979 3. 25 vs. Louisville, 1988 25 vs. UT-Chattanooga, 1988 5. 24 vs. Illinois State, 1985 24 vs. North Carolina A&T, 1985 u TURNOVERS 1. 21 vs. Manhattan, 1995 2. 20 vs. Towson State, 1990 3. 19 vs. Syracuse, 2003 4. 18 vs. Syracuse, 2009 18 vs. UW-Milwaukee, 2006 u BLOCKED SHOTS 1. 10 vs. Texas, 1979 2. 9 vs. Louisiana Tech, 1989 3. 8 vs. Louisiana Tech (OT), 1985 4. 6 vs. Morgan State, 2009 6 vs. Indiana State (OT), 2001 6 vs. Southwestern Louisiana, 1992 u STEALS 1. 16 vs. Louisiana Tech, 1989 16 vs. Auburn, 1988 3. 14 vs. Iowa, 1987 4. 13 vs. Syracuse, 2003 13 vs. Kansas, 1988 13 vs. Louisville, 1988 13 vs. Pittsburgh, 1987 OPPONENTS u POINTS 1. 98, Louisville, 1988 2. 94, Indiana, 1998 3. 93, Pittsburgh, 1987 93, Iowa, 1987 93, Indiana State, 1979 u FIELD GOALS 1. 40, Louisville, 1988 2. 38, Pittsburgh, 1987 3. 35, Kansas, 1988 35, North Carolina A&T, 1985 35, Indiana State, 1979 u FIELD GOAL ATTEMPTS 1. 84, Auburn, 1988 84, Louisiana Tech, 1985 3. 79, Texas, 1979 4. 77, Morgan State, 2009 77, Louisiana Tech, 1989 u FIELD GOAL PERCENTAGE 1. .636, Kansas, 1988 2. .595, Utah, 2005 3. .593, Louisville, 2008 .593, Indiana, 1998 5. .583, Indiana State, 1979 u 3-POINT FIELD GOALS 1. 9, Louisville, 2008 9, Indiana, 1998 9, Temple, 1996 4. 8, Indiana, 2002 8, Xavier, 2002 8, UNC Charlotte, 1999 8, Auburn, 1988 8, Tulsa, 1987 u 3-POINT FG ATTEMPTS 1. 28, Niagara, 2005 2. 27, Michigan, 2009 3. 24, Syracuse, 2009 24, Auburn, 1988 5. 23, Morgan State, 2009 23, UNC Charlotte, 1999 23, Arizona, 1988 u 3-POINT FG PCT. (MIN. 10 ATTEMPTS) 1. .700 (7-for-10), North Carolina, 1990 2. .615 (8-for-13), Indiana, 2002 3. .529 (9-for-17), Louisville, 2008 4. .500 (9-for-18), Indiana, 1998 5. .474 (9-for-19), Temple, 1996 u FREE THROWS 1. 27, Virginia, 1989 2. 26, UW-Milwaukee, 2006 3. 24, Stanford, 1997 24, Manhattan, 1995 5. 23, Indiana State, 1979` u FREE THROW ATTEMPTS 1. 36, Virginia, 1989 2. 35, Manhattan, 1995 3. 34, Missouri, 2002 34, Indiana State, 1979 5. 33, Indiana, 2002 u FREE THROW PCT. (MIN. 10 ATTEMPTS) 1. .938 (15-for-16), North Carolina, 2009 2. .913 (21-for-23), Auburn, 1988 3. .867 (13-for-15), Niagara, 2005 4. .864 (19-for-22) E. Tenn. State, 1989 5. .857 (12-for-14), Texas, 1947 u REBOUNDS 1. 57, Auburn, 1988 2. 50, Indiana State, 1979 3. 48, Louisiana Tech, 1989 4. 46, Northeastern, 1986 46, Louisiana Tech, 1985 u ASSISTS 1. 26, Louisiana Tech, 1985 2. 24, Louisville, 2008 3. 23, Pittsburgh, 1987 4. 21, Iowa, 1987 5. 19, Indiana, 2002 19, DePaul, 1986 19, Memphis State, 1985 u TURNOVERS 1. 29, Louisiana Tech, 1989 2. 26, UT-Chattanooga, 1988 3. 25, Auburn, 1988 4. 24, Syracuse, 2003 5. 23, Kansas, 1988 23, Indiana State, 1979 u BLOCKED SHOTS 1. 8, Indiana, 2002 2. 7, Louisiana Tech, 1989 3. 6, Xavier, 2002 4. 5, North Carolina, 1990 5, Memphis State, 1985 5, Indiana, 1983 u STEALS 1. 13, Syracuse, 2003 13, Manhattan, 1995 3. 11, Kansas, 1988 11, Louisiana Tech, 1985 5. 10, Syracuse, 2009 10, Arizona, 1999 10, North Carolina, 1990 10, Memphis State, 1985 31 2012-13 OKLAHOMA MEN’S BASKETBALL NCAA TOURNAMENT CATEGORY LEADERS u GAMES PLAYED 1. 12, Hollis Price (2000, 2001, 2002, 2003) 12, Stacey King (1987, 1988, 1989) 3. 11, Dave Sieger (1986, 1987, 1988) 4. 10, Terrence Mullins (1988, 1989, 1990) 10, Darryl Kennedy (1984, 1985, 1986, 1987) 10, David Johnson (1984, 1985, 1986, 1987) 7. 9, Jabahri Brown (2002, 2003) 9, Ebi Ere (2002, 2003) 9, Quannas White (2002, 2003) 9, Mookie Blaylock (1988, 1989) 9, Ricky Grace (1987, 1988) 9, Harvey Grant (1987, 1988) 9, Tim McCalister (1984, 1985, 1986, 1987) u MINUTES PLAYED 1. 393, Hollis Price (2000, 2001, 2002, 2003) 2. 365, Stacey King (1987, 1988, 1989) 3. 362, Tim McCalister (1984, 1985, 1986, 1987) 4. 345, Darryl Kennedy (1984, 1985, 1986, 1987) 5. 337, Mookie Blaylock (1988, 1989) 6. 310, Ricky Grace (1987, 1988) 7. 306, Harvey Grant (1987, 1988) 8. 282, Dave Sieger (1986, 1987, 1988) 9. 265, Ebi Ere (2002, 2003) 10. 257, Wayman Tisdale (1983, 1984, 1985) u POINTS 1. 246, Stacey King (1987, 1988, 1989) 2. 170, Harvey Grant (1987, 1988) 3. 158, Wayman Tisdale (1983, 1984, 1985) 4. 153, Tim McCalister (1984, 1985, 1986, 1987) 5. 140, Darryl Kennedy (1984, 1985, 1986, 1987) 6. 138, Hollis Price (2000, 2001, 2002, 2003) 7. 134, Blake Griffin (2008, 2009) 8. 132, Mookie Blaylock (1988, 1989) 9. 120, Ebi Ere (2002, 2003) 10. 118, Aaron McGhee (2001, 2002) u FIELD GOALS 1. 102, Stacey King (1987, 1988, 1989) 2. 66, Harvey Grant (1987, 1988) 66, Wayman Tisdale (1983, 1984, 1985) 4. 61, Darryl Kennedy (1984, 1985, 1986, 1987) 61, Tim McCalister (1984, 1985, 1986, 1987) 6. 56, Blake Griffin (2008, 2009) 7. 52, Mookie Blaylock (1988, 1989) 8. 48, Hollis Price (2000, 2001, 2002, 2003) 9. 45, Ebi Ere (2002, 2003) 10. 39, Aaron McGhee (2001, 2002) u FIELD GOAL ATTEMPTS 1. 185, Stacey King (1987, 1988, 1989) 2. 136, Tim McCalister (1984, 1985, 1986, 1987) 3. 126, Hollis Price (2000, 2001, 2002, 2003) 4. 123, Darryl Kennedy (1984, 1985, 1986, 1987) 5. 121, Harvey Grant (1987, 1988) 6. 116, Mookie Blaylock (1988, 1989) 7. 112, Ebi Ere (2002, 2003) 8. 109, Wayman Tisdale (1983, 1984, 1985) 9. 78, Aaron McGhee (2001, 2002) 10. 77, David Johnson (1984, 1985, 1986, 1987) u FIELD GOAL PERCENTAGE (MIN. 40 ATTEMPTS) 1. .778, Blake Griffin (2008, 2009) 2. .606, Wayman Tisdale (1983, 1984, 1985) 3. .551, Stacey King (1987, 1988, 1989) 4. .548, Jabahri Brown (2002, 2003) 5. .545, Harvey Grant (1987, 1988) 6. .500, Taj Gray (2005, 2006) .500, Aaron McGhee (2001, 2002) 8. .496, Darryl Kennedy (1984, 1985, 1986, 1987) 9. .494, David Johnson (1984, 1985, 1986, 1987) 10. .493, Anthony Bowie (1985, 1986) u 3-POINT FIELD GOALS 1. 21, Hollis Price (2000, 2001, 2002, 2003) 2. 20, Dave Sieger (1986, 1987, 1988) 3. 14, David Godbold (2005, 2006, 2008) 14, Mookie Blaylock (1988, 1989) 14, Ricky Grace (1987, 1988) 6. 13, Tim McCalister (1984, 1985, 1986, 1987) 7. 11, Eric Martin (1999) 8. 10, Ebi Ere (2002, 2003) 9. 9, Willie Warren (2009) 9, Eduardo Najera (1997, 1998, 1999, 2000) 9, Terrence Mullins (1988, 1989, 1990) u 3-POINT FIELD GOAL ATTEMPTS 1. 60, Hollis Price (2000, 2001, 2002, 2003) 2. 52, Dave Sieger (1984, 1986, 1987, 1988) 3. 43, Ricky Grace (1987, 1988) 4. 39, Ebi Ere (2002, 2003) 5. 38, Mookie Blaylock (1988, 1989) 6. 29, Tony Crocker (2008, 2009) 7. 27, Eduardo Najera (1997, 1998, 1999, 2000) 8. 26, Willie Warren (2009) 9. 23, David Godbold (2005, 2006, 2008) 23, Kelley Newton (2000, 2001) u 3-PT. FG PERCENTAGE (MIN. 15 ATTEMPTS) .609 (14-23), David Godbold (2005, 2006, 2008) .590 (13-22), Tim McCalister (1984, 1985, 1986, 1987) .500 (11-22), Eric Martin (1999) .500 (9-18), Terrence Mullins (1988, 1989, 1990) .400 (6-15), Austin Johnson (2006, 2008, 2009) .385 (20-52), Dave Sieger (1986, 1987, 1988) .375 (6-16), Nate Erdmann (1996, 1997) .375 (6-16), Skeeter Henry (1989, 1990) .368 (7-19), Tim Heskett (1997, 1999, 2000, 2001) .368 (14-38), Mookie Blaylock (1988, 1989) u FREE THROW ATTEMPTS 1. 69, Stacey King (1987, 1988, 1989) 2. 55, Harvey Grant (1987, 1988) 3. 44, David Johnson (1984, 1985, 1986, 1987) 4. 43, Ricky Grace (1987, 1988) 5. 42, Blake Griffin (2008, 2009) 42, Aaron McGhee (2001, 2002) 7. 35, Wayman Tisdale (1983, 1984, 1985) 8. 29, Ebi Ere (2002, 2003) 9. 28, Gerald Tucker (1943, 1947) 10. 27, Darryl Kennedy (1984, 1985, 1986, 1987) 27, Tim McCalister (1984, 1985, 1986, 1987) u FREE THROW PERCENTAGE (MIN. 20 ATTEMPTS) 1. .857 (36-42), Aaron McGhee (2001, 2002) 2. .840 (21-25), Hollis Price (2000, 2001, 2002, 2003) 3. .821 (23-28), Gerald Tucker (1943, 1947) 4. .808 (21-26), Quannas White (2002, 2003) 5. .760 (19-25), William Davis (1989, 1990) 6. .744 (32-43), Ricky Grace (1987, 1988) 7. .743 (26-35), Wayman Tisdale (1983, 1984, 1985) 8. .722 (26-36), Ebi Ere (2002, 2003) 9. .691 (38-55), Harvey Grant (1987, 1988) 10. .667 (18-27), Darryl Kennedy (1984, 1985, 1986, 1987) .667 (18-27), Tim McCalister (1984, 1985, 1986, 1987) u REBOUNDS 1. 93, Stacey King (1987, 1988, 1989) 2. 73, Darryl Kennedy (1984, 1985, 1986, 1987) 3. 71, Blake Griffin (2008, 2009) 71, Harvey Grant (1987, 1988) 5. 68, Darryl Kennedy (1984, 1985, 1986, 1987) 6. 67, Wayman Tisdale (1983, 1984, 1985) 7. 57, Ebi Ere (2002, 2003) 8. 55, David Johnson (1984, 1985, 1986, 1987) 9. 52, Eduardo Najera (1997, 1998, 1999, 2000) 10. 48, Aaron McGhee (2001, 2002) u ASSISTS 1. 57, Ricky Grace (1987, 1988) 2. 52, Mookie Blaylock (1988, 1989) 3. 50, Tim McCalister (1984, 1985, 1986, 1987) 4. 45, Dave Sieger (1986, 1987, 1988) 5. 41, Quannas White (2002, 2003) 6. 37, Hollis Price (2000, 2001, 2002, 2003) 7. 35, Anthony Bowie (1985, 1986) 8. 28, Darryl Kennedy (1984, 1985, 1986, 1987) 9. 25, Austin Johnson (2006, 2008, 2009) 25, Linwood Davis (1985, 1986) u BLOCKED SHOTS 1. 17, Stacey King (1987, 1988, 1989) 2. 12, Wayman Tisdale (1983, 1984, 1985) 3. 8, Harvey Grant (1987, 1988) 4. 7, Ryan Humphrey (1998, 1999) 5. 6, Johnnie Gilbert (2001, 2003, 2005) 6, Eduardo Najera (1997, 1998, 1999, 2000) 6, Renzi Stone (1997, 1998, 1999, 2000) u STEALS 1. 32, Mookie Blaylock (1988, 1989) 2. 28, Ricky Grace (1987, 1988) 3. 21, Dave Sieger (1984, 1986, 1987, 1988) 4. 17, Hollis Price (2000, 2001, 2002, 2003) 5. 15, Stacey King (1987, 1988, 1989) 1. 2. 3. 5. 6. 7. 9. u FREE THROWS 1. 42, Stacey King (1987, 1988, 1989) 2. 38, Harvey Grant (1987, 1988) 3. 36, Aaron McGhee (2001, 2002) 4. 32, Ricky Grace (1987, 1988) 5. 26, Wayman Tisdale (1983, 1984, 1985) 6. 24, David Johnson (1984, 1985, 1986, 1987) 7. 23, Gerald Tucker (1943, 1947) 8. 22, Blake Griffin (2008, 2009) 9. 21, Hollis Price (2000, 2001, 2002, 2003) 21, Quannas White (2002, 2003) 32 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 2012-13 NEWS CLIPPINGS 33 2012-13 OKLAHOMA MEN’S BASKETBALL M’Baye could be key to Oklahoma revival By Jon Rothstein CBS New York September 20, 2012. 34 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Sweet 16: Andrew Fitzgerald, Oklahoma By Matt Bracken The Baltimore Sun October 9, 2012] midrange.” 35 2012-13 OKLAHOMA MEN’S BASKETBALL Sooners, picked seventh, have nothing to hide By John Shinn The Norman Transcript October 12, 2012 NORMAN — No one associated with Oklahoma basketball will likely work for the CIA. The Sooners make little attempt to keep secrets. Wander by Lloyd Noble Center at 5 p.m. today and you can watch their first practice of the 2012-13 season. If that’s not convenient enough, the practice will be streamed live on soonersports.tv. The Sooners don’t have anything to hide. “We don’t have any secrets,” OU coach Lon Kruger said. “This game always comes down to execution and doing it well enough to get the result that you want. I think this will be good for the people that want to tune in and find out about what’s going on. Hopefully, they’ll get to know the players a little bit better. In the long run, I hope it will encourage them to come out to Lloyd Noble Center and be part of the crowd.” The Sooners firmly believe this is a season that won’t end with a loss in the Big 12 tournament. OU returns its top six scorers from last season’s 15-16 squad, including all five starters. All told, 88 percent of their scoring, 81 percent of their rebounding and 78 percent of their assists from last season will be in the practice gym today. Steven Pledger and Romero Osby are the Big 12’s leading returning scorer (16.2 points per game) and rebounder (7.3 rebounds per game), respectively. Point guard Sam Grooms ranked second in the league in assists last year (6.0 per game). Preseason Big 12 Newcomer of the Year Amath M’Baye, a transfer from Wyoming who practiced with the Sooners last season, will also be on the court. “We’re a much deeper and more athletic team on the whole,” Kruger said. “There’s gonna be better competition for time, internally. We’ll be able to keep people fresher in ballgames, which is great.” OU was picked to finish seventh in the Big 12 Conference in the coaches poll that was released on Thursday. It might sound like a slight, but the league easily placed six teams in the NCAA Tournament last season. Exceeding expectations by one spot can mean the end of a three-year absence from March Madness. “I hope that’s the case,” Grooms said. “More importantly, I just think we need to push ourselves above 20 wins this year. It’s really possible with the returning people we have and with guys being better than we were last year and the guys we’ve added. This could be a really good year.” If you don’t believe Grooms, check out for yourself. The Sooners will live stream their first eight practices. “I think if we can get more people to take an interest, then we’re all for it,” Kruger said. 36 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Three captains named for Oklahoma By Stephanie Kuzydym The Oklahoman October 17, 2012 The men’s basketball team voted and Oklahoma basketball coach Lon Kruger announced the men’s basketball team will be led by two senior and one junior captains. Seniors Andrew Fitzgerald and Romero Osby and junior Amath M’Baye are the 2012-2013 captains for the Sooners. .” Osby started all 31 games last season averaging 12.9 points, a team-high 7.3 rebounds and 1.0 blocked shot in 30.2 minutes per game. Fitzgerald has started the last 64 games for Oklahoma, finishing last season third in team scoring. M’Baye is making his debut with the Sooners this season after transferring from Wyoming and sitting out last season due to NCAA’s transfer rules. The three captains will lead the Oklahoma men’s basketball team during the first home exhibition game against Washburn at 7 p.m. on Nov. 2. 37 2012-13 OKLAHOMA MEN’S BASKETBALL Transfer Amath M’Baye had a good summer camp By Guerin Emig Tulsa World October 18, 2012 KANSAS CITY, Mo. — There is a 55-second YouTube video that shows exactly why Oklahoma basketball fans feel safe to be excited again. It features Amath M’Baye, the Sooners’ Preseason Big 12 Newcomer of the Year, dunking. And sending someone’s shot straight to the floor. And hitting 3s from the corner, from one wing and then from the other. And then dunking again. OU saw a lot of this from M’Baye last year in practice, where the 6-foot-9 forward spent all of his time after transferring from Wyoming. This, however, was no OU practice. This was a highlight reel from the Adidas Nations camp last August near Long Beach. This was M’Baye among fellow college counselors like Duke’s Mason Plumlee, Louisville’s Peyton Siva and Murray State All-American Isaiah Canaan. M’Baye had been invited to join the cast. And here he was proving he belonged on stage. “I thought I did OK,” he said Wednesday from Big 12 Media Day. “I heard he did really well,” OU coach Lon Kruger said. “I didn’t see any of that, but all of the comments back were he held his own very well against other very good players.” Here is a sample, from on-the-scene Hoopsworld.com college basketball editor Yannis Koutroupis: “Somewhat of a mystery going into the Nations, M’Baye earned himself a lot of attention for this upcoming season at Oklahoma.” This is why the Sooners were so excited as they closed down their 15-16 2011-12 season, their third straight losing effort since Blake Griffin skipped town. Help was on the way. They had seen what M’Baye could do. They figured with another offseason of work, he could do even more. “He’s fine-tuned his jump shot,” guard Sam Grooms said. “I think he’s in better shape. He’s always been athletic, but he looks even more athletic this year. He can do more. He’s better. “It’ll be exciting to watch, I promise you that.” M’Baye’s offseason wasn’t all California camp flash. There were plenty of non-glamorous early mornings. “He was in there at seven o’clock, and lifting at 7:05,” Kruger said. “That’s just his routine.” “Always in the gym,” forward Romero Osby said. “We’d get in there together and compete against each other.” And what did Osby notice? “He’s really been working on his game,” he said. “He can play outside just as well as he can play inside now. I think the biggest thing with him is to make sure he comes in confident. If he’s confident, the sky’s the limit.” M’Baye’s invitation to Adidas Nations should only feed his ego. Among players the event’s website touts as having taken part in the past: Derrick Rose, Kevin Love, Tyreke Evans, Antawn Jamison and Eric Gordon, plus Oklahoma City Thunder players James Harden, Serge Ibaka, Daequan Cook and Cole Aldrich. Last summer, it was M’Baye’s turn to tutor some of the nation’s top high school talent, and scrimmage with fellow counselors in between the high schoolers’ games. “I hadn’t played all year,” M’Baye said, “and I was able to scrimmage and play against very good competition to see where I stood. Anytime you play against such good players, it makes you feel better about yourself.” M’Baye feels pretty good going into his junior season, his first as a Sooner. That has the Sooners feeling much better. “It’s very good motivation to see that people actually see my improvement and see how I work and are confident that I’m going to be a factor in the Big 12,” M’Baye said. “It makes me want to work harder to make sure I don’t disappoint all of these people that believe in me.” 38 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Deeper, more athletic Sooners look to play up-tempo By Guerin Emig Tulsa World October 21, 2012 NORMAN — There came a point during Saturday’s intrasquad scrimmage where Oklahoma showed exactly how it wanted to play this season, beginning when Amath M’Baye rose for a defensive rebound and zipped an outlet pass to Steven Pledger. “Good!” coach Lon Kruger yelled from the bench. “Now finish it!” Finish Pledger did. He caught M’Baye’s outlet and attacked immediately, swooping to the basket from the right wing before laying it in with his right hand. This is a deeper Sooners team than Kruger’s first bunch a year ago. It is their most athletic since Willie Warren, Juan Pattillo and Blake and Taylor Griffin soared to an Elite Eight appearance in 2009. It stands to reason the Sooners want to play faster than they did last season. “A lot faster,” Andrew Fitzgerald confirmed. “A lot faster,” Pledger echoed. “We’ve got more bodies. We can exert ourselves more.” M’Baye is now aboard after sitting out last year due to NCAA transfer policy. He and Cameron Clark are OU’s most explosive players. Freshman guards Isaiah Cousins, Buddy Hield and Je’lon Hornbeak join Pledger, M’Baye, Clark, Sam Grooms and Tyler Neal around the perimeter. Three rookies were occasionally out of control Saturday, but you could also see their influence. “The three as a group bring athletic ability, good ranginess, good activity defensively, enthusiasm,” Kruger said. “They love to play, love to compete. Just tremendous upside.” Hield scored 16 points in the scrimmage. Cousins chalked up 10. Hornbeak hit a pair of 3-pointers. It wasn’t so much that they scored, though. It was that they ran. “I think we’ll have more speed coming out of the backcourt,” Kruger said, “more ability to push it.” That generally wasn’t the case a year ago. Kruger tightened his rotation as the season wore on, by necessity. The Sooners went 1-8 in February and 3-11 over their last 14 games. Several players showed up Saturday. “ ‘Ro’ did a lot of good things,” Kruger said of forward Romero Osby, who put up 24 points and eight rebounds. “I thought Tyler Neal did a lot of good things. I thought the three freshman guards did some good things as a group.” Neal had nine points and four rebounds. Clark had 13 and 11. Pledger scored eight points behind a pair of 3s. There was plenty of ugly, to be sure. “A good reminder we’ve got to improve our habits, improve a lot of things,” Kruger said. “But I’m still excited about this group.” If nothing else, they should be more exciting to watch. 39 2012-13 OKLAHOMA MEN’S BASKETBALL Junior transfer brings a different dimension to Sooner game By John Shinn The Norman Transcript October 30, 2012 NORMAN — It’s been nearly two years since Amath M’Baye played in an official college basketball game. Since then everything has changed. He’s left Wyoming for Oklahoma, added muscle to his lean 6-foot9 of-tobasket.” 40 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 OU, Navy SEALs train together By Guerin Emig Tulsa World October 30, 2012 NORMAN — The thing Sam Grooms remembers is being submerged from the neck down in water more fit for polar bears, and then crawling along the ground like sloths. “In mud,” said Amath M’Baye, Grooms’ Oklahoma basketball teammate. “They had me lifting logs.” “Big 60-pound logs that you had to carry as a group,” Grooms said. “You had to turn a certain way. You couldn’t cheat the drill.” Cheating at anything when you’re being trained by a Navy SEAL is a particularly bad idea. Which is why the Sooners took their recent session with SEAL chief special warfare operator Rob Stella last month very seriously. “It was for real,” Grooms said. “Everything that he said was true. He said he was gonna find out a lot about us in a short amount of time. He did.” The key was for the Sooners to learn just as much about themselves. The idea is that will pay off as the 2012-13 season grinds into February. OU went 1-8 over that month last year. The Sooners made a habit of playing teams close for a while, then fading late. They’ve done that a lot, actually, since Blake Griffin left school. Their February record over the past three years is 3-21. It is a program crying for toughness. So when word got out that Stella was going to be available, well, why not? “The lacrosse team on campus, their coach called us and said, ‘Hey, we’ve got the SEALs coming in. Would you guys like to partake?’” OU coach Lon Kruger said. “I checked with the players and they were very intrigued by it.” So Sept. 11, both men’s and women’s basketball teams joined lacrosse players and members of OU’s ROTC. They pushed around monster truck tires and logs that looked more like telephone poles. They did pushups and bear-crawled under bridges formed by their teammates. Stella oversaw the two-hour session, barking things like: “You learn to play out of your comfort zone, your opponents will not be able to match you.” And: “Situational awareness, confidence in yourself and your teammates, and resiliency. You’ve got those, you’ve got the recipe for success.” “It was different, the way we went about things, the way we had to repeat things. It was good for us,” guard Steven Pledger said. “It boosted team unity. It brought us closer together.” The Sooners don’t push tires around Allen Fieldhouse, or logs across Gallagher-Iba Arena. But then, that wasn’t really the point. “I don’t know if that one day of physical stuff will be the difference in a game,” guard Tyler Neal said. “But I think just taking that and building on it each day, yeah, I think it’ll help.” 41 2012-13 OKLAHOMA MEN’S BASKETBALL Veterans counting on newcomers to push team forward By Clay Horning The Norman Transcript October 30, 2012 NORMAN —ve Noworyta — and they’re probably doing a heck of a job, because that is the way of the walk-on. Still, “the newcomers,” really, are freshmen Isaiah Cousins, Buddy Hield.”. 42 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 M’Baye eager to chip in after long journey from France to Oklahoma Jeff Latzke Associated Press October 30, 2012 NORMAN, Okla. —ianaMon.” 43 2012-13 OKLAHOMA MEN’S BASKETBALL OU freshmen set to make impact this season By Guerin Emig Tulsa World November 4, 2012 NORMAN — They’ve come from Dallas, Wichita and New York to play basketball together at Oklahoma. They are, as nicknamed by assistant coach Lew Hill, “Three the Hard Way.” Freshman guards Je’lon Hornbeak, Buddy Hield and Isaiah Cousins. Get used to them. They’re going to impact OU basketball for a pretty long time. They have already done so. After all three stood out at the Sooners’ first public intrasquad scrimmage Oct. 20, coach Lon Kruger said: “The three as a group bring athletic ability, good ranginess, good activity defensively, enthusiasm. They love to play, love to compete. Just tremendous upside.” Kruger hasn’t backed off much since. Last week, he declared at OU’s media day the three freshmen “are going to play quality minutes for sure.” “I think they’ve really been a good addition to the team,” forward Tyler Neal said. “They’ve been really explosive. They really have an urge to score.” Cousins and Hornbeak can do so from the point guard position, where they’ll press returning starter Sam Grooms for playing time. Hield is a wing who, Kruger said, “can attack the paint and shoot the three.” The Sooners will be counting on the youngsters’ aggressiveness to help them back into the NCAA tournament for the first time in four years. They like that about the trio, but that’s not nearly all. “They’ve been a good addition to the locker room as well,” Neal said, “and I think they’re hard workers. They’re in the gym often.” “We all push each other. We’re like a band of brothers, us three,” said Hornbeak, a four-star player for Grace Preparatory Academy in Arlington, Texas. “We pick each other up and all three of us go to the gym. We live here. Sometimes we might sleep here, take naps. We’ll bring some food, stop to eat, then go back to work out.” Hornbeak and Hield bonded last March in New Orleans, where they roomed together at a high school slam dunk/3-point contest as part of Final Four weekend. They roomed together after arriving at OU. “And then Isaiah came in a month after,” Hornbeak said. “Once he warmed up to us, you couldn’t break us apart. That’s just how it was. Since he really didn’t know anybody, we took it upon ourselves to get to know him.” Cousins, whose soft speech belies the fact he grew up playing street ball across New York’s five boroughs, was drawn in immediately. “All three of us are aggressive. All of us like to compete. We like the same stuff off the court, too,” Cousins said. “We like to dance. We like girls. We definitely like music. All of us like reggae.” Hield, who prepped at Sunrise Christian Academy in the Wichita suburb of Bel Aire, didn’t have the others’ big-city background. But he absolutely fit in from a confidence standpoint. “We compete every day with a chip on our shoulder,” Hield said. “That’s how we play.” The Sooners appreciate that. They expect to benefit from that, this season and beyond. “People will like that trio right there,” Grooms said. “They’ll be good for years to come, I promise you.” PLAYERS TO WATCH The star Steven Pledger became a focal point for the first time in his career last season. He responded with career highs in points, rebounds, field goal percentage, 3-point percentage and steals. He is the Big 12’s leading returning scorer after averaging 16.2 points as a junior. The supporting cast It’s bigger and better than it was in Lon Kruger’s first season as coach. He signed Je’lon Hornbeak, Buddy Hield and Isaiah Cousins to plug holes in the backcourt. All three will play significant minutes, with Hornbeak and Cousins expected to push Sam Grooms at the point. All three freshmen can shoot, giving Kruger options beyond 18 feet besides Pledger. Cameron Clark needs to score more than he did as a sophomore, when he scored less than he did as a freshman. Amath M’Baye and Tyler Neal can play small or power forward, with M’Baye expected to provide instant impact after sitting out last season. He’s the Big 12 Preseason Newcomer of the Year. It will be interesting to see how he affects returning starters Romero Osby and Andrew Fitzgerald Budding star It’s tough to call M’Baye “budding,” since he’s a junior who averaged 10 points in two years at Wyoming. He’s just new is all. Instead, keep an eye on Hield, Hornbeak and Cousins WHAT TO EXPECT Best-case scenario Amath M’Baye gives the Sooners an athletic, versatile forward, making things easier for frontcourt mainstays Romero Osby and Andrew Fitzgerald. Lon Kruger works his three freshmen into the backcourt to complement Steven Pledger, Cameron Clark and Sam Grooms. OU plays a faster, more entertaining game featuring more players and more pressure. Most likely scenario The three freshmen all contribute, but also fight through growing pains typical of first-year Big 12 players. Pledger goes through streaks of games where he can’t miss and some where he struggles. Clark benefits from a faster pace, but doesn’t quite break out. Grooms, Osby and Fitzgerald continue their steady contributions, while M’Baye provides an instant shot in the arm. OU hovers around 20 wins in March, and faces Selection Sunday as a nervous bubble team. 44 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Newcomer Buddy Hield hoping to live up to nickname By Stephanie Kuzydym The Oklahoman November 10, 2012. Besides, there are apparently two other electrical appliances that help the Sooners heat things up. Freshman Je’lon Hornbeak tried to convince his cohorts that the freshmen are like a one-stop appliance shop. Hield’s the microwave, Hornbeak’s the stove and Isaiah Cousins is the oven. They’re ready to heat it up and dish it out. “We the buffet and we deliver,” Hornbeak said. “We’re hungry and we’re just going to eat.” During Oklahoma’s first two exhibition games, the three freshmen produced, and newcomer Amath M’Baye combined to shoot .591 from beyond the arc (13-for-22) and .517 from the field. Hornbeak averaged 10.5 points per exhibition, while Cousins averaged 7.5. All three freshmen said they’re excited to continue “cooking” in the regular season. “It’s what we live for,” Hornbeak said. “We used to be on the video game playing but now it’s not a video game, we actually get to play.” Still, senior Romero Osby is holding OU’s freshman trio accountable. Exhibition production was great, but he emphasized that they can keep the nicknames if they produce. “Hold on. Hold on. Hold on,” Osby said when he overheard the Microwave nickname for Hield. He wrapped his arm around Hield’s shoulder and put his face within inches of the freshman’s. “That’s Vinnie Johnson’s nickname. To earn that nickname you have to come in, in the NCAA Tournament, knock down shots, in the clutch.” All the laughter subsided for a second, and Hield looked Osby in the eyes as he said, “Yes, sir.” 45 2012-13 OKLAHOMA MEN’S BASKETBALL OU’s objective this season — earn NCAA Tournament bid By Guerin Emig Tulsa World November 7, 2012 NORMAN — Steven Pledger has contributed 1,022 points and 178 3-pointers to Oklahoma basketball while making 59 starts in three years. Still, he does not care. It’s so much more about what Pledger has not done, and that’s why after a recent practice, he insisted: “If we don’t play in the tournament then it’s four years wasted.” A few weeks ago, coach Lon Kruger brought to everyone’s attention the lack of NCAA Tournaments on his five seniors’ resumes. He said it matter of factly, explaining why it was such a natural goal for the group. Since then, those seniors have made it more personal. They have upped the ante on the 2012-13 season that begins Sunday with a 2 p.m. home game against Louisiana-Monroe. “Ever since I came to the University of Oklahoma, I expected to be in the tournament,” Andrew Fitzgerald said. “It’s a must that we go this year.” It hasn’t happened since 2009, Blake Griffin’s last season at OU. Pledger and Fitzgerald arrived the following summer. Sam Grooms and Casey Arent transferred from junior colleges in 2011. Romero Osby arrived via Mississippi State in 2010. He, at least, reached the NCAA first round as a Bulldogs freshman in 2009. He rather liked it. “It’s just the atmosphere,” Osby said. “You get a police escort everywhere you go. You eat well. They treat you like a king, just for making it in the tournament.” There isn’t anything like it in college basketball, which is why March has driven OU’s two four-year seniors crazy the past three years. “Every time I watch it I get mad,” Pledger said, “so I stop watching.” “The first I watched last year was when Kansas played in the Final Four,” said Fitzgerald, who felt like he owed old pal Thomas Robinson that courtesy. “Other than that, I didn’t watch at all. I just got a feeling in my gut like, ‘Dang, we should be playing in the NCAA.’ I used it as motivation for next year.” Now that next year has arrived, the Sooners plan on being one of the 68 teams that frustrated outsiders choose not to watch. “Everything that we’re doing now is preparing us to win in March. That’s kind of what we go by,” Osby said. “We want to get back to the NCAA tournament as players. Coach wants to get back there. That’s where he’s used to being.” Kruger has been there with Kansas State, Florida, Illinois and UNLV the past quarter century. Thus, the Sooners tune in when he tells them November habits lead to March appearances. “It’s our attitude,” Fitzgerald said. “We’re really competitive with each other.” “Guys never walking,” Osby said, “always being ready to fight for every possession.” “Making extra passes, getting on the boards,” Pledger said, “things like that.” It helps, of course, to have talent. OU’s has been upgraded since Kruger’s first season. That, as much as anything, has everyone hopeful. Or maybe hopeful isn’t the right word. Asked if this season will be a failure without an NCAA Tournament appearance, Osby replied: “Yeah. That’s my opinion. Because it’s my last year. I want it for all the seniors. I want it for Cam Clark, who hasn’t made it. Tyler Neal, who’s been here three years. I want it for them. I want it for Coach, too. He deserves it as well. “But it’s gotta come from us.” 46 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Andrew Fitzgerald grips new role off bench for Sooners By Guerin Emig Tulsa World November 16, 2012 NORMAN — Andrew Fitzgerald isn’t going to lie. He was pretty ticked off at first. It was a few days after the start of Oklahoma basketball practice, and he was being told that after starting all 63 of OU’s games the past two years, he would now be coming off the bench. “The first 10 minutes, my ego got to me,” Fitzgerald recalled of his meeting with coach Lon Kruger. “It was kind of hard to absorb.” Kruger figured it would be. All he could do was keep reassuring Fitzgerald and hope his message might overcome the senior forward’s hurt feelings. After those 10 minutes, that’s just what happened. “It wasn’t like everything is changing. My role is the same. They still want me to score. They still want me to do a lot of things,” Fitzgerald said. “When he kept saying that, that he still wants me to be aggressive, it didn’t bother me as much.” So there was Fitzgerald last Sunday afternoon, coming off the bench seven minutes into OU’s season-opening win over Louisiana-Monroe, scoring six points before checking back out to help the sluggish Sooners take control. His six field goals on 10 attempts tied for team highs. He added six rebounds, three on each end of the floor. It was just the kind of aggression Kruger hoped to get. It was just the kind of attitude as well. “Deep down, everybody would like to start,” Kruger said. “Drew understands that depth is a strength of our team.” And so he has given up his starting position to Amath M’Baye, the Big 12’s preseason newcomer of the year. M’Baye and Romero Osby, as Fitzgerald acknowledged himself, “are practicing hard and are more athletic than me. But I’m still working hard and doing what I need to help the team.” A snapshot of Fitzgerald’s selflessness from the opener: As M’Baye drove the baseline midway through the second half, Fitzgerald screened the closest ULM defender and instructed, “All the way! All the way!” M’Baye did what he was told and took the ball in for an uncontested dunk. “Emotionally, Drew has handled it very well,” Kruger said, “and he’s played well in games to this point. We’ll expect that to continue.” It’s not like Fitzgerald has been banished to mop-up duty. Kruger gave 10 players at least 14 minutes Sunday. Fitzgerald logged 15. He’ll continue to play a key role. He’ll just do it in quicker bursts, something he can handle now that he has shed 12 pounds from last year’s playing weight of 247. “He’s moving a lot better than he did a year ago,” Kruger said. Fitzgerald’s body is sounder, and his mind has cleared. That’s doubly beneficial for the Sooners. “I figured I’d make a positive about the whole situation,” he said of his new role, “just keep playing basketball and doing whatever it takes to help this team out.” 47 2012-13 OKLAHOMA MEN’S BASKETBALL Sooners finding momentum, identity By John Shinn Norman Transcript November 28, 2012 NORMAN —-tobasket. 48 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Sooners believe lessons will carry over By John Shinn Norman Transcript November 30, 2012 NORMAN — The climb from where Oklahoma has been the last three seasons to where it wants to be has certain thresholds that must be crossed. One appeared to occur Wednesday night in Tulsa against Oral Roberts. The Sooners trailed by 10 points with 9 minutes left, a familiar spot last season from which they rarely escaped. This time, the Sooners did escape with a 63-62 victory over the Golden Eagles. “Last year, we probably would have given up or just hung our head,” OU forward Romero Osby said. “Tonight, we battled back and just kept telling ourselves, ‘We’re going to win this game.’ We fought our way back.” It’s an important step because teams rarely play 40 minutes of great basketball. What winning teams to do is figure out how to stay in games until the great five-minute spurt comes along. OU was lethargic for about 31 minutes on Wednesday night. After making the first basket, it didn’t take the lead again until there was less than four minutes left. The win was OU coach Lon Kruger’s 499th in a career that dates back 27 years. There was one to get to the Final Four at Florida in 1994. Others were for conference titles or big wins in the NCAA Tournament. But many of the wins were like Wednesday’s. “We were fortunate to learn a lot from this ballgame and still have it be in the right column so I feel good about that, but we still have a lot of work to do,” Kruger said. The Sooners (5-1) are back at Lloyd Noble Center at 7 tonight to face Northwestern (La.) State (3-2). It will be OU’s fifth game in the last nine days. It’s been a grueling stretch designed to put the Sooners in tough situations and see if they can work through them. Outside of a loss to No. 12 Gonzaga last week, the Sooners have succeeded. “We’re learning from each game,” Kruger said on Thursday. “Even though you wouldn’t say last night wasn’t pretty, we’re competing better for results.” 49 2012-13 OKLAHOMA MEN’S BASKETBALL Kruger plays down talk of impending 500th win By Guerin Emig Tulsa World November 30, 2012 NORMAN — Lon Kruger doesn’t remember anything specific about the first game he won as a college coach. Something does strike him about the first game he lost. . His Sooners take the Lloyd Noble Center court at 7 p.m. Friday. He is simply concerned with beating Northwestern State, the Louisiana visitor from the Southand Conference, and improving to 6-1 on the season His players have something a little bigger on their minds. “It would mean a lot, to be part of a great career, a historic career,” forward Romero Osby said. “To get a chance to give Coach Kruger his 500th win, it’s a blessing to be a part of that.” “I’m looking forward to it,” said point guard Sam Grooms. “I’d rather him do it here so everyone can celebrate with him. When you’re away from home, you’ve got the bus ride back. You don’t get to enjoy it as much. Here, you can sit down and enjoy it afterwards.” The fans inside Lloyd Noble should enjoy it, too, provided OU wins. There will be some sort of recognition, whether it be an announcement or game-ball presentation or something along those lines. Just don’t expect Kruger to make a big fuss about it. Reporters tried to draw that out of him after practice Thursday, to no avail. “It’s nice, I guess, because we’ve been doing it a while with a lot of good players and a lot of good coaches,” he said. “But other than that ...” Someone asked about favorite wins. Kruger said something general about second- or third-week NCAA tournament victories. He said what he mostly remembers is, “Your players feel so much satisfaction, your fans feel so much joy from it. But as far anything specific about it ...” Right. He’d rather coach wins than talk about them. That’s been his way from Pan American to Kansas State to Florida. From Illinois to UNLV to his current shop at OU. Which is why he shook everyone’s hands after fielding their questions Thursday, then went over and started tossing Osby tennis balls, smiling and encouraging as he rotated from left to right hand during the hand-eye coordination exercise. Five hundred wins? It is a very big deal, and it will be treated as such if OU wins tonight. It’s just you’ll see more of a reaction from the players who contributed than the coach who reached the milestone. “He hasn’t said anything about it. He doesn’t talk about stuff like that. That’s not his personality or demeanor,” Grooms said. “But that a man can coach that long and have the ability to win that many games? Five hundred games? That’s crazy right there.” 50 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Kruger gets 500th win as OU edges Northwestern State By Stephanie Kuzydym The Oklahoman November 30, 2012 NORMAN — There were missed shots, 46 total free throw attempts and piles of players struggling for the ball on the floor. There was a stop of play right after tip due to the official getting smacked in the chin. There were dunks and alley-oops, shouting and a technical. It was an ugly, messy, physical basketball game, but in the end there was victory. Near midcourt, the Oklahoma players raised their pointer fingers while surrounding their successful coach. On Friday night, in front of an estimated 3,420 fans, the Sooners beat Northwestern State (La.) 69-65. The victory was No. 500 for a Lon Kruger-coached team. “In true Oklahoma style, you hung half a thousand on them,” Oklahoma athletic director Joe Castiglione said in a postgame ceremony for Kruger’s historical victory. “We’re glad you did it right here in Oklahoma, and we hope you have many, many more in the crimson and cream.” This victory, however, was one Kruger said was hard for his team to grasp. “Lot of big plays there late that allowed us to sneak out with a win,” the second-year OU coach said. The game was OU’s fifth in eight days, and although Kruger credited Northwestern State for a physical game, senior Steven Pledger sat shaking his head up and down when asked if the ugly win came because of a tired team. The Sooners finished the game 22 of 56 from the floor and 5 of 12 from 3-point range. Oklahoma struggled in the first half. Starters Amath M’Baye and Romero Osby combined for eight missed shots. Pledger missed a three. Tyler Neal missed a three. Pledger stole the ball and nothing came from it. There was missed opportunity after missed opportunity. And the whistle blew often for fouls. The Sooners went into the locker room at halftime down by three. “Just not moving the ball like we really want to,” Pledger said of the struggles. “It looks real smooth in practice, but when we get in games, it hasn’t come out the way we practiced.” The second half started much of the same way. Pledger started the half with a 3-pointer. But on OU’s next attempt, two Northwestern State players lay in a tangled mess after trying for a rebound — and the Sooners still failed to score. The game continued to have an edge, and with about 51/2 minutes left, Osby was pushed to the floor as a Northwestern State player went up for shot. Osby thought it was a charge, but the referee called the Sooner for a foul. While sitting on the flour, Osby began to shout and threw his hand in the air. He was called for a technical. OU trailed by six points but worked its way back. With 2:05 remaining, freshman Je’lon Hornbreak hit a 3 from the left side to give the Sooners a one-point lead. “Usually that’s the way it’s been going,” Pledger said about the late-game boost. “It’s been every other game, me or Je’lon ... Je’lon hit this last one. It’s just those shots during the game that sparks something that we’re winning games off of.” As the game’s final minute began to tick off, Pledger put up an alley oop, which M’Baye finished from the right side of the hoop. When the final seconds faded from the clock, Kruger stood just beyond the bench with his arms spread. “It’s an honor to help coach get his 500th win,” Osby said, “and a testament to how hard he’s worked.” 51 2012-13 OKLAHOMA MEN’S BASKETBALL Kruger wants Sooners to be more physical By John Shinn Norman Transcript December 6, 2012 NORMAN —College.” 52 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Isaiah Cousins brings New York toughness to Sooners By Stephanie Kuzydym The Oklahoman December 12, 2012. Oklahoma’s freshman guard explained that street ball in New York is totally different from the college game. In Harlem, they play with NBA rules. “In college, you can just sag in the paint,” Cousins said. “In street ball, you can’t sag in the paint. It’s just one-on-one. So you can just kill your man in the corner. Give him 30 all night.” Senior forward Romero Osby watches Cousins bring his streetball toughness to practice daily. Although the starting guard is young, Osby can see that he can play and lead the team by taking the ball down the court after most possessions. “Guys from New York City are edgy,” Osby said. “They always talk a lot of cash money or as we call or it trash. “He’s tough. He brings an edge. He can get to the basket and make plays that he wants and can really handle the ball for his size.” That toughness and edge can lead to a player being aggressive. OU coach Lon Kruger said the coaches have talked with Cousins about being a bit more aggressive — like he would if he were playing street ball. “We also want him to attack and be more aggressive because he’s one of the guys we have that can do that,” Kruger said. “And I think we’ll see him do that as the year unfolds — to be more aggressive, more intuitive.” Besides his New York background, Cousins is a quiet kid. He didn’t even talk to freshmen Buddy Hield or Je’lon Hornbeak when they all came to Oklahoma. “He’s just quiet,” Hornbeak said. “He wanted to know he could trust us. I don’t blame him, being from New York.” The three freshmen love to listen to music together, especially reggae. Cousins is also known a bit on the team for his dance moves. “Yeah I can dance a little,” he said after a video appeared of him busting moves at the Old Spice Classic surrounded by the other seven teams of the tournament. What else? “Are you serious? What am I supposed to tell you?” Cousins said. “I’m tall, light-skinned and handsome. 6-foot-3, smooth dude, know what I mean?” He’s definitely got that New York swag. 53 2012-13 OKLAHOMA MEN’S BASKETBALL Clark provides much-needed spark for Sooners’ win vs. Aggies By John Shinn Norman Transcript December 15, 2012 6454.” 54 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Clark at ‘four’ a new wrinkle By John Shinn Norman Transcript December 17, 2012. 55 2012-13 OKLAHOMA MEN’S BASKETBALL Sooners dominate in first game at OU Field House since 1975 By Clay Horning Norman Transcript December 31, 2012 NORMAN — Oklahoma scored 30 points before the first half was half over, at times threatened to double up Monday’s challenger, Texas A&M-Corpus Christi, and even inserted crowd favorite James Fraschilla 3:56 before its 72-42 victory was complete. On the face of it, it was everything the Sooners could have wanted on throwback day at Howard McCasland Field House, where the program won its first regular season game since March 5, 1975 (an 84-79 decision over Iowa State). The only downside was OU might have gone for a little more. Scoring 30 in the first 10 minutes meant the Sooners scored just 42 the game’s last half hour. Those first 10 minutes also included six 3-pointers from five different players — Steven Pledger (2), Buddy Hield, Cam Clark, Je’lon Hornbeak, Isaiah Cousins — yet only three more the rest of the game. And after a hot start, OU shot just 40.7 percent (24 of 59) overall. Sooner coach Lon Kruger chose door No. 1. “It was good to finish non-conference play with not only a win, but a game where we had a lot of guys who stepped up and played well and made shots and moved the ball well,” he said. “We had good activity on the floor and now we have a few days in preparation for the Big 12 opener.” OU moved to 9-3, while the Islanders fell to 1-10. The Sooners open conference play Saturday at West Virginia. The players were with their coach. “I’m just glad we got the win in the way we got it,” Pledger said. “We kept our foot down the way we were supposed to and did things we talk about day in and day out.” Pledger led with 17 points, following a fine second half two days earlier against Ohio with 5-of-10 accuracy from beyond the 3-point arc against the Islanders. Amath M’Baye finished with 14 points and six rebounds. Andrew Fitzgerald came off the bench to add nine points. That it happened in the venerable old arena, normally the home to Sooner wrestling and volleyball, made it a nice change of pace. “I think it is a lot of fun, M’Baye said. “We do it for the fans and, apparently, they like it, too … It’s always fun to come back and play here.” Throwback day included scoreboard replays in black and white and fedoras worn along the scorer’s table. Even the security detail went with dark suits. Throwback or not, it was no fun for the Islanders. Led by Oklahoma City native Joy Williamson’s 14 points, TAMU-CC was down by 10 points 6:26 into the game, by 20 1:17 before the half and by 30 for the first time with 6:34 remaining. OU’s best moments were very early. By getting points on 7 of 9 and 11 of 14 possessions to begin the game, the Sooners set a fantastic pace. When Hornbeak knocked down his 3-pointer, the lead was 27-10. OU was running, gunning and converting. “It’s definitely something we have been working on … We were doing what we’re supposed to be doing, and that is getting out and running,” M’Baye said. “The wings are running the floor and the bigs are running the floor, so we had some breakaway opportunities.” A difficult pace to maintain, sure, but the Sooners got what they wanted. “There were a lot of good shots,” Kruger said. Plenty enough to win big. 56 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Sooners believe they’re ready for Big 12 By John Shinn Norman Transcript January 5, 2013 NORMAN —.” 57 2012-13 OKLAHOMA MEN’S BASKETBALL Attitude makes Buddy spark for Sooners By John Shinn Norman Transcript January 9, 2013 NORMAN —.” 58. 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 OU basketball: midseason review By Guerin Emig Tulsa World January 9, 2013 10-3 overall, 1-0 Big 12 Outlook The Sooners have several things going for them. They have reliable depth for the first time in five years, so they shouldn’t fade in February. They have some confidence after bagging an out-of-the-gate Big 12 road win at West Virginia. And they get to play TCU and Texas Tech twice. Signature win West Virginia isn’t very good right now, so it’s not like the Sooners can frame their NCAA resume around Saturday’s 67-57 win in Morgantown. Still, it came on the road, and it came after OU trailed by 12 in the second half. The Sooners showed some resolve and fight, two things they have been without since Blake Griffin left. Worst loss It’s probably the 56-55 setback to Stephen F. Austin on Dec. 18. The Sooners couldn’t make shots, couldn’t impose their physical advantage and seemed embarrassed afterward. You can also make a case for OU’s 81-78 loss at Arkansas on Dec. 4. Winning in Fayetteville, even when the Razorbacks are down, gets the NCAA selection committee’s attention. Star performer Forward Romero Osby leads the Sooners in points, rebounds, blocked shots and field goal percentage. He has made 31 straight free throws. He has been OU’s most consistent player by a wide margin, and he has provided the most senior leadership. Without Osby - OU lost to Stephen F. Austin because of his foul trouble the Sooners are hurting. Biggest surprise The elements are in place for the Sooners to score. Their depth should force a fast pace. Their defense should force turnovers and easy transition baskets. Shooters Steven Pledger and Andrew Fitzgerald are around. So are athletic finishers Cameron Clark, Amath M’Baye and Buddy Hield. So how is OU eighth in the Big 12 in scoring? Toughest remaining game Any remaining game on the road, with the exception of Texas Tech on Feb. 20 and TCU on March 9. The Sooners aren’t winning at Kansas. What they must do, besides win at Tech and TCU, is find a way to go 3-2 or 2-3 in games at Kansas State, Baylor, Iowa State, OSU and Texas. OU will make the NCAA Tournament if ... Pledger starts making shots more consistently, and Lon Kruger finds one more source of outside shooting. ... M’Baye and Clark play to their potential more often. ... Freshmen Hield, Je’lon Hornbeak and Isaiah Cousins continue finding ways to contribute. ... The team hovers around .500 in conference play. 59 2012-13 OKLAHOMA MEN’S BASKETBALL OU’s Romero Osby feeling right at home in Norman By Guerin Emig Tulsa World January 12, 2013 NORMAN - Mississippi remains Romero Osby’s first home. He’ll tell you about its Southern hospitality, easy pace and the fact that “you don’t have to worry about gun shots, unless it’s somebody back off in the woods shooting at a deer.” He wouldn’t mind returning someday. Right now, though, there are matters to attend to at Oklahoma. He is the leading scorer and rebounder on a 10-3 OU team which hosts 11-3 Oklahoma State at 2 p.m. Saturday. It is the most important game of the Sooners’ season to date, and he is their most important player. Not just because he averages 13 points and 6.5 rebounds, and leads his team in blocked shots and charges taken, and has made his last 31 free throws. “ ‘Ro’ has been terrific from day one in terms of his body language, his message to everyone else, his attitude, his focus. He’s an ideal team guy,” OU coach Lon Kruger said. “He’s a coach’s dream.” Osby is glad to oblige. He’s true to his Mississippi roots that way. Besides, it honors his second home. “He loves Oklahoma,” Daryl Osby, Romero’s father said from Meridian, Miss., where he teaches and coaches high school and junior high basketball. “The people are very friendly. It’s kind of like Meridian. Everybody speaks to you and waves at you when they see you. You can go some places and people are always in some hustle and bustle. Not there. Not here, either. He always talks about how much he loves it.” The only thing Osby knew about Norman before he visited three years ago was that he’d be in for a surprise. Jeff Capel, OU’s coach at the time, told him so. “Coach Capel said he had interviewed in Atlanta, not Norman, so when he got here he thought it would be different,” Osby recalled. “He was right. I thought it would be like Starkville (Mississippi State’s home), more of a country town. But Norman is a city. It’s nice. It’s still flat land like Mississippi. But there are great people, very versatile people. It still has that Southern hospitality, but it’s mixed with Midwest culture.” Osby was on the market at the time because things hadn’t worked out at Mississippi State. He had been a two-year reserve for the Bulldogs. It wasn’t exactly what he envisioned after choosing the comforts of home (Starkville is 75 miles from Meridian) over offers from programs like Kansas, Louisville and Tennessee coming out of high school. “You feel like you have an opportunity to walk in and start as a freshman, and it’s a disappointment when in your mind you feel like coaches told you one thing and it was different,” Daryl Osby said. “Romero wasn’t very happy. By the middle of his sophomore year, he started saying, ‘I don’t know if I want to stay here.’ “I said, ‘OK, let’s finish the season and then weigh our options. If you still feel that way, we can move on from there.’ “ Osby had OU in the back of his mind since Capel recruited him out of Meridian’s North Lauderdale High. “I had a good relationship with Coach Capel, and with Rod Barnes, who used to be an assistant here and was once head coach at Ole Miss,” Osby said. “When I decided to transfer, South Florida and VCU were high on me. But I was sold on Coach Capel.” “I’ve always known their history,” Daryl Osby said. “I remember Mookie Blaylock going to the national championship against ‘Danny and the Miracles.’ I knew they went to the Final Four in 2002, and lost to Carmelo Anthony in the Elite Eight. I’ve been watching basketball since I was young, so I knew about their tradition. I remembered Wayman Tisdale and Billy Tubbs and all those teams.” The coach and program were slam dunks. All Osby needed was reassurance about leaving his comfort zone. Complicating matters was a relationship with his girlfriend since high school. They’d been soul mates since grade school. They had a baby girl Osby’s sophomore year at Mississippi State. All Osby could do was visit OU. “I just fell in love,” he said. “The whole aura of this place was great.” There were rough patches. Osby’s girlfriend-turned-fiancée and daughter stayed in Mississippi. He stayed on the bench his first season at OU per NCAA transfer rules. Then Capel was fired. Osby was too attached to the program to do anything but give the new coach a chance, however. It worked out fine. “Me and Alex Brown, our trainer, just talked about this,” Osby said. “The best thing that ever could have happened for me was Coach Kruger. And he really kind of has been, because he has helped me develop into more of a man.” So has a reunion with his family. His fiancée became Shalonda Osby last May. She has relocated to Oklahoma along with their daughter, Saniya. “Even though Romero was able to talk to his wife and child, he was always worried about the baby,” Daryl Osby said. “I see a calmness over him now. Now he has his family with him. Now he can go home and hash out if practice wasn’t good that day, or any other problems. He can watch his child grow up, see her every day. It makes a big difference.” This week, when Osby was asked about the Bedlam game, he rattled off names and numbers like someone who grew up around Bedlam. Like a home-state player. It is, in a sense, what he has become. “I wouldn’t mind having a house back home. It’s so laid back and chill out in the country,” Osby said. “But I’ll always come back to Norman, and it will always feel like home as well.” 60 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Sooners headed in right direction By John Shinn The Norman Transcript January 14,5 from 3-point range. Freshman guard Je’lon Hornbeak was 2-for2. 61 2012-13 OKLAHOMA MEN’S BASKETBALL OU’s Buddy Hield won’t back down from challenge RJ Young SoonerScoop.com January 18, 2013 NORMAN, Okla. — Blake Griffin wanted a challenge. He wanted Amath M’Baye to try to block his shot, someone similar in size, stature. M’Baye said no. “I got too much pride for that,” he said. Understandable. Griffin leaps tall men in a single bound. He’s made many a poster out of unwilling accomplices in game-time and playground situations. Nobody wanted any part of the best basketball player Oklahoma has ever produced that day, a 6-foot-10, 250-pound NBA All-Star. Nobody except Buddy Hield. Hield volunteered to step underneath the basket and leap with the 2011 NBA Slam Dunk Contest Champion. “That’s a freshman mistake,” M’Baye said. Griffin accepted Hield’s challenge and took his position at the baseline. Players and staff surrounded the north basket with camera phones at the ready. He dribbled four times and launched into the air with two steps. With the ball squeezed in the palm of his right hand, Griffin engaged Hield. Hield dodged the onslaught to come after figuring out, midflight, he had no chance. He shifted his body around Griffin and landed with a loud laugh. “He just climbed a monster that day and lost,” Sam Grooms said. “I didn’t think he had a chance anyway. I thought it was over with when he first tried to stand underneath the basket and challenge him. I don’t understand why he even tried that.” Kyle Lindsted does. It’s the reason he left the country to recruit Hield to play for him at Sunrise Christian Academy in Wichita, Kan. A TRIP DOWN SOUTH Chavano Rainier “Buddy” Hield was a sophomore in high school when Lindsted first saw him at a showcase for young ball players in Freeport, Bahamas. Hield was a skinny 6-foot-1 kid then, but he had a pure stroke, brilliant scoring sense and a nose for the basket, even in middle school. Hield didn’t play basketball seriously until seventh grade. Before basketball became a focal point in his life, he was a track and field athlete, specializing in the middle distances, until he learned he was good at this basketball thing. “The first year I played I started on a JV (high school) team,” Hield said. “People were like, ‘Seventh grade and you starting on a JV team? You probably be good, you know?’” That’s what Lindsted thought, too. He regularly takes business trips to Freeport to look for the type of ball players who fit his program. Hield was one such player but not for plain reasons at the time. It wasn’t Hield’s athleticism and ability to score that attracted Lindsted to him. By Lindsted’s account, Hield wasn’t one of the more skilled basketball players at the showcase. The trait he was most enamored with was Hield’s energy, his magnetic presence. Where Hield walked, the masses followed. “Wherever he was in the gym, there was always a crowd of people around him,” Lindsted said. “He was always making them laugh. It was his personality and all the little intangible things that he did.” Not long after the showcase, Lindsted asked Hield if he’d be interested in attending Sunrise Christian. Normally, this kind of exchange -- a recruiting pitch -- is laced with promises and flattery. Lindsted said it wasn’t like that at all between Hield and him. There was a relationship between them that usually takes coaches months, if not years, to establish with players. “We had a conversation, and it was like we’d known each other our whole entire life,” Lindsted said. “That’s just how flawless it was between Buddy and I.” Hield’s mother sent him away with simple and powerful advice, advice he’s held onto through his first season as a Sooner. “She always said read the Bible,” Hield said. “Never lose your faith, and never forget where you come from.” BUDDY BUCKETS By the time Hield stepped on campus at Sunrise Christian, he’d grown to 6-foot-3 and gained 30 pounds without losing any of his quickness or agility. Couple Hield’s physical maturation with his constant desire to shoot in the gym, along with an abundance of energy, and his scoring averaging of 22.7 points in 21 minutes as a prep senior isn’t tough to believe. It also isn’t tough to believe Lindsted had a hard time slowing him down. So hard, in fact, Lindsted had to be conscious of just how much time Hield spent in the gym. “He’s the kind of kid that we would go hard for three or four hours in the gym, and he would spend two more hours just getting up shots and working on his game,” Lindsted said. “He’s almost a kid you’d have to lock out of the gym to get him to rest at all.” That’s the kind of drive it takes to become a Rivals top 100 recruit. That’s the kind of work ethic that allowed Hield to lead Sunrise Christian to a National Association of Christian Athletes national title as a junior and 24-4 record. That’s the kind of discipline that receives recruiting attention from Colorado. From Kansas. From Oklahoma.? “We chose OU because we knew Buddy was different,” Lindsted said. “We knew Lon [Kruger] would let him go up and down the floor, and I also knew that it was going to be tough on Buddy. There would be transition period that he’s going through right now.” If Hield becomes the kind of player many in and around the program believe he can be, it’ll be because he displayed the same confidence that caused him to call out Blake Griffin. Believe that. “I’m not afraid of anybody,” Hield said. 62 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Sooners’ Osby leads by example By John Shinn The Norman Transcript January 23, 2013 NORMAN — Even after playing 31 grueling minutes Monday night, Oklahoma forward Romero Osby ran down to the freethrow line after being fouled. It wasn’t the two foul shots he eventually made to cap his 29-point effort against Texas that caused him to hurry. He wanted to be. 63 2012-13 OKLAHOMA MEN’S BASKETBALL Je’lon Hornbeak maintains family ties By Stephanie Kuzydym The Oklahoman January 29, 2013 NORMAN — Right after Oklahoma’s loss to Kansas on Saturday, Sooner freshman Je’lon Hornbeak received a message from Isaiah Austin, Baylor’s standout freshman center. . “There were days he destroyed me,” Hornbeak said, “and games I beat him. You really got to work on your shot and create space (to shoot over him). Sometimes he takes me to the post and I just have to foul him.” Hornbeak said the all-time series between the two is “probably even, but it’s probably in his favor. I’ll give it to him.” The two talked about going to the same college, but they always said that they would do what was best for each other. Once Austin told Hornbeak he was going to Baylor, Hornbeak almost joined him, but concluded Baylor wasn’t for him. The two keep in contact every day through a group text message with two other high school friends. “(Isaiah) just sends me some crazy picture he finds on the Internet,” Hornbeak said. “We all just laugh about it.” Wednesday night will just add one more game to the list in which Hornbeak and Austin will try to outdo each other, but no matter the outcome — they’ll tell their brother to “get the next one.” “We always told each other no matter where we go we’ll still be brothers and family,” Hornbeak said. “Because it doesn’t matter the distance — family is always family.” 64 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Sooners can see unlimited potential in junior M’Baye By John Shinn The Norman Transcript January 30, 2013.” 65 2012-13 OKLAHOMA MEN’S BASKETBALL M’Baye, Pledger set tone for Sooners’ big victory over Bears By John Shinn The Norman Transcript January 31, 2013 the. 66 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Lon Kruger’s winning formula is working at Oklahoma By Stephanie Kuzydym The Oklahoman February 1, 2013 NORMAN — As the final shot went up in the OU-Baylor game, Bears coach Scott Drew bounced around like a kangaroo on the sideline before falling to his Texas. Watch him during a game after a possession with a mistake. Sometimes Kruger furrows his brow and his forehead creases. Sometimes he slightly sticks out his lower jaw. Rarely, he’ll shout. That’s as far as it goes. During Oklahoma’s practice, Kruger, usually dressed in a pair of red sweatpants, will quicken his stride when he means business but as soon as he reaches his group of players, he’s back to clapping his hands and saying something stern with a sense of encouragement and always a load of knowledge. “The guys around him feel comfortable,” said Jeff Guin, a former basketball manager for Kruger at Florida and who later joined Kruger’s Illinois staff. “Some coaches when they coach, you can tell the kids are tense and they’re worried about making mistakes. He just gets them to go out and play. At the same time, it’s not that the kids are looking over the shoulder on what to do next. Coach has already taught them what to do.” Kruger’s ability to rebuild comes from more than just the team accepting him. He also accepts the team. D.J. Allen, a communications director at UNLV, said Kruger looked at what players he has, what strengths they provided and determined the positions he could put them in to be successful. Allen was so amazed at Kruger’s ability to rebuild, he wrote a book with him about it. Kruger took Florida from being ecstatic about making it to the NIT all the way to the program’s first Final Four. He set Illinois on a steady course for success. He turned UNLV from being an NIT team to an NCAA Sweet Sixteen team. Koss said: “A lot of people tend to focus on weaknesses and say, ‘Well you know, this person has this shortcoming and that shortcoming.’ I don’t think Lon sees shortcomings.” *** Kruger smiled as he watched his team run a play during a recent practice. That’s how Kruger looks most of practice. At the end of the practice, he chatted with fans who had made their way to watch the Sooners practice. In a day of reduced access and availability, Kruger and his team are available for all to watch. He gathers with his team at the end of practice as they say a prayer, watches them shake hands with fans and then follows. Kruger thanks people for coming, diverting attention from himself. “Need anything?” he says. “He’s the same guy, I’m telling you,” Koss said of the coach. “Lon Kruger hasn’t changed one iota. He’s the same grounded, downto-earth, interested in others, only sees the positive things guy. I’m older than Lon and I’d still like to grow up and be like Lon.” 67 2012-13 OKLAHOMA MEN’S BASKETBALL OU gets a win worth celebrating in downing No. 5 Kansas By Guerin Emig Tulsa World February 9, 2013 NORMAN — When the Lloyd Noble Center horn sounded, Oklahoma freshman Buddy Hield was jumping up and down at midcourt, staring at all of those Kansas seniors and laughing. Pretty soon, Hield was riding around the court on someone’s shoulders in the mass of OU’s first court-rush since ... Since when exactly? Near as anyone could remember, since Feb. 20, 1995, the Big Monday night the Sooners beat No. 1 Kansas in Kelvin Sampson’s first year on the job. Here, 18 years later, OU had beaten Kansas again. This time the No. 5 Jayhawks went down 72-66. How it happened was, in a way, even more stunning. Back in ‘95, it took an Ernie Abercrombie 3-pointer in the final minute for OU to pull ahead and win. Saturday afternoon in front of 10,503 fans, the Sooners took a lead on Isaiah Cousins’ 3 with 14:27 left in the first half, and they never gave it up. “Give OU credit,” Bill Self said. “They controlled the game, basically, from the start.” Self didn’t dump on his team like he did after last week’s losses to Oklahoma State and TCU. He couldn’t. The Sooners (15-7, 6-4) were just better was all, and it saw to their first win over Kansas since 2005 after 10 straight defeats. “I’m not leaving disgusted with my team at all,” Self said in the midst of KU’s first three-game losing streak since ‘05. “We actually played better today. We just played a good team. They shot the heck out of the basketball.” Romero Osby, who went 4-of-16 in OU’s 67-54 loss at Kansas Jan. 26, made 6-of-8 for a game-high 17 points. He got the better of KU center Jeff Withey. Cameron Clark made 4-of-7 and scored 10 points. That helped OU’s bench outscore KU’s 23-11. Steven Pledger wasn’t always hot, but he made a 3 from the right wing after Osby’s offensive rebound with four minutes left. That kept the Sooners ahead 63-59. “I want those shots,” said Pledger, who finished 6-of-14 en route to 15 points. “I have more confidence to hit those than at any point in the game.” How about Je’lon Hornbeak’s confidence? OU’s freshman guard had missed his only shot until taking Osby’s feed on the right wing with 1:29 to play. “I got it, sized it up and saw I had of space,” Hornbeak said. “So I took it.” He buried it, and the Sooners led 66-61. Hornbeak followed that by making 3-of-4 free throws in the final 30 seconds to keep Kansas at bay. He finished what another OU freshman started - Cousins getting his first start since midDecember and responding with five points, a rebound and an assist in the first 5 1/2 minutes as OU jumped in front. “We had a lot of energy from the get-go,” said Osby, who added a team-high eight rebounds. “Shootaround was real active. The guys were all anxious to get out there and play.” It’s not that the Jayhawks were flat coming off their shocking loss at TCU. OU was simply more energized. It’s not that a Kansas lineup including four seniors played poorly. It’s just that OU’s group, including starting freshmen Cousins and Hield and reserve Hornbeak, were better. They made bigger shots, more free throws. They shared the ball better and came up with one more steal. “It’s great,” OU coach Lon Kruger said. “A lot of people feel good about their contributions.” It was a complete, deserved victory that left no less a player than KU senior point guard Elijah Johnson insisting his team took a step forward despite losing. “We looked different tonight than we did at TCU, and different than at the end of Oklahoma State,” he said. The Sooners enjoyed themselves Saturday, for the two hours during the game and the 10 minutes after when they were swept up by court-rushers. The fans had been taken on quite a ride, so they returned the favor to players like Hield. “I see that on TV all the time,” Pledger said. “I always wished we could get something like that to happen.” Saturday, after 18 years, it finally did. 68 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Playing without Hield By John Shinn The Norman Transcript February 13, 2013 NORMAN — Oklahoma coach Lon Kruger said freshman guard Buddy Hield underwent successful surgery on his broken right foot Tuesday morning. Hield is expected to miss at least the next four weeks while mending. However, losing a starter to injury isn’t something the Sooners have dealt with the last two seasons. Until Hield suffered a broken foot in Monday night’s 75-48 victory over TCU, the only OU player to miss a game this season due to injury was backup point guard Sam Grooms. He missed the Stephen F. Austin game on Dec. 18 with a concussion. No player missed a game due to injury last season. The Sooners (16-7, 7-4 Big 12) will be without Hield for at least the final seven regular-season games. His energetic presence will be missed on both ends of the court. Hield is the team’s leader in minutes played at 26.5 per game. One way OU appears equipped to handle the extended absence of a starter is Kruger hasn’t over extended any of his players this season. He’s used his bench liberally this season. “I think we have 10 guys who can get results, so it’s not just for that reason,” Kruger said Tuesday. “When you do have the luxury of doing that it does help with foul trouble or injury. We’re fortunate enough to have the quality of depth — not just depth — that we do have that can come in and make a difference.” The victory over TCU was another game where that was the case. The Sooners’ bench scored 34 points. Andrew Fitzgerald and Je’lon Hornbeak both scored nine while Tyler Neal and Cameron Clark both finished with eight. Because of the deep contributions, the performance against the Horned Frogs was one of OU’s best of the season. Winning wasn’t a surprise, but OU showed no signs of the expected letdown after beating Kansas on Saturday “I thought it was. Everyone was together and into the game,” Fitzgerald said. “A lot of teams do get sidetracked after they win a big game against a team like Kansas. We came out with a lot of energy and that energy won the game for us.” Obviously, with Hield out one of those four, most likely Hornbeak, will turn into a starter. But all will need to make greater contributions. Kruger has a lot of options with how he’ll replace Hield in the lineup. Hornbeak has responded well in the last two games since being moved from the point guard spot to the wing. Clark has been incredibly productive as well. After Monday night’s 4-for-7 performance, he’s shooting 53 percent in conference play. A lot will depend on the opponent. The Sooners face No. 17 Oklahoma State (17-5, 7-3) at 12:30 p.m., Saturday at GallagherIba Arena in Stillwater. It will be OU’s first game since the loss of Hield. Bedlam should give a strong indication how it will handle his absence. “Buddy is a player who brings a lot of energy and it’s hard to see him get hurt like that,” Clark said. “We have some guys on this who can step up.” 69 2012-13 OKLAHOMA MEN’S BASKETBALL Pair of OU freshmen must compensate for Hield’s absence By Guerin Emig Tulsa World February 16, 2013 NORMAN — Buddy Hield leaned over his crutches the other day, his injured right foot in a cast and boot, and playfully referred to the Oklahoma staff’s nickname for their three freshman guards. “It’s not ‘Three the Hard Way’ anymore,” Hield said. “It’s ‘Two the Hard Way.’” Hield is done for the rest of the regular season at least, due to a broken bone sustained during OU’s victory over TCU last Monday. No Sooner has played more minutes, made more steals or been more reliable from the free-throw line. Hield is among OU’s top three in 3-pointers, rebounds and assists. He leaves a sizable void. Fellow freshmen Je’lon Hornbeak and Isaiah Cousins must help fill it beginning Saturday in Bedlam at Oklahoma State. You have to contain Marcus Smart to contain the Cowboys. Hield would have led that charge. “He’s been the guy meeting the ball for us on top. He gives us good activity there,” said Lon Kruger, whose Sooners enter Stillwater tied for second in the Big 12 Conference, one game behind Kansas, OSU and Kansas State. “He’s long, rangy and tireless. He stays after it. We’ll miss that.” Who gets first crack at Smart on Saturday? “Buddy normally picked up the ball. Now I’m going to,” Hornbeak said. “It’ll be pretty much me and (Smart) going up and down the court.” Expect the spindly-armed Cousins to help with that. “If that’s what Coach Kruger wants,” he said. “I don’t care. I’ll play on the ball. I’m ready for that challenge.” Cousins and Hornbeak are in better position to meet the challenge of playing in Gallagher-Iba Arena, as well as replacing Hield, than they were just a couple weeks ago. Cousins has shot 50 percent, raising his season percentage to 29, while averaging eight points over his last three games. He is finally playing with confidence, something Hield has never had trouble doing. Hornbeak is also shooting and scoring better. He has made 12 of his last 26 3s. He averaged eight points in back-to-back wins over Kansas and TCU last week. Hield averaged 8.6 points. It’s not like he was going to get 30 anytime soon. But his offense came in momentum-building spurts, and was often created by his defense. “He’ll come up with a turnover, steal the ball, make a layup, make a pass, make a play. That’s Buddy,” Hornbeak said. “He makes plays quick, quick, quick. That’s the big thing we’re going to miss.” Among other big things. “Defense... The energy that he brings... Rebounding from a guard’s standpoint,” Cousins said. “And hitting big buckets at crucial times.” It is a lot to make up for. “Two the Hard Way” indeed. “I talked to them. I said, ‘Y’all need to pick it up.’ Je’lon and Isaiah are gonna play hard,” Hield said. “They’ll do what it takes to get through this.” 70 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Bedlam defeat still hurts, but taken in stride By John Shinn The Norman Transcript February 18, 2013high. 71 “I think we did a lot of things to help us grow in the future,” Grooms said. “That’s what we’re looking forward to. It’s difficult walking out of here because we wanted to get this win.” 2012-13 OKLAHOMA MEN’S BASKETBALL Sooners lean on upperclassmen during crucial stretch By John Shinn The Norman Transcript February 22, 2013 NORMAN — Oklahoma can take a lot of positives away from Wednesday night’s 86-71 victory over Texas Tech. It shot the ballclass.” 72 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 OU making best of foul-heavy games By John Shinn The Norman Transcript February 26, 2013 NORMAN — It is hard to get a rhythm going when the game stops every 45 seconds for a foul, but that’s been the average in Oklahoma’s last two games. Last Wednesday’s game at Texas Tech included 43 fouls. Saturday’s game against Baylor had 57. Some of that was the Bears fouling to stop the clock, but, still, 100 fouls in two games seems excessive. “Officials are in a no-win situation,” OU coach Lon Kruger said. “Everyone is talking about defenses grabbing and holding, and clearly that’s happening. But if officials call all those fouls everyone is upset because everyone is in foul trouble. “I think it will be a major topic this spring and summer about whether we want officials to call the rule book or to be subjective and be different game-to-game-to-game.” The average number of fouls in an OU game this season has been 34.24. In truth, the current fouls per game has declined slightly from the 34.77 in OU’s games last season. There were 35.9 per game in the 2010-11 season. The average was 34.35 in 2009-10. In 2008-09, which was Blake Griffin’s last season as a Sooner, the average was 38.5 per game. One of the major complaints about college basketball is the lack of scoring. That hasn’t been the Sooners’ problem the last two games. They set season highs for points against the Red Raiders (86) and against the Bears (90). Kruger is part of the overwhelming majority of coaches who would like to see the rule book enforced. It would cut down on the grabbing and pulling that goes on in most games and allow for more movement on offense. “The NBA had this problem a few years ago,” Kruger said. “Scoring was going down, so they said, OK, no more. Offensive guys get to move, and the game became very popular again. It can be done.” Different Texas: The Sooners face Texas at 8 p.m. Wednesday in Austin. Even though OU won the first meeting, 73-67, in Norman. Texas has gone through some changes since. Sophomore point guard Myck Kabongo has returned to the lineup after a 23-game NCAA-mandated suspension. “They’re considerably different because they’ve added a top, elite player,” Kruger said of the Longhorns. “(Kabongo) does a lot of things offensively, but he’s also very active and very quick defensively. It’s not just his points. He creates, he gets in the lane, he pushes tempo. He does a lot of good things for them.” No medical boot for Hield: Freshman guard Buddy Hield is still is not practicing with the team, but he was shooting flat-footed shots at Monday’s practice and he was no longer wearing a medical boot on his right foot. “He’s more active every day,” Kruger said. “He’s making good progress from what (OU trainer Alex Brown) says. I don’t know what it means in terms of number of days, but Buddy is certainly on schedule. He’s working as hard as he can work at it. He wants to get back.” Hield has missed the last three games since breaking a bone in his right foot on Feb. 11 against TCU. The original prognosis was for him to miss four-to-six weeks. Long night: OU guard Je’lon Hornbeak wore a big smile. He chipped his two front teeth in Saturday’s win over Baylor and he had to go see a dentist about an hour after the game ended. The procedure lasted about 90 minutes and included two root canals. “It was worth it,” Hornbeak said. “… It came out nice.” Hornbeak said the most painful part of the night was the shot of Procaine he received before the surgery. “The numbness stuff, they hit me up right on the nerves,” he said. “That stuff hurt; I’m not gonna lie.” 73 2012-13 OKLAHOMA MEN’S BASKETBALL Sooners can’t muster overtime win after late collapse at Texas By John Shinn The Norman Transcript February 27, 2013 AUSTIN, Texas — For 32 minutes, Oklahoma dominated Texas. The last eight minutes and overtime, however, turned a potential blowout into a 92-86 debilitating loss to the Longhorns. Romero Osby scored 31 points and Steven Pledger scored 18 to lead the Sooners. Both, however, were upstaged by Texas guard Myck Kabongo. The Longhorns’ point guard scored 31 points, including an off-balance prayer with the clock winding down in regulation that sent the game to overtime. The Sooners (18-9, 9-6 Big 12) never recovered. They were in shock after blowing a 22-point lead with a 7:54 to play. At that point, a small crowd at the Erwin Center had already started filing out. Most had no intreats in watching OU snap a six-game losing streak to the Longhorns in Austin. It was an alley-oop dunk from Amath M’Baye, who scored 16 points, that gave OU its largest lead of the game. The junior forward flashed the “’Horns Down” sign as he trotted back down the floor. Texas (13-15, 5-10) launched a 32-10 run after it. OU lost despite shooting 50.9 percent (29-for-57) and 9 for 18 from 3-point range. However, the hot shooting was from the first 32 minutes. After M’Baye’s dunk, OU made just three more shots the rest of the game. Its composure disappeared. It committed five turnovers in a three-minute span that quickly allowed Texas to get back in the game. Osby got in M’Baye’s face after the taunt. “I wasn’t trying to get on him, because he’s a grown-up. I was just telling him, ‘Let’s win with class,’” Osby said. “We were up by 20 at the time. I just didn’t want karma to kinda come back on us over something like that.” Osby’s fear became reality. OU was 3 for 15 from the field after M’Baye’s dunk and committed five turnovers. Neither Kabongo or Texas’ Ioannis Pappetrou or Sheldon McClellan claimed to see the gesture, but the game obviously changed. The Sooners finished with 16 turnovers. The Longhorns turned those into 26 points. “We didn’t take care of the ball and you have to credit them,” OU point guard Sam Grooms said. “They went to the full-court press and were active. They got their hands on some balls and got some steals. It led to scoring opportunities for them and gave them momentum.” Kabongo, who didn’t play in the Sooners’ 73-67 victory Jan. 21 over the Longhorns at Lloyd Noble Center, only had three points in the first half. He scored 28 in the final 25 minutes, including eight in overtime. McClellan added 18 and was a perfect 13-for13 from the free-throw line. Three came after a controversial foul on Pledger on a 3-point attempt with nine seconds to go. Osby had a chance to seal the game in regulation, but missed one of two free throws. Kabongo drove the length of the floor and scored in six seconds to send the game into overtime. Osby gave OU a brief lead with 3:10 left in overtime with a dunk, but the Sooners’ never led again. The loss blew a chance for OU to seize fourth place in the Big 12 all by itself. Instead, it’ll face Iowa State on Saturday for that designation. “It’s tough to let this one slip away, we’ve got to regroup,” OU coach Lon Kruger said. “This one is going to hurt for a while, but we have to bounce back.” 74 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Pledger, Fitzgerald have learned lessons the hard way By Stephanie Kuzydym The Oklahoman March 1, 2013 NORMAN — Steven Pledger and Andrew Fitzgerald have gone through it all with Oklahoma basketball. Well, all except March. The two have been roommates since the summer before their freshman year — two teenagers from the East Coast that came halfway across the country to play college basketball. They came in the year after Blake Griffin led the Sooners to an Elite Eight appearance. The two freshmen thought their first year would be one of victories and a Big Dance. Then they went through the firing, the hiring, the losses and the eventual upsets. Now, the two fourthyear Sooners are ready for Senior Day against Iowa State. “It brings us to this moment right now,” Pledger said. “We’re in tournament talk, and we’re used to our coach. It took us a year, but we’re ready.” It all began with a different team, a different head man. In the spring of 2009, when Pledger and Fitzgerald were seniors in high school, they sat as signed recruits watching Griffin take OU to the Elite Eight. They were excited to join then-coach Jeff Capel’s squad. But the next year was nothing like what they saw from their homes in Chesapeake, Va. and Baltimore, Md. Their freshman year ended on a nine-game losing streak. Their sophomore year, they only won 14 games. Capel was like a father-figure to Pledger, but he was fired after the 2010-2011 season. The senior guard said he never would have left his family back in Virginia if he’d known that in Year 2 his coach would be fired. Year 2, though, had gone a lot like Year 1 to Pledger and Fitzgerald. The team felt like one of individuals. It didn’t gel as a unit. Pledger had been so excited for that team, too. “In my first game, I went out and (scored) 21 points,” Pledger said. “As the year went on, a bad first year, and the start of my sophomore year at playing point guard, it was just up and down.” That’s the same way Fitzgerald described the years. “I felt like we could win every game, but being realistic, I knew that we could lose,” Fitzgerald said. “That really hurt me as a player. I still went out there and played as hard as I could. It’s really just hard to think about stuff like that.” The thoughts of tournament titles, March Madness and glory disappeared from their heads. But Fitzgerald and Pledger learned from the losses. Through it all, they learned how to become men and best friends. “Oh, we’ve had our arguments,” Pledger said of their friendship and of being roommates. “The arguments that we had were idiotic arguments.” Their largest came the summer before their junior season, when current Oklahoma coach Lon Kruger was going through his first summer with the team. Pledger and Fitzgerald were always arguing in the gym. Eventually, they solved their differences and took their frustration to the court and unleashed it on their opponents. Although OU only won 15 games during their junior season, Pledger finished with a team-high 16.2 points per game. He made 72 3-pointers. Fitzgerald was the third-highest scorer on the team. He had the second-most rebounds with 154. They learned how to adjust to a new system, a new coaching staff and a new style of teaching. They learned more about each other. “We know more about each other than we probably should,” Pledger said. “Blood couldn’t make us any more closer.” Now, four years later, thoughts of tournaments and Madness in March make them smile. While Pledger said he’ll let others bring up the talks of tournaments, Fitzgerald admitted he and his roommate look at the projections quite a bit. “We don’t like being the 8, 9 seed because then you’re going to get the No. 1 seed in the (second) round,” Fitzgerald said. “We’re really just trying to get it together where we get a better seed in the tournament.” Regardless of their seed, the two East Coast Sooners are playing on Senior Day — and another chance to impress the NCAA selection committee. “We never been in it,” Pledger said of tournament talk. As he shook his head and smiled, he said, “It’s a good feeling.” 75 2012-13 OKLAHOMA MEN’S BASKETBALL OU’s strong recovery crushes Iowa State By Guerin Emig Tulsa World March 3, 2013 NORMAN — It was torture, but Sam Grooms pushed through it. Then he started over and pushed through it again. Then he went back and did it again. The Oklahoma point guard returned home from his team’s midweek meltdown at Texas, and watched the whole thing “three of four times.” All those turnovers, bad fouls and bad shots that contributed to Texas’ 22-point rally. All alone at home. “I would watch and get to the point where we’d turn it over, and I’d turn it off and get mad,” Grooms said. “And then I’d be like, ‘I can’t do that. I’ve gotta finish watching.’ I’d get through two more possessions and turn it off again, before turning it back on. “I was livid.” By the time Saturday’s game against Iowa State rolled around ... “I had a lot to prove,” he said. The most driven player on a motivated team, Grooms led the Sooners to an 86-69 hammering of Iowa State. He managed 19 points, six assists and just one turnover while conducting his offense in 31 minutes of play. That made the most difference in what was supposed to be a ridiculously competitive game between two teams with nearly identical records and NCAA Tournament hopes. Both teams needed to show something, OU after collapsing at Texas and Iowa State after having victory snatched away against Kansas last Monday. The Cylcones (19-10, 9-7) didn’t come out so hot. “We didn’t have it,” coach Fred Hoiberg said. “It’s really the first time all year where we’ve gotten it absolutely taken to us, where we got our butts kicked.” Grooms took the first swing. Thirty seconds after tipoff, Iowa State’s Korie Lucious left him for an open 18-footer. Swish. The Sooners led 2-0. They never trailed from there. Grooms fed Steven Pledger coming off a curl, and Pledger’s 3 made it 9-2 at the first timeout. Iowa State came back out, left Grooms alone again and paid again. When Grooms hit two more back-to-back perimeter shots with five minutes left in the half, the Cyclones changed tactics. We’ll pick up Grooms, in full court, they decided, like Texas pressured him Wednesday night. Grooms helped the Sooners (19-9, 10-6) break it once, and then again, when Grooms took Lucious to the baskett and scored to make it 37-23. So much for the press. The Cyclones closed to within 37-28, but Grooms zipped a 3-pointer five seconds before halftime to swing the momentum back OU’s direction. The second half was a matter of OU making 30 straight free throws to finish an NCAA record-tying 34-of-34. Someone asked Hoiberg in postgame about that, and the difference between Saturday’s game and the 83-64 spanking Iowa State administered OU Feb. 4 in Ames. “Our gameplan was similar,” the coach said. “Grooms stepped up and hit shots against us. Give the kid credit for stepping up with confidence and knocking those down.” It didn’t happen in Ames, where Grooms went 1-of-3 for two points. It didn’t happen at Texas Wednesday, as Grooms missed all four of his shots and turned the ball over four times. But it had happened in between. Grooms’ emergence was a big reason for OU’s four-wins-in-five-games stretch heading to Austin. All he needed was confidence he could re-emerge. Teammates helped restore that. Coaches gave him some help by refining OU’s press offense the past two days in practice. “It’s not just the guy with the ball. It’s also receivers moving and being available,” coach Lon Kruger said. “A lot of the focus is on Sam because he has the ball, but a lot of other people are responsible.” The practice paid off Saturday. OU had 17 assists and just five turnovers. All that remained was motivation. Grooms supplied that by digesting Wednesday’s debacle. Saturday afternoon, Grooms came off the court shaking hands, posing for pictures and hearing one “Great game!” after another. His mom had seen it all, having traveled from Greensboro, N.C., to see her son honored with OU’s other four seniors in pregame. Quite a change over three days’ time. “I’m thankful,” Grooms said. “I wanted to come out here and play as hard as I could and show that I could bounce back. This is the real way Sam plays.” 76 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Sam Grooms on a mission By John Shinn The Norman Transcript March 4, 2013 NORMAN — Oklahoma point guard Sam Grooms played like he was on a redemptive mission Saturday. It wasn’t the jump shots he made or even the 19 points he scored in the Sooners’ 86-69 victory over Iowa State Saturday that mattered most. The senior wanted to prove he can still keep his team clear of trouble in the harshest of circumstances. “I had a lot to prove. I’m pretty sure my teammates believe in me. But, by the same token I don’t want them to ever second-guess me, think that Sam will turn the ball under pressure. I don’t want them to ever feel that way,” Grooms said. “I wanted to come out here and play as hard as I could and show them that I could bounce back from it. This is the real way Sam plays.” If the “real” Grooms keeps playing like he did Saturday, the Sooners (19-9, 10-6 Big 12) could be one of the best offensive teams in the Big 12 Conference. Saturday’s victory was OU’s fifth straight game with at least 79 points, and fourth in a row with 80 or more on the scoreboard. There’s a lot of factors that have contributed to the scoring outburst. The NCAA record-tying 34-for-34 performance from the free-throw line had a major impact, but there were other factors like the 17 assists, with six coming from Grooms’ hands. “Guys have done a good job of moving the ball and handling it. That starts with Sam, of course,” OU coach Lon Kruger said. “He did a terrific job again today. We expect that to continue. It’s nice to see that happen for him.” Grooms took the loss to Texas last Wednesday especially hard. It was a total team collapse that caused the Sooners to blow a 22-point lead with less than eight minutes to go. Grooms, however, saw it as failure in his ability to direct the Sooners. He was only credited with four of the Sooners’ 16 turnovers. Nonetheless, the Sooners went into a free-fall and he couldn’t pull them out of it once Texas unleashed a frenetic press. Grooms watched the game tape several times with the team and a few more on his own. Those last seven minutes were excruciating to watch. “I would watch and get to the point in time where we’d turn it over, and I’d turn it off and get mad. And then I’d be like, I can’t do that. I’ve gotta finish watching it. I’d get through two more possessions and turn it off again,” Grooms said. “I’ve watched a lot of tape since I’ve been here. That’s the biggest thing that’s helped me out. I was livid, I’ll be honest, I was pissed.” Irritation turned into determination against the Cyclones. Iowa State went with the same press about 15 minutes into OU’s game. The Sooners didn’t bat an eye. Grooms weaved his way through it and they cruised to a win that secured the program’s first winning record in Big 12 play since 2009. OU enters the final week of the regular season in position to improve its seed for the NCAA Tournament instead of securing it. There’s still a chance OU could finish as high as third in the Big 12 standings if it beats West Virginia at Lloyd Noble Center Wednesday and wins at TCU Saturday. The Sooners will be favored to accomplish the tasks. They’ve moved into that position because Grooms has led them there. “What happened in Texas... It happened,” Grooms said. “But I don’t want them to ever think about it.” After Saturday, there’s no need to worry. 77 2012-13 OKLAHOMA MEN’S BASKETBALL Romero Osby becomes a grown-up By Stephanie Kuzydym The Oklahoman March 5, 2013 NORMAN — With his eyebrows raised and speaking through a half-smile, Romero Osby’s voice rose two levels. He was messing around with teammate Sam Grooms like they were two best friends on the playground at recess. That’s Romero Osby — a big kid at heart. Except there was a time in his college basketball career when he was just an immature kid, when he thought everything would come easy and things would just go his way. That was during his two years at Mississippi State. During his years as a Sooner, Osby has grown from a kid to the father of a kid. He has become a leader and a big, but stern, brother to his teammates. In his final home game, which comes Wednesday at 8 p.m. against West Virginia, he’ll be all business on the court. There’s a time and a place to be serious — and to be a kid. When Osby was turning 17, he said he weighed a lot of options. Go to Kansas and play for Bill Self? Go to Louisville and be with Rick Pitino? Sit the bench at both? Or go to Mississippi State and contribute right away? He chose Mississippi State. “I was a kid expecting to play ball and thinking everything was going to be easy,” he said. “Not as far as on the court, but life would be easy.” But that’s when he got a wake-up call. He wasn’t playing as much as he thought, and basketball and life started to change. “My life was just different because basketball was different,” he said. “That really made me kind of be different. That really made me kind of be stubborn sometimes. I wouldn’t really listen anymore because things weren’t kind of going my way ...” Osby’s wife, Shalonda, who was his girlfriend while he was at Mississippi State, said he became “boxed up” and he felt like his dreams were “slipping away.” Nothing was forcing him to mature. He was a 45-minute drive away from his home in Meridian, Miss. Coaches weren’t saying what they wanted from him, according to Shalonda, and things on the team, which Romero declines to go into detail about, just weren’t good. “Mississippi State is a great university,” Shalonda said. “It’s the things that transpired down there that nobody should ever be a part of.” Then Romero transferred to Oklahoma, and on the first day, thencoach it. 78 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Sam Grooms always has a good word to offer By Stephanie Kuzydym The Oklahoman March 8, 2013to..” 79 2012-13 OKLAHOMA MEN’S BASKETBALL Sooners’ resurgence attributed to scoring By John Shinn The Norman Transcript March 9, 2013 NORMAN — The players are the same, but if you watched Oklahoma play in November, December or even January it’s hard to believe the same group that struggled to score 60 points throughout the first half of the season has averaged 80.25 in its last seven games. And that average doesn’t include two overtimes. The Sooners have blossomed into one of the Big 12’s best offensive teams in the second half of conference play. Wednesday night’s 83-70 victory over West Virginia marked the fourth time in the last five games they scored at least 83 points in a 40-minute game. “It’s a case of when you see teams playing well offensively, it’s individuals are playing with confidence and shooting with confidence,” OU coach Lon Kruger said. “It’s happening for us.” The offensive surge is the reason OU has stormed its way inside the NCAA Tournament bubble over the last month. The victory over the Mountaineers was its sixth in the last eight. Only overtime losses at Texas and No. 13 Oklahoma State serve as blights. So, where did that shooting confidence come from? The Sooners are still the same team that scored 70 or more points just five times in 12 non-conference games. They’re still the same bunch that could muster just 50 points in a two-point home loss to No. 9 Kansas State on Feb. 2. Well, that loss to the Wildcats served as a springboard. “I remember the Kansas State game was just a horrible offensive game for both teams,” OU forward Romero Osby said. “It was just a grind-it-out defensive game. I think if we would have shared the ball and made the plays we’re making now, we would have had a better chance to win that game.” Kruger, however, is one of the few who aren’t surprised by what OU’s done record-wise or on the offensive end. He’s about to become the only coach to guide five different programs to the NCAA Tournament. That doesn’t happen by pigeonholing your players. Kruger believes if you watched OU (20-9, 11-6 Big 12) play in November and watched the OU team that will conclude the regular season against TCU (10-20, 1-15) at 4 p.m., today at Daniel-Meyer Coliseum in Fort Worth, Texas, you would see a night-and-day difference on the offensive end. The biggest alteration has been the emergence of Osby, who is averaging 20.3 points in his the last eight games. “We didn’t know in November how dominant Ro would be in terms of dictating a lot of what we’re doing offensively,” Kruger said. “A lot of what we’re doing revolves around him garnering extra attention from the defense. He’s made better shots for everyone else because he’s been so effective. So, we’re giving it to him a lot more than we did in November.” The attention Osby commands has given guard Steven Pledger more room to operate. The emergence of Sam Grooms as not only the facilitator of the offense, but as a scorer has made OU more potent. However, none of what has happened has been a fluke. There was a process the Sooners followed to get to their current status. They won with defense early on, and continually built themselves offensively. “Guys are now doing what they’re capable of doing,” Kruger said. “That may exceed some people’s expectations based on what’s happened recently. I think we’re achieving rather than exceeding.” 80 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 OU’s Romero Osby named first-team All-Big 12 By John Shinn The Norman Transcript March 11, 2013 NORMAN — Romero Osby carried Oklahoma this season and those efforts were rewarded by the Big 12 Conference’s coaches Sunday. Osby became the first Sooner since Blake Griffin to be named first-team All-Big 12. The senior averaged 15.7 points per game and 6.9 rebounds, but put up better numbers in conference play. In Big 12 games, Osby led the league in field goals (109), was second in scoring (17.8), third in field-goal percentage (54 percent) and fifth in rebounding (7.3). His 77.6-percent accuracy at the free-throw line also ranked fifth. During the 18-game conference schedule, Osby was the Sooners’ leading scorer in 13 games, and scored at least 12 points in 17 of those games. Osby also led OU (20-11, 11-7 Big 12) with 26 blocked shots and 20 charges taken. Kansas center Jeff Withey, Kansas guard Ben McLemore, Kansas State guard Rodney McGruder and Oklahoma State guard Marcus Smart, who was also named the conference’s player of the year and freshman of the year, joined Osby on the first team. The Sooners placed two players on the All-Big 12 third team. Senior guard Steven Pledger was named to the team after averaging 12.0 points per game. He finished third in the conference with 2.3 made 3-pointers per game and his 37.3-percent shooting from beyond the arc was sixth best in the conference. Pledger has made 247 3-pointers during his career and is 12 short of matching OU’s all-time record. Junior forward Amath M’Baye was named to two teams Sunday. He joined Pledger on the third team and was also voted onto the all-rookie squad. M’Baye averaged 10.3 points per game during the regular season and 5.3 rebounds. Much like Osby, M’Baye numbers improved in conference play. The Wyoming transfer shot 82.9 percent from the free-throw line and 40 percent from 3-point range in league games. Twice this season, M’Baye was named the Big 12 Rookie of the Week. The announcement of the All-Big 12 awards coincided with the end of the regular season. The voting was done by the conference’s head coaches. They were not allowed to vote for their own players. The Big 12 tournament begins Wednesday at the Sprint Center in Kansas City, Mo. OU, which finished tied for fourth in the league, received a first-round bye as the tournament’s fourth seed. It will face fifth-seeded Iowa State in the quarterfinals at 11:30 a.m. Thursday. 81 2012-13 OKLAHOMA MEN’S BASKETBALL OU hopes Buddy Hield’s return can provide boost to team By Guerin Emig Tulsa World March 14, 2013 KANSAS CITY, Mo. — Can something hopeful emerge out of something dreadful? In the case of Buddy Hield, Oklahoma’s unique freshman guard, yes. Less than a minute remained in the Sooners’ first half at TCU last Saturday. OU trailed 42-20, and Romero Osby had just missed a shot he makes 19 times out of 20. The ball bounced high off the rim.Hield rose above the scrum of bigger bodies, cuffed it with his right hand, and rammed it through the hoop on his way back down. “That play, it wasn’t so much to prove my foot was feeling OK. I was just hungry for the basketball and I was mad we were down,” Hield said Wednesday from Kansas City, where OU plays Iowa State in Thursday’s 11:30 a.m. Big 12 Tournament quarterfinals. “That play took a lot of stress off my head.” The entire program, shaken by the broken foot Hield sustained in OU’s Feb. 11 victory over TCU, exhaled. The Sooners need Hield in a game some consider a must-have for both teams’ NCAA resumes. They need the uncanny sparks of energy and momentum he supplied the first three months of the season. Asked whether OU’s offense or defense benefits most from Hield’s bursts, guard Je’lon Hornbeak said: “With him, it’s everything. He’ll get in there and get a couple tipped passes. And he’ll come down and do something you wouldn’t think anybody would do. And we’ll be like, ‘Man, that’s a game-changer right there.’” The Sooners outscored TCU 45-28 after Hield’s dunk. They couldn’t prevent the 70-67 loss, but at least they awoke in time to give themselves a chance. Going forward, they also had something to rally around - Hield was healthy again. He returned to practice three weeks after undergoing surgery, but wasn’t quite himself. He got a four-minute taste of OU’s March 6 win over West Virginia, but nothing more. He came out of that saying, “It doesn’t hurt me when I’m playing, just the fear inside. Me and fear don’t go well together. I have to get it out of my system.” That’s just what happened late in the first half at TCU. “It was kind of surprising,” OU coach Lon Kruger said. “He jumped up there out of nowhere.” This was the pre-injury Hield, not the one who worried about cutting and putting too much pressure on the repaired foot. Now, Kruger could say: “Buddy clearly has the emotional and physical part of the injury behind him. He’s full speed, ready to go. He hasn’t shot the ball with the rhythm that he did prior to the injury. He missed three weeks of shooting. It’s going to take him a little time to come back there. “But from a physical standpoint and an emotional standpoint, I think he feels great.” It’s the best news the Sooners can get heading into their postseason, for Hield has noticed something important. “The better I feel, the better the team plays,” he said. “I can get after their point guard or whoever I’m guarding, be that spark, make little plays to change the whole game around... “I feel much better. My confidence has started getting higher and higher. Every turn and twist doesn’t bother me anymore. I’m getting back to my regular self, trying to help us win this game tomorrrow.” 82 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 OU can’t finish off Iowa State By John Shinn The Norman Transcript March 14, 2013 KANSAS CITY, Mo. — If the Oklahoma Sooners get a lousy NCAA Tournament seed, or travel to Dayton for a First Four play-in game, or even get left off the 68-team bracket altogether, they can blame it on 7 1/2 minutes of basketball. They can blame it on the last stretch of Thursday’s Big 12 Tournament quarterfinal against Iowa State, when a 12-point lead became a 73-66 loss. The fourth-seeded Sooners needed to win to lock up an NCAA berth. That looked like a good bet most of the day. Romero Osby was unmanageable. Cameron Clark was having his best game of the year. And 5-seed Iowa State wasn’t making the 3-pointers they rely on to win. When Clark made two free throws with 7:42 remaining, OU led 60-48. And then? “We knew we had our backs against the wall,” Cyclones forward Melvin Ejim said, “and we just started playing harder than they did.” Harder and better. “They hit tough shots,” OU guard Steven Pledger said. “A spinning one-handed shot off the glass. A step-back fadeaway three from the corner. Those are tough shots, and they started to hit them.” They hit some easy ones, too. The Cyclones manhandled OU’s defense and scored on 10 of their last 12 possessions. They were 3-of-20 from 3, until Georges Niang hit one from the right wing with 7:22 left. That moment signaled two important things: ISU was about to get hot, and OU coach Lon Kruger was about to rue a couple decisions. The Cyclones followed Niang’s 3 with four three throws, then Will Clyburn drove Osby for one basket and hit a 3 over him for another. The trey concluded a 12-0 run with 4:10 to play, and pulled ISU into a 60-60 tie. The few thousand Cyclone fans got louder with every second of the run. OU was clearly rattled, yet Kruger elected not to call time to settle his team and quiet the crowd. “Yeah, you can always look back and say liked to have made this shot or liked to have had a timeout here, liked to have run something differently,” Kruger said. “No question, that’s always going through your mind.” Removing Osby from the game as Clark hit those free throws to make it 60-48 was even more costly. Replacement Andrew Fitzgerald gave up a 3-pointer and an offensive rebound and committed an offensive foul as Iowa State scored a quick seven points. “We tried to (rest) him a couple or three possessions there,” Kruger said of Osby. “We had a couple of plays there when ���Ro’ was out that we would have liked to have done differently.” Kruger got Osby back in after a two-minute breather, but the Cyclones had momentum by then. Also, OU’s offense had bogged down by then. The Sooners missed all eight of their shots over the final 7:42. Osby, who finished with 18 points, went 0-for-2. Clark, who tied a season high with 17, didn’t attempt one down that stretch. At the other end, Clyburn converted a three-point-play after OU gave up an offensive rebound with 3:19 left. That gave the Cyclones their first lead, 63-62. Sixth-man Tyrus McGee buried a 3 near his bench at the 2:44 mark to shove ISU ahead 66-63. Ejim, who scored a game-high 23, hit a spinning, leaning banker on Pledger to make it 68-64 with 1:18 showing. Then, after a pair of Sam Grooms free throws cut it to two, Chris Babb hit a straightaway 3 to make it 71-66 with 36 seconds to play. The 22-10 Cyclones had the victory they felt they needed to avoid NCAA Tournament limbo. The 20-11 Sooners boarded the bus to spend three nervous days at home. 83 2012-13 OKLAHOMA MEN’S BASKETBALL OU hopes to fix offensive struggles before NCAA Tourney begins By Guerin Emig Tulsa World March 16, 2013 KANSAS CITY, Mo. — The last thing Steven Pledger did before leaving Oklahoma’s Sprint Center locker room Thursday was assess his team’s NCAA Tournament situation. “I’m definitely going to be anxious waiting to see if they call our name,” he said. “We’ll see.” The odds remain in OU’s favor. But they’re not as strong as they were before the Sooners lost back-to-back games to TCU in the regular season finale, and to Iowa State in the Big 12 Tournament quarterfinals. OU is sweating it out primarily because of two problems: a lack of shooting and a lack of playmaking in crunch time. The Sooners won four of five games from Feb. 20 through March 6 thanks to an offense that scored more than 80 points each time out. OU hadn’t been that proficient over five straight conference games since Billy Tubbs was coach. Things like ball movement, cutting and screening were all very good over that stretch. Still, what ultimately made the offense hum was shot-making, especially from long range. The Sooners made six of their 10 3-pointers to open a comfortable first-half lead Feb. 20 at Texas Tech. They went 6-of10 again in a 47-21 first-half domination of Baylor on Feb. 23. They went 7-of-9 before collapsing late at Texas on Feb. 27, then 10-of-18 in their March 6 victory over West Virginia. Since then, however, they’ve shot 3s like Kendrick Perkins. They went 0-for-16 at TCU and 3-for-18 against Iowa State. Suddenly, the team you couldn’t keep under 80 points can’t get to 70. The Sooners have until next Thursday, the potential day of their potential NCAA first-round game, to rediscover their range. That goes particularly for guards Pledger, Je’lon Hornbeak and Buddy Hield (a combined 2-for-24 their last two games). As it is, wayward shooting contributed to OU’s recent failures to close against TCU and Iowa State. Romero Osby’s dunk pulled the Sooners within 59-58 of the Horned Frogs last Saturday, but then OU missed five straight shots over a four-minute stretch. That allowed TCU to keep a safe distance, until Sam Grooms missed one final 3-point jumper that would have tied the game at the buzzer. The drought was worse, and more costly, Thursday against Iowa State. Cameron Clark’s 15-footer gave the Sooners a 58-48 lead with 8:10 remaining. From there, Pledger, Hield, Hornbeak, Osby, Grooms and Andrew Fitzgerald all missed shots. Not a make in the bunch. OU’s 0-for-8 stretch helped Iowa State close the game on a 25-6 run to advance. Finishing tight games has been an issue for the Sooners since February started. Recall overtime losses at Oklahoma State and Texas, as well as a 52-50 homecourt setback against Kansas State. The shooting woes are a more recent problem. A few days before the TCU game, coach Lon Kruger was asked about his team’s hot streak and said: “Anytime you see a team play well offensively it’s a result of individuals playing with confidence, shooting with confidence. That right now is happening for us.” It hasn’t happened since, however. When they’re not watching the Selection Show, expect the Sooners in the gym trying to get their confidence back. We won’t know until Thursday at the earliest whether they, in fact, recaptured it. 84 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 How Joe Castiglione lured Lon Kruger to Oklahoma By Berry Tramel The Oklahoman March 16, 2013 Joe. Joe C. wouldn’t take no for an answer. So there they sat, in that Houston hotel suite, with Boren working his charm and Castiglione growing confident Kruger was about to accept the challenge. Then the knock. No telling what Castiglione feared. Pesky media? The Las Vegas mafia come to cart their coach back to UNLV? Joe C. looked through the peephole and saw nothing. Maybe it was kids fooling around. Then another knock. Joe C. looked through the peephole again. Saw nothing. This time, Castiglione cracked open the door. There stood a small woman. “Turn down?” she asked. Castiglione was confused. What? “Turn down?” she asked again. Finally, Castiglione figured it out. The housekeeper was asking if he needed turndown service. “No, ma’am,” Joe C. said abruptly. “I’ve already been through it twice. I’m not going to let it happen again.” The NCAA basketball committee will announce its 68-team field Sunday afternoon, and the Sooners are virtually certain to be back in the Big Dance for the first time since 2009. In that hotel suite, Kruger agreed to coach OU basketball, and now he’s on the verge of NCAA history. Kruger will become the first coach ever to take five schools to the NCAA Tournament. What Kruger did at Kansas State, Florida, Illinois and Nevada-Las Vegas, he’s doing at OU. “He really is one of the most successful change agents in college basketball history,” Castiglione said. “He felt motivated to take on another challenge.” But only with plenty of nudges from Joe C. When he fired Jeff Capel in March 2011, after a second straight disastrous OU season, Castiglione targeted a few prospects and quickly settled on Kruger as his primary. But Kruger wasn’t interested. “Lot of respect for Oklahoma and the history of it, but we were really comfortable with what we were doing,” Kruger said of his UNLV job. “We really enjoyed the people. When you know what you have, there’s value in that. We loved the city. Friends and families coming through all the time.” Kruger wasn’t playing hard-to-get. Kruger had just moved into a house he and his wife, Barbara, had built. His daughter and her family had recently moved to Las Vegas. His son used Vegas as a base for his basketball career. Plus, the UNLV program was flourishing. When Kruger was hired in 2004, the Runnin’ Rebels hadn’t won an NCAA Tournament game since reaching the 1991 Final Four and had made the bracket only twice. But in Kruger’s third season, he coached Vegas to the Sweet 16. Another NCAA victory followed in 2008. The Rebels made the tournament four times in a five-year span. Which is why Castiglione worked so hard to entice Kruger. At UNLV, Kruger had rebuilt community relations. The same touch was needed in Norman. “The University of Oklahoma was looking for an exceptional leader,” Castiglione said. “We really felt like he would be a great fit. It kept coming back to me, the right person at the right time. Just fits Oklahoma to what we want to do.” So Castiglione called Kruger, after informing UNLV athletic director Jim Livengood, and made his pitch. They had a nice conversation. Kruger said he would get back to Joe C. Kruger’s answer was thanks, but no thanks. Castiglione was undeterred. He flew out to meet Kruger face to face, seeking to build a relationship with the coach he knew only superficially, mostly from old Big Eight days, when Kruger coached at K-State and Castiglione was a Missouri administrator. Again, a nice chat. Again, no thanks. At that point, Joe C. was torn. He sensed a sliver of hope that Kruger could be persuaded to take the job, but Castiglione also had to keep the search going in other directions. “It’s a delicate balance, dealing with the reality of what could occur,” Castiglione said. Joe C. chose aggression over caution. He went after Kruger again. Castiglione doesn’t claim to know what finally piqued Kruger’s interest, and Kruger offers little insight himself. But the nature of Castiglione’s courtship offers clues. (continued) 85 2012-13 OKLAHOMA MEN’S BASKETBALL How Joe Castiglione lured Lon Kruger to Oklahoma (continued) “We clearly demonstrated we were serious about changing the direction of our basketball program,” Castiglione said. Joe C. said his mission was to “build trust in the relationship, in a compressed time frame. We had to convince him we were people of our word.” The Sooners actually came calling at a very opportune time. Kruger had rejected inquires from Southern Cal, Oregon and Utah the previous year or two. But Nevada’s governor had recently proposed a 17 percent budget cut for higher education, which had everyone associated with UNLV a little skittish. OU eventually offered a big-time contract, $2.2 million annually over seven years, a substantial raise from Vegas. And Kruger also felt the pull back to Middle America. He grew up just outside Topeka, in Silver Lake, Kan., and his wife is from rural Kansas, too. “It’s who we are,” Kruger said. “Small town, friendly people. Principled people. People who care about others.” Kruger has three brothers and a sister who all live in the Topeka/ Kansas City region. Coming to Oklahoma got the Krugers closer to home. So when Castiglione came at Kruger a third time, this time the answer was maybe. Kruger flew to Houston, Boren flew in from Washington, D.C., and Castiglione started feeling a whole lot better. “You know how convincing he can be,” Joe C. said of Boren. “I know how convincing he can be, because I experienced it myself.” Now Kruger is a Sooner, OU is about to end a discouraging March Madness drought and the knock on the door is nothing but opportunity. 86 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Inside OU’s Selection Sunday By RJ Young SoonerScoop.com March 18, 2013 TV cameras and camera phones are all focused on the men who make up the Oklahoma men’s basketball team at Lloyd Noble today, Selection Sunday. The players are packed in tightly; close enough that if they were strangers sitting next to each other they might feel the need to separate. Friends, family and fans are packed in tightly behind the team, and they look as eager and nervous as some of the players. Only OU men’s basketball coach Lon Kruger looks calm, cool. He’s sitting with his legs hanging off a stage he stood on just a half-hour ago to announce the winners of the team awards at Oklahoma’s banquet. The players are dressed in a casual uniform for the NCAA TV selection show playing on a large projector screen: white polo shirts with the OU insignia stitched on it and blue jeans. Only two of the players have ever played in the NCAA tournament, and only one of those two is a senior. Romero Osby is that senior. He’s bouncing his right leg in anticipation while the TV announcers reveal the teams from the Midwest Region that have made the tournament. Louisville is announced as the No. 1 overall seed, and the countdown began. The show takes a commercial break, and a low hum takes the place of the sound of TV voices cascading from the speakers. Andrew Fitzgerald holds a nervous closed fist to his lips, and Sam Grooms checks his mobile phone for news about tournament seedings. The South Region is being announced, and Big 12 foe Kansas is awarded the No. 1 seed in the region. The announcers work their way through the remaining seeds and come to No. 7. It’s San Diego State, and the Aztecs will play in Philadelphia, Pa., Friday against the No. 10 seed. “For some reason when I saw San Diego State’s name go up, I said ‘I think we might end up playing them because I know they said we’d probably be in the Austin region or Philadelphia,” Osby said. There’s a void left to fill for the No. 10 seed in the region on the projector screen, and the word Oklahoma fills it. Players and fans erupt in happiness, in relief. “When I saw our name go across, it was crazy,” Osby said. “It was amazing.” With its selection to the tournament, Oklahoma ended a threeyear postseason drought, and in only his second season, Kruger returned OU to the Big Dance. He is the first coach in Division-I history to guide five programs to the NCAA tournament. He started by taking his alma mater, Kansas State, to the tourney 25 years ago and has continued the trend at every university he’s coached at since then. Later, Kruger cited the one constant he’s had throughout his success, the one constant he believes is the foundation of his tournament teams. “It starts with good players, and people who are gonna work hard,” Kruger said. “That’s always the case. Not many team with players that aren’t good get into the tournament.” Just after the announcement of OU returning the tournament, Steven Pledger jumped out of his seat and fist-pumped, hugging his teammates. In matter of moments, the players’ phones began to ring. Grooms was still on his phone by the time he reached the hallway leading into the interview room to talk with local reporters about his feelings, about finally reaching the goal OU set to begin the season. “I was extremely, extremely, extremely happy,” Grooms said. “To see where we were at before and to see your name pop up on the screen on a big occasion like this, lets you know that hard work pays off.” After starting all 31 of Oklahoma’s games last season, he gave up his starting spot this season for this moment, for this opportunity. But that didn’t make it any less tough for him to come off the bench for the first half of this season. So he used his frustration to help the team. “Being the man the man that I am, I took it, and I tried to help the young guys as much as I can because it’s bigger than just me,” Grooms said. Grooms understood how young his fellow point guards, Isaiah Cousins and Je’lon Hornbeak, were to be Big 12 starters. He needed to prepare them for what they’ll face over the next three years. He knew in November if Oklahoma was to make the tournament, Cousins and Hornbeak would have to be made ready to contribute early and often. Grooms was a part of the 2011-12 team that lost more games than it won, that showed signs of the kind of team it could be given time. He didn’t see OU making the tournament at the beginning of this season, but as his team began to win games, he began to believe. So he played for that. He played for what could be. “I saw a team that could be good later on, but nobody expects to be in the NCAA tournament just right then and there, especially coming off the season that we came off of last year,” Grooms said. He’d always dreamed of having an opportunity to play in the tournament. He’d watched it on TV from home, believing he was good enough to play in the field of 68. Today, he is. Today, dreams were fulfilled. 87 2012-13 OKLAHOMA MEN’S BASKETBALL Kruger makes history as OU to face SDSU By Guerin Emig Tulsa World March 18, 2013 NORMAN — For a man about to make college basketball history, Lon Kruger sure looked sedate. His arms at his side, the Oklahoma coach sat watching CBS’ Selection Show behind his crowd of anxious players inside the Lloyd Noble Center Sunday. The Midwest Region went by without an OU mention. Greg Gumbel went to commercial, and nervous murmuring rose from the arena floor. Kruger just kept watching the show, never changing expressions. When the Sooners appeared after the commercial break — they’re the 10-seed in the South Region and will play 7-seed San Diego State on Friday in Philadelphia — he was one of the few in the building not going nuts. Kruger had just become the first man to coach a fifth program into the NCAA Tournament, but he didn’t revel in that. Only in what the whole scene meant to those around him. “It’s like as a parent when the package is under the Christmas tree,” Kruger said. “You don’t get excited about your own, you get excited about seeing your kids. That’s the same thing here. You see the fans enjoy it, and the players. The coaches have worked so hard. “For them to forever have that NCAA Tournament experience is what makes it most enjoyable for sure.” It had been a while in Norman. Billy Tubbs, Kelvin Sampson and Jeff Capel spoiled the place for more than a quarter century, coaching the Sooners to 22 NCAA Tournaments in 27 seasons from 1982-2009. Then things just spoiled the past three years, before Kruger freshened up the program with a 20-win season. The postseason looked like a sure thing, until OU lost its way at lowly TCU on March 9, then squandered a double-digit second half lead against Iowa State in Thursday’s Big 12 quarterfinal. Thus the nerves at the Sooners’ watch party Sunday. Asked to describe the time between Thursday’s Big 12 exit and Sunday’s good news, OU forward Romero Osby said: “Tough... “Friday was a day off, so I hung out with my family a little bit, but I really couldn’t stop thinking about basketball. I watched the Iowa State (semifinal) game and I really felt like we should have been playing against Kansas. We let an opportunity slip away, but we still got an opportunity to get in the tournament. “Thank God we’re here.” Kruger has spent all season bragging about the commitment of team leader Osby and his three fellow seniors, Steven Pledger, Andrew Fitzgerald and Sam Grooms. It would have been a shame had a lousy last five days sabotaged nearly a year’s effort. “After last year they rallied around and said, ‘Let’s get to work. Let’s focus,’ “ Kruger said, “and they haven’t wavered from that.” The team that hadn’t finished above .500 the past three seasons won 20 games. The team that had gone 14-36 in the Big 12 Conference went 11-7. Kruger had done it again. He had rebuilt his sixth program in as many tries, putting OU on track for its old March destination. All he needed was for the NCAA Selection Committee to see it that way. “Waiting is the hardest part,” Kruger said. “The Bracketology reports all seemed to be pretty consistent in that 10, 11 or 12 area. That helped a little bit. Not that that erased all doubt. “Because they couldn’t guarantee anything about seeing your name announced.” OU’s name was, in fact, announced Sunday. Kruger’s reputation as college basketball’s Great Rebuilder was affirmed. History was made, even if the man making it didn’t recognize it much beyond “it just kind of turned out that way.” “I don’t think too much about it,” Kruger said. “Obviously we’ve had a lot of good stops. We’ve been very fortunate. This wasn’t a plan going on. It’s just worked out very well.” Well, OK, he finally relented, this particular Selection Sunday might resonate some. Just not for historical reasons. “The first time at a new school is always a little extra special,” Kruger said. “I’m so happy for the seniors. They hadn’t played in a postseason. To see them on their phones calling family and calling friends right afterwards... “This is about a lot of things, but just to be able to have those memories for a lifetime. They’ll leave Oklahoma now with a good feeling about the progress they made as a program and their contributions to that. That makes it more special.” 88 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 OU already breaking down first-round foe San Diego State By John Shinn The Norman Transcript March 18, 2013 NORMAN — Oklahoma director of basketball operations Mike Shepard immediately began tracking down game film of San Diego State early Sunday night. Getting in touch with coaches familiar with the Aztecs shouldn’t have been a problem. Sooner coach Lon Kruger spent seven seasons at UNLV prior to coming to OU. All of those seasons were spent competing with the Aztecs in the Mountain West Conference. “San Diego State is a tough team. Steve Fisher does a great job. We battled him a lot of years at UNLV,” Kruger said. “He’s got a very talented, athletic basketball team.” The Sooners haven’t played San Diego State since 1975 (OU won 79-74 in overtime). Kruger doesn’t believe his personal history with the Aztecs will have much to do with Friday’s NCAA tournament contest. “I didn’t see them play that much this year. I know they’re very talented, very athletic,” Kurger said. “As far as knowing exactly about this team, we’ll learn more the next couple days watching film.” Long trip home: OU returned from Kansas City, Mo., Thursday night after its loss to Iowa State at the Big 12 tournament. Some players went home on the team bus. Others came home with their families. Romero Osby came home with his family. He said it wasn’t a pleasant ride. “I was tired and (ticked) off from losing and then I had to drive and my daughter was driving me crazy. It was a tough ride back,” he said. “I kept thinking if we would have made this play or would have made that play, we would have won that game. “It was tough. I’m happy we still made it into the tournament.” Osby’s daughter is 3 years old but seemed to take OU losing personally. “I think she was mad because Iowa State beat us and her dad didn’t do anything in the second half,” Osby said. “I think she was frustrated at my play in the second half. “I think that was why she was (ticked) off. It was a situation where everyone was in a bad mood from losing and then you have a long drive back after a loss.” Close to home: Going to Philadelphia will allow seniors Steven Pledger and Andrew Fitzgerald to play close to home. Pledger is from Chesapeake, Va., while Fitzgerald is from Baltimore. Both are familiar with the city. “Oh, yeah it’s going to be a lot of family members,” Fitzgerald said. “My father, he lives in New York, so he’s definitely going to come down for that game. I know my mother’s going to be there. There’s going to be a lot of family and friends there.” It will be a homecoming of sorts for Pledger. “My parents, they don’t really get to come out and see me play that much, but this is going to be great. Both my parents grew up in Philadelphia, so I have a lot of family there,” he said. Happy with the seed? Receiving a No. 10 seed was where many had OU projected going into the tournament. Kruger has no complaints. “No one puts more time into it than the selection committee. They have to consider a lot of different things the fans don’t realize or understand, in terms of people from different conferences and different home sites and things that go into that,” he said. “Yeah, we feel like this group is deserving of what we’ve got. The opportunity to play, that’s the most important thing. Just to be in the field and having an opportunity to play.” 89 2012-13 OKLAHOMA MEN’S BASKETBALL OU needs to stay focused to avoid leaving the Big Dance early By John Shinn The Norman Transcript March 19, 2013.” 90 2011-12 OKLAHOMA MEN’S BASKETBALL 2010-11 2012-13 Aztecs bring highlights, defense to tournament against OU By Guerin Emig Tulsa World March 19, 2013 NORMAN — Jamaal Franklin gave San Diego State its YouTube cred with one breathtaking play this past January. Dribbling full-speed on the break, the Aztecs’ star guard lobbed the ball toward the backboard while still a step behind the 3-point line. He never broke pace after the release, striding five times through the lane before leaping, catching his self-alley oop off the glass and dunking it home. If it wasn’t the best moment in college basketball all season, it was easily the bravest. “I don’t know if it was rehearsed,” Oklahoma guard Je’lon Hornbeak said. “But just the guts to do that, I give him credit.” Friday night in Philadelphia, the Sooners will meet the man behind the moment. They’re the No. 10 seed in the South Region, matched against No. 7 San Diego State in the first round. They’ll want to limit Franklin’s highlight reel to a minimum. That’s important, considering he leads the 22-10 Aztecs in nearly every conceivable category. “He can score in a lot of different ways,” OU coach Lon Kruger said. “He can score from three. He gets to the rim. He’s very good off the dribble, gets to the free-throw line. He’s a very good offensive rebounder. A good basketball player, plays hard. “He’s a very involved veteran guy with a lot of experience.” That’s the key to the Aztecs. Not their SportsCenter Top 10 tendencies, although they do exist, but their seasoning. This is the Aztecs’ fourth consecutive NCAA Tournament appearance. The only Sooner who has ever played this deep into a season is Romero Osby, and that was at Mississippi State four years ago. San Diego State’s coach is Steve Fisher. He won the 1989 national championship at Michigan before nearly winning another two with the Fab Five. He’s used to bringing in runners and jumpers with a high degree of swag to them. But his teams succeed because they adhere to the non-glamorous stuff. Opponents shot a Mountain West Conference-low 39 percent against San Diego State this year. On Jan. 26, No. 15 New Mexico made 11-of-44 tries in losing 55-34 at SDSU. “Every strength we have, they took it away,” Lobos coach Steve Alford said afterward. That will be the game plan against the Sooners Friday night. OU coaches aware of the Aztecs from their Mountain West tenure at UNLV know full well. “They’re always athletic and very good defensively, with a little edge to them,” OU assistant Steve Henson said. “At UNLV we were pretty athletic and pretty respected. But they had more belief that they could get after guys. They always had a toughness and an edge about them. “I watched four of their games last night and they looked as tough, athletic, with interchangeable guys as ever.” So while Franklin, a First Team All-MWC performer who was the conference player of the year in 2012, makes for a convenient centerpiece, there is a lot going on around him. There is a lot for the Sooners to worry about besides getting dunked on. “They’re very athletic. They’ll rebound it very aggressively. They’ll guard you like crazy,” Kruger said. “They’ll be a good team.” No reassurance in the fact that Kruger is at least familiar with the Aztecs? “It would be more reassuring if they didn’t cover well or weren’t athletic,” he cracked. “Knowing they’re really good, it’s what you expect come tournament time.” 91 2012-13 OKLAHOMA MEN’S BASKETBALL ROSTERS NUMERICAL No. Name Pos. Cl. Ht. Wt. So. Sr. Sr. Fr. Sr. Fr. Fr. So. Fr. Jr. Jr. Jr. Sr. Fr. Jr. Sr. 6-8 6-1 6-4 6-3 6-8 6-3 6-3 5-10 6-7 6-7 6-6 6-9 6-8 6-6 6-8 6-10 227 203 219 199 238 180 182 150 200 229 208 208 232 225 210 223 Blanchard, Okla. (Bridge Creek HS) Greensboro, N.C. (Chipola College [Fla.]) Chesapeake, Va. (Atlantic Shores Christian School) Freeport, Bahamas (Sunrise Christian Acad. [Iowa] CC) Penryn, Calif. (Sierra College) ALPHABETICAL No. Name Pos. Cl. Ht. Wt. Hometown (Last School) 32 31 21 25 11 4 13 1 3 5 22 15 14 24 2 00 Casey Arent* D.J. Bennett% Cameron Clark** C.J. Cole^% Isaiah Cousins Andrew Fitzgerald*** James Fraschilla*^ Sam Grooms* Buddy Hield Je’lon Hornbeak Amath M’Baye Tyler Neal** Steve Noworyta^ Romero Osby* Steven Pledger*** Ryan Spangler# C F G/F F G F G G G G F F F F G F Sr. Jr. Jr. Fr. Fr. Sr. So. Sr. Fr. Fr. Jr. Jr. Fr. Sr. Sr. So. 6-10 6-8 6-6 6-6 6-3 6-8 5-10 6-1 6-3 6-3 6-9 6-7 6-7 6-8 6-4 6-8 223 210 208 225 182 238 150 203 199 180 208 229 200 232 219 227 Penryn, Calif. (Sierra College) Chicago, Ill. (Indian Hills [Iowa] CC) Sherman, Texas (Sherman HS) Sperry, Okla. (Sperry HS) Mount Vernon, N.Y. (Mount Vernon HS) Baltimore, Md. (Brewster Academy [N.H.]) Dallas, Texas (Highland Park HS) Greensboro, N.C. (Chipola College [Fla.]) Freeport, Bahamas (Sunrise Christian Acad. [Kan.]) Arlington, Texas (Grace Preparatory Academy) Bordeaux, France (University of Wyoming) Oklahoma City, Okla. (Putnam City West HS) Hainesport, N.J. (Holy Cross HS) Meridian, Miss. (Mississippi State University) Chesapeake, Va. (Atlantic Shores Christian School) Blanchard, Okla. (Bridge Creek HS) * Letters earned at Oklahoma ^ Walk-on # Sitting out the 2012-13 season due to NCAA transfer rules % Redshirting the 2012-13 season STAFF Head Coach: Lon Kruger (Kansas State ’75) Assistant Coaches: Chris Crutchfield (Nebraska-Omaha ’92) Steve Henson (Kansas State ’90) Lew Hill (Wichita State ’88) Director of Operations: Mike Shepherd (Kansas State ’92) Video Coordinator: Scott Thompson (Mississippi ’02) Trainer: Alex Brown (Appalachian State ’79) Strength and Conditioning Coach: Jozsef Szendrei (Oklahoma ’03) PRONUNCIATION GUIDE Casey Arent: ARNT James Fraschilla: fruh-SHILL-UH Buddy Hield: HEELD Je’lon Hornbeak: juh-LON Amath M’Baye: ah-MOTT EM-by Steve Noworyta: no-va-REE-ta Romero Osby: AHZ-bee 92
http://issuu.com/soonersports.com/docs/2013_mbb_postseason_guide?mode=window
CC-MAIN-2015-06
refinedweb
74,236
89.18
grid = planar square grid neighborhood = 8 cells adjacent to a cell either orthogonally or diagonally generation = all cells with fewer than 2 or more than 3 neighbors die, while a cell is born in each empty node with exactly 3 neighbors. These simple rules generate amazingly complex, chaotic behavior, but balanced in the sense that it always settles down after a while to a static or oscillatory state. See also: barber pole, barge, beacon, beehive, blinker, block, boat, clock, eater, fishhook, glider, glider gun, loaf, long barge, long boat, long ship, pond, ship, sinking ship, spaceships, toad, tub. Sometimes lies were more dependable than the truth --Ender (Orson Scott Card)) One way of perceiving the life that we live and the workings around it is that of a game in which we are all players and pawns in each other's game of survival and dominance. Every person has an agenda - a goal in life. Initially our goal in life is to survive and to establish a goal. Once we have a goal, we seek its accomplishment. At midlife, we look back on what we have accomplished, our goal, and consider again if we have attained it. There is as much of a crisis in having a goal that is too difficult to attain as there is one that is attained at a younger age, with no more game to play. Both are causes for depression. The important thing to remember in playing the game of life is that each person will manipulate the others to try to attain their goal. Sometimes our goals coincide and we are able to help each other along the way. Other times our goals clash and a conflict arises. For the most part, the conflict is rare except when people have tied their lives together later to find they are heading in opposite directions. It is rare that the clash of goals occurs outside of this for normally there is more than enough happiness to go around and satisfy all who seek it. However, there are times in career where people will reach for the same object and some must be refused. The universe is an infinitely large array of square cells. Each cell can be in one of two distinct states: dead or alive, empty or full, or 1, etc. Each cell is adjacent to eight other neighbouring cells. In every generation, a cell changes state according to its current state and the state of its eight neighbours: neigbours: 0 1 2 3 4 5 6 7 8 if dead : . . . A . . . . . if alive : . . A A . . . . . All cells change state simultaneously. By successively repeating this operation, patterns evolve. It is rather easy to demonstrate that a 'final' state of Conway's life is not necessarily a static world or a oscillating state. The simplest case of this is that of a simple glider. This collection of cells will repeat its shape but be shifted in position. In doing so, it no longer remains a oscillating set (such as a blinker). Some objections may be raised that a change in position does not constitute enough to say that the life world is not oscillating. For those who raise this objection the glider gun should be demonstrated. This is a finite pattern that has unbounded growth - every 30 iterations it produces another glider. In doing this, it has altered the world so that there is another 5 cells in the world and another position that will never repeat itself. The glider gun is only one such example of infinite growth within Conway's Life. Many other examples of infinite growth can be found (the first of which was the glider gun) and some of them have been listed at: Given that the game is played out on a two-dimensional grid, let f(x,y) be the function describing the state of the grid point (x,y). If f(x,y) = 1, then the point is alive. If f(x,y) = 0, then the point is dead. Let N(x,y) be the number of neighbors of (x,y) that are alive. In other words: N(x,y) = f(x-1,y-1) + f(x-1,y) + f(x-1, y+1) + f(x, y+1) + f(x+1, y+1) + f(x+1, y) + f(x+1, y-1) + f(x, y-1) The function f'(x,y), which describes whether (x,y) will be dead or alive on the next turn, can be defined as: { 0 if N(x,y) < 2 f'(x,y) = { f(x,y) if N(x,y) = 2 { 1 if N(x,y) = 3 { 0 if N(x,y) > 3 "The Game of Life" is board game originally issued by Parker Brothers back in the 1950s. The game simulated (as much as a board game can) the major life decisions an individual would make from high school until retirement: going to college, choosing a career, getting married, buying a home, having children, living through random windfalls and disasters, and so forth. The object is simply to have the most money upon retirement. I played this game with my siblings all the time when I was a kid; it's essentially random who comes out ahead at the end, so every player has a chance to win if they don't screw up the major choices. Every game with the same number of players also lasts the same amount of time, so it never drags on. Despite this, it's still just as much fun for grownups as for kids. I recently bought a version to play with my eleven-year-old stepdaughter, and we both enjoyed it equally. Since it's original release, Parker Brothers has changed the game slightly while keeping the basics identical. Prices have been updated to more contemporary quantities. You now have a chance to choose your salary and career from three randomly-chosen cards, assuming you take the time to go to college. Four kinds of insurance have been resolved down to two: auto and homeowner's. The confusing "stock market" bar has been replaced with "stock certificates" that pay off whenever someone spins that number. Best of all, certain spaces -- "night school", "taxes due", "throw a party", and so forth -- pay off to specific players if those players hold certain careers. All these changes are improvements, IMO: it's easier to follow all the rules, and it's more fun the more people are playing. However,"? Realistically, it's more like "The Game of Idyllic Suburban Life", but then again it was created in the 1950s. It leaves room for good-natured abuse, too. My stepdaughter decided to make up for not having any children one game by stealing my pink-peg daughter and accusing me of leaving her to wander the roadside for three hours negligently. I retorted that it didn't matter if she had the most money at the end: she had never landed on the "Become a born-again Christian" space (there isn't one), so she was going to Hell and all her ill-bought gains would avail her naught in the afterlife. If you tally up the neighbors using a vertical counter so you have each bit in the neighbor count as a separate variable: using C operators, | (logical or), & (logical and), and ~ (logical not) a = state of cell in the next generation b = state of cell in the current generation c = bit 2 of neighbor count (count & 4) d = bit 1 (count & 2) e = bit 0 (count & 1) a = (~c)&d&(e|b) Truth table: b c d e | a ----------- 0 0 0 0 | 0 0 0 0 1 | 0 0 0 1 0 | 0 0 0 1 1 | 1 Three neighbors to an 'off' cell. 0 1 0 0 | 0 0 1 0 1 | 0 0 1 1 0 | 0 0 1 1 1 | 0 1 0 0 0 | 0 1 0 0 1 | 0 1 0 1 0 | 1 Two neighbors to an 'on' cell. 1 0 1 1 | 1 Three neighbors to an 'on' cell. 1 1 0 0 | 0 1 1 0 1 | 0 1 1 1 0 | 0 1 1 1 1 | 0 In an attempt to node my homework and do a favor to anyone who needs it, here's the source code in C++ for the game of life. If you see a way I can optimize it (boy, my code can usually be optimized quite a bit), /msg me, and I'll credit you at the bottom. Skill level: Moderately skilled beginner #include <iostream.h> #include "apstring.h" #include "apmatrix.h" // you can get the ap*.h files from the college board website void dispgrid(apmatrix <int> grid); void figsurr(apmatrix <int> &grid, apmatrix <int> &grids); void change(apmatrix <int> &grid, apmatrix <int> &grids); void main() { apmatrix <int> grid(10,10,0); // grid holds the alive/dead value apmatrix <int> grids(10,10,0); // grids holds the surrounding alive/dead cells char cont='Y'; // this is where we make the base setup. // you can change it however you want // everything is declared as a 0 already, // so just make it a '1' to start. // the suggested values for beginning: grid[2][4]=1; grid[3][5]=1; grid[4][3]=1; grid[4][4]=1; grid[4][5]=1; grid[5][3]=1; grid[5][4]=1; grid[5][5]=1; while(cont=='Y') { dispgrid(grid); // display the grid figsurr(grid, grids); // figure out surrounding alive/dead cells change(grid, grids); // do the next generation cout<<"\nDo you want to continue? [Y/N] "; cin>> cont; cont = toupper(cont); cin.ignore(100,'\n'); // allows the program to repeat } } void figsurr(apmatrix <int> &grid, apmatrix <int> &grids) { int surr; // the two for loops run through the whole grid // regardless of size for(int i=0; i<grid.numrows(); i++) { for(int j=0; j<grid.numcols(); j++) { surr=0; // the i!=__ clauses are basic bounds checking // the grid____==1 clauses are to check if a surrounding // cell is alive or dead if(i!=0&&j!=0&&grid[i-1][j-1]==1) surr++; if(i!=0&&grid[i-1][j]==1) surr++; if(i!=0&&j!=9&&grid[i-1][j+1]==1) surr++; if(j!=0&&grid[i][j-1]==1) surr++; if(j!=9&&grid[i][j+1]==1) surr++; if(i!=9&&j!=0&&grid[i+1][j-1]==1) surr++; if(i!=9&&grid[i+1][j]==1) surr++; if(i!=9&&j!=9&&grid[i+1][j+1]==1) surr++; grids[i][j]=surr; // send the results to the corresponding cell on "grids" } } } void change(apmatrix <int> &grid, apmatrix <int> &grids) { // here's where the rules come into play // you can change them depending on how you // want to run the game. // Currently: if the current cell is alive // and there are less than two surrounding living // cells, the cell will die of starvation. // More than three and it will die of overcrowding // If it's dead, and there are exactly 3 surrouding // living cells, the cell will gain life. for(int i=0; i<grid.numrows(); i++) { for(int j=0; j<grid.numcols(); j++) { if(grid[i][j]==1&&(grids[i][j]<2||grids[i][j]>3)) { grid[i][j]=0; } else if(grid[i][j]==0&&grids[i][j]==3) grid[i][j]=1; } } } void dispgrid(apmatrix <int> grid) { // just neato formatting. // Change it to please you. cout << "\n 0123456789\n"; cout << " __________\n"; for(int i=0; i<grid.numrows(); i++) { cout << i << " |"; for(int j=0; j<grid.numcols(); j++) { if(grid[i][j]==0) cout << "."; if(grid[i][j]==1) cout << "x"; //InfoDisplay:cout << grid[i][j] << grids[i][j]; } cout << "|\n"; } cout << " ----------\n"; } complete with a decent history of the topic, and gallery of some of the more famous discoveries. There's patterns with all kinds of crazy properties - There's even a pattern that determines if a number is prime or not. The mind boggles (at least mine does) at all this complexity from squat in terms of input. Life begins to seem a very apt name indeed. Those with math-ish minds beware! I have just wasted a whole afternoon playing around with this thing. All those morphing patterns - it's kind of mentally addictive!. Update: Several people have messaged me on this, so I think I now have my answer. Basically, the laws of the game are a bit too arbitrary for the second law to necessarily apply (which is, after all, essentially only an observational law about the real world. It need not to apply to some imagined system) Txikwa points out that if we assume that changing the state of a cell requires some energy, then we can't have infinite growth without infinite energy input, just like the real world. Also, as tdent points out, for most sensible definitions of entropy, an initial condition consisting of a few cells has very low entropy, and infinite growth means infinitely larger entropy. Anyway, we are now far from the main subject of this node, so I will leave it at that. Welcome, contestants, to the Universal Machine Contest! Your purpose, as I'm sure you know from the pre-briefing notes that were handed out, is to build a machine. However, this is no ordinary contest, and these will be no ordinary machines. The prize? I'm afraid I'm not allowed to divulge that information. The purpose of the machines? I can't tell you that either, although you're more than welcome to guess. You will each be given a workshop, sealed off from the rest of the contestants. Each workshop contains a small mountain of references in a digital format. We've been kind and given you a few technical manuals, but most of the material relates only to the external appearance and functionality of previous machines - not all of which may have been completed or even existed. You will also be given access to our parts warehouse, which contains several million different components. Some of them are new, but most of them are spare parts designed for previous machines - or the disassembled remnants of such. As such, none of them are labelled, and many that look okay on the first inspection may conceal a fatal flaw deep inside. Others which look obsolete and worn-out may serve as an anchor to hold your entire machine together. We don't like to dictate what your machine must or must not contain, but as a hint, the input/output and encryption/decryption subsystems may come in very handy, since they'll allow you access to the references. Of course, you can get by without them, but it'll be a long, difficult journey, and whether or not you believe there'll be an additional reward for doing it "blind", as it were, is entirely up to you. Implementing a network interface will allow you to communicate with other machines, although bandwidth is very limited due to our large number of contestants and the aging network. It's needed an overhaul for a long time, but as of yet nobody has managed to come up with a machine capable of the task, although we've had some worthy contenders. You will be given a "black box" power supply to start you off. Activation of said power supply will be your very first task, and its deactivation - whether your fault or not - will cause you to forfeit your place in the contest. Deactivation can be caused by four things. First, a major malfunction in your machine may cause enough backlash to overload and destroy your supply. Ideally, this should never happen - but it's fairly common in the case of particularly badly-built machines, or those using faulty parts. Thirdly, every five minutes we select a random contestant from our database of several billion current contestants. They are removed from the Contest and taken to the next level. Which, of course, I can't tell you about. And fourthly, your power supply has a limited lifetime built into it, randomly selected upon activation - anything from one day to over a hundred years. Once this time is up, the next level awaits. Part of the beauty of this contest is that we give you no tools to start off with, apart from the power supply. Your machine will become your tool, as well as your source of reference and your overall purpose. The first components you add will be building blocks which will allow you to add more sophisticated components, which in turn will allow you to add yet more, or even to construct your own. You'll probably find that you end up doing a lot of work on the fly, as opposed to stripping entire subsystems out for rebuilding. Just watch out - although some pieces may slot in easily and immediately mesh with the rest of the system, there are others which may cause things to seize up or break or, more insiduously, slowly damage and corrupt other components, requiring extensive repair later on. Of course, this wouldn't be the Universal Machine Contest without the Challenges. Every so often, depending on your performance in previous Challenges, your machine will be entered into a series of improbable and extreme situations, often joining with or competing against other machines. You may get the chance to help repair a badly damaged machine or have your own machine repaired by another. You may be tasked to keep your machine running under an onslaught of attacks from others. You might have the opportunity to set up temporary or permanent networks with other machines, to compare and contrast the inner workings of other projects. You may have networks that you set up in previous Challenges disrupted or subverted. Every Challenge is different. Passing a Challenge entitles you to a reward, which may range from a whole new subsystem... to nothing at all. You will have the chance to modify your machine on the fly during each Challenge, repairing damage, or occasionally picking up discarded parts from other machines and making them part of yours. In the end, every machine is unique. No machine undergoes the same set of Challenges as any other, and even those which look identical at a quick glance are usually radically different inside. You'll end up with something that any sane designer would flee in terror from, an assemblage of odd parts tied together with duct tape and hope that somehow works despite all the odds. Maybe you'll be proud of your creation. Maybe you'll hate the sight of it by the time your spell in Stage One ends. Regardless, I'm sure you'll find the Contest to be the experience of a lifetime. And now, without further ado... I bid you luck. You may begin. Inspired by a couple of pages of night-time scribble found in an old, forgotten notebook. Closed-captioned for the Metaphorically Impaired (clumsily) Log in or registerto write something here or to contact authors. Need help? accounthelp@everything2.com
http://everything2.com/title/game+of+life
CC-MAIN-2016-40
refinedweb
3,195
69.11
So a few weeks ago I found out about the Stanford CS106a classes that you could find on youtube, and since then I have been occasionally working on Karel programs when I get the chance. For the past few days though Ive been working on programming actual java. I've done a few things so far, mainly just math related code to get me used to programming Console Programs. For the past 2 days when I've gotten the chance I've been working on just simply writing the quadratic formula, which took roughly 3-4 hours to write, and another hour and a half to debug mainly one bug that caused the math to not function properly. So last night I got everything fixed, and this morning I thought before I celebrate I had better make it so that the program repeats so I don't have to close it and run it every time I run a problem. So, like I did in Karel programs, I used the standard "private void repeat() {" (without quotation marks). Which ended up getting some errors and causing some other errors. So after about an hour and a half now messing with the code, googling, and trying to figure out what the error messages mean, I havent gotten to far. At the moment I have "private @ repeat() {" (once again without quotes) and the only error message given is "Syntax error, insert 'enum Identifier' to complete enumHeader". All im aiming to do is create a method to call on if the user presses "y" and wants to run the program again. Heres the code: Code : /* This program should allow the user to input variables, and solve the quadratic formula. * * Code that causes program to repeat may not be debugged fully. * Currently working on code to make the program repeat itself. * Could look neater in the future. */ import acm.program.ConsoleProgram; public class quadraticFormula extends ConsoleProgram { public void run() { private @ repeat() { println("Enter values a, b, and c to compute Quadratic Formula"); int a = readInt("Enter a: "); // Getting some input for the formula // int b = readInt("Enter b: "); int c = readInt("Enter c: "); int discriminant = ((b*b) - (4*a*c)); { // Solves the inside of the radical without finding the square root if (discriminant < 0) { // This checks for an imaginary number // println("This is an imaginary number."); } else { // This executes the rest of the equation if it is not imaginary // println("The discriminant (result inside radical) is " + (Math.sqrt(discriminant))); // Prints & squares the discriminate // int dividend = 2*a; // Simply multiplies the 2 on the bottom of the equation times a // double posativeEquation = ((-b) + Math.sqrt(discriminant))/dividend; // These do the basic math to finish up the problem double negativeEquation = ((-b) - Math.sqrt(discriminant))/dividend; println("Result of addittion equation is " + posativeEquation + "."); println("Result of subtraction equation is " + negativeEquation + "."); println("----Would you like to compute another formula?"); int r = readInt("Enter y or n"); // Everything below this will cause the program to run again if y is read int y = repeat; int n = ABORT; if (r = y); { repeat(); } if (r = n); { ABORT(); } } } } } } I kinda realize this maybe kindav painful to look at, which is another question I had. My karel programs looked extremely neat, but these end up looking pretty rough. Could I get some advice about how to make this program look a little neater? Like I was saying before Im really looking for something that I could just call on in "y" that would cause the program to restart. I know this maybe pretty bad, but for my first real program Im pretty proud of it! Thx in advance for any advice you can give that I could use to improve!
http://www.javaprogrammingforums.com/%20loops-control-statements/2510-need-some-general-specific-advice-printingthethread.html
CC-MAIN-2016-26
refinedweb
616
57.91
In their book, Design Patterns, Elements of Reusable Object-Oriented Software, Gamma, Helm, Johnson and Vlissides describe a design pattern called State. The State pattern allows an object to change its behaviour when its internal state changes. For example, suppose we have a Button class with a (public) member function, Press(). The first time the Press() function is called some piece of equipment is turned on; the second time the equipment is turned off. There is one event (pressing the button) that triggers multiple actions (switch on, switch off). Gamma, et al. (the Gang of Four), present a design in which each internal state is a separate object. The parent class stores a pointer to the current state object and delegates all operations to the current state. The states are polymorphic. The base class declares a virtual function to handle each event and derived classes provide different implementations of the event handling functions. class Button; class State { public: virtual void Toggle(Button&); }; class Off : public State { public: virtual void Toggle(Button&); }; class On : public State { public: virtual void Toggle(Button&); }; class Button { public: Button(); void Press() {state->Toggle(*this);} private: State* state; }; Figure 1 - State selects and performs action The parent class passes a reference to itself to each of the event handling functions so that the current state can be updated. The Design Patterns book makes the State base class a friend and its derived classes call a protected function in State to get access to the state pointer. The implementation must also consider when the state objects are created and destroyed and where they are stored. This article presents an alternative implementation in which the derived classes, passing a reference to the parent class and friends all become unnecessary. This new implementation tends to be simpler and fits well with the usual solutions to the problems of creating, destroying and accessing the state objects. In the Gang of Four version the State objects do two things: they select an action and perform that action on behalf of the parent object. In the new implementation the State objects select an action, but the parent object retains responsibility for performing the selected action. class Button { public: Button() : state(&off) {} void Press(); private: struct State { void (Button::*toggle)(); }; private: static const State off, on; private: void SwitchOn (); void SwitchOff(); private: const State* state; }; const Button::State Button::off = {&Button::SwitchOn }; const Button::State Button::on = {&Button::SwitchOff}; void Button::Press() {(this->*state->toggle)();} Figure 2 - State selects action, Button performs action The State class stores pointers to member functions of the Button class. When a button press event occurs the Press() function uses the current state to get a pointer to a Button member function and executes that function on its own Button object. If we dissect the Press() function we can break it down into the following steps: typedef void (Button::*Action)(); // pointer to Button member function void Button::Press() { Action action = state->toggle; // select action (this->*action)(); // perform selected action } If the current state is 'off', state->toggle points to Button::SwitchOn(), which switches on the equipment and sets the Button state to 'on'. Now, state->toggle points to Button::SwitchOff(), which switches the equipment off again and resets the Button state to 'off'. void Button::SwitchOn() { // ... switch on the equipment ... state = &on; // change to the 'on' state } void Button::SwitchOff() { // ... switch off the equipment ... state = &off; // change to the 'off' state } What could be simpler? The State class only contains data; there are no virtual functions to override and, hence, no need of derived classes. To emphasise this I have used a Plain Old Data type (struct) instead of a class with separate interface and implementation. Purists may prefer to make the data private and provide suitable access functions. Now that there is just one State class instead of a class hierarchy it can be nested inside the parent class without unduly complicating the parent class declaration. This generates fewer identifiers at namespace scope. The simple, data-only State objects are good candidates for class scope and static storage. There is no need to use the Singleton design pattern to provide the action functions with access to the State objects or to ensure that all Buttons share the same State information. The relationships between states, events and actions are fixed at compile time and stored in the State objects, so the State objects can be const qualified. The set of State objects provides a direct implementation of a state table. This implementation typically produces simpler source code, especially when the parent class contains data that is shared by the action functions. The pointer to the current state is just such a data item. Each action function can change the state of the parent object by directly updating the pointer. It may be argued that the State class is very weak. However, it is private to Button and, as all of its members are pointers to Button member functions, it is difficult to see how the State representation could change. So, client code can not misuse the State class and little would be gained from hiding the data behind access functions. The presence of the State class definition within the Button class is slightly more difficult to defend. In large projects this style can lead to excessive dependencies between header files and painfully slow compilations. However, if this is a problem, it can be fixed by storing pointers to the State objects in the Button class instead of the objects themselves. The State class definition can then be moved to the Button's .cpp file, leaving just a declaration of the incomplete type in the header. The implementation described in Design Patterns uses fully-fledged State objects. Encapsulation, inheritance and polymorphism are all essential to their design. Of course, the Gang of Four were writing a book about object-oriented design patterns in general and pointers to member functions may not be available in other OO languages. In the context of C++, however, I believe applying object-oriented principles too rigidly has led to an inappropriate separation of responsibilities. Like all good things, object-oriented thinking can be overdone.
https://accu.org/index.php/journals/528
CC-MAIN-2020-16
refinedweb
1,030
51.28
I am trying to add a feature into my app where it can take a UIView and then post that UIView onto a stream that anyone who has the app can see. Any advice or help would be great and I hope this helps future viewers. Try using the Firebase API. Firebase is a backend that is simple to work with and will allow you to create a realtime updating display. In firebase, data is formatted as JSON. There is a root dictionary with (arrays/strings/other dictionaries) within it. Learn more about JSON: Firebase will allow you to observe an array of dictionaries that can contain info that you can load into UIView's on the client side and display. When each user adds a new view, extract the info from the view, and post it to firebase- and firebase will update all the other clients. Firebase Quickstart: This is an example: import Firebase // in your view controller var myRootRef = Firebase(url:"https://<YOUR-FIREBASE-APP>.firebaseio.com") override func viewDidLoad() { super.viewDidLoad() let views = myRootRef.childByAppendingPath(pathString: "viewData") // this is where you will store an array of viewData objects // Attach a closure to read the data at our views reference // Every time a view is added Firebase will execute this block on all listeners ref.observeEventType(.Value, withBlock: { snapshot in if let arr = snapshot.value as? [[String:AnyObject]] { // UPDATE DISPLAY WITH THIS DATA } }, withCancelBlock: { error in println(error.description) }) } func postData(data: [String:AnyObject]) { let views = myRootRef.childByAppendingPath(pathString: "viewData") // this is where you will append new object let newObject = ref.childByAutoId() // only exists locally newObject.set(data) // Firebase handles getting this onto the server } The observer in viewDidLoad: is realtime so every time you add data from any client, it will update all the clients. Call postData: every time your user adds a new info with data. For this example I made each data model a dictionary, but you can change that as per your needs. Sample data in JSON format: "app" : { "viewData": [ 0: { "title": "This is the first view", "number": 45 }, 1: { "title": "This is the next view", "number": 32 } ] }
https://codedump.io/share/q2sbWeHGxRN6/1/how-can-all-users-post-uiviews-to-a-single-stream-while-connected-to-internet-in-swift
CC-MAIN-2017-13
refinedweb
354
55.64
Issues Show Unassigned Show All Search Lost your login? Roundup docs Created on 2008-09-03.14:54:49 by htgoebel, last changed 2009-10-19.19:33:07 by pje. setuptools 0.6c10 is released with a fix for this issue. The recursion in the log attached to this case here is occurring during entry point resolution; specifically, it appears to be trying to use an egg_info.writers entry point that depends on PasteDeploy while running the egg_info command on PasteScript. This causes it to try to install PasteDeploy (because it's an install-time requirement of PasteScript as a whole), but since the entry point is still present, the attempt to run the egg_info command on PasteDeploy tries to make it install PasteDeploy a second time. Two possible ways to fix this would include making PasteDeploy a setup-time requirement of PasteScript, or making it not a requirement at all. To fix the problem in future versions of setuptools, I'll ensure that the pkg_resources state is sandboxed between the parent and child builds, and that a child build's working set includes the setup directory. (Currently, the directory is added to sys.path, but not to the working set.) This should let child builds be considered a resolution to the parent's requirements, without starting a recursive rebuild of the child. Then, as long as the child has an .egg-info file or directory when the build starts, the problem won't happen. (One could still have a problem on an svn checkout in that case, though; not a lot I can do about that one, except document that you should use setup_requires.) For now, though, try putting PasteDeploy in setup_requires as well as install_requires, or alternatively dropping it from install_requires. I will also soon have a patch for the original problem in setuptools trunk, which I'd like for you to test (without the workaround) to make sure I've fixed it correctly. Thanks! There isn't a circular requirement, but I have come upon different recursion problems (they sometimes manifest themselves different ways, like a Bus Error). They seem to be related to PasteScript's entry points: [distutils.setup_keywords] paster_plugins = setuptools.dist:assert_string_list [egg_info.writers] paster_plugins.txt = setuptools.command.egg_info:write_arg And then some issue about what order things are installed it, because the presence of the argument seems to sometimes cause an installation or... something. It's been confusing, because the errors don't seem directly related to the source of the problem. The PasteScript problem appears unrelated; judging from the attached log, it looks like it has a build-time dependency on PasteDeploy, which in turn has a build-time dependency on PasteScript, which then results in an infinite recursion. This is different from the original problem reported here, and should be referred to Ian, as it does not appear to be a setuptools bug. Adding ianb who is the author of PasteScript. Also happens when you run "easy_install PasteScript". Log file attached. The installation target(s) for the develop command should not be the current directory. There should probably be a check for this. (Maybe for install, too.) I'm installing a development egg like this:: PYTHONPATH=.:$PYTHONPATH python setup_.py develop --install-dir . --script-dir . Now when re-running the command above, it will fail:: File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 1072, in safe_name File "/usr/lib/python2.5/re.py", line 150, in sub return _compile(pattern, 0).sub(repl, string, count) File "/usr/lib/python2.5/re.py", line 230, in _compile p = _cache.get(cachekey) RuntimeError: maximum recursion depth exceeded in cmp This seams to be a problem with *.egg-link. If I add these lines to teh fron tom my setup.py, re-running is fine: import glob, os for fn in glob.glob('*.egg-link'): os.remove(fn)
http://bugs.python.org/setuptools/issue40
crawl-003
refinedweb
652
57.67
I'de have to disagree with that argument, Joe. I think Andrew did the work for core plugins, and there should be no published external plugins using the new 3.0 plugin structure yet, right? Are we intending to not break compatibility with some hypothetical external plugin dev who used a pre-release tool, yet isn't willing to a single string find-and-replace? Is there a even a single concrete example here, or is this just speculation? -Michal On Tue, Jul 9, 2013 at 7:22 PM, Joe Bowser <bowserj@gmail.com> wrote: > This creates more work one week prior to release. If we didn't have a > deadline for this release, I'd be OK with it, but this means that the > trivial change would have to happen to all our plugins. Given the time > constraint, I think we shouldn't do it. > > There's also the fact that our plugin developers hate all change, no matter > how reasonable it may seem. > > That's why I think this should go in 3.1 or 3.2. > On Jul 9, 2013 4:12 PM, "Andrew Grieve" <agrieve@chromium.org> wrote: > > > :) okay, now let's see if I can convince you Joe. > > > > What I've done so far was put classes in o.a.c.api that extend the actual > > implementations in o.a.c. This is a bit more annoying than I'd like, > > because for it work properly, most types must continue to refer to the > > o.a.c.api classes, or else you'll get a type errors when dealing with > > non-updated code that expects a o.a.c.api class. > > > > Using a separate namespace (.api) to indicate which methods are a part of > > our public API has the huge draw-back of not allowing us to make use of > > package-private visibility with the classes in the non-.api namespace. > This > > is my main motivation for the change. I think Java devs often assume any > > symbol that is public is a part of our API, and I think that's pretty > > reasonable. Going forward, we should make an effort to convert public > > symbols to package-private symbols. This will break any plugin that is > > relying on the symbol, but will *not* break any plugins that are not > using > > the symbol. OTOH, a namespace change, as we're doing here, will break all > > plugins. > > > > So... I'd like to do the complete namespace change now so that when > > we privatize symbols that we don't want to be a part of our public API, > it > > will not break the large majority of plugins. > > > > If you're not convinced, please say why :) > > > > > > > > > > > > > > > > > > On Tue, Jul 9, 2013 at 5:33 PM, Joe Bowser <bowserj@gmail.com> wrote: > > > > > Actually, on second thought, no, let's keep the compatibility classes > > > in for now. We may want to keep using this namespace post-3.0. I > > > think I misunderstood what was being asked. > > > > > > On Tue, Jul 9, 2013 at 2:28 PM, Joe Bowser <bowserj@gmail.com> wrote: > > > > On Mon, Jul 8, 2013 at 12:50 PM, Andrew Grieve <agrieve@chromium.org > > > > > wrote: > > > >> Want to bring this up again. > > > >> > > > >> There was a bit of discussion on the bug: > > > >> > > > >> > > > >> I've already gone ahead with creating backward-compatiblity classes > in > > > the > > > >> .api namespace, but I think it would be better to just delete them. > > > >> > > > >> Main points in favour: > > > >> 1. For 3.0, people will need to do some work to their plugins > anyways > > > (add > > > >> plugin.xml + refactor their JS into modules comes to mind) > > > >> 2. The change to plugins is trivial. Just replace all occurrences of > > > >> "import org.apache.cordova.api" with "import org.apache.cordova". > > > >> > > > > > > > > I'm OK with it for now, only because we don't have the time to > > > > formalize the Android Plugin API. I would have liked to keep the api > > > > separation but perhaps we can revisit this 3.1 or 3.2. > > > > > >
http://mail-archives.apache.org/mod_mbox/cordova-dev/201307.mbox/%3CCAEeF2TfvViTFe83c+duHBr0m6Q529RJ6WOdFhX2eLu2b=VkdTA@mail.gmail.com%3E
CC-MAIN-2018-43
refinedweb
657
74.79
indent [options] [input-files] indent [options] [single-input-file] [-o output-file] indent --version Misc. Reference Manual Pages INDENT(1L) NAME indent - changes the appearance of a C program by inserting or deleting whitespace. SYNOPSIS indent [options] [input-files] indent [options] [single-input-file] [-o output-file] indent --version DESCRIPTION This man page is generated from the file indent.texinfo. This is Edition 2.2.9 of "The indent Manual", for Indent Version 2.2.9, last updated 10 November. See STATEMENTS. -blin, --brace-indentn Indent braces n spaces. SunOS 5.11 Last change: 1 Misc. Reference Manual Pages INDENT(1L) See STATEMENTS. -bls, --braces-after-struct-decl-line Put braces on the line after struct declaration lines. See DECLARATIONS. -br, --braces-on-if-line Put braces on line with if, etc. See STATEMENTS. SunOS 5.11 Last change: 2 Misc. Reference Manual Pages INDENT(1 SunOS 5.11 Last change: 3 Misc. Reference Manual Pages INDENT(1L) opera- tors. See BREAKING LONG LINES. -nbc, --no-blank-lines-after-commas Do not force newlines after commas in declarations. See DECLARATIONS. -nbfda, --dont-break-function-decl-args Don't put each argument in a function declaration on a seperate. SunOS 5.11 Last change: 4 Misc. Reference Manual Pages INDENT(1L) -ncs, --no-space-after-casts Do not put a space after cast operators. See STATEMENTS. -nfc1, --dont-format-first-column-comments Do not format comments in the first column as normal. See COMMENTS. -nfca, --dont-format-comments Do not format any comments. See COMMENTS. . SunOS 5.11 Last change: 5 Misc. Reference Manual Pages INDENT(1L). . -prs, --space-after-parentheses Put a space after every '(' and before every ')'. See STATEMENTS. -psl, --procnames-start-lines Put the type of a procedure on the line before its name. See DECLARATIONS. -saf, --space-after-for Put a space after each for. See STATEMENTS. SunOS 5.11 Last change: 6 Misc. Reference Manual Pages INDENT(1L) . : SunOS 5.11 Last change: 7 Misc. Reference Manual Pages INDENT(1L) spec- ify for- matted. SunOS 5.11 Last change: 8 Misc. Reference Manual Pages INDENT(1L) cur- rent directory and use that if found. Finally indent will search your home directory for `.indent.pro' and use that file if it is found. This behaviour is different from that of other ver- sions of indent, which load both files if COM- MON suf- fix by setting the environment variable SIMPLE_BACKUP_SUFFIX to your preferred suffix. SunOS 5.11 Last change: 9 Misc. Reference Manual Pages INDENT(1L) Numbered backup versions of a file `momeraths.c' look like `momeraths.c.~23~', where 23 is the version of this particu- lar num- bered backups for the file being indented; otherwise, a sim- ple. COMMON STYLES There are several common styles of C code, including the GNU style, the Kernighan & Ritchie style, and the original Berkeley style. A style may be selected with a single back- ground option, which specifies a set of values for all other options. However, explicitly specified options always over- ride SunOS 5.11 Last change: 10 Misc. Reference Manual Pages INDENT(1L) follow- ing SunOS 5.11 Last change: 11 Misc. Reference Manual Pages INDENT(1L) int foo () { puts("Hi"); } /* The procedure bar is even less interesting. */ char * bar () { puts("Hello"); } indent -bap produces int foo () { puts ("Hi"); } /* The procedure bar is even less interesting. */ SunOS 5.11 Last change: 12 Misc. Reference Manual Pages INDENT(1L), com- ments which follow declarations, comments following pre- processor directives, and comments which are not preceded by code of any sort, i.e., they begin the text of the line (although not neccessarily in column 1). indent further distinguishes between comments found proce- dures and aggregates, and those found within them. In par- ticular, comments beginning a line found within a procedure will be indented to the column at which code is currently indented. The exception to this a comment beginning in the leftmost column; such a comment is output at that column. indent attempts to leave boxed comments general idea of such a comment is that it is enclosed in a rectangle or ``box'' of stars or dashes to visually set it apart. More pre- cisely,. SunOS 5.11 Last change: 13 Misc. Reference Manual Pages INDENT(1L) for- matted. col- umn). This alignment may be affected by the `-d' option, which specifies an amount by which such comments are moved to the left, or unindented. For example, `-d2' places com- ments two spaces to the left of code. By default, comments are aligned with code, unless they begin in the first col- umn, in which case they are left there by default --- to get them aligned with the code, specify `-fc1'. Comments to the right of code will appear by default in SunOS 5.11 Last change: 14 Misc. Reference Manual Pages INDENT(1L) column 33. This may be changed with one of three options. `-c' will specify the column for comments following code, `-cd' specifies the column for comments following declara- tions, and `-cp' specifies the column for comments following preprocessor directives #else and #endif. If the code to the left of the comment exceeds the beginning column, the comment column will be extended to the next tab- stop column past the end of the code, or in the case of pre- processor spa- ces by which braces are indented. `-bli2', the default, gives the result shown above. `-bli0' results in the fol- lowing: SunOS 5.11 Last change: 15 Misc. Reference Manual Pages INDENT(1L): { SunOS 5.11 Last change: 16 Misc. Reference Manual Pages INDENT(1L) + state- ment, SunOS 5.11 Last change: 17 Misc. Reference Manual Pages INDENT(1L) known as the `Bill_Shannon' option. The `-saf' option forces a space between an for and the fol- lowing parenthesis. This is the default. The `-sai' option forces a space between an if and the fol- lowing vari- ables SunOS 5.11 Last change: 18 Misc. Reference Manual Pages INDENT(1L) pro- cedure. speci- fied SunOS 5.11 Last change: 19 Misc. Reference Manual Pages INDENT(1L) inden- tation level is increased by the value specified by the `-i' option. For example, use `-i8' to specify an eight charac- ter: SunOS 5.11 Last change: 20 Misc. Reference Manual Pages INDENT(1L) if ((((i < 2 && k > 0) || p == 0) && q == 1) || n = 0) indent assumes that tabs are placed input and output charac- ter defini- tions look like this: char * create_world (x, y, scale) int x; int y; float scale; { . . . } For compatibility with other versions of indent, the option `-nip' is provided, which is equivalent to `-ip0'. ANSI C allows white space to be placed on preprocessor com- mand lines between the character `#' and the command name. By default, indent removes this space, but specifying directs indent to leave this space unmodified. The option `-ppi' overrides `-nlps' and `-lps'. This option can be used to request that preprocessor condi- tional statements can be indented by to given number of spa- ces, for example with the option `-ppi 3' #if X #if Y #define Z 1 #else #define Z 0 #endif #endif becomes #if X # if Y # define Z 1 # else # define Z 0 # endif SunOS 5.11 Last change: 21 Misc. Reference Manual Pages INDENT(1L) #endif BREAKING LONG LINES' && SunOS 5.11 Last change: 22 Misc. Reference Manual Pages INDENT(1L) ( Formatting of C code may be disabled for portions of a pro- gram clos- ing func- tion and continuing it after the end of the function may lead to bizarre results. It is therefore wise to be some- what modular in selecting code to be left unformatted. As a historical note, some earlier versions of indent pro- duced error messages beginning with *INDENT**. These ver- sions of indent were written to ignore any with such error messages. I have removed this incestuous feature from GNU indent.. SunOS 5.11 Last change: 23 Misc. Reference Manual Pages INDENT(1L) com- ment but as an identifier, causing them to be joined with the next line. This renders comments of this type useless, unless they are embedded in the code to begin with. COPYRIGHT The following copyright notice applies to the indent pro- gram.. SunOS 5.11 Last change: 24 Misc. Reference Manual Pages INDENT(1L) SunOS 5.11 Last change: 25 Misc. Reference Manual Pages INDENT(1L) - SunOS 5.11 Last change: 26 Misc. Reference Manual Pages INDENT(1L) RETURN VALUE Unknown FILES $HOME/.indent.pro holds default options for indent. AUTHORS Carlo Wood Joseph Arceneaux Jim Kingdon David Ingamells HISTORY Derived from the UCB program "indent". COPYING Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 Free Soft- ware Foundation, Inc. Copyright (C) 1995, 1996 Joseph Arce- neaux. Copyright (C) 1999 Carlo Wood. Copyright (C) 2001 David Ingamells. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this per- mission notice are preserved on all copies. ATTRIBUTES See attributes(5) for descriptions of the following attributes: +---------------+----------------------+ |ATTRIBUTE TYPE | ATTRIBUTE VALUE | +---------------+----------------------+ |Availability | developer/gnu-indent | +---------------+----------------------+ |Stability | Volatile | +---------------+----------------------+ NOTES This software was built from source available at. The original community source was downloaded from Further information about this software can be found on the open source community website at- ware/indent/. SunOS 5.11 Last change: 27
https://docs.oracle.com/cd/E36784_01/html/E36870/indent-1.html
CC-MAIN-2019-30
refinedweb
1,548
67.65
shmget - get shared memory segment #include <sys/shm.h> int shmget(key_t key, size_t size, int shmflg); The shmget() function returns is initialised will be initialised with all zero values. Upon successful completion, shmget() returns a non-negative integer, namely a shared memory identifier; otherwise, it returns -1 and errno will be set to indicate the error. The shmget() function will fail if: - [EACCES] - A shared memory identifier exists for key but operation permission as specified by the low-order nine bits of shmflg would not be granted. See IPC. - [EEXIST] - A shared memory identifier exists for the argument key but (shmflg&IPC_CREAT)&&(shmflg&IPC_EXCL) is non-zero. - [EINVAL] - The value of size is less than the system-imposed minimum or greater than the system-imposed maximum, or a shared memory identifier exists for the argument are to. shmat(), shmctl(), shmdt(), shm_open(), shm_unlink(), <sys/shm.h>, IPC. Derived from Issue 2 of the SVID.
http://pubs.opengroup.org/onlinepubs/007908775/xsh/shmget.html
CC-MAIN-2015-32
refinedweb
154
53.61
Simple melody with buzzer Now it’s time to make some noise🎶. In this tutorial, you’ll work with a new component - buzzer. You'll make it play a scale. Besides, you will adjust LED brightness with PWM signal. Let’s figure it out together. Learning goals - Clarify the working principle of the PWM signal. - Know two different types of buzzers. - Understand how a buzzer produces sound. - Learn to control LED brightness with PWM output. 🔸Background What is PWM? In the previous projects, you tried the digital output to turn on and off an LED. But how can you make the LED dimmer or brighter? Well, the pulse width modulation (PWM) can deal with it. Let's first learn about the PWM. As you know, a digital signal always outputs high or low level. The PWM signal is still a square wave signal with two states: on (when the signal is high) and off (when the signal is low). The on-time of the signal is called pulse width. So as its name suggests, PWM refers to the method of changing the pulse width, that is, the proportion of on-time to control the output. The signal would change extremely quickly between on and off. It's so fast that your eyes can't notice the change. In this way, you seem to get an average voltage between 0V and 3.3V. Here are some more concepts about PWM: The duty cycle describes the percentage of the on-time in a period: - 0 means the signal is always low. - 1 means it is always high. - A signal with a duty cycle of 0.5 should be high for 50% of the time and low for 50% of the time. And the average voltage is 1.65V. - So a signal with any duty cycle between 0 and 1 can simulate a voltage between 0 and 3.3V. One period of the signal consists of on-time and off-time. It describes the time that a cycle lasts. The frequency is the inverse of the period. It tells the count of cycles in one second. Take 1000Hz for example, the signal has 1000 cycles per second, and the period is 1ms. PWM is useful in many situations: adjusting LED brightness, controlling a servo, or making a buzzer produce sound. You may adjust the duty cycle or the frequency of signals according to your projects. In this tutorial, a buzzer needs different frequencies to generate different notes, while an LED want varying duty cycles to show brightness change. 🔸New component Buzzer The buzzer is a kind of audio device to produce beeping and sharp sounds. It is widely used for notification and confirmation. You may hear it from alarms, toys, or when pressing buttons. Symbol: How does it emit the sound? It's due to the diaphragm inside it. As you apply to a buzzer a current that changes with time, the internal diaphragm will vibrate back and forth quickly. The vibration of the diaphragm thus vibrates the surrounding air, hence producing a sound. When there is no current, the diaphragm will go back to its original position, the sound thus stops. There are two kinds of buzzers: active buzzer and passive buzzer. They needs different types of current. - The active buzzer contains an internal circuit that can create varying voltage. So once you power this kind of buzzer, it will make a sound automatically. But it can only produce one constant sound since the wave generated by the internal circuit is determined. What's more, the active buzzer is polarised and needs to connect in the right direction. - The passive buzzer needs a PWM signal to drive it. The pitch of a sound depends on the frequency of the signal. Higher frequency would move the diaphragm faster and lead to a higher pitch. And the one in the kit is a passive buzzer. They looks alike. To distinguish them, you can connect them to power. If it sounds, it is an active buzzer. 🔸New concept Pitch You must be familiar with do, re, mi... They correspond respectively to the note C, D, E, F, G, A, B. Please note the notes start from C but aren't in alphabetical order. The pitch of each note is decided by the frequency. High pitch corresponds to high frequency, low pitch corresponds to low frequency. The following table gives the frequency of each note. When it comes to Middle C (octave 4), which is the first note to find when you start to learn the piano, the frequency is about 262 Hz. A piano keyboard would be helpful to understand the concept. All keys on the keyboard has a corresponding pitch. They are divided into several octaves: 0 to 7. Let's look the octave 4 in the middle. The white keys corresponds to the notes C, D, E, F, G, A, B. And the note C in this octave is the middle C. The other octave are similar, but will be higher or lower in pitch according to the frequencies. So to make the buzzer play a piece of melody, you need to find the frequency and set a proper duration for each note according to the score. 🔸Circuit - buzzer module The buzzer is connected to the pin PWM5A. The PWM pins are marked with a tilde (~) on the silkscreen of your board. Most of the pins on your SwiftIO Feather board are multifunctional. A pin may be used as digital pins and PWM pins. You can refer to this pinout to know the functionalities of each pin. note The circuits above are simplified for your reference. 🔸Preparation Class PWMOut - this class allows you to set the frequency and duty cycle of PWM output from the board. 🔸Projects 1. Musical scale In this project, the buzzer will play the musical scale. Example code // Import the SwiftIO library to set the input and output, and the MadBoard to use the pin id. import SwiftIO import MadBoard // Initialize a PWM pin for the buzzer. let buzzer = PWMOut(Id.PWM5A) // Declare a constant to store an array of frequencies. // Consult the pitch-frequency chart above and list all the necessary frequencies in order in the array. let frequencies = [262, 294, 330, 349, 392, 440, 494, 523] // Use the for-in loop to iterate through each frequency. // Set the frequency of the PWM signal to generate sounds. Each note will last 1s. for frequency in frequencies { buzzer.set(frequency: frequency, dutycycle: 0.5) sleep(ms: 1000) } // Stop the buzzer sound. buzzer.suspend() while true { sleep(ms: 9999) } Code analysis let buzzer = PWMOut(Id.PWM5A) The id of PWM pins are a little different. You will see A or B in the end. Actually, the PWM pins are grouped in pairs, like PWM2A and PWM2B. The two pins in a group share the same frequency. So if you need two PWM pins with different frequencies, you should use the pins in different groups, like PWM0A and PWM1A. let frequencies = [262, 294, 330, 349, 392, 440, 494, 523] Here you create an array to store the frequencies of each note from C (octave 4) to C (octave 5). The frequencies is a constant, so the array cannot be changed later. If you want to change the array, you need to change let to var to make it a variable. for frequency in frequencies { } Iterate through each value in the array frequencies using for-in loop. buzzer.set(frequency: frequency, dutycycle: 0.5) You are going to set the frequencies, so the method set(frequency:dutycycle:) is more suitable in this case. The frequency corresponds to the values in the array. And the duty cycle could be any float number between 0.0 and 1.0. buzzer.suspend() It will suspend the output, thus stop the sound from the buzzer. If you remove this statement, the last note will last forever. 2. Breathing LED After the musical scale with the buzzer, let’s go back to the LED again. The PWM signal can not only drive a buzzer, but also change LED brightness. By applying PWM output, the LED changes between on and off quickly. You could not notice this change, so it seems the LED becomes brighter and dimmer. BTW, your monitor may also use this method to control the backlight. A bigger duty cycle will make the LED brighter, since the time for high level is much longer. So let’s try a breathing LED! You may notice it when a new message comes on your phones. The LED changes from the darkest to the brightest, from brightest to darkest smoothly. It looks like it is breathing. Example code // Import the SwiftIO library to set the input and output and the MadBoard to use the pin id. import SwiftIO import MadBoard // Initialize a PWM output pin for the LED. let led = PWMOut(Id.PWM4A) // Set the PWM output to control the LED. // The frequency is set to 1000Hz or can be other value. // The duty cycle is 0 in the beginning so LED keeps turning off. led.set(frequency: 1000, dutycycle: 0) // Store the maximum and minimum values of the duty cycle to two constants. let maxDutycycle: Float = 1.0 let minDutycycle: Float = 0.0 // Set the change of duty cycle for each action. let stepDutycycle: Float = 0.01 // Create a variable to store the varying duty cycle. var dutycycle: Float = 0.0 // A condition used to decide whether to increase or decrease the duty cycle. var upDirection = true while true { // Output a PWM signal with the specified duty cycle to control LED brightness. led.setDutycycle(dutycycle) // Keep each brightness last for 10ms, or you may not see the changes. sleep(ms: 10) // Increase or decrease the duty cycle within its range according to the value of upDirection. if upDirection { dutycycle += stepDutycycle if dutycycle >= maxDutycycle { upDirection = false } } else { dutycycle -= stepDutycycle if dutycycle <= minDutycycle { upDirection = true } } } Code analysis let maxDutycycle: Float = 1.0 let minDutycycle: Float = 0.0 let stepDutycycle: Float = 0.01 There are some built-in data types in the Swift language, like Int (integer), Float and Double (decimal number), Bool (true and false), etc. Each type corresponds to different values type and value range. If the values in your program don't match or exceed the default range, the compilation will fail. Besides, if you don’t explicitly declare the data type, Swift will use type inference to decide the type. For example, if the minDutycycle is written as 0, Swift would judge it as an Int. When dealing with decimal numbers 0.0, it could be either float or double. The default choice of Swift is double. However, the duty cycle used in PWMOut class is Float. Therefore, the values above need to be declared as Float. The LED brightness depends on the duty cycle of the PWM signal. The duty cycle is always between 0 and 1. So the maximum and minimum values are stored in two constants for later comparison. The constant stepDutycycle is the change of the duty cycle. You'll increase and decrease the duty cycle by the value repeatedly. Make sure stepDutycycle is not too big so the brightness changes smoothly. var dutycycle: Float = 0.0 A variable, like a constant, is a container for a value but can be changed with other values of the same type. In this case, the duty cycle will always change, so it is stored as a variable instead of a constant. var upDirection = true This variable is used as a condition to decide whether the LED will become brighter or dimmer. In the beginning, it's true so the LED will become brighter at first. led.setDutycycle(dutycycle) Set the duty cycle of PWM output. The LED brightness will change according to its value. sleep(ms: 10) It makes each brightness last for 10ms. If you remove this statement, the LED changes so fast that you cannot notice the brightness change. The duty cycle is 0 - 1, and the change is 0.01 each time. So one loop will last 100 times. Then let’s suppose the LED changes from off to full brightness in 1 second, and you will get the duration for each state - 10ms. if upDirection { ... } else { ... } This conditional statement will decide how the duty cycle will change according to upDirection. If it's true, the duty cycle will increase by the value of stepDutycle. Once its value exceeds the maximum, upDirectionwill be false. If it’s false, the duty cycle will decrease. When it is below its minimum, upDirectionbecomes trueagain. dutycycle += stepDutycycle += combines the addition and assignment. It equals dutycycle = dutycycle + stepDutycycle. And -= means dutycycle = dutycycle - stepDutycycle. if dutycycle >= maxDutycycle { upDirection = false } This statement is to know whether the duty cycle exceeds its range. If so, upDirection is changed to false. In next loop, the duty cycle will begin to decrease by stepDutycycle. 3. LED brightness control You'll adjust the brightness of the LED using two buttons: one is reserved to increase the brightness, the other is to reduce the brightness. Example code // Import two necessary libraries. import SwiftIO import MadBoard // Initialize the PWM pin. let led = PWMOut(Id.PWM4A) // Set the frequency of the PWM signal and set the duty cycle to 0 to keep the LED off. led.set(frequency: 1000, dutycycle: 0) // Store the max and min values of duty cycle to two constants. let maxDutycycle: Float = 1.0 let minDutycycle: Float = 0.0 // The variation of duty cycle per button press. let stepDutycycle: Float = 0.1 // Create a variable to store the value of duty cycle. var dutycycle: Float = 0.0 // Initialize the digital pins. downButton is to dim the LED and the upButton is to brighten the LED. let downButton = DigitalIn(Id.D1) let upButton = DigitalIn(Id.D21) // Each time this button is pressed, the LED will dim a little until it reaches the minimum brightness. downButton.setInterrupt(.rising) { dutycycle -= stepDutycycle dutycycle = max(dutycycle, minDutycycle) led.setDutycycle(dutycycle) } // Once this button is pressed, the LED becomes brighter until it reaches the maximum brightness. upButton.setInterrupt(.rising) { dutycycle += stepDutycycle dutycycle = min(dutycycle, maxDutycycle) led.setDutycycle(dutycycle) } // Keep the board sleeping when the button is not pressed. while true { sleep(ms: 1000) } Code analysis downButton.setInterrupt(.rising) { dutycycle -= stepDutycycle dutycycle = max(dutycycle, minDutycycle) led.setDutycycle(dutycycle) } The two button upButton and downButton works similarly. Take downButton for example. You'll use the interrupt mechanism to detect if the button is pressed. There are three statements for the interrupt. Each of them can be executed in a very short time and thus can be used as ISR. max() is used to get the biggest one between the values. In this way, even if the result of the calculation is smaller than its minimum (0.0), the duty cycle is still 0.0 to keep the LED at the minimum brightness. 🔸More info Here are some links to help you find out more detail:
https://docs.madmachine.io/tutorials/swiftio-circuit-playgrounds/modules/buzzer
CC-MAIN-2022-21
refinedweb
2,496
68.36
Chatlog 2012-01-11 From RDF Working Group Wiki Revision as of 17:20, 11 January 2012 by Commonscribe (Talk | contribs) See panel, original RRSAgent log or preview nicely formatted version. Please justify/explain non-obvious edits to this page, in your "edit summary" text. 15:54:04 <RRSAgent> RRSAgent has joined #rdf-wg 15:54:04 <RRSAgent> logging to 15:54:06 <trackbot> RRSAgent, make logs world 15:54:06 <Zakim> Zakim has joined #rdf-wg 15:54:08 <trackbot> Zakim, this will be 73394 15:54:08 <Zakim> ok, trackbot; I see SW_RDFWG()11:00AM scheduled to start in 6 minutes 15:54:09 <trackbot> Meeting: RDF Working Group Teleconference 15:54:09 <trackbot> Date: 11 January 2012 15:54:11 <cygri> cygri has joined #rdf-wg 15:55:34 <Guus> Guus has joined #rdf-wg 15:56:05 <yvesr> Zakim, who is on the phone? 15:56:05 <Zakim> SW_RDFWG()11:00AM has not yet started, yvesr 15:56:06 <Zakim> On IRC I see Guus, cygri, Zakim, RRSAgent, AZ, MacTed, LeeF, mischat, ivan, SteveH, AndyS1, manu, davidwood, mdmdm_, gavinc, trackbot, yvesr, manu1, NickH, sandro, ericP 15:57:11 <ericP> i'll be 10 mins late... 15:57:18 <SteveH> SteveH has left #rdf-wg 15:57:39 <swh> swh has joined #rdf-wg 15:59:44 <swh> Zakim, who's on the phone? 15:59:44 <Zakim> SW_RDFWG()11:00AM has not yet started, swh 15:59:46 <Zakim> On IRC I see swh, Guus, cygri, Zakim, RRSAgent, AZ, MacTed, LeeF, mischat, ivan, AndyS1, manu, davidwood, mdmdm_, gavinc, trackbot, yvesr, manu1, NickH, sandro, ericP 15:59:48 <cgreer> cgreer has joined #rdf-wg 15:59:59 <gavinc> Zakim, start meeting 16:00:00 <Zakim> I don't understand 'start meeting', gavinc 16:00:06 <pchampin> pchampin has joined #rdf-wg 16:00:12 <swh> Zakim, this will be RDF-WG 16:00:12 <Zakim> I do not see a conference matching that name scheduled within the next hour, swh 16:00:14 <gavinc> Zakim this is rdfwf 16:00:44 <swh> Zakim, this will be RDFWG 16:00:44 <Zakim> ok, swh, I see SW_RDFWG()11:00AM already started 16:00:53 <swh> Zakim, who's on the phone? 16:00:53 <Zakim> On the phone I see ??P0, gavinc, ??P2, +1.206.494.aaaa, mhausenblas, cgreer 16:00:55 <cygri> zakim, mhausenblas is temporarily me 16:00:57 <Zakim> +cygri; got it 16:00:59 <yvesr> Zakim, ??P0 is me 16:01:03 <Zakim> +yvesr; got it 16:01:22 <Arnaud1> Arnaud1 has joined #rdf-wg 16:01:25 <Zakim> +??P10 16:01:32 <AndyS> zakim, ??P10 is me 16:01:34 <swh> Zakim, ??P2 is me 16:01:35 <Zakim> +AndyS; got it 16:01:41 <Zakim> +swh; got it 16:01:45 <Zakim> +??P11 16:01:49 <AndyS> zakim, who is on the phone? 16:01:50 <ivan> zakim, dial ivan-voip 16:01:56 <mischat> zakim, ??P11 is me 16:01:57 <Zakim> On the phone I see yvesr, gavinc, swh, +1.206.494.aaaa, cygri, cgreer, AndyS, ??P11 16:01:59 <Zakim> ok, ivan; the call is being made 16:02:01 <Zakim> +Ivan 16:02:01 <AZ> zakim, aaaa is me 16:02:09 <Zakim> +mischat; got it 16:02:13 <Zakim> +AZ; got it 16:02:16 <mischat> zakim, mute me 16:02:17 <Zakim> + +1.408.996.aabb 16:02:37 <Zakim> mischat should now be muted 16:02:46 <Arnaud> zakim, aabb is me 16:03:13 <Zakim> +Arnaud; got it 16:03:35 <Zakim> +sandro 16:04:26 <Zakim> +David_Wood 16:04:46 <davidwood> Zakim, David_Wood is me 16:04:47 <Zakim> +davidwood; got it 16:04:53 <Zakim> +LeeF 16:05:05 <mischat> davidwood: ww is not here today, i will scribe 16:05:27 <mischat> davidwood: i will send you an email on that front 16:05:42 <davidwood> PROPOSED to accept the minutes of the 4 Jan telecon: 16:05:42 <davidwood> 16:05:53 <mischat> davidwood: any objections to accepting the minutes ? 16:06:00 <JeremyCarroll> JeremyCarroll has joined #rdf-wg 16:06:02 <mischat> RESOLVE accept minutes 16:06:05 <davidwood> Action item review: 16:06:05 <trackbot> Sorry, couldn't find user - item 16:06:05 <davidwood> 16:06:05 <davidwood> 16:06:40 <mischat> davidwood: moving on to open actions … 16:07:00 <Zakim> +JeremyCarroll 16:07:09 <mischat> davidwood: sandro any update on action 82(?) 16:07:16 <sandro> action-82? 16:07:16 <trackbot> ACTION-82 -- Sandro Hawke to draft well-known URI template and propose WG resolution that it is "stable" enough for IETF. -- due 2011-09-14 -- OPEN 16:07:16 <trackbot> 16:07:25 <mischat> davidwood: any updates on action 98 ? 16:07:33 <mischat> action-98 ? 16:07:33 <trackbot> ACTION-98 -- Sandro Hawke to rdf: and rdfs: namespace should resolve to something that meets best practices -- due 2011-12-31 -- OPEN 16:07:33 <trackbot> 16:08:01 <mischat> davidwood: shouldn't this be something for the w3c systems team 16:08:15 <mischat> davidwood: should someone else do this action? 16:08:55 <mischat> sandro: should we be following what the foaf ns does ? 16:08:59 <Zakim> +Souri 16:09:30 <Souri> Souri has joined #rdf-wg 16:09:43 <cygri> q+ 16:09:43 <mischat> davidwood: should we do it the way SKOS does it ? 16:10:03 <mischat> JeremyCarroll: is sandro being too picky here ? 16:10:24 <cygri> 16:10:32 <Zakim> +OpenLink_Software 16:10:33 <mischat> cygri: there is a document best practices for the vocabs 16:10:36 <yvesr> i think danbri is not overly keen on the way FOAF is published 16:10:39 <MacTed> Zakim, OpenLink_Software is temporarily me 16:10:39 <Zakim> +MacTed; got it 16:10:40 <MacTed> Zakim, mute me 16:10:40 <Zakim> MacTed should now be muted 16:10:41 <mischat> cygri: we should follow the above document ^^ 16:10:45 <yvesr> mainly because they're stuck on 0.1 :) 16:11:10 <mischat> sandro: what is the user experience when users as for HTML 16:11:10 <mischat> ? 16:11:40 <mischat> JeremyCarroll: we need 10 lines of HTML, here is the RDF, this is the namespace 16:12:01 <mischat> sandro: doesn't want to do that project 16:12:03 <Zakim> +EricP 16:12:34 <sandro> 16:12:47 <gavinc> 16:12:48 <mischat> davidwood: right now if we resolve a url like above ^^, as it stands we get no HTML 16:13:10 <mischat> davidwood: we shouldn't get RDFXML when asking for a human readable document 16:13:52 <gavinc> eh, _n isn't that bad in javascript ;) 16:14:14 <mischat> davidwood: so where are we at now … 16:14:18 <sandro> zakim, who is making noise? 16:14:28 <Zakim> sandro, listening for 10 seconds I heard sound from the following: cgreer (9%), Arnaud (5%), sandro (34%), davidwood (30%) 16:14:58 <mischat> agenda: RDFa working group last call 16:15:12 <mischat> davidwood: manu asks us to review the RDFa documents 16:15:26 <mischat> davidwood: davidwood will ping Guus about this 16:15:45 <mischat> davidwood: charles have you reviewed the RDFa doc ? 16:15:53 <Zakim> -JeremyCarroll 16:16:09 <mischat> charles : happy with the RDFa doc he reviewed 16:16:45 <ivan> q+ 16:16:47 <mischat> davidwood: we should be reviewing the document in terms of what the RDF WG are interested in document 16:17:01 <cygri> q- 16:17:03 <mischat> davidwood: was reviewing with an RDF WG hat on 16:17:11 <davidwood> ack ivan 16:17:33 <mischat> ivan: charles please submit under your own name 16:17:34 <gavinc> +q to ask about CURIEs 16:17:56 <mischat> ivan: you can tell from the RDFa, that they are staying clear of the named graph issue 16:17:58 <davidwood> ack gavinc 16:17:58 <Zakim> gavinc, you wanted to ask about CURIEs 16:18:04 <mischat> s/charles/cgreer/ 16:18:18 <mischat> gavinc: has gone through the RDFa curie's section 16:18:37 <mischat> gavinc: was wondering whether we should comment on the differences between CURIEs and prefixing ? 16:18:47 <mischat> ivan: which difference are you referring to ? 16:19:24 <cygri> q+ to ask whether they aren't the same now 16:19:25 <mischat> gavinc: the set of URIs which can be represented in CURIES is different from the set of IRIs that SPARQL's & RDF prefixes can represent 16:19:39 <mischat> gavinc: CURIEs don't work with XML 16:19:51 <mischat> gavinc: CURIE has a broader set than XML names 16:20:04 <mischat> gavinc: XML names are valid CURIES and prefix names … 16:20:14 <Zakim> +JeremyCarroll 16:20:28 <mischat> gavinc: we talked about this when talking about Turtle 16:20:41 <ericP> q? 16:20:57 <mischat> davidwood: it would be happy if this would be noted in the spec 16:21:07 <mischat> davidwood: because it is a syntax issue 16:21:11 <AndyS> CURIE is very open : prefix+local for anything, then says other syntaxes can restrict. 16:21:14 <davidwood> ack cygri 16:21:14 <Zakim> cygri, you wanted to ask whether they aren't the same now 16:21:20 <mischat> cygri: can you give an example please ? 16:21:35 <mischat> gavinc: not right now 16:21:37 <cygri> ack me��� 16:21:56 <mischat> JeremyCarroll: 2 use-case to motivated CURIE, 1) ending in numbers 16:22:01 <mischat> as per the IPTC 16:22:24 <mischat> ivan: would like to see a very detailed example please :) 16:22:31 <cygri> thanks in advance gavinc! 16:22:36 <mischat> davidwood: before next week please 16:22:47 <mischat> ericP: you have 2 hours ;) 16:23:00 <mischat> moving on … 16:23:27 <mischat> davidwood: sandro or ivan, what is the best way to get these comments from this WG to the RDFa WG ? 16:23:38 <mischat> ivan: ideally we should send the comments to their mailing list 16:24:12 <mischat> ivan: because when they go to CR, it will be easier for the RDFa folks to handle. Please send comments to the RDFa mailing list 16:24:22 <mischat> davidwood: a link to the public-comments list ? 16:24:38 <mischat> ivan: please use the rdfa wg's list 16:24:44 <ivan> W3C RDFWA WG <public-rdfa-wg@w3.org> 16:25:21 <mischat> ivan: please use ^^ 16:25:23 <gavinc> hey look an example! CURIE: db:resource/Albert_Einstein vs. PNAME db:resource\/Albert_Einstein that's just escaping, will see about others 16:25:49 <mischat> topic: named graphs 16:26:19 <mischat> davidwood: sandro wanted Pat's on scoping, Pat sent an email about it 16:26:31 <mischat> davidwood: Pat would rather not have bnodes in the 4th column 16:26:45 <swh> +1 to not allowing bNodes in the 4th slot 16:26:45 <mischat> davidwood: can we make progress based on cygri being here and Pat's email. 16:27:08 <david." 16:27:20 <mischat> davidwood: Pat's comments re: bnode in 4th slot ^^ 16:27:25 <cygri> q+ to suggest straw poll, let's allow only IRIs in the 4th slot 16:27:37 <mischat> +1 to not having them either 16:27:54 <mischat> sandro: the scope for bnode is a document 16:28:40 <Zakim> -davidwood 16:28:42 <mischat> sandro: doesn't think that Pat's comment address his use-case from last week 16:28:47 <JeremyCarroll> q+ 16:29:13 <mischat> cygri: is confused, quote from Pat was about bnodes and not IRI 16:29:22 <mischat> i parsed that from the conversation too, fwiwi 16:29:26 <Zakim> +??P22 16:29:38 <mischat> cygri: are we considering using bnodes in the 4th slot ? 16:29:45 <Zakim> +davidwood 16:30:10 <mischat> cygri: as all the existing syntax, sparql, currently don't support bnodes in the 4th slot 16:30:28 <AZ> NQuads allows anything in 4th position 16:30:36 <davidwood> q? 16:30:43 <cygri> ack me 16:30:43 <Zakim> cygri, you wanted to suggest straw poll, let's allow only IRIs in the 4th slot 16:30:46 <mischat> ericP: you can use a variable which matches in a bnode in SPARQL 16:31:05 <cygri> AZ, fair enough 16:31:17 <mischat> AndyS: you can use it in SPARQL query, but datasets don't allow for bnodes in the 4th slot 16:31:18 <davidwood> ack JeremyCarroll 16:31:35 <sandro> andy: SPARQL datasets dont allow bnodes in the URI part of the pair 16:31:40 <mischat> JeremyCarroll: re-capping conversation with Pat from 6 years back 16:31:50 <mischat> JeremyCarroll: wanted the bnodes in the 4th slot, as he is a big fan 16:31:53 <AndyS> (checking) sandro UC is convenience of not needing to mint a URI 16:32:05 <AndyS> s/URI/IRI/ <<--- arrg 16:32:11 <ericP> q? 16:32:22 <mischat> JeremyCarroll: couldn't see how to get the RDF graph isomorphism with bnodes in 4th slot 16:32:40 <mischat> JeremyCarroll: this causes problems when software testing 16:32:49 <ericP> q+ to ask if that's an artifact of the popular algorythm for isomorphisms 16:33:20 <swh> q+ to talk about use 16:33:30 <mischat> sandro: doesn't want bnodes in the 4th slot, but we haven't agreed on a design for our use-cases 16:34:08 <ericP> JeremyCarroll, if i exhaust a mapping of bnodes to bnodes, why would the additional permutations of having a graph named by a bnode be any harder than the other permutations? 16:34:09 <mischat> sandro: and dismissing bnodes there, is limiting our final design space, i.e. why limit ourselves now, before we have a design, based upon agreed use-cases 16:34:13 <gavinc> on the other hand, constricting the design space can help force a design? 16:34:29 <mischat> davidwood: can you walk through the use-case, which you think definitely requires a bnode there 16:35:35 <mischat> sandro: if you want to state that "dave asserts these triples", would require a IRI, but a bnode would allow us not to mint a new IRI 16:35:52 <AndyS> q+ to say IF we allow 4th slot bNodes, THEN limiting such bNodes to only 4th slot seems rather odd. 16:36:05 <mischat> JeremyCarroll: skolemisation is the work around for this 16:36:56 <sandro> JeremyCarroll: In general using blank nodes is a good way to indicate that we didnt have a good way to agree on a URI for the thing. 16:36:58 <mischat> JeremyCarroll: a blank-node would allow different people to articulate that they are talking about the same thing, without agreeing upon what the IRI should be minted before hand 16:36:58 <sandro> +1 16:37:03 <ivan> q+ 16:37:16 <davidwood> ack ericP 16:37:16 <Zakim> ericP, you wanted to ask if that's an artifact of the popular algorythm for isomorphisms 16:37:39 <yvesr> JeremyCarroll, +1 - skolemisation would imply reconciliation a-posteriori, but i think i also understand why it could be a cause fo concerns 16:38:36 <sandro> JeremyCarroll: If one bnode is also used as a graph name, then isomorphism is more complicated 16:38:47 <swh> q- 16:39:02 <davidwood> ack AndyS 16:39:02 <Zakim> AndyS, you wanted to say IF we allow 4th slot bNodes, THEN limiting such bNodes to only 4th slot seems rather odd. 16:39:36 <mischat> AndyS: Pat's point about if used in 4th slot, is not clear 16:40:45 <mox601> mox601 has joined #rdf-wg 16:41:04 <AZ> q+ to say that what's allowed in the 4th slot probably depends on what it identifies 16:41:10 <JeremyCarroll> q+ 16:41:16 <mischat> AndyS: there is a balance to be struck, sometimes it is better to mint a URI, we should find if there is a use-case for not wanting to name a set of triples 16:41:25 <mischat> AndyS: perhaps using the "_". 16:42:16 <swh> q+ 16:42:23 <mischat> JeremyCarroll: AndyS was suggesting that bnodes used in the 4th column shouldn't be used in the g-snap named by that bnode 16:42:39 <davidwood> ack ivan 16:42:52 <mischat> sandro: we shouldn't limit our design space without clear objective/use-cases in mind 16:43:21 <sandro> sandro: we should build up designs, rather than chopping off options blindly 16:43:51 <sandro> +1 ivan: it's like the use of [...] in turtle 16:43:56 <swh> +1 to ivan 16:44:17 <AndyS> Relative IRIs do that? e.g. <#abc1> 16:44:19 <swh> maybe .well-known/genid 16:44:21 <JeremyCarroll> JeremyCarroll: we could restrict bnodes as graph names to ones that are only used in graphs named with an IRI 16:44:23 <mischat> ivan: do we need a way in the syntax to mint a new IRI for a use, which is scoped to a document. Bnodes are used in turtle, for when users don't care or want to mint a new IRI, something like [ … ] in bnode, which mints a new IRI and not a bnode 16:44:36 <mischat> personally that is why I use bnodes 16:44:37 <JeremyCarroll> JeremyCarroll: that wouild meet most of my objections, and maybe Pat's 16:45:02 <JeremyCarroll> JeremyCarroll: this for me, proves Sandro's point, that we shouldn't chop off the design space a priori 16:45:05 <mischat> AndyS: if you parse a file with that syntatic sugar, would you get the same IRI generated ? 16:45:22 <pchampin> q+ 16:45:27 <JeremyCarroll> q- 16:45:58 <pchampin> q- 16:46:01 <mischat> ivan: most people use bnodes when they don't want/care to mint a new IRI 16:46:16 <davidwood> ack AZ 16:46:16 <Zakim> AZ, you wanted to say that what's allowed in the 4th slot probably depends on what it identifies 16:46:54 <JeremyCarroll> q+ to suggest a straw poll on either making decision now or postponing til after the rest of the design is made 16:47:07 <gavinc> +q to propose a VERY concrete use case for Named Graphs 16:47:32 <mischat> AZ: maybe we will know how to restrict the 4th slot if we know that it identifies. If it is just a label for a graph, it doesn't matter if it is a literal, IRI or a bnode. 16:47:46 <cygri> q+ 16:47:48 <mischat> AZ: so the question to answer is, "what does the 4th slot identify" ? 16:47:56 <davidwood> ack swh 16:48:29 <mischat> swh: doesn't feel convinced that we haven't exhausted all of the use-cases 16:48:42 <mischat> swh: has been working with quad-stores for 10 years or so 16:49:06 <mischat> swh: initially we didn't rule out bnodes in the 4th slot, but it has turned out that people don't actual use them 16:49:47 <mischat> davidwood: feels that we are in a bit of a deadlock here. 16:49:49 <davidwood> ack JeremyCarroll 16:49:49 <Zakim> JeremyCarroll, you wanted to suggest a straw poll on either making decision now or postponing til after the rest of the design is made 16:49:53 <mischat> sandro: we need to revisit the design 16:50:13 <mischat> JeremyCarroll: 2nd'ing sandro's position re: revisiting the design 16:50:14 <gavinc> -q 16:50:19 <sandro> s/revisit/discuss 16:51:09 <ivan> -> Sandro's three design aproaches 16:51:23 <davidwood> ack cygri 16:51:35 <swh> it's an existential variable! 16:51:43 <mischat> davidwood: doesn't think it seems minor given the ramifications for the semantics, for the various syntax, and the implementations 16:52:02 <mischat> s/davidwood/cygri/ 16:52:16 <swh> JeremyCarroll, cwm isn't the only system to have graph IDs that are bNodes, 3store did too, it just wasn't very popular 16:52:21 <swh> …with users 16:53:07 <mischat> cygri: re: AZ's point, we need to figure out what the interpretation of a dataset. Is it true/false? This will help cygri figure out the semantics of a dataset . 16:53:13 <sandro> yes, absolutely 16:53:18 <AZ> q+ 16:53:31 <cygri> ack me 16:53:40 <davidwood> ack AZ 16:53:42 <sandro> a dataset must have truth conditions, yes. being true or false. 16:54:12 <cygri> sandro, i disagree. is a dataset containing several versions of a graph true or false? 16:54:15 <mischat> AZ: the semantics of a dataset hasn't been decided upon yet, AZ proposed one, Pat didn't like it, but he don't have any progress on this front 16:54:36 <cygri> thanks AZ 16:54:48 <mischat> AZ: we don't even have the beginnings of what a dataset is yet, this work needs to be performed 16:55:48 <AZ> s/he don't have any progress/we don't have any progress/ 16:56:35 <mischat> sandro: is talking about the use case re: graphs ^^ 16:56:38 <gavinc> +q for concrete use case 16:57:22 <mischat> Use case 1 : Several systems want to use the data gathered by one RDF crawler. They don't need simultaneous access to older versions of the data. 16:57:31 <mischat> Use case 2: Several systems want to use the data gathered by one RDF crawler. They need simultaneous access to older versions of the data. 16:57:58 <mischat> davidwood: can you find a real-world example for use-case 2 16:58:01 <swh> we do provenance of that kind, and we don't model it that way 16:58:09 <AndyS> 16:58:21 <gavinc> Archiving Crawler Concrete! 16:58:23 <mischat> sandro: people would like to know how and why data has changed 16:58:44 <mischat> sandro: would allow for provenance data to be modelled in RDF 16:58:54 <mischat> Use-case 3 : A system wants to convey to another system in RDF that some person agrees with or disagrees with certain RDF triples. 16:59:20 <mischat> sandro: these 3 use-case could easily be modelled in trig and in nquads 16:59:51 <mischat> sandro: the syntaxes get used in different ways, and all of the ways can be used to model the use-cases 17:00:32 <mischat> sandro: enumerated these are called the ways : Trig/REST, Trig/Equality, and Trig/bnode 17:00:33 <sandro> third approach: eg:sandro eg:endorses { ... the triples I'm endorsing ... } 17:00:59 <gavinc> +q 17:02:13 <sandro> and third design on UC1 is: <> rdf:graphState { ... triples recently fetched from there } 17:03:05 <mischat> davidwood: most discussion was around the 3rd solution, and we haven't had much discussion on this, probably due to the timing of the email 17:03:06 <davidwood> ack gavinc 17:03:07 <Zakim> gavinc, you wanted to discuss concrete use case and to 17:03:56 <mischat> gavinc: we are talking about archiving data on the web, as one of our use-cases, and we have an ISO standard for it at the moment 17:04:38 <JeremyCarroll> please post link 17:04:40 <gavinc> 17:04:44 <cygri> i've worked with it 17:04:55 <mischat> gavinc: in our use-case, without RDF, and without the SW cached in, when people have designed archiving systems for the web, they minted URIs 17:04:56 <cygri> most off-the-shelf crawlers support it 17:05:12 <mischat> gavinc: a standard for archiving data from the web ^^ 17:05:29 <mischat> gavinc: so why are we talking about archiving the web, without minting new IRIs 17:06:06 <JeremyCarroll> ISO 28500. 17:06:17 <mischat> sandro: please put your comments in context 17:06:37 <mischat> gavinc: use-case 2 is not necessary for needing 17:06:56 <mischat> s/needing/motivating bnodes in the 4th column/ 17:07:38 <cygri> davidwood++ 17:07:45 <mischat> davidwood: please motivation use-case 3 17:07:51 <mischat> s/motivation/motivate/ 17:08:00 <cygri> q+ 17:08:13 <LeeF> Don't people build their own technology for something like this if they want to do it? How does the Tim Clark type group of people do it? 17:08:42 <davidwood> ack cygri 17:08:42 <mischat> sandro: doesn't think that anyone is publishing data for use-case 3 because there are no mechanisms for people to make use of the practices described in use-case 3 17:09:03 <davidwood> LeeF, Tim Clark type group? 17:09:22 <gavinc> Specific every WARC record must have an IRI 17:09:28 <LeeF> project formerly known as SWAN - think it became the scientific discourse sub-group of the SW HCLS IG 17:09:33 <LeeF> but i don't know a lot about what it's been up to 17:09:38 <LeeF> ericP? 17:09:54 <davidwood> WARC specifies a URI, not an IRI 17:10:20 <mischat> cygri: doesn't believe that the use-case 3 should be top of our agenda 17:11:23 <LeeF> I'm not that interested in this use case :-) 17:11:53 <swh> yes, lets ask the question about who's interested 17:12:12 <gavinc> since you can create a new graph that contains only the subgraph, and endorse that 17:12:22 <mischat> JeremyCarroll: thinks that we can endorse a graph, but not a subgraph, and doesn't think this is a major issue 17:12:31 <AndyS> Also - converse is whether it is a requirement to be solved - middle ground of "not blocked" 17:12:44 <mischat> davidwood: can we have a straw-poll about who is interested in use-case 3 ? 17:12:49 <LeeF> Talking about graph versus talking about subgraph? 17:12:52 <MacTed> sorry... link to this? 17:12:52 <JeremyCarroll> i am interested in uc3 ... 17:12:55 <AndyS> +0.25 17:13:15 <davidwood> +0 17:13:33 <JeremyCarroll> q+ tp talk about owl test cases 17:13:35 <mischat> swh: finds it hard to know what use-case 3 is talking about 17:13:43 <JeremyCarroll> q+ to talk about owl test cases 17:13:48 <davidwood> MacTed, UC3 in 17:13:53 <MacTed> danke 17:14:47 <davidwood> ack JeremyCarroll 17:14:48 <Zakim> JeremyCarroll, you wanted to talk about owl test cases 17:15:31 <swh> SELECT ?s ?p ?o WHERE { eg:sandro eg:endorses ?g } GRAPH ?g { ?s ?p ?o }} 17:15:40 <LeeF> syntax error! 17:15:41 <mischat> JeremyCarroll: in the owl test case, there are manifest files which stated that one graph entails another graph. JeremyCarroll thinks this is a different concrete use case regarding what sandro is talking about 17:15:45 <swh> all the triples endorsed by eg:sandro 17:15:54 <swh> sorry LeeF :) 17:15:57 <mischat> sandro: thinks that use-case 4 is touching upon what JeremyCarroll mentioned above ^^ 17:16:12 <ericP> +1 to PML use case 17:16:13 <LeeF> at least you didn't write "SELECT ?s, ?p, ?o" :-D 17:16:14 <MacTed> +1 interested in expressing endorsement (agreement with, has confidence in, etc.) of <arbitrary g-snap> 17:16:31 <Zakim> -JeremyCarroll 17:16:40 <AZ> thx 17:16:41 <Zakim> -cygri 17:16:41 <AZ> buy 17:16:42 <Zakim> -Souri 17:16:43 <swh> LeeF, yeah, after years I finally stopped putting the , in there :) 17:16:43 <Zakim> -Arnaud 17:16:43 <Zakim> -yvesr 17:16:44 <Zakim> -gavinc 17:16:45 <Zakim> -sandro 17:16:47 <Zakim> -davidwood 17:16:48 <Zakim> -AZ 17:16:48 <Zakim> -swh 17:16:50 <Zakim> -MacTed 17:16:52 <Zakim> -pchampin 17:16:53 <Zakim> -mischat 17:16:57 <cgreer> cgreer has left #rdf-wg 17:16:58 <Zakim> -EricP 17:17:00 <Zakim> -AndyS 17:17:02 <Zakim> -Ivan 17:17:21 <Zakim> -cgreer 17:17:25 <Arnaud> Arnaud has left #rdf-wg 17:17:36 <AndyS> Did we make progress today? 17:17:42 <Zakim> -LeeF 17:17:42 <Zakim> SW_RDFWG()11:00AM has ended 17:17:43 <Zakim> Attendees were gavinc, +1.206.494.aaaa, cgreer, cygri, yvesr, AndyS, swh, Ivan, mischat, AZ, +1.408.996.aabb, Arnaud, sandro, davidwood, LeeF, JeremyCarroll, Souri, MacTed, EricP, 17:17:45 <Zakim> ... pchampin 17:17:52 <LeeF> There's a disconnect somewhere here 17:17:59 <mischat> do I have to do things now 17:18:08 <mischat> make scribe logs or something 17:18:13 <LeeF> Because I think that people are disagreeing over what needs to happen (if anything) in a design to support UC3 17:18:17 <mischat> been on holiday for a while :) 17:18:26 <cygri> trackbot, make logs public 17:18:26 <trackbot> Sorry, cygri, I don't understand 'trackbot, make logs public'. Please refer to for help 17:18:33 <LeeF> RRSAgent, make logs public 17:18:39 <cygri> ah. 17:18:44 <LeeF> mischat, think you want this # SPECIAL MARKER FOR CHATSYNC. DO NOT EDIT THIS LINE OR BELOW. SRCLINESUSED=00000390
http://www.w3.org/2011/rdf-wg/wiki/index.php?title=Chatlog_2012-01-11&oldid=1695
CC-MAIN-2015-35
refinedweb
4,941
50.54
We will see how to extract text from PDF and all Microsoft Office files. Generating OCR for PDF: The quick way to get/extract text from PDFs in Python is with the Python library "slate". Slate is a Python package that simplifies the process of extracting text. Installation: $ pip install slate $ pip install pdfminer Usage: import slate with open('sample.pdf', 'rb') as f: pdf_text = slate.PDF(f) print pdf_text Output: ['Sample text...', '......', '......'] * The PDF class, of slate, takes file-like object and extracts all the text from the PDF file. It provides the output as a list of strings(one for each page). * NOTE: If the PDF file has password, then pass the password as second parameter. Example: import slate with open('test_doc.pdf', 'rb') as f: pdf_text = slate.PDF(f, "pass the PDF file password here") print pdf_text Output: ['Sample...
https://micropyramid.com/blog/extract-data-from-pdf-and-all-microsoft-office-files-in-python/
CC-MAIN-2021-17
refinedweb
142
77.33
Update (01/2014): correction of the schematics and picture update to comply to the current setup (not necessary final but at least more reliable than the previous version). This instructable follows my previous one () Now we have a good understanding of what is sent by the remote, we can make our own. Like the previous instructable, this circuit was made some months ago, so multiple solutions were tried, leading to a rather strange set up. The setup goes like this : A server (Pi or other) hosts a website presenting commands Connected to the server (USB) is an Arduino with a custom Shield with an IR LED. This instructable covers the Arduino connected by USB, the associated circuit and programming. BOM: - An Arduino, with auto reset function disabled (I used a seeeduino board, it has a switch to disable the auto-reset feature, but solutions exist to disable the feature with any arduino) -... - An IR LED. Be careful about the characteristics, such as max current in burst and light emission angle (the wider the angle the easier it is to aim the air conditioner but the less is the reach) - A NPN transistor - A set of resistors - An RGB LED is used here but not necessary This project is well under 30$, if you already have an arduino it would be less that 2$ I think Note: As the project is old (although still ongoing... well more like "on pause" actually) I updated it so the schematics and pictures are more accurate and I also cleaned and simplified the code for it to be understandable here. But doing so I might have broken it to some extent so don't hesitate to tell me if you use it and encounter problems. As you can see on the picture no box has been hurt during this instructable (I think I will print one someday). ;) Teacher Notes Teachers! Did you use this instructable in your classroom? Add a Teacher Note to share how you incorporated it into your lesson. Step 1: Circuit Nothing complicated here, the circuit is mainly an LED driver with an NPN transistor and a resistor to limit the current flowing through the LED. I added RGB LED to indicate the schedule mode status (programmed, forced, off...) and a temperature probe. The circuit is powered by the USB cable of the arduino. Tip: to check that the IR LED is working properly you can watch it through a digital camera (or a smartphone camera), The IR frequency can appear on the screen. I'm not sure it's good for the camera though. Step 2: Programming - Arduino Side We need to communicate over serial interface and send IR commands. For the IR remote part we will use the IRremote Arduino library (). This library can be used to send predefined data over IR, as LIRC does. But We'll use it only for its helper functions (to set the 38KHz frequency for IR and to manage timings while sending messages). In the previous instructable we found that to communicate commands to the air conditioner we needed to send a lock sequence, a constant introduction, the lock sequence again, then the actual payload. Well the Arduino can very well have the introduction in its code and just wait for the payload. We could just send the options values and make the Arduino modify a template with these values, but to keep it simple we'll just provide the entire payload and let it send it as is. To send the bits it will turn the IR LED ON and OFF according the the timings found previously. Here the Arduino acts as a "slave", never initiating a communication itself. As I intend to make multiple uses of this unit I begin the communications by a single character 'I' meaning "send by IR", followed by 19 bytes of payload. The Arduino then sends the message to the air conditioner. On the Arduino side the code can look a little over-complicated, but it's because it is supposed to serve as a radio relay as well, so the communication between the Pi and the Arduino over Serial interface won't always be just to send IR message. Here is the arduino source that will be used to send commands to the Air Conditioner. A bit of explanation: -> the loop code just checks if a command is ready. In that case it executes the command (for now just "send an IR message"). -> the SerialEvent() is called after a loop(), if there is serial data in the buffer. In this function the command is read, the payload is prepared, then a flag is set to tell the loop() function that a command is ready serialEvent will receive ASCII characters representing HEX values. To convert it we use the sscanf function with the "%x" (hexadecimal) format option. We store the received characters in a 5 char array and fill it with : "0x"+the 2 chars+'\0' (to finish the string). char hexConvert[5] = "0x"; // ASCII is received for (int i = 0 ; i < 19 ; i++){ hexConvert[2] = Serial.read(); hexConvert[3] = Serial.read(); hexConvert[4] = '\0'; // convert the received chars to a numeric value in payload[i] sscanf(hexConvert, "%x", &(payload[i])); } At this point payload[i] contains the binary value represented by the received chars. In the send command proper timings are used to send locks, introduction, and payload. To send data, the code has to send each bit separately with the function irsend.mark(duration) and irsend.space(duration). As explained in the previous instructable the duration is of about 400us (should actually be closer to 420 I think) for the mark (ON state), and either 400us or 1300us for the space (OFF state) to send a 0 or a 1, respectively. To send each bit of each byte the following code is used : for (int s = 0 ; s < payloadSize ; s++ ){ for (int i = 7 ; i >= 0 ; i--){ // Most Significant Bit comes first irsend.mark(irSpace); irsend.space((payload[s] >> i) & 1 == 1 ? irOne : irZero); } } If you are not familiar with bitwise operations there are plenty of tutorials available on the net. What happens here is: For each byte of the payload (works the same manner with the intro): For i going from 7 to 0 shift the byte for i ranks to the right look at the last bit if that bit is one, send a signal of "irOne" us (1300us), else send a signal of "irZero" us (400us) Basically what we obtain by shifting the byte right of N ranks (adding zeros at the left side) is the Nth bit on the rightmost side. When masking with a bitwise AND (&) 1 we take only the rightmost bit, so globally we obtain the Nth bit value. Example with 5B in hexa = 0101 1011 in binary. The parenthesis are here to emphasize the shifted bits, for readability... i = 7 => shift (0)101 1011 for 7 ranks => 0000 000(0) mask with 1 => 0000 0000 & 0000 0001 = 0 => send irZero i = 6 => shift (01)01 1011 for 6 ranks => 0000 00(01) mask with 1 => 0000 0001 & 0000 0001 = 1 => send irOne i = 5 => shift (010)1 1011 for 5 ranks => 0000 0(010) mask with 1 => 0000 0010 & 0000 0001 = 0 => send irZero i = 4 => shift (0101) 1011 for 4 ranks => 0000 (0101) mask with 1 => 0000 0101 & 0000 0001 = 1 => send irOne i = 3 => shift (0101 1)011 for 3 ranks => 000(0 1011) mask with 1 => 0000 1011 & 0000 0001 = 1 => send irOne i = 2 => shift (0101 10)11 for 2 ranks => 00(01 0110) mask with 1 => 0001 0110 & 0000 0001 = 0 => send irZero i = 1 => shift (0101 101)1 for 1 rank => 0(010 1101) mask with 1 => 0010 1101 & 0000 0001 = 1 => send irOne i = 0 => shift (0101 1011) for 0 rank => (0101 1011) mask with 1 => 0101 1011 & 0000 0001 = 1 => send irOne So we sent bits in the left to right order. Note that IRremote library uses pin3 to send messages. I suppose it could be possible to use the pin 11 (same timer for PWM) by modifying the target pin in the library code, but I haven't tested it. Step 3: Programming - PC Side On the PC side (be it a Pi or any other linux PC), here is a program to send commands to the arduino. It is based on the previously given "encode.c" to build an IR command. The program will build the command payload according to the command line options (see usage) and send the command to the device connected to the USB port. The port can be specified with the -u option, otherwise it will try /dev/ttyUSB0, /dev/ttyUSB0, /dev/ttyACM0, /dev/ttyACM1, as the arduinos can be mapped as (at least) these files, depending on the arduino type and disconnections/reconnections. As indicated in the introduction the Arduino has to have its autoreset function disabled, otherwise it will reset each time a connection is made. This is the way the IDE can program the chip, but it is not desirable in our case. Should you wish to test the code with an autoreset enabled arduino, you should add a sleep(2) command after the connection (after opening the tty file) to let the arduino reset and being able to get the messages. As expected the code sends a 'I' character to the Arduino, then sends the payload and read the file to wait the Arduino's response. This step is not crucial for a simple command send, but it will be if the goal is to fetch information from the Arduino itself or another device controlled by radio. For now the Arduino just responds "OK" so the program just displays the response as is. As for the Arduino part, there is a part of the code where the message is converted to ASCII representation of the binary message. message[0] = 'I'; // turning binary payload into ASCII characters (HEX representation) for (i = 1, j = 0 ; i < 39 ; i+=2, j++){ message[i] = (payload[j] & 0xF0) >> 4; if (message[i] < 10){ message[i] += '0'; // ASCII } else { message[i] += 'A' - 10; } message[i+1] = payload[j] & 0x0F; if (message[i+1] < 10){ message[i+1] += '0'; // ASCII } else { message[i+1] += 'A' - 10; } printf("0x%c%c ",message[i], message[i+1]); } Once again bitwise operators are used to select and shift the first or last 4 bits and convert it to a digit or a character (A to F): message[i] = (payload[j] & 0xF0) >> 4; Here we take the byte and apply a mask 11110000 so we obtain only the foremost left bits, and we shift these bits to the right message[i+1] = payload[j] & 0x0F; Same here but selected bits are already at the right of the byte so no shift is necessary. if (message[i] < 10){ message[i] += '0'; // ASCII } else { message[i] += 'A' - 10; } Here if the digit is < 10 the ASCII value is comprised between 48 and 57 (decimal), and we just have to add the represented value to the character '1' value (which is 48 but '1' is usable without knowing the ASCII table by heart ;) ). The same apply to characters A to F but A(Hex) is 10(Decimal) so if we added the represented value to the ASCII value for 'A' we'd be 10 values to high. So we add the value -10 and end up with the proper character. Now, you might wonder why we bother converting from Hex to ASCII and from ASCII to Hex on the other side. You'd be right to ;) Indeed, it is useless in that case, and the first version of the code worked directly with binary values. Actually it worked by sending only the 5 bytes that are actually useful and the Arduino made the update of the payload template. So now we send 40 bytes instead of 5. For what reason? Well, although this is out of this particular instructable I indicated that I had a second micro controller in my room for the second Air Conditioner unit. This chip is a Seeediuno Wifi Bee. I found it difficult to implement the correct behavior in that chip using sockets so I ended up using the embedded minimalist web server, so I send the full IR command in the URL in Hex characters. Now you have the reason: I wanted to use the same code to control both units, sending data to USB or over WiFi but manipulating the same message, in the same format. Step 4: Conclusion In this instructable I obtained a proper replacement to my air conditioner remote with an Arduino connected to a PC. Now I can control the unit by issuing commands to my computer, which is pretty cool :) $ sendCmd -m HEAT -q -s 5 23 will set the air conditioner to HEAT mode, with the "quiet" option activated (visible by an LED on the unit), with the air flow stuck in high position (swing 5) and a temperature of 23° $ sendCmd -o OFF sends an OFF command that turns off the unit. Air conditioning control from Mat_fr on Vimeo. In the video I use another version of the code which displays plenty of messages, just ignore that ;) OK, That's fun. But what is really cool is that from this starting point I will be able to: - send commands from a remote location (connecting via ssh for instance) - set a command to be sent at a specific time using the "at" command or a crontab What comes next (in my project, not necessarily in instructables...) is: - a remote controller to relay orders to the second unit - a web page to send commands from a browser instead of a command line (as seen in the picture, sorry it's in french ;) ) - a database to store commands to be sent at specific times, potentially with conditions such as current season, current inside or outside temperature, ... - a web page to manage programs Hope this instructable helps. 1 Person Made This Project! lowflyerUK made it! 15 Discussions 4 years ago on Introduction Hi Mat, how about if my AC Panasonic Remote Control is different from yours, the buttons are just on off, air swing, mode, fanspeed, there isnt option button, does the serial IRsender for arduino same as on your instructables? thank you Reply 4 years ago on Introduction Hi, I can't say for sure, but it is possible the protocol would still be the same: the protocol I analyzed has many chunks that are not used on my AC. I can imagine a firm like Panasonic would develop only one protocol for all their products, using more or less options depending on the product. So you can test the code on your AC. On the other hand, there are 2 parts on the signal, maybe the first part corresponds to the product to control, I don't know. If that's the case, you could have to change the "introduction" of the signal to match your remote. But that's only a guess. See my other instructable for details. Reply 4 years ago on Introduction Hi Mat, so what i have to do is compiling the SerialIRSend on the Arduino and compile the sendcmd on Raspberry Pi right? i have done it but it didnt work, do you have any account to chat like facebook? thank you very much 4 years ago on Introduction Is it possible to use a teensy or a digispark attiny85 instead of the arduino? Reply 4 years ago on Introduction Or something like this:... ? Reply 4 years ago on Introduction It should be possible to use either one, although I'm not sure the IR remote lib works with the Attiny85. Anyway it's just a matter of setting the correct PWM frequency (38KHz) for it to work, so I assume I could have done without the lib. The other problem with the Attiny85 is that it doesn't have hardware serial if I remember correctly, so you would have to work out another way of communicating with it whatever the chosen solution (software serial or network). Reply 4 years ago on Introduction I see, but how will I be able to read the IR signal from my remote with the teensy for example? Where will the information go? Reply 4 years ago on Introduction This is explained in my other instuctable. I used a Raspberry Pi with LIRC installed and an IR Receiver module to read the signal from my remote. You could do the same with an Arduino or equivalent plugged into your computer and an IR receiver. I think the IRRemote library has an example to dump the raw signal to the serial connection, so you can read it from the serial console of the Arduino IDE. This instructable assumes you already know how the signal is made. 4 years ago on Introduction Hi Mat, Your article is very good. I was doing the same exercise with my air conditioner when I found your work ! And Cherry on the cake, I have the same one. I try to do a n autonomous WiFi to InfraRed convertor. The idea is to send via IP commands to the convertor which will Activate functions on the air conditioner using IR. Regards and many thanks !!! Seb Reply 4 years ago on Introduction Hi, glad it helped :) I tried using WIFI for the unit in my room, unfortunately it kept loosing the connection... I ended up building an atmega based circuit with an enc28j60 ethernet module. Cheap and reliable :) Reply 4 years ago on Introduction Hi Mat, I finally bought the IRkit (see). I did the same job than you to understand how to generate the good codes ! I would like to thank you because with your study, it was easier for me (expectaly for the CRC code). Regards 4 years ago on Introduction Thanks a lot ! You are such a clever, patient and nice person. I took the instructable as an inspiration. Because it is enough for me to switch on, or off my AC (Toshiba) I am using a simple program which I would never write without your help. For unpatient (like me)This is the simplest way how I switch off Toshiba aircondition (Arduino codes captured with LIRC on raspberry): #include <IRremote.h> IRsend irsend; void setup() { pinMode(13,OUTPUT); digitalWrite(13,HIGH); delay(5000); digitalWrite(13,LOW); delay(5000); digitalWrite(13,HIGH); delay(5000); digitalWrite(13,LOW); irsend.enableIROut(38); powerToshOff(); } void loop() {} void powerToshOff() { //this is just replayng the values as recorded with lirc irrecord -m irsend.space( 4824102 ); irsend.mark( 4396 );irsend.space( 4355 );irsend.mark( 646 );//here comes the of values as captured with irrecord -m ; each odd is space each even is mark irsend.space(0); // to leave the LED low } Reply 4 years ago on Introduction Hey, Glad my instructable helped you. I just made a replacement circuit for this remote, I should update the instructable at some point. 4 years ago on Step 4 Hi Mat, Thanks a lot for posting this article, it's great reading. I have been trying myself to control a Pana HVAC with an Arduino by sending raw codes, but have struggled to make it stable. i realize now that it's probably my timings and maybe the checksum that is not accurate enough. Hence i would like to use your code and use the arguments for the swing, fan, temperature etc. But unfortunately im a dumb novice in the codings and are struggeling to see how the payload should be build if i am only to use the arduino. Are you able to provide a little guidance on how the payload variable would look lige, if for instance i would execute a HEAT commando of 5 deg C, powerfull fan, Swing at position 1. And if possible also a turn off command. Then i think i would manage to make things work :-) /OMJ Reply 4 years ago on Step 4 Hi, It is possible to make the Arduino alone handle the computation on the payload, but how will you send the command ? I use the serial interface (or network, depending on the unit) to send the command to relay to the AC so I decided the computer would be the best place to build the payload. You could just send parameters and let the Arduino build the payload but as you already have something to send... If you just want to send pre-recorded commands you can very well declare bytes arrays inside the code, one for each command you want to be able to send (there is limited memory on the chip, though). If your problems come from the timings that would not match what the AC expects there is not much I can do to help... You'd need an IR receiver and a computer with lirc for instance, to record the timings, or an oscilloscope to see what gets recorded. If the problem is the checksum here what I do: int checksum = 0; for ( i = 0 ; i < 19 ; i++ ){ checksum+=reverse_byte(frame[i]); } checksum = reverse_byte(checksum); checksum &= 0xFF; // force 1 byte See my other instructable for the reverse byte code (which is actually a straightforward list of reversed values for each possible byte, not very memory efficient for an arduino) :
https://www.instructables.com/id/An-air-conditioner-remote-replacement/
CC-MAIN-2019-43
refinedweb
3,571
65.05
Functions are great! You need them for everything. If you want to use code more than once, just write a function containing this code block. This makes your code easily readable, well structured, reusable and easy to share! In the previous tutorial on working with external code, we have already seen some built-in functions (find some more here). Also, you can be sure that if you need some standard functions, somebody, somewhere probably coded it up for you already. So just do some quick research on the internet and check out what other motivated coders made available for you open-source. But first let us investigate how we can write our own user-defined functions with this Full Stack Embedded tutorial! Learning goals In this tutorial you will learn all the basics on functions. This includes how to: - Define functions - Write docstrings - Call functions - Hand over arguments - Return - Return errors First, some theory A function is put together as follows: - The function begins with the keyword def, followed by the function name, parentheses and a colon - Any indented code following the function header is part of the function - The body of the function should begin with the “docstring” - When the function is called, the code in the function body is executed – this is where the magic happens. For example, in this function: - The assignment statement assigns a value to a variable - The return statement returns the output value (this is optional) This is the basic and universal function structure. In order to make the code more readable, the so-called docstrings are used. Documenting our code is very important, as we would like to share our codes with others and at times forget what we actually coded after reading it half a year later :). In the parentheses after the function name, different arguments can be handed over to the functions. But first things first. We now know what a basic function looks like now, so let’s try it! Note: In the following the $ will be used for command line commands and >>> for python prompt commands. All hands on deck In the following we will work with some examples. We will start with a very basic example and then we will slowly add a bit of spices as we continue. Your first function Let’s start with something very simple, let’s try writing a function consisting of the function parts we learned above. def greetings(): ‘’’This function returns a greeting phrase.’’’ phrase=”Hello! I wish you a great day!” return phrase That really looks like the example above doesn’t it?! And yes, it’s really that simple. Please remember, that as soon as the indentation ends, the function ends. This is also true for any return statements – as soon as the Python interpreter reaches a return, it passes the value to the right of the return keyword and exits the function. The same as when dealing with loops, as we learned in the previous tutorial. And please: never forget the docstring. Call me! We wrote our first function, so now let’s call it. Calling a function means to execute the function code. You can either do that on your command line, in your python prompt or use it in a script. In the following we will insert the greetings function in the script first_function.py and call it on the command line. Please note, that our function does not require any input and is thus called with empty parentheses. Here’s the content of first_function.py: #!/usr/bin/python # define my function def greetings(): ‘’’This function returns a greeting phrase.’’’ phrase=”Hello! I wish you a great day!” return phrase # Call function and print output print(greetings()) On the command line execute the command: $ python first_function.py Hello! I wish you a great day! Reading the docstring Calling the docstrings is a great way to investigate the content of a function. In order to have a look at the docstring that we wrote in our example, we first have to import our function from the file and the call the docstring using the help function. In the python prompt: >>> from first_function import greetings >>> help(greetings) Help on function greetings in module first_function: greetings() This function returns a greeting phrase. This way you get the information needed in order to execute the functions. Using help is also very useful for looking at the documentation of a built-in function. Especially when arguments are used as input, the help method supports the understanding of the required input types and optional/required arguments. But we will get to that in the next sub-section. Passing arguments Previously, we learned all the tools for building, executing and calling the docstring of a function. Now let’s hand over an integer to a function that returns the squared value of the input argument. You can save the function either in the same .py file as the first function or just simply name it second_function.py. #!/usr/bin/python # define function def calc_square(x): ‘’’This function returns the square of the input value.’’’ square = x * x return square # Call function with the integer 5 as input argument and print output print(calc_square(5)) On the command line execute: $ python second_function.py 25 Yay!!! We managed to write a function and call it with an input argument! Required vs optional arguments Some functions can be called without any input parameters (see greetings), some with one or more required input arguments (see calc_square) and some functions can have optional named input parameters. For this purpose, a default value has to be set. Let’s make a file named third_function.py: #!/usr/bin/python # define function def calc_exp(x, expo=2): ‘’’Return x to the power of expo. x is squared by default.’’’ our_exp = x ** expo return our_exp # Call function with 7 as required input argument and print output print(‘With the required argument’, calc_exp(7)) # Call function with 7 as required input argument, 3 as optional # argument and print output print(‘With the required and optional argument’, calc_exp(7,3)) On the command line execute: $ python third_function.py ('With the required argument', 49) ('With the required and optional argument', 343) You can also find required and optional arguments in the built-in functions. In order to look at the documentation of a built-in function use the built-in help function (i.e. help(sum)). This is also how you call the docstring for one of your self-built functions. Please don’t forget to import the functions first though. Anonymous arguments with *args Using multiple optional arguments is quite a beauty as it is so simple. Let’s say we are packing our suitcase. The first argument is the ‘required argument’. The rest of the arguments are optional parameters in case there is enough room in the suitcase 🙂 For our example we use a list of strings as an argument list. Let’s put this into fourth_function.py: #!/usr/bin/python # define function def bag(must, *maybe): ‘’’Help me pack my bag.’’’ print(‘I absolutely need to pack my: ’ + must) for arg in maybe: print(‘If there is still room, I can also take my: ’ + arg) # Call function with anonymous arguments bag(‘passport’, ‘toothbrush’, ‘food’, ‘book’, ‘tshirt’) On the command line execute: $ python fourth_function.py I absolutely need to pack my: passport If there is still room, I can also take my: toothbrush If there is still room, I can also take my: food If there is still room, I can also take my: book If there is still room, I can also take my: tshirt Declared arguments with **kwargs Multiple arguments can also be used for dictionaries, instead of *args with anonymous arguments, **kwargs (keyword arguments) are used. Using **kwargs, our example from above would look like this: def suitcase(must, **kwargs): '''This is the function to help me pack my bag.''' print('I absolutely need to pack my:' + must) for key in kwargs: print('If there is still room, I can also take:' + key + " " + kwargs[key]) When we run this, it produces: >>> suitcase(must='passport', item2='toothbrush', item3='food', item4='book', item5='tshirt') I absolutely need to pack my: passport If there is still room, I can also take: item2 toothbrush If there is still room, I can also take: item3 food If there is still room, I can also take: item4 book If there is still room, I can also take: item5 tshirt Oh no… I broke it Errors happen and we learn from them. Let’s have a look at our previous function calc_exp. In the example, we called the function with an integer. What happens when we accidentally call calc_exp with a string input? >>> from third_function import calc_exp >>> calc_exp('Z')) TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int' In case an error occurs it is a advised to go back to the code and handle it. A possibility for handling the above improper use of the function is: #!/usr/bin/python def calc_exp(x, expo=2): """ Return x to the power of expo. x is squared by default.""" if isinstance(x, str): raise TypeError( "Whoops, your input was a string. Please use a number!") return x ** expo Calling our revised calc_exp function now raises the clear error: >>> calc_exp(‘Z’) TypeError: Whoops, your input was a string. Please use a number! The output now tells you exactly what your error was and how to deal with it. You can also raise an error on purpose if you want to ensure that your function behaves exactly in the way you want it to. Try to think through all the possible inputs a user could call your function with. You surely want to have a stable code. How to handle possible errors and exceptions can be found here. Looking deeper: Arguments in functions “Normal” arguments Let’s take a closer look at the more complex concepts *args and **kwargs. In function heads, any arguments specified without a default value are required. Thus, these arguments have to be passed when the function is called. For example: # We define a function >>> def words(required): >>> print ("required arg: " + required) ... >>> # Now we call the function. >>> words("required argument") required arg: required argument >>> # The argument required must be given! >>> # Otherwise the call produces an error >>> words() ... TypeError: words() takes exactly 1 argument (0 given) It’s also possible to specify optional arguments. Python knows that these arguments are optional because they have default values. Like this: >>> # We define a function >>> def words2(>> words2() passed argument: Nothing If you want, you can define functions that have both required and optional arguments – that’s not a problem. However, when defining the function, the required arguments have to be listed first in the function head, followed by any optional arguments. *args and **kwargs *args and **kwargs, on the other hand, can be used for undefined arguments. This means any arguments that you don’t know about at the time you define the function. Normally, this isn’t required, so it’s a good idea to only use these special arguments if you have a good reason to do it. Examples are when you’re writing subclasses of library code and you think the parent classes you’re basing your code off of might be extended to accommodate more arguments. Why are these special arguments called args and kwargs?They don’t have to be – it’s a convention. The only requirement is that args (or whatever you name it) is preceded by one asterix – * – and that kwargs (or whatever you call it) is preceded by two asterix – **. They stand for “args” or “arguments”, and “keyword args” or “keyword arguments”, respectively. You’ll see why in a second. The important thing to remember is that although you don’t have to name your args and kwargs that, if you do, other developers will understand what you meant and what those arguments do right away, without trying to have to decipher your code. They work like this: Any arguments that aren’t found in the function head are bundled into the variables args or kwargs. Arguments that weren’t in the function head and aren’t named in the function call are passed into the function as a tuple named args, while named arguments that weren’t listed in the function head are passed into the function as a dictionary named kwargs, where the arguments’ names are the dictionary’s keywords with corresponding values taken from the arguments. This is easier to understand with an example: >>> # We define a function using *args and **kwargs >>> def my_fun(*args, **kwargs): >>> print(args) >>> print(kwargs) ... >>> # With no arguments, the tuple and dictionary are empty >>> my_fun() () {} >>> # Unnamed arguments go into args >>> my_fun(1, 2, 3) (1, 2, 3) {} >>> # Named arguments go into kwargs >>> my_fun(this="that", foo=42) () {'this': 'that', 'foo': 42} >>> # You can mix named and unnamed arguments >>> my_fun("foo", "bar", name="hulk") ('foo', 'bar') {'name': 'hulk'} You can use these properties of args and kwargs in order to obtain and process variables, like in any other context. You’re up! Next please get creative and test your self-built functions! Inside the functions you can write everything that you have learned in the previous tutorials: Try using some built-in functions and loops. What would you pack in your suitcase if the weather is sunny or rainy? Can you formulate different possibilities of treating potential errors? Further reading I hope you enjoyed your fun with functions! If you want to read a bit more or learn a bit more, check out the pages listed below and continue doing all the Full Stack Embedded tutorials. And please remember that Google is one of your best friends while coding. A lot of people in the coding world are happy to share their experience and functions with you. So if you are looking for a special function, check online if somebody else has already done the job for you (and give them credit for it if they did). Also have a look online when encountering errors. Other people make mistakes too and for loads of the problems, the solutions are online. Have a look at: - An online course on data science with an intro to functions (some courses are for free - An overview for writing functions - Information on *args and **kwargs: - Errors and Exceptions
https://fullstackembedded.com/tutorials/the-magic-of-functions/
CC-MAIN-2018-47
refinedweb
2,401
61.67
Opened 14 years ago Closed 8 years ago #2915 enhancement closed fixed (21) comment:1 Changed 13 years ago by comment:2 Changed 13 years ago by It's definitely a poor description. I think it's meant to refer to t.python._releases.getNextVersion (pasted below), which quite clearly doesn't support patch numbers. How did we increment the patch number in the 8.0.1 release? def getNextVersion(version, now=None): """ Calculate the version number for a new release of Twisted based on the previous version number. @param version: The previous version number. @param now: (optional) The current date. """ # XXX: This has no way of incrementing the patch number. Currently, we # don't need it. See bug 2915. Jonathan Lange, 2007-11-20. if now is None: now = date.today() major = now.year - VERSION_OFFSET if major != version.major: minor = 0 else: minor = version.minor + 1 return Version(version.package, major, minor, 0) comment:3 Changed 13 years ago by Thanks, that clears things up. Maybe radix can comment on how 8.0.1 was produced. comment:4 Changed 13 years ago by We haven't even used getNextVersion yet. I just call the function that takes a version number directly. comment:5 Changed 13 years ago by Are we planning to call getNextVersion at some point in the future? comment:6 Changed 13 years ago by Maybe once it provides a useful result :-) comment:7 Changed 13 years ago by Okay. So presumably getNextVersion needs to have two different behaviors. One behavior is that it increments the major.minor portion of a version in an appropriate manner, setting patch to 0. The other is that it leaves major.minor alone and increments patch. The former behavior is for new releases (ie, the first release of a new branch of trunk). The latter is for subsequent releases of such branches. Can it tell what is going on by itself? Does it need a new parameter? Should there just be two functions? comment:8 Changed 13 years ago by I'd go for two different methods, possibly renaming the pair to incrementRelease and incrementPatch or something like that. My working assumption is that the hypothetical automated release tool probably needs to take an argument as to whether a release is a bugfix release or not. comment:9 Changed 10 years ago by comment:10 Changed 10 years ago by comment:11 Changed 9 years ago by comment:12 Changed 9 years ago by comment:13 Changed 9 years ago by comment:14 Changed 9 years ago by The branch attached changes the way change-versions works: instead of passing the version, it takes 2 flags, prerelease and patch, which choose automatically the new version. Most of the changes are in getNextVersion, then ChangeVersionsScript and changeAllProjectVersions. I also removed updateTwistedVersionInformation which was not used anywhere. getNextVersion code is fairly ugly, but the tests cover it properly, and match the use cases I have when doing releases. Sorry for the formatting changes, I got a little bit carried away. comment:15 Changed 9 years ago by I forced a build to make the reviewer's job easier. comment:16 Changed 9 years ago by I also think this would be less ugly moved into two functions rather than writing getNextVersion(version, False, False, now). Is there a reason you preferred one? comment:17 Changed 9 years ago by Well there are actually 3 versions, considering the prerelease bit, which overlaps with each other, so I don't think having 2 functions would really improve things. comment:18 Changed 8 years ago by - From twistedchecker: ChangeVersionsScriptOptionshas no docstring. getNextVersionhas missing descriptions of a couple of arguments. - The code would be clearer if keyword arguments were used for patchand prerelease. Otherwise looks good. Please address the above and then merge. We very recently did 8.0.1. I suppose that means we managed to make it non-zero. Does that mean this ticket is resolved? I don't think I quite understand the description.
https://twistedmatrix.com/trac/ticket/2915
CC-MAIN-2021-31
refinedweb
670
68.06
Difference between revisions of "Weapon script" Revision as of 14:54, 23 March 2018 Contents - 1 Standard keys - 2 Console/Controller Mode-Specific Variables (New with Half-Life 2: Episode Two / Source 2007) - 3 Ammunition - 4 SoundData - 5 TextureData - 6 Flags - 7 Parsing new keys - 8 Encryption While it is perfectly possible to define a weapon's properties entirely in C++, Valve tend to use weapon scripts instead. These allow changes to be applied by a server restart, with no need to shut the game down and recompile its code. Weapons scripts should be located at game\scripts\<classname>.txt, and everything inside should be a child of a single WeaponData key. A weapon's scripted values are accessed from its GetWpnData() function. Standard keys These are the keyvalues that will be read by CBaseCombatWeapon. All weapons support them. Script keys are on the left, C++ variables on the right. Viewmodel and UI printname / szPrintName - The friendly name shown to players in the UI. Max 80 characters (but can be a localization key). viewmodel / szViewModel - Path to the viewmodel seen by the player holding the weapon. Relative to the game root, so be sure to include the models\folder. Max 80 characters. Not providing a viewmodel and selecting the weapon will cause the game to crash. bucket / iSlot - The HUD weapon selection in the X axis. 0 being the melee weapons by default. bucket_position / iPosition - The HUD weapon selection in the Y axis. 0 Being the pistol in the (1) X axis by default. weight / iWeight - Used to determine the weapon's importance when the game auto-selects one. - The "weight" used in the name is often erroneously misunderstood to mean weight as a mass, but is actually the weight as a priority. - Higher priority weapons will be selected before others when a weapon runs out of ammo, and a replacement is auto-selected by the game based on this value. autoswitchto / bAutoSwitchTo - Whether to switch to this gun on running out of ammo for another. Defaults true. - Combined with the previous weightcommand can set the order of precedent for auto-selection. - An example of this is the initial appearance of the Magnum in the map d1_canals_08 in Half-Life 2; when the player walks within pickup range of the .357, the weight value of the Magnum (being the highest in HL2 at 7) combined with this boolean ensures it is automatically selected for the scripted sequence that follows. autoswitchfrom / bAutoSwitchFrom - Whether to switch away from this weapon when picking up another weapon or ammo. Defaults true. showusagehint / bShowUsageHint - Show on-screen hints about how to use the weapon. Defaults false. BuiltRightHanded / m_bBuiltRightHanded - Weapon viewmodel is right-handed. Defaults true. Used in Counter-Strike: Source to differentiate weapon models that are modeled as such from the rest. AllowFlipping / m_bAllowFlipping - Allow the viewmodel to be mirrored if the user wants left handed weapons. Defaults true. Worldmodel playermodel / szWorldModel - Path to the weapon's regular model that is seen in the world. Relative to the game root, so be sure to include the \modelsfolder. Max 80 characters. anim_prefix / szAnimationPrefix - Prefix of the animations that should be played by characters wielding this weapon (e.g. prefix_idle, prefix_reload). Max 16 characters. Does not appear to have any effect when changed in Half-Life 2, however. Console/Controller Mode-Specific Variables (New with Half-Life 2: Episode Two / Source 2007) Support for some controller features were added with the release of The Orange Box for the Xbox 360, which aimed to take advantage of the force feedback (rumble) system of modern controllers; as well as slightly modified weapon bucket commands, due to the console version using a modified HUD and weapon selection system, via the directional pad (d-pad). bucket_360 - The HUD weapon selection on one of the four directional pad buttons. Only supports integers from 0 to 3 (See image). bucket_position_360 - The HUD weapon selection priority in the four buckets themselves. Weapons shown in the image start at 0, and increment by one each. rumble / iRumbleEffect - Which rumble effect to use when fired when playing with a controller. Works on consoles, as well as when using Xbox controllers on PC. - The table below includes an overview of some of the default rumblesettings. Of note is that only three rumble effects may be active at any given time (unless changed in the compiled code). Rumble Settings rumble -1 / RUMBLE_INVALID - The fallback if a rumble isn't valid. rumble 0 / RUMBLE_STOP_ALL - Cease all current rumbling effects. rumble 1 / RUMBLE_PISTOL - Used on the Pistol. - When used, firing too quickly will prevent the rumble from activating at all. rumble 2 / RUMBLE_357 - Used on the Magnum. - Similar to the previous, but firing speed has no ability to stop the rumble from activating. rumble 3 / RUMBLE_SMG1 - Used on the SMG. - An initial shake, followed by a rapid fall-off of feedback after a few rounds are fired. Using on a weapon like the Pistol will prevent the rumble from activating if fired too quickly. rumble 4 / RUMBLE_AR2 - Used on the AR2. - An initial shake, followed by a slight fall-off of feedback but maintains most of the "punch" of the first shot. rumble 5 / RUMBLE_SHOTGUN_SINGLE - Used on the Shotgun for single-shot. - A fairly large feedback pulse, that consistently maintains the force with every subsequent follow-up shot, even in automatic. rumble 6 / RUMBLE_SHOTGUN_DOUBLE - Used on the Shotgun for double-shot. - Feels identical to the normal shotgun rumble effect. rumble 7 / RUMBLE_AR2_ALT_FIRE - Used on the AR2 for the energy ball alt-fire. - Over the course of the AR2 alt-fire animation, quickly builds a rumble, and then releases at the point of firing the ball. rumble 8 / RUMBLE_RPG_MISSILE - Used when firing an RPG rocket. rumble 9 / RUMBLE_CROWBAR_SWING - Used when swinging the Crowbar, regardless of if it hit anything. rumble 10 / RUMBLE_AIRBOAT_GUN - Used when firing the Airboat gauss cannon. rumble 11 / RUMBLE_JEEP_ENGINE_LOOP - Used for the Jeep engine idle. rumble 12 / RUMBLE_FLAT_LEFT - Used for the Jeep. rumble 13 / RUMBLE_FLAT_RIGHT - Defined, but unused in the Source SDK 2013 code. rumble 14 / RUMBLE_FLAT_BOTH - Used for the rumble effects when using the Crane. rumble 15 / RUMBLE_DMG_LOW - When taking light damage; defined/unused. rumble 16 / RUMBLE_DMG_MED - When taking medium damage; defined/unused. rumble 17 / RUMBLE_DMG_HIGH - When taking high damage; defined/unused. rumble 18 / RUMBLE_FALL_LONG - When taking a lethal amount of fall damage. rumble 19 / RUMBLE_FALL_SHORT - When taking a non-lethal amount of fall damage. rumble 20 / RUMBLE_PHYSCANNON_OPEN - When the Gravity Gun claws open. rumble 21 / RUMBLE_PHYSCANNON_PUNT - In speculation: when punting something with the Gravity Gun - In implementation: defined/unused. rumble 22 / RUMBLE_PHYSCANNON_LOW - In speculation: when using a low amount of force on an object. - In implementation: when punting something with the Gravity Gun. rumble 23 / RUMBLE_PHYSCANNON_MEDIUM - In speculation: when using a medium amount of force on an object; defined/unused. rumble 24 / RUMBLE_PHYSCANNON_HIGH - In speculation: when using a high amount of force on an object; defined/unused. rumble 25 / RUMBLE_PORTALGUN_LEFT - When firing the blue portal with the Portal Gun; defined/unused. rumble 26 / RUMBLE_PORTALGUN_RIGHT - When firing the orange portal with the Portal Gun; defined/unused. rumble 27 / RUMBLE_PORTAL_PLACEMENT_FAILURE - When the Portal Gun fails to place down a portal; defined/unused. Ammunition clip_size / iMaxClip1 clip2_size / iMaxClip2 - Bullets in each clip. -1 means clips are not used. default_clip / iDefaultClip1 default_clip2 / iDefaultClip2 - Amount of ammo in the weapon when it spawns. primary_ammo / szAmmo1 secondary_ammo / szAmmo2 - The AmmoDef name of the hitscan ammunitions this weapon fires. Both default to "none". Max 32 characters each. MeleeWeapon / m_bMeleeWeapon - Weapon is a crowbar, knife, fists, etc. Defaults false. SoundData The sounddata subkey defines the sounds that should play when the weapon fires a bullet, fires dry, reloads, and so on. CBaseCombatWeapon will understand (but not necessarily use) the following: empty single_shot single_shot_npc double_shot double_shot_npc burst reload reload_npc melee_miss melee_hit melee_hit_world special1 special2 special3 taunt An example from the default HL2 weapon_smg1.txt file: sounddata { reload Weapon_SMG1.Reload // When the player reloads reload_npc Weapon_SMG1.NPC_Reload // When an NPC reloads empty Weapon_SMG1.Empty // Dry-fire single_shot Weapon_SMG1.Single // When the player fires single_shot_npc Weapon_SMG1.NPC_Single // When an NPC fires double_shot Weapon_SMG1.Double // When firing the grenade launcher special1 Weapon_SMG1.Special1 // Single-shot fire mode selection; unused special2 Weapon_SMG1.Special2 // Burst fire mode selection; unused burst Weapon_SMG1.Burst // Burst fire sound; unused } TextureData To define the HUD bucket icons, crosshairs, and ammo icons used by a weapon, you must edit the texturedata table. There are primarily two main ways of editing HUD icons: custom fonts, and traditional bitmap images. For more information, see the related article. Arguments Within the texturedata table, there are several values by default: weapon - The weapon icon that appears when the HUD is drawn, but the weapon is not selected. weapon_s - An additional icon that is overlaid on top of the weaponicon, to provide a glow effect when the weapon is selected, hence the _ssuffix. ammo - An icon used when picking up primary ammo that appears on the side of the screen. ammo2 - An icon used when picking up secondary/alt-fire ammo that appears on the side of the screen. Examples of this are AR2 balls and SMG grenades. crosshair - Used for the main crosshair that appears on the screen while using this weapon. autoaim - Used when the crosshair is on a target class, to change the crosshair style and colours. Defining Glyphs For each of these definitions, there are two ways to define a glyph for use by default. The first involves the use of fonts, as defined in the resource/clientscheme.res file included with every stand-alone Source game. The article linked abouve dictates how to use this. Font-Specific Arguments - font <string> - The name of a font class defined in the clientscheme.resfile. In Half-Life 2, they are usually a variation of the name WeaponIconsfor weapon glyphs. - character <string> - The specific font character to use on the sheet itself. For example, in HL2, on the WeaponIconsfont, ais the character used for the SMG. - The character specified is case-sensitive, as using Ain place of the former changes the glyph to a Lambda symbol used in the Half-Life 2 branding. This allows font sheets to have not just 26 different glyphs across the alphabet, but doubles it for lowercase and uppercase. The second method, is to use bitmap images, such as sprites to define the glyphs: Bitmap-Specific Arguments - file <path/to/image> - The path to the image, relative to materials/, so the initial root folder name is not needed. - x <integer> - The lateral (X-axis) position of the desired glyph on the sprite sheet. - y <integer> - The longitudinal (Y-axis) position of the desired glyph on the sprite sheet. - width <integer> - How wide to render the selected area of the sheet, in pixels. - height <integer> - How tall to render the selected area of the sheet, in pixels. An example from the default scripts/weapon_smg1.txt found in Half-Life 2: texturedata { weapon { font WeaponIcons character a } weapon_s { font WeaponIconsSelected character a } ammo { font WeaponIcons character r } ammo2 { font WeaponIcons character t } crosshair { font Crosshairs character Q } autoaim { file sprites/crosshairs x 0 y 48 width 24 height 24 } } Flags The following base-2 keyvalue flags are used to imbue the weapon with any combination of the following effects. To combine multiple effects, add the integer assigned to the effects you wish to use together in the weapon script. For example: item_flags 38 Would give the weapon the ITEM_FLAG_DOHITLOCATIONDMG, ITEM_FLAG_NOAUTOSWITCHEMPTY, and ITEM_FLAG_NOAUTORELOAD flags (32 + 4 + 2, respectively). 1 / ITEM_FLAG_SELECTONEMPTY - If a player runs out of ammo in their current weapon, and the ITEM_FLAG_NOAUTOSWITCHEMPTY is not assigned to that weapon, select a weapon that has this flag. Note: the 'weight' value assigned to the weapons with this flag affect switch priority. 2 / ITEM_FLAG_NOAUTORELOAD - Weapon does not automatically reload. 4 / ITEM_FLAG_NOAUTOSWITCHEMPTY - Weapon does not automatically switch to another weapon when empty. 8 / ITEM_FLAG_LIMITINWORLD - Weapon is limited in world. 16 / ITEM_FLAG_EXHAUSTIBLE - A player can totally exhaust their ammo supply and lose this weapon. The Frag Grenade has this flag. 32 / ITEM_FLAG_DOHITLOCATIONDMG - This weapon takes hit location into account when applying damage. 64 / ITEM_FLAG_NOAMMOPICKUPS - Don't draw ammo pickup sprites/sounds when ammo is received. 128 / ITEM_FLAG_NOITEMPICKUP - Don't draw weapon pickup when this weapon is picked up by the player. Parsing new keys You will at some point probably want to parse additional keys from a weapon script. You may want to simply because important values like cycle time (how long between each bullet) and bullets per shot are not read from scripts by Valve's code. Doing it is incredibly easy: #include "cbase.h" #include "weapon_parse.h" #include "KeyValues.h" class MyWeaponParse : public FileWeaponInfo_t { public: DECLARE_CLASS_GAMEROOT( MyWeaponParse, FileWeaponInfo_t ); void Parse( ::KeyValues* pKeyValuesData, const char* szWeaponName ) { BaseClass::Parse( pKeyValuesData, szWeaponName ); m_flCycleTime = pKeyValuesData->GetFloat( "CycleTime", 0.15 ); m_iBullets = pKeyValuesData->GetInt( "Bullets", 1 ); } float m_flCycleTime; int m_iBullets; }; // This function probably exists somewhere in your mod already. FileWeaponInfo_t* CreateWeaponInfo() { return new MyWeaponParse; } From outside the weapon To load weapon script keys from outside the weapon class (e.g. for VGUI use): Client: const FileWeaponInfo_t &weaponInfo = C_BasePlayer::GetLocalPlayer()->GetActiveWeapon()->GetWpnData(); wchar_t* wepname = g_pVGuiLocalize->Find(weaponInfo.szPrintName); // Loading a localised string Server: // TODO Encryption To prevent server operators from changing the behaviour of your weapons, you can ICE encrypt them. This isn't totally secure as your ICE key can be extracted from your mod's binaries by anyone with enough knowledge, but it will head off most tampering. To implement encryption, choose a secret eight-character alphanumeric key and run your weapon scripts through VICE with it. Then create const unsigned char* GetEncryptionKey() in your GameRules class and have it return the key. Once your mod starts loading ICE-encrypted files (.ctx) it will not load normal .txt files, even if a CTX is missing.
https://developer.valvesoftware.com/w/index.php?title=Weapon_script&diff=prev&oldid=212465
CC-MAIN-2019-35
refinedweb
2,292
57.16
Python & C# – Background Let’s clear the air. Using Python and C# together isn’t anything new. If you’ve used one of these languages and at least heard of the other, then you’ve probably heard of IronPython. IronPython lets you use both C# and Python together. Pretty legit. If you haven’t tried it out yet, hopefully your brain is starting to whir and fizzle thinking about the possibilities. My development experiences is primarily in C# and before that it was VB .NET (So I’m pretty attached to the whole .NET framework… We’re basically best friends at this point). However, pretty early in my career (my first co-op at Engenuity Corporation, really) I was introduced to Python. I had never really used a dynamic or implicitly typed language, so it was quite an adventure and learning experience. Unfortunately, aside from my time at EngCorp, I hadn’t really had a use to continue on with Python development. Lately, I’ve had a spark of curiosity. I’m comfortable with C#, sure, but is that enough? There’s lots of great programming languages out there! It’s hard for me to break out of my comfort zone though. I’m used to C# and the awesomeness of Visual Studio, so how could I ever break free from these two things? Well… I don’t have to yet. Python Tools for Visual Studio This was a nice little treasure to stumble upon: Free/OSS Python Tools for VS 2.0 RC is out! See it: – then download it: — VisualStudio (@VisualStudio) September 10, 2013 But I didn’t really know what it was all about. I had heard of IronPython, and I knew I could use Python with C# together, so what exactly is “Python Tools“? After I watched the video that the Visual Studio team tweeted out, I was captivated. Did this mean I could revisit python without having to leave the comfort of my favourite IDE? You bet. First thing I did after watching this video (and yes, I somehow managed to hold back the excitement and wait until the video was done) was fire up Visual Studio. I run with Visual Studio 2012 (the dark theme too) so in my screenshots that’s what you’ll be seeing. Once Visual Studio has loaded: - Go to the “Tools” menu at the top of the IDE. - Select the “Extensions and Updates…” menu item. - You should see the “Extensions and Updates” dialog window now. You’re going to want to search for “Python Tools” after you’ve selected the “Online” option on the left side of the dialog. It should look something like this: Installing Python Tools for Visual Studio is pretty easy. Make sure you’re searching online and search for “Python Tools”. After you’ve followed all of the installation instructions, it’s time to make sure the installation worked. Simple enough! - Go to the “File” menu at the top of the IDE. - Go to the “New” menu item. - Select the “Project…” menu item. - You should now see the “New Project” dialog To ensure Python is now available, try seeing if you have Python project templates available: To verify that Python is now available in Visual Studio, check under the installed templates. It should be under “Other Languages”. Hopefully it’s there. If not, or if you have any other install questions, I highly recommend you refer to the official site and follow along there. This is what got me up and running with my current machine, but if your setup is slightly different you should definitely follow their instructions. That’s it! You have Python Tools! Application I’m sure you feel the excitement building. I’ll start by saying the code is all available online, so even though I’ll have snippets and pictures here, you can download all of the source and follow along that way if you want. Otherwise, I’ll do my best to walk you through how I set things up! This application is going to be pretty simple. It’s a tiny bit bigger than a “Hello World” application, with the difference being that you tell Python what you want to print to the console. Easy-peasy, right? First up, let’s make a new C# console project. - From Visual Studio, go to the “File” menu at the top of the IDE. - Select the “New” menu item. - Select the “Project” menu item. - You should see the “New Project” dialog. - Select the “Visual C#” template on the left of the dialog. - Select “Console Application”. - In the framework dropdown at the top of the dialog, select .NET 4.5 - Fill in the details for where you want to save your project. - Press “OK”! And we’re off! Now that you have a console application you’re going to want to add in all the dependencies we need. If you look at the project in your solution explorer, you’re going to want to add the following dependencies: Add the IronPython and Microsoft.Scripting dependencies through the solution explorer in Visual Studio. If you’re having trouble getting the dependencies set up, remember you can always download the source projects I’ve put together. Now that you have all the necessary dependencies, here’s the source for our little application: using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using IronPython.Hosting; namespace PrintToConsole { internal class Program { private static void Main() { Console.WriteLine("What would you like to print from python?"); var input = Console.ReadLine(); var py = Python.CreateEngine(); try { py.Execute("print('From Python: " + input + "')"); } catch (Exception ex) { Console.WriteLine("Oops! We couldn't print your message because of an exception: " + ex.Message); } Console.WriteLine("Press enter to exit..."); Console.ReadLine(); } } } Let’s walk through what this code is doing: - First we’re getting input from the user. This is some pretty basic C# stuff, but we’re simply printing a message to the console and taking in the text the user enters before they press enter. - Next, we create a Python engine instance. This is the class that’s going to be responsible for executing python for us! - The code that exists within the try block tells our engine instance to execute some python code. - The print() method that you see being passed to the engine is the syntax since Python 3.0. - The parameter that we’re passing into the print() method is a python string… but we’re sticking our user input inside of it as well! - It’s also important to note that we’re building up a C# string that contains all of the Python code that will be executed and passing that to the engine. - I have a catch block here to catch any unexpected problems. Can you think of any? - What happens if your user input some text with a single quote? - The last part of the application just asks the user to press enter when they are all done. Simple! There’s your first C# + Python application! You can see the source for the whole thing over here. Run External Script So this is great: you can now run some python code from within C#. Totally awesome. But what about all those python scripts you have written up already? Do you need to start copying and pasting them into C# code files and start to try and format them nicely? The answer is no, thankfully! Let’s start by following the exact same steps as outlined in the first example. You should be able to set up a new .NET 4.5 C# console project and add in all the same dependencies. Once you have that put together, you can use the following source code: using System; using System.Collections.Generic; using System.Text; using IronPython.Hosting; namespace RunExternalScript { internal class Program { private static void Main(string[] args) { Console.WriteLine("Press enter to execute the python script!"); Console.ReadLine(); var py = Python.CreateEngine(); try { py.ExecuteFile("script.py"); } catch (Exception ex) { Console.WriteLine("Oops! We couldn't execute the script because of an exception: " + ex.Message); } Console.WriteLine("Press enter to exit..."); Console.ReadLine(); } } } This script looks similar, right? Before I explain what it does, let’s add in the Python script that you’ll be executing from this console application. - Right click on your project in the solution explorer. - Select the “Add” menu item from the context menu. - Select the “New Item…” menu item. - You should see the “Add New Item” dialog. - You’ll want to add a new text file called “script.py”. It should look a little something like this: The next really important step is to ensure that this script gets copied to the output directory. To do this, select your newly added script file in the solution explorer and change the “Copy to Output Directory” setting to “Copy Always”. Now when you build your project, you should see your script.py file get copied to the build directory. Woo! You can put any python code you want inside of the script file, but I started with something simple: print('Look at this python code go!') Okay, so back to the C# code now. This example looks much like the first example. - Wait for the user to press enter before executing the Python script. Just to make sure they’re ready! - Create our engine instance, just like in the first example. - In the try block, we tell the engine to execute our script file. Because we had the file copy to the output directory, we can just use a relative path to the file here. - Again, we’ve wrapped the whole thing inside of a try/catch to ensure any mistakes you have in your python script get caught. - Try putting some erroneous Python code in the script file and running. What happens? - Finally, make sure the user is content with the output and wait for them to press Enter before exiting. Look how easy that was! Now you can choose to execute Python code generated in C# OR execute external Python scripts! Summary It’s awesome to see that you expressed an interest in trying to marry these two languages together inside of a powerful IDE. We’re only breaking through the surface here, and admittedly I’m still quite new to integrating Python and C# together. I need to re-familiarize myself with Python, but I can already see there is a ton of potential for writing some really cool applications this way. In the near future, I’ll be discussing how the dynamic keyword in C# can actually allow you to create classes in Python and use them right inside of C#… Dynamically! Both of these pages were helpful in getting me up and running with C# and Python together: - - Source code for these projects is available at the following locations: October 4th, 2013 on 11:20 am This article also appears on CodeProject: October 31st, 2014 on 12:29 am Is it possible to create a true windows application using only python and .net? The examples I’ve seen all use the console to demonstrate a ‘hello world’ application. Or does one have to start with c# and then add python to make windows apps? Thanks! October 31st, 2014 on 8:22 am Thanks for the question Ben. To make a windows form app using *JUST* strictly Python and .NET, sure, it’s entirely possible. If you have Python installed on a system, you can always just launch a new process pointed at Python scripts. If you’re cool with IronPython like I was showing in this example, then it’s even easier (in my opinion). Here I showed a console application, but check out my other post on this stuff: In this example, I built up a WinForm application that uses IronPython. The point is, it’s not restricted to just console applications. If you want to get Python actually doing some of the UI work, I think things would start to get interesting there… I don’t want to say it’s impossible (it probably just needs a handle for where to render to) but I haven’t ventured into that territory. Let me know if that helps! August 10th, 2016 on 4:22 pm Hi Nick, I have MSVS2010 Ultimate, but following your guide, no Python Tools are retrieved searching online. Do you know if I necessarily have to have a later version than 2010? I googled it and came across the following page, but the download link is basically a MSVS download. I am not sure if I should go ahead and download this: Please let me know what you think… Thanks, H August 10th, 2016 on 7:09 pm Hey there! I don’t want to leave you hanging or anything, but I’m not positive. I think I recall reading that Microsoft has done a better integration of Python and Visual Studio in more recent times. So perhaps that’s totally replaced the original integration I wrote about. The only thing I can’t really advise is whether or not that particular download will be compatible with your product. However, I do think you’re probably on the right track! With that said, I’d say it’s worth a check. 🙂
http://devleader.ca/2013/09/23/visual-studio-c-python-sweet/
CC-MAIN-2018-09
refinedweb
2,225
74.49
Given a number n, find LCM of its digits. Examples: Input : 397 Output : 63 LCM of 3, 9 and 7 is 63. Input : 244 Output : 4 LCM of 2, 4 and 4 is 4. We traverse the digits of number one by one below loop digit = n mod 10; n = n / 10; While traversing digits, we keep track of current LCM and keep updating LCM by finding LCM of current digit with current LCM. // CPP program to find LCM of digits of a number #include<iostream> #include<boost/math/common_factor.hpp> using namespace std; int digitLCM(int n) { int lcm = 1; while (n > 0) { lcm = boost::math::lcm(n%10, lcm); // If at any point LCM become 0. // return it if (lcm == 0) return 0; n = n/10; } return lcm; } // driver code int main() { long n = 397; cout << digitLCM(n); return 0; } Output: 63 This article is contributed by nikunj find LCM of two numbers - Pair with maximum GCD from two arrays - Program for Fibonacci numbers - Divisible by 37 for large numbers - Program to find GCD of floating point numbers - JavaScript | Math.log2() function - JavaScript | Math.sinh() function - JavaScript | Math.LOG10E property - JavaScript | Math.log10() function - JavaScript | Math.tanh() function Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.
https://www.geeksforgeeks.org/lcm-digits-given-number/
CC-MAIN-2018-13
refinedweb
216
74.08
ESP32 Course Example: Module 4, Unit 2, ESP32 Web Server – Control Outputs: The ESP32 works fine for a few minutes, but when I come back to the ESP32 Web Server several minutes later, it doesn’t respond on the webpage I used to connect with. Do you have any suggestions as to why this is occurring? Are you going to add a Unit to the course on Watchdog Timers? Thank you for any assistance, Joel Hi Joel, - How are you powering the ESP32 through a reliable and stable power source? - Can you try let the Arduino IDE serial monitor open to print the error that occurs that makes the web server stop working? - We don’t have any Units about watchdog timers at the moment… Thanks! Rui Powered with the USB port on my computer running Windows 10. I was using Chrome to access the web server when I had this problem. I switched to Microsoft Edge and now the web server works fine. Can anyone tell me why Chrome isn’t working with the ESP32 Web Server? Is there some setting in Chrome that needs to be changed? Thanks for any advice, Joel Hum… It should work regardless of the web browser and in fact I only use Google Chrome. Did you leave the Google Chrome window open for a long time with the web server open? Did you see the error printed in the Arduino IDE serial monitor? Thanks! Hi I have just completed a project using the ESP8266 which I imagine is similar to the ESP32. It appears to have a default time out of 2 hours. Powering the ESP8266 from a separate 5Volts the ESP8266 will continue to run no matter how many times the browser (Chrome) goes to sleep/switched off PROVIDED it is re-activated about every 2 hours. I am confident that my system is working as I use it to display elapsed time using the function millis( ). The html code was programmed to refresh every 5 seconds – it reached 95 million milli seconds before I went to sleep for greater than 2 hours! JK Thanks for providing additional details. Yes, most ESP8266 code should work on an ESP32. Simply import the WiFi library for your ESP32 with: #include <WiFi.h> Instead of using the ESP8266WiFi: #include <ESP8266WiFi.h> Hi Rui Santos I have been a bit slow at the course and only now did the web server interface module. Having the same issue with losing connection after a while. It seems as if the serial monitor also stops and the port gets lost at the same time. There is no way to find the reason that way. My ESP32 board type is a ESP-DEV board. Could there possibly be a way to detect in the sketch program when connection is lost and the re-start it? Chris Could I retract an earlier statement and add some explanation: “…………. if the browser ever closed down for any length of time (eg greater than two hours such as the PC being switched off for the night) the system failed to recover. This is possibly due to the time out on the ESP8266.” I gave some investigation to that issue. The data sheet indicates that the ESP8266 timeout could be set to up to 7200 seconds (2 hours) so that led me to believe the above statement of the system failing after 2 hours was sensible. However including the following code Serial.println(“AT+CIPSTO?”) indicated that the default factory setting was 180 seconds or 3 minutes well short of 2 hours. At this point it was assumed that the ESP8266 was being interrogated by neighbours’ computers. When they went off for the night the ESP8266 timed out. It was nothing to do with my browser not requesting a response after two hours – it was to do with the whole spectrum of computers in range “closing down”. This result does highlight an issue with testing – it appears that the results will be different between an area heavily populated with computers and a remote area. Testing this system in the city it will work but if it was to go in the middle of the Simpson Desert to advise the next traveller of the status of the next waterhole the situation could be drastically different. The data sheet indicates setting CIPSTO=0 there will be no time out. However the manual in red does not recommend that. It does not say why. I cannot help as to what library routine handles CIPSTO- I wanted to understand the ESP8266 so have written my own libraries. JK Hi @John Kneen, I think there’s a misunderstanding and please create a new thread here, if you need help with the ESP8266: Basically, after flashing the ESP32/ESP8266 with Arduino IDE sketch, the AT firmware that was originally running is erased, so if you send those AT commands, they won’t wrong/they will be ignored. Regards, Rui Hello @Chris Coetser, - How are you powering the ESP32 through a reliable and stable power source? - Which web browser are you using (Google Chrome?)? - Did you leave the web browser window open? Regards, Rui Hi Rui I am powering it from 1.) Laptop USB 2.) 3.3V LiFeP04 cell 3500mA at Vin and grd pins with same results. I use Google Chrome in windows 10. I have tried on Windows 7 with same results. Yes I did leave web browser window open. After a while it stops working. As soon as I press EN it works again. I plan to switch on/off my house security lighting through static relay using my smartphone if I can make this reliable. Cheers Chris If you close the web browser window, does it also close the ESP32 web server connection properly? Yes it does. “waiting for new client” I have opened a new question on this error message from the serial monitor. I think it has to do with ESP32 memory but I am still a newby 🙂 E (220) spi RAM enabled but initialisation failed. bailing out Cheers Chris Hello @Chris Coetser, @John Kneen, and @Joel Farnham,!
https://rntlab.com/question/esp32-drops-connection/
CC-MAIN-2021-25
refinedweb
1,022
72.26
Defines sets and intervals to work with time, and provides arithmetic operations for them. Uses Cython extensions for performance. Project description PyTimeSet Library that defines time intervals and sets and offers typical operations between them using Cython for speed. Installation Requirements: Python 3.6+ To install, simply run pip install pytimeset Basic Usage: This library defines two immutable, timezone-aware, objects: TimeInterval and TimeSet. Time intervals are defined by their start and end moments. Intervals are defined to contain their start point, but not their end point (closed to the left, open to the right). Time sets are defined by the minimum set of intervals that contains all the points in it. This means that the intervals passed to the constructor of the TimeSet may not be the same intervals contained inside it, as "touching" intervals are merged and empty intervals are removed. from datetime import datetime from timeset import TimeInterval, TimeSet t0 = datetime(2019, 7, 19) t1 = datetime(2019, 7, 20) t2 = datetime(2019, 7, 21) t3 = datetime(2019, 7, 22) t4 = datetime(2019, 7, 23) empty = TimeInterval(t0, t0) i0 = TimeInterval(t0, t2) i1 = TimeInterval(t1, t3) i2 = TimeInterval(t3, t4) i3 = TimeInterval(t0, t4) i0.contains(t1) # True i0.start == t0 # True i0.end == t2 # True i0.overlaps_with(i1) # True i0.is_subset(i3) # True empty.is_subset(i2) # True, the empty set is subset of every other set. i0.intersection(i1) # TimeInterval(t1, t2) Undefined behavior Intervals defined by a single point (Such as TimeInterval(t, t)) are a bit weird. As of now, I have defined them to be equivalent to the empty set, but that might change in the future, so just don't mess too much with them. This library is timezone-aware, meaning that you can pass timezone-aware datetimes to it and you will get back datetimes in the same timezone. That said, if you mix timezones, the results will point to the right moment in time, but their timezones are undefined (meaning any one of those you originally passed). When in doubt, simply convert the results to your preferred timezone. Project details Release history Release notifications | RSS feed Download files Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/pytimeset/
CC-MAIN-2022-27
refinedweb
377
64.61
Hello, All!I'm trying to turn on a relay, count a specific number of pulses on a digital input, then turn the relay off. I can't find a way to count the pulses in Cayenne. Any ideas? -Jason Hello,I also didn't know how to do it with Cayenne, but you can write your code and use Cayenne only for monitoring the number of the pulses and IF you reach specify number, you can use Triggers to turn ON/OFF the relay. What kind of platform do you use? I recommend to count the pulses in your algorithm and send them as a Number to the Cayenne. If you want to see de pulses in Cayenne dashboard just do (If you are using arduino): CAYENNE_OUT(VIRTUAL_PIN) { Cayenne.virtualWrite(VIRTUAL_PIN, pulses); } However, if you want to make the pulses with a button from Cayenne dashboard just drag and drop a button and: int pulses; CAYENNE_IN(VIRTUAL_PIN) { if(getValue.asInt() == 1){ pulses++; } } Or with a 1 - 2 state button int pulses; CAYENNE_IN(VIRTUAL_PIN) { pulses++; } Did I understand you? I'm using a Raspberry Pi Zero to as an irrigation controller. I have it working with Python code, but was wondering if I could do it with Cayenne. I use GPIO.event_detect to count the pulses of a water meter (1 gal/pulse). I wasn't aware that I could send that data to Cayenne. I'll look into it. Thanks for the idea! If you have the code already in python then you are 75% of the way there. You just need to install the Cayenne MQTT library and send the data via MQTT. Here are some links that will get you where you need to be, post back if you need any help! (or you can also use the paho MQTT library) Thanks, Adam. I looked at the pydoc and understand all the methods exceptthe "topic" methods (getCommandTopic, getResponseTopic, & getDataTopic).Where can I find more details about these? I'm not sure what those are either. Can you post the link where you found it? They are in the Methods section of the pydoc for Cayenne. I get to it by clicking "Python 3.5 Module Docs" under the Python group in the Windows menu (I have Python installed on my Windows 10 machine). The address in the browser that it goes to is "". Does this comments from the code help you? I think these are the methods for populating, communication and updating the data to the cayenne? def getDataTopic(self, channel): """Get the data topic string. channel is the channel to send data to. """ return "%s/%s/%s" % (self.rootTopic, DATA_TOPIC, channel) def getCommandTopic(self): """Get the command topic string.""" return "%s/%s/+" % (self.rootTopic, COMMAND_TOPIC) def getResponseTopic(self): """Get the response topic string.""" return "%s/%s" % (self.rootTopic, RESPONSE_TOPIC) The comments help a bit, but I still don't understand what the "Topics" are used for. I'd love to see a good example. Here's a nice MQTT tutorial:
http://community.mydevices.com/t/pulse-counter-on-standard-digital-input-pin/2562
CC-MAIN-2017-39
refinedweb
504
76.11
This article extends my discussion of advanced programming, but strays into an area that is not exclusively object oriented. What we are interested in for this installment is ways of writing programs that are declarative rather than imperative. In many cases, simply notating facts is more concise and less error prone than providing instructions. A number of less common programming languages make declarative styles predominant, but it is also possible to use a declarative style within generally imperative languages. In this article, as with the others in this series, I will focus on techniques as exemplified in Python. When most programmers think about programming, they imagine imperative styles and techniques for writing applications. The most popular general purpose programming languages are predominantly imperative in style. On the other hand, there are also many programming languages that are declarative in style, including both functional and logic languages. Let me list a few languages that fall in various categories. Many readers have used many of these tools, without necessarily thinking about the categorical differences among them. Python, C, C++, Java, Perl, Ruby, Smalltalk, Fortran, Basic, and xBase are all straightforwardly imperative programming languages. Some of these are object oriented, but that is simply a matter of the organization of code and data, not of the fundamental programming style. In these languages, you command the program to carry out a sequence of instructions: put some data in a variable; fetch the data back out of the variable; loop through a block of instructions until some condition is satisfied; do something if something else is true. One nice thing about all these languages is that it is easy to think about them within familiar temporal metaphors. Ordinary life consists of doing one thing, making a choice then doing another thing, and maybe using some tools along the way. It is easy to imagine the computer that runs a program as a cook, or a bricklayer, or an automobile driver. Languages like Prolog, Mercury, SQL, XSLT, EBNF grammars, and indeed configuration files of various formats, all declare that something is the case or that certain constraints apply. Mathematics is generally the same. The functional languages—such as Haskell, ML, Dylan, Ocaml, and Scheme—are similar, but with more of an emphasis on stating internal (functional) relationships between programming objects (recursion, lists, etc.). Our ordinary life, at least in its narrative quality, provides no direct analog for the programming constructs of these languages. For those problems you can naturally describe in these languages, however, declarative descriptions are far more concise and far less error prone than are imperative solutions. Prolog is a language that comes close to logic or mathematics. In it you simply write statements you know to be true, then ask the application to derive consequences for you. Statements are composed in no particular order, and you the programmer or user need have no real idea what steps are taken to derive results. For example: Example 1. family.pro Prolog sample /* Adapted from sample at: This app can answer questions about sisterhood & love, e.g.: # Is alice a sister of harry? ?-sisterof( alice, harry ) # Which of alice's sisters love wine? ?-sisterof( X, alice ), love( X, wine) */ sisterof( X, Y ) :- parents( X, M, F ), female( X ), parents( Y, M, F ). parents( edward, victoria, albert ). parents( harry, victoria, albert ). parents( alice, victoria, albert ). female( alice ). loves( harry, wine ). loves( alice, wine ). Another declarative example is a document type definition that describes a dialect of valid XML documents. Example 2. An XML document type declaration <!ELEMENT dissertation (chapter+)> <!ELEMENT chapter (title, paragraph+)> <!ELEMENT title (#PCDATA)> <!ELEMENT paragraph (#PCDATA | figure)+> <!ELEMENT figure EMPTY> The DTD language does not contain any instructions about what to do to recognize or create a valid XML document. It merely describes what one would be like if it were to exist. Python libraries can use declarative languages in two fairly distinct ways. Perhaps the more common technique is to parse and process non-Python declarative languages as data. An application or a library can read in an external source (or a string defined internally, but just as a "blob"), then figure out a set of imperative steps to carry out that conform in some way with those external declaration. In essence, these types of libraries are "data-driven" systems; there is a conceptual and category gap between the declarative language and what a Python application does to carry out or apply its declarations. There is a Python library to implement Prolog, called PyLog. There are several Python libraries that work with Extended Backus-Naur Form (EBNF) grammars. The Python module xmlproc determines if an XML document conforms with a DTD. Moreover, libraries to process those identical declarations have also been implemented in other programming languages. For example, in the Python library SimpleParse, you can declare grammar rules in a data file, then use those grammar rules to parse a conforming document into a tree structure. Such a rule file might look like: Example 3. EBNF sample word := alphanums, (wordpunct, alphanums)*, contraction? alphanums := [azAZ0-9]+ wordpunct := [-_] contraction := "'", ("clock"/"d"/"ll"/"m"/"re"/"s"/"t"/"ve") The data file read by SimpleParse is a pretty standard looking EBNF grammar, which is to say that it doesn't look much like Python. The same is true for the other mentioned tools that happen to be written in Python, but use declarations that are quite unlike Python. While there is nothing wrong with this approach and these tools (I use them all the time), it might be more elegant, and in some ways more expressive, if Python itself could be the declarative language. If nothing else, libraries that facilitated this would not require programmers to think about two (or more) languages when writing one application. The EBNF parsers Spark and PLY let users declare Python values in Python, then use some magic to let the Python runtime environment act as the configuration of parsing. Using PLY, you can write a grammar that is equivalent to the prior SimpleParse EBNF example: Example 4. PLY sample tokens = ('ALPHANUMS','WORDPUNCT','CONTRACTION','WHITESPACE') t_ALPHANUMS = r"[azAZ0-0]+" t_WORDPUNCT = r"[-_]" t_CONTRACTION = r"'(clock|d|ll|m|re|s|t|ve)" def t_WHITESPACE(t): r"\s+" t.value = " " return t import lex lex.lex() lex.input(sometext) while 1: t = lex.token() if not t: break Without going into details of the PLY library, what you should notice here is that it is the Python bindings themselves that configure the parsing (actually lexing/tokening in this example). The PLY module just happens to know enough about the Python environment it is running in to act on these pattern declarations. Python's introspective capabilities are quite powerful, but the details of how PLY works internally are omitted here. The module gnosis.xml.validity is a framework for creating classes that map directly to DTD productions. It is available as part of Gnosis Utils. Any gnosis.xml.validity class can only be instantiated with arguments obeying XML dialect validity constraints. Actually that is not quite true; the module will also infer the proper types from simpler arguments when there is only one, unambiguous, way of "lifting" the arguments to the correct types. For this article, I only want to look at the declarative style in which validity classes are created, not explore the uses of the module. A set of rules/classes matching the DTD listed above consists of the following: Example 5. gnosis.xml.validity rule declarations from gnosis.xml.validity import * class figure(EMPTY): pass class _mixedpara(Or): _disjoins = (PCDATA, figure) class paragraph(Some): _type = _mixedpara class title(PCDATA): pass class _paras(Some): _type = paragraph class chapter(Seq): _order = (title, _paras) class dissertation(Some): _type = chapter You might create instances out of these declarations using: ch1 = LiftSeq(chapter, ("1st Title","Validity is important")) ch2 = LiftSeq(chapter, ("2nd Title","Declaration is fun")) diss = dissertation([ch1, ch2]) print diss The classes defined closely match the prior DTD. The mapping is basically one-to-one; except it is necessary to use intermediaries for quantification and alternation of nested tags (intermediary names are marked by a leading underscore). Notice that these classes, while created using standard Python syntax, are unusual (and more concise) in having no methods or instance data. Classes are defined solely to inherit from some framework, where that framework is narrowed by a single class attribute. For example, a <chapter> is a sequence of other tags, namely a <title> followed by one or more <paragraph> tags. All we need to do to assure the constrain is obeyed in the instances is declare the chapter class in this straightforward manner. No methods are programmed by the library user, and there is no imperative flow within the classes. The main "trick" involved in programming parent classes like gnosis.xml.validity.Seq is to look at the .__class__ attribute of an instance during initialization. The class chapter does not have its own initialization, so its parent's __init__() method is called, but the self passed to the parent __init__() is an instance of chapter, and it knows it. To illustrate, this is part of the implementation of gnosis.xml.validity.Seq: Example 6. Class gnosis.xml.validity.Seq class Seq(tuple): def __init__(self, inittup): if not hasattr(self.__class__, '_order'): raise NotImplementedError, \ "Child of Abstract Class Seq must specify order" if not isinstance(self._order, tuple): raise ValidityError, "Seq must have tuple as order" self.validate() self._tag = self.__class__.__name__ Once an application programmer tries to create a chapter instance, the instantiation code checks that chapter was declared with the required _order class attribute, and that this attribute is the needed tuple object. The method validate() performs some further checks to make sure that the objects the instance was initialized with belong to the corresponding classes specified in _order. A declarative programming style is almost always a more direct way of stating constraints than is an imperative or procedural one. Of course, not all programming problems are about constraints; or at least, that is not always a natural formulation. Problems of rule-based systems, though, such as grammars and inference systems, are much easier to manage if they can be described declaratively. Imperative verification of grammaticality quickly turns into spaghetti code and is difficult to debug. Statements of patterns and rules can remain much simpler. David Mertz , being a sort of Foucauldian Berkeley, believes, esse est denunte. Return to the Python DevCenter.
http://www.linuxdevcenter.com/lpt/a/4041
CC-MAIN-2015-14
refinedweb
1,740
54.32
Odoo Help Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps: CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc. What's the context? Several questions about context in OpenERP: - What is it ? - How to define it and what is active_id regarding context ? - What does context.get('Active_id',False/True) stand for ? The context is a python dictionary and is used to pass certain data to a method. Since nearly all methods have a context parameter you can use the context to pass data through several levels of python methods. For example you can set a context value in a XML-view and process it in the write() method of the osv object. context.get('active_id',False) returns the value of the key 'active_id'. If the key is not in the context, then it returns the value 'False'. The value in 'active_id' is passed from the web client and contains the ID of the current selected record. Here is an example how the context is used in the Sale module. File sale_view.xml: <record id="view_order_form" model="ir.ui.view"> <field name="name">sale.order.form</field> <field name="model">sale.order</field> <field name="arch" type="xml"> <form string="Sales Order" version="7.0"> <header> <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" groups="base.group_user"/> <button name="invoice_corrected" states="invoice_except" string="Ignore Exception" groups="base.group_user"/> <button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="oe_highlight" groups="base.group_user"/> .... You can see that the button third button ( Send by Email) calls method action_quotation_send in sale.py. Here is the relevant code in sale.py: def action_quotation_send(self, cr, uid, ids, context=None): ....... ctx.update({ 'default_model': 'sale.order', 'default_res_id': ids[0], 'default_use_template': bool(template_id), 'default_template_id': template_id, 'default_composition_mode': 'comment', 'mark_so_as_sent': True }) return { 'type': 'ir.actions.act_window', 'view_type': 'form', 'view_mode': 'form', 'res_model': 'mail.compose.message', 'views': [(compose_form_id, 'form')], 'view_id': compose_form_id, 'target': 'new', 'context': ctx, } The context is updated with the flag mark_so_as_sent set to True. Afterwards the send-mail window ( mail.compose.message) is opened and the modified context is passed. Then the send_mail() method is overwritten. If the flag mark_so_as_sent has been set in the context, then the new functionality is called. This ensures that the current behavior of send_mail() is not affected. But when the wizard is opened from the Sale Order, the new functionality will be executed. Also in sale.py: class mail_compose_message(osv.Model): _inherit = 'mail.compose.message' def send_mail(self, cr, uid, ids, context=None): context = context or {} if context.get('default_model') == 'sale.order' and context.get('default_res_id') and context.get('mark_so_as_sent'): context = dict(context, mail_post_autofollow=True) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'sale.order', context['default_res_id'], 'quotation_sent', cr) return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context) Can you give some additional details and samples ? I have updated my answer with an example how the context is used in the Sales module why is the context parameter send as "context=context" and not just ''context''? In this example this would make no difference. But sometimes there are more parameters between "ids" and "context" and then this is required. The context is used to pass certain data to a method in the python code. stock/product.py def get_product_available(self, cr, uid, ids, context=None): if context.get('shop', False): --- if context.get('warehouse', False): ---- if context.get('location', False): ----- return res stock/stock.py def _default_location_source(self, cr, uid, context=None): if context.get('move_line', []): ---- elif context.get('address_in_id', False): ---- return location_id In my doubt is How to find set a context value in a XML-view for a particular python code? In the below python xml code:- stock/stock_view.xml:- context="{'location':location_id, 'uom':product_uom, 'to_date':parent.date}" stock/product_view.xml:- <field name="location_id" widget="selection" context="{'location': self}"/> <field name="warehouse_id" widget="selection" context="{'warehouse': self}"/> In the stock_view and product_view xml file context set "location" and "warehouse" only found. How to find the xml file where context set value for the "shop", "move_line", "address_in_id"? In the above example Context can set only same module xml file or can set any other module xml file? To get parent value in one2many we may use context in XML. First of all I will define you the problem statement that why we need this scenario. And using context in xml what we could achieve. After reading the article, answer of these questions help you to reflect upon and analyse what you have read. 1- \What is context? 2- Why we need context? 3- How to use or define context in Odoo/OpenERP? What is context? About This Community Odoo Training Center Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
https://www.odoo.com/forum/help-1/question/what-s-the-context-2236
CC-MAIN-2018-47
refinedweb
800
53.17
Regex: How to turn more words in the line as if they were seen in the mirror? - Hellena Crainicu last edited by very long Regex, hard to work… but there are many simple solutions in Python, just run it with any IDLE. For example: def revwordSentence(Sentence): return ' '.join(word[::-1] for word in Sentence.split(" ")) Sentence = "Your sentence here that will be change" print(revwordSentence(Sentence)) OR def reverseword(str): word = str.split(" ") newWord = [words[::-1] for words in word] new = " ".join(newWord) return new str = "Python Guides is good for beginners" print(reverseword(str)) You can find any other Python code examples on internet. - Alan Kilborn last edited by @Hellena-Crainicu said in Regex: How to turn more words in the line as if they were seen in the mirror?: very long Regex, hard to work… Copy-paste is “hard to work”? but there are many simple solutions in Python, Yes, but in general, we don’t care. There’s also solutions in Java, C, C++, V, etc. But again, we don’t care. This is a forum about Notepad++, so we concentrate on solutions provided within Notepad++. We prefer native solutions, like the one @guy038 provided, but when those aren’t available, plugin solutions are valid. Sure, you could’ve turned your suggestion into a PythonScript plugin based one, and that would have been “OK”, but even that is not great because there are so many non-coders that use Notepad++ that are intimidated by a code solution. Best to take the native solution and run with it, in this particular case. - Robin Cruise last edited by thank you @guy038 I don’t know how can I use your regex, just copy-paste and Replace doesn’t work. Seems that it is a code too large. @Hellena-Crainicu thanks for your Python Code, I will install Python and I will test those scripts. @Alan-Kilborn I am using only notepad++, and it is my favorite editor. But if a solution cannot be find in notepad++, I am sure that another solution in other programs will be welcome. - Alan Kilborn last edited by @Robin-Cruise said in Regex: How to turn more words in the line as if they were seen in the mirror?: But if a solution cannot be find in notepad++, I am sure that another solution in other programs will be welcome. Sure it can be mentioned, but as it is “off-topic” for this forum, it should be just a mention and not an exposition into other tools. I don’t know how can I use your regex, just copy-paste and Replace doesn’t work. So one of the things people do when they get answers on this (or any) forum, is that they immediately go off and do their own thinking, without trying exactly what is suggested first. Suggest you try following the instructions in this section of @guy038 's posting, as exactly written, and I think you’ll find it works just fine: Now, follow carefully each step, below Hi, @robin-cruise, @alan-kilborn, @hellena-crainicu and all, First, @robin-cruise, as suggested by @alan-kilborn, just execute each step, one after another and the replacement will occur ;-)) Now, let’s suppose that we want to consider expressions like middle-agedor I'mor John'sas single words ! So, we must include the dash ( -), the apostrophe ( ') and the right single quotation mark ( ’) as word characters So each single character to find can be expressed with the character class [\w'’-] Now, in order to look for the consecutive letters of a word, we’ll use the general syntax ([\w'’-])((?1))((?1))•••••((?1))where (?1)is a subroutine call to group 1, so [\w'’-]and the outer parentheses, of each (?1), stores the corresponding character as groups 2, 3, and so on … So, here is, below, a regex S/R, which deals with expressions from 2to 24letters, only. It’s our best solution as the overall regex cannot exceed 2,048characters ! SEARCH : (?x) (?| ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1))((?1)) | ([\w'’-])((?1))((?1))((?1)) | ([\w'’-])((?1))((?1)) | ([\w'’-])((?1)) ) REPLACE : $24$23$22$21$20$19$18$17$16$15$14$13$12$11$10$9$8$7$6$5$4$3$2$1 So this INPUT text : Mary's brother is a middle-aged person will be changed as : s'yraM rehtorb si a dega-elddim nosrep With the regex S/R, provided in my previous post, we would have obtained, instead : yraM's rehtorb si a elddim-dega nosrep Cheers, guy038 P.S. : You’ll need to search for words containing 25or more letters, by yourself, with the regex [\w'’-]{25,}and, then, change these words manually. Not a big task, anyway ! @Robin-Cruise said in Regex: How to turn more words in the line as if they were seen in the mirror?: Mirrors Actually Flip the Letters in a Word? Or, how to turn more words in the line as if they were seen in the mirror? For example: At the Olympics you run not only for yourself, but for all people. After using a regex formula, the output should be: Ta eht scipmylO uoy nur ton ylno rof flesruoy, tub rof lla elpoep. Using the examples provided (by OP and @guy038) the following regex would do the job. It is much shorter than the second regex provided by @guy038, although I should add that my regex will (currently) work with a word of between 2 to 39 characters long. The regex could be extended much further as not anywhere approaching the 2048 character limit. A calculation suggests a word of 79 characters could be accomodated as ([\w'’-])?(?(19)([\w'’-]))is 26 characters long. Divided into 2048 we have 78 with 20 to spare. 20 together with the #1-#9 groups saving another 9 characters allows for 1 additional word character. I am not going to write a regex that long even if I can cheat by using a number of Notepad++ functions to create that regex. So using the Replace With function we have: Find What: \b([\w'’-])([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?(?(19)([\w'’-]))(?(18)([\w'’-]))(?(17)([\w'’-]))(?(16)([\w'’-]))(?(15)([\w'’-]))(?(14)([\w'’-]))(?(13)([\w'’-]))(?(12)([\w'’-]))(?(11)([\w'’-]))(?(10)([\w'’-]))(?(9)([\w'’-]))(?(8)([\w'’-]))(?(7)([\w'’-]))(?(6)([\w'’-]))(?(5)([\w'’-]))(?(4)([\w'’-]))(?(3)([\w'’-]))(?(2)([\w'’-]))([\w'’-])\b Replace With: ${39}${38}${37}${36}${35}${34}${33}${32}${31}${30}${29}${28}${27}${26}${25}${24}${23}${22}${21}${20}${19}${18}${17}${16}${15}${14}${13}${12}${11}${10}${9}${8}${7}${6}${5}${4}${3}${2}${1} What follows is how I reached the solution and need not be read unless you want an in-depth foundation on how it works. What is occuring is that it has to capture a minimum of 2 word characters (plus additional characters) [\w'’-], and that is the first and last capture groups in the regex. There are 39 capture groups with pairs of #2 & #38, #3 & #37, #4 & #36 etc linked together. That is to say if capture group #2 does capture a character then capture group #38 MUST also capture a character. Since these work as pairs and I already have the first and last capture groups which also MUST capture a character each I needed to include another capture group which operates alone, allowing for an odd numbered length word, this is the one immediately before (?(19)([\w'’-])). Of course the replacement field just needs to write these capture groups back in reverse order. If a capture group never stored a character it doesn’t write anything back. Terry - Robin Cruise last edited by Robin Cruise @Terry-R your Regex works fine, except that no more than 74 words ( 462 characters) can be change.But, important is that is working fine @guy038 I have a little problem. I copy and find with your regex. The search works. Just like in your first regex. Good. But the replacement doesn’t work. Says that all occurrences were replaced in entire file, but actually nothing is change. @Robin-Cruise said in Regex: How to turn more words in the line as if they were seen in the mirror?: your Regex works fine, except that no more than 74 words ( 462 characters) can be change. I don’t understand what you mean by 74 words. Currently any word of 39 characters or less will be “mirrored”. So if you have a document of many words, all shorter than 40 characters they will ALL reverse. If you have a problem, then possibly the next word (75th) is longer or has some other issue. Maybe you need to provide an example around the area my regex fails, or even better a link to download the file you are testing with. Terry - Robin Cruise last edited by Robin Cruise @Terry-R your regex is very good, except it cannot replace more than 74 words (aprox.) For example, try yourself to replace this text, you will see that you have to shorten it: I hear the echo of my mind on the mist of the summer wind. And, most importantly, when you listen to something soothing, it is because your soul is there, in the sun, by the sea, by the sand, barely looking for that special something that will not consume you, a sparkle, a beautiful word, a contoured idea of a thought that crosses your mind and that you can only share with yourself. It all starts with a thought that appears in the field of your consciousness. The heat of the summer wind is still there. @Robin-Cruise said in Regex: How to turn more words in the line as if they were seen in the mirror?: For example, try yourself to replace this text, you will see that you have to shorten it: Nope, did not need to shorten it, changed all the 2 (or more) letter words. Here is the result: So that was 90 changes made. I recall from previous posts finding solutions for you forum members have often had problems getting you to understand the need for accuracy in copying the expressions we supply. And also issues with getting you to actually supply examples where issues occur. I can only reiterate those sentiments, you do need to be accurate and provide good examples when you find issues. The above example you provided was not a problem when I tested it. Terry Hi, @robin-cruise, @alan-kilborn, @hellena-crainicu, @terry-r and all, Sorry, Terry, that I have not commented on your solution yet, but I was busy sorting out a lot of photos, and reducing their size by lowering their JPEGquality factor ! And, indeed, your solution, with conditional expressions, is really impressive ! Where I use brute force, you use a very subtle method ;-)) I did some additional tests with the license.txtfile. I tested if the two \bassertions are necessary in my and your solutions ! And it happens that the only difference is about words ending with an apostrophe, as in this beginning of sentence : For both users' and authors' sake, ... With the \bassertions the text becomes roF htob sresu' dna srohtua' ekas, ... Without the \bassertions the text becomes roF htob 'sresu dna 'srohtua ekas, ... Omitting the \bassertions seems more logical as we consider the apostrophe as a word char itself. So the ending 'must becomes a starting ', after replacement ! So, your search regex can be expressed, in free-spacing mode, as : (?x) ([\w'’-]) # Group 01 FIRST char of a 'word' ([\w'’-])? # Group 02 ([\w'’-])? # Group 03 ([\w'’-])? # Group 04 ([\w'’-])? # Group 05 ([\w'’-])? # Group 06 ([\w'’-])? # Group 07 ([\w'’-])? # Group 08 ([\w'’-])? # Group 09 ([\w'’-])? # Group 10 ([\w'’-])? # Group 11 ([\w'’-])? # Group 12 ([\w'’-])? # Group 13 ([\w'’-])? # Group 14 ([\w'’-])? # Group 15 ([\w'’-])? # Group 16 ([\w'’-])? # Group 17 ([\w'’-])? # Group 18 ([\w'’-])? # Group 19 ([\w'’-])? # Group 20 CENTRAL char when 'word' with an ODD number of letters (?(19) ([\w'’-])) # Group 21 (?(18) ([\w'’-])) # Group 22 (?(17) ([\w'’-])) # Group 23 (?(16) ([\w'’-])) # Group 24 (?(15) ([\w'’-])) # Group 25 (?(14) ([\w'’-])) # Group 26 (?(13) ([\w'’-])) # Group 27 (?(12) ([\w'’-])) # Group 28 (?(11) ([\w'’-])) # Group 29 (?(10) ([\w'’-])) # Group 30 (?(9) ([\w'’-])) # Group 31 (?(8) ([\w'’-])) # Group 32 (?(7) ([\w'’-])) # Group 33 (?(6) ([\w'’-])) # Group 34 (?(5) ([\w'’-])) # Group 35 (?(4) ([\w'’-])) # Group 36 (?(3) ([\w'’-])) # Group 37 (?(2) ([\w'’-])) # Group 38 ([\w'’-]) # Group 39 LAST char of a 'word' And the replacement part is the single line : $39$38$37$36$35$34$33$32$31$30$29$28$27$26$25$24$23$22$21$20$19$18$17$16$15$14$13$12$11$10$9$8$7$6$5$4$3$2$1 And, we have the general template : - For words containing 1 WORD char => NOT processed - For words containing 2 WORD chars => The groups 1 and 39 are DEFINED - For words containing 3 WORD chars => The groups 1, 20, and 39 are DEFINED - For words containing 4 WORD chars => The groups 1, 2, 38 and 39 are DEFINED - For words containing 5 WORD chars => The groups 1, 2, 20, 38 and 39 are DEFINED - For words containing 6 WORD chars => The groups 1, 2, 3, 37, 38 and 39 are DEFINED - For words containing 7 WORD chars => The groups 1, 2, 3, 20, 37, 38 and 39 are DEFINED ... ... Again, a very nice and clever solution ! Best Regards, guy038 @guy038 said in Regex: How to turn more words in the line as if they were seen in the mirror?: Omitting the \b assertions seems more logical as we consider the apostrophe as a word char itself. So the ending ’ must becomes a starting ', after replacement ! Thanks @guy038 for your background research. Whilst removing the \bworks, it seemed to me to be illogical to do so, yet the facts seem to prove it. I would not have considered that option. What I have been doing though is to do some additional research on my solution, see if it’s possible to include other features. One which I was successful with, is to also work on single letter words. You may ask why, however often a single letter word (I, A) are at the start of a sentence, or at least capitalised. I figured that the result might be to not only reverse the letters but to make ALL letters lowercase. So the latest version including your removal of \band incorporating single letter words is (this regex works on a maximum of 25 letter words, more on that later). Find What: ([\w'’-])([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?([\w'’-])?(?(12)([\w'’-]))(?(11)([\w'’-]))(?(10)([\w'’-]))(?(9)([\w'’-]))(?(8)([\w'’-]))(?(7)([\w'’-]))(?(6)([\w'’-]))(?(5)([\w'’-]))(?(4)([\w'’-]))(?(3)([\w'’-]))(?(2)([\w'’-]))([\w'’-])|(\w) Replace With: \L${26}${25}${24}${23}${22}${21}${20}${19}${18}${17}${16}${15}${14}${13}${12}${11}${10}${9}${8}${7}${6}${5}${4}${3}${2}${1} The reason for working to a maximum of 25 letters (similar to your 24 letter word max) was to look at the number of steps taken to process and indirectly time to process. I used the OP’s initial example and used the regex101.com website to show stats. My regex took 20892 steps and a time of 6.1ms. Your regex took (for the same example) 5506 steps and a time of 0.9ms. So my regex takes almost 4 times as many steps to process a file as yours, but more importantly it takes over 6 times longer to process that file. I’d mentioned some time ago about making regex efficient and whilst for normal use it doesn’t cause any issues not being totally efficient I wondered if in this case the process time might be significant enough for users who are otherwise unfamiliar with potential lag in processing time. I ran my (revised) regex on the LICENSE.TXT file (for Notepad++) and it completed in about 1 second for just over 5800 words. So the conclusion seems to be that whilst my regex will take 6 times longer than yours to process, the “wait to complete” time will be minimal. Cheers Terry - Hellena Crainicu last edited by Hello, @robin-cruise, @alan-kilborn, @hellena-crainicu, @terry-r and all, @terry-R, yes, I suppose that a limit of 24/25characters, for length of English words, seems sensible, anyway ! In this article : it is said :and counterrevolutionaries, with 22letters each. Note also this curiosity, in your country : BR guy038 - Hellena Crainicu last edited by Hellena Crainicu I thought of a much simpler solution, maybe you can help me a little bit. SEARCH: ([A-Za-z0-9\-\'])+ REPLACE BY: \1 The only inconvenience, is that after S/R, I get only the last letter from each word. I don’t know where the other letters were lost… Maybe some of you will update a little bit my regex, as to find a simple solution. of cours, I can obtain many letters, if I double the regex as: SEARCH: ([A-Za-z0-9\-\'])+([A-Za-z0-9\-\'])+([A-Za-z0-9\-\'])+([A-Za-z0-9\-\'])+ REPLACE BY: \4\3\2\1 @Hellena-Crainicu said in Regex: How to turn more words in the line as if they were seen in the mirror?: I thought of a much simpler solution, maybe you can help me a little bit. Your idea is actually just a rehash of the ones provided by @guy038 and myself. You have a lot to learn yet about regex, but don’t worry, this is a good way to learn. By trying something, realising it didn’t work, you at least have opportunity to dissect it and understand yet more about regex. I use the website rexegg.com as a good source of information. Just be aware that it refers to the many different flavours of regular expressions, not all examples will work in Notepad++. There are also other good sources of regex information available through the FAQ section of the forum. In your regex the [A-Za-z0-9\-\']is almost identical to the \wthat we used. You also ask where the other letters went to, in finding only the last letter was returned by using \1when your find expression had the +at the end. The reason is that at the point the capture group saved any characters the +was outside of the (). So the expression captured a single character, then as the +was processed, it AGAIN captured a character, but in doing so the capture group \1was overwritten with the latest character. Had you put the +inside of the ()you will get all characters returned, but they will be in the original order. At the moment I think @guy038 and my solutions are as good as it gets within a regex world. Whilst we have shown it is possible with a regular expression to “mirror” (reverse) a word it does take quite a bit of coding to do so. Python (and other) language solutions work far more efficiently as they will often have higher level functions to take care of most of the hard work. In regex everything must be completed simply. Terry
https://community.notepad-plus-plus.org/topic/22054/regex-how-to-turn-more-words-in-the-line-as-if-they-were-seen-in-the-mirror/12
CC-MAIN-2021-49
refinedweb
3,496
80.21
Overview Atlassian SourceTree is a free Git and Mercurial client for Windows. Atlassian SourceTree is a free Git and Mercurial client for Mac. Intensional (rule-defined) sets for Python. Overview There are two ways of defining a set: intensional and extensional. Extensional sets like set([1,3,5,'daisy']) enumerate every member of the set explicitly. Intensional sets, in contrast, are defined by rules. For example "the set of all prime numbers" or "every word beginning with 'a' and ending with 't'. Intensional sets are often infinite. It may be possible to generate a list of their members, but it's not as simple as a "give me everything you've got!" for loop. Once you know what you're looking for, intensional sets are everywhere. Python doesn't represent them directly, but regular expressions, many list comprehensions, and all manner of testing and filtering operations are really faces of the intensional set concept. Many functions test whether something 'qualifies'. os.path.isdir(d) for example, tests whether d is in the set of legitimate directories, and isinstance(s, str) tests whether s is a member of the set of str objects. Even the core if conditional can be construed as testing for membership in an intensional set--the set of all items that pass the test. Many such tests have a temporal aspect--they determine whether a value is a member right now. The answer may change in the future, if conditions change. Others tests are invariant over time. %%734 will never be a valid Python identifier, no matter how many times it's tested--unless the rules of the overall Python universe change, that is. Intensional sets are part and parcel of all programming, even if they're not explicitly represented or called by that name.``intensional`` helps Python programs represent intensional sets directly. Usage intensional defines several set IntensionalSet subclasses such as Any, Every, ButNot, and EitherOr. These correspond roughly to set operations union, intersection, difference, and symmetric difference (aka xor). Of these, Any is the most useful: from intensional import * name = 'Stephen' if name in Any('Steve', 'Steven', 'Stephen'): print 'Good name!' So far, there's nothing here you couldn't do with standard Python set data types. So let's broaden out to more generic intensional sets: if name in Test("x.startswith('S')"): print "Your name starts with S!" Test takes a lambda expression or string in its constructor. If it's a string, Test assumes the interesting variable name is x and compiles the string expression with an automatically provided lambda x: prefix. This makes code a bit terser and cleaner. Now the sets start getting more interesting.: starts_with_S = Test("x.startswith('S')") ends_with_n = Test("x.endswith('n')") if name in Every(starts_with_S, ends_with_n): ... # Stephen and Steven pass, but Steve does not Of course, this could also be rendered as: if name in Test("x.startswith('S') and x.endswith('n')"): ... # Stephen and Steven pass, but Steve does not Or even: S_something_n = starts_with_S & ends_with_n if name in S_something_n: ... String Search intensional defines sets for regular expression (Re) and glob (Glob) string matching. For example: name = 'Stephen' if name in Re(r'\b(s\w*)\b', Re.I): print 'Good name, {}'.format(Re._[1]) Note that this enables a form of (or alternative to) en passant assignment that shortens regular expression conditionals by at least one line compared to the standard re module. A spiffed-up version of the re.MatchObject is available at Re._. This object can be indexed to get regexp match groups. For named groups (e.g. (?P<firstname>\w+)), the matched value can be retrieved by attribute: Re._.firstname. All of the other re.MatchObject methods and properties can also be accessed this way, such as Re._.start(1) and Re._.span(1). For simple matching, the Glob class (which plays by the rules of Unix glob expressions) may be simpler: - if name in Glob('S*'): - ... Type Membership if x in Instances(int): ... is identical to: if isinstance(x, int): ... An alias IsInstance exists for Instances for cases where the singular construction is more linguistically natural. A second alias Type is also available. Set Operations intensional supports some, but not all, of Python's classic set operations. There are two primary rules: - IntensionalSet attempts to supports all of the collections.Set methods like union() and intersection(). But IntensionalSet objects are immutable, so they do not support self-mutating operations like add(), pop(), and |= defined by collections.MutableSet. - Because they are defined by rules rather than explicit lists of members, it is not (in general) possible to determine the cardinality (i.e. len()) of an IntensionalSet, nor to iterate through all of its members, nor to test equality. IntensionalSet objects are used primarily for determining membership. Because of an implementation detail, IntensionalSet classes are parallel to, but are not true subclasses of, collections.Set. Extensions It's easy to define new IntensionalSet subclasses that define other kinds of logical tests in generalized, linguistically "clean" ways that make code more readable. As an example, the Instances intensional set is defined like this: class Instances(with_metaclass(MementoMetaclass, IntensionalSet)): """ An object is in an IsInstance if it is an instance of the given types. """ def __init__(self, *args): self.types = tuple(args) def __contains__(self, item): return isinstance(item, self.types) __init__() simply remembers what arguments the set is constructed with, while __contains__() implements the test, answering: Does the given item belong in a set constructed with these arguments? The only complexity here is the with_metaclass(MementoMetaclass, IntensionalSet) phrase, which is simply a compatibility mechanism to be able to define a class in either Python 2 or Python 3 with a given metaclass. MementoMetaclass is used so that once constructed, a set object is fetched from cache rather than redundantly reconstructed if any subsequent mentions are made. This is a useful performance tweak. For regular expressions, for example, it allows the Re.__init__() set constructor to compile the regular expression just once, even if a program contains many mentions of Re(<some regular exprssion>). Even higher-performance is to assign constructed sets to a name/variable and refer to them via that name. This: integers = Instances(int) if x in integers: ... requires less work than: if x in Instances(int): ... and is preferred if the test is to be executed frequently. But this pre-naming is just a tweak, and not a requirement. Notes - Commenced automated multi-version testing with pytest and tox. - Now successfully packaged for, and tested against, all late-model versions of Python: 2.6, 2.7, 3.2, and 3.3 plus one (2.5) that isn't so very recent, and one (PyPy 1.9, based on Python 2.7.2) that is differently implemented. - intensional is just one facet of a larger project to rethink how items are tested for membership and/or chosen from collections. Stay tuned! - The author, Jonathan Eunice or @jeunice on Twitter welcomes your comments and suggestions. Installation To install the latest version: pip install -U intensional To easy_install under a specific Python version (3.3 in this example): python3.3 -m easy_install --upgrade intensional (You may need to prefix these with "sudo " to authorize installation. If they're already installed, the --upgrade flag will be helpful; add it right before the package name.)
https://bitbucket.org/jeunice/intensional
CC-MAIN-2016-07
refinedweb
1,225
58.58
As of Bokeh 0.11.1 there is no way to have the actual superscript. Support for LaTeX labels is a long-standing feature request, but some recent other work may have helped pave the way for finally adding it in the near future. In the mean time, you could create your own custom TickFormatter. This is a fairly advanced technique, and also fairly new. We are still working out documentation for this particular topic (there should be quite alo more guidance available on the next release). But here is a complete example to just print the exponents: from bokeh.plotting import figure, output_file, show from bokeh.models.formatters import TickFormatter x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0] y = [10**xx for xx in x] output_file("log.html") class MyTickFormatter(TickFormatter): __implementation__ = """ _ = require "underscore" Model = require "model" class MyTickFormatter extends Model type: 'MyTickFormatter' doFormat: (ticks) -> return ("#{ Math.log10(tick) }" for tick in ticks) module.exports = Model: MyTickFormatter """ # create a new plot with a log axis type p = figure(plot_width=400, plot_height=400, y_axis_type="log", y_range=(10**-1, 10**4)) p.line(x, y, line_width=2) p.circle(x, y, fill_color="white", size=8) # use the custom TickFormatter p.yaxis[0].formatter = MyTickFormatter() show(p) With the result:
https://codedump.io/share/6SW8PjwrCwf7/1/formatting-log-axis-labels-with-proper-superscripts-in-bokeh
CC-MAIN-2017-17
refinedweb
216
51.75
Dear Community. I am trying to install Google Analytics according to the guide: - First I did step 1 - 5 of this guide: - Then I followed the Quasar framework guide. Question 1 I’m not sure what to fill in the sessionId. Do I have to use the user ID that is logged into my cordova app? Question 2 Nothing is recorded in my Google Analytics… How can I know if I set up everything correctly? The ajax requests seem to be sent correctly. Any ideas?? Best regards, -Luca Ban ** Question 1 ** If you have a user id you could use this with the benefit that you can link that id to real world users. But you can use everything you want to, as long as it is unique per user. ** Question 2 ** Use your Quasar app in web mode and try to check the links with a tool like @a47ae Thanks!! I tried the link you gave me. It seems nothing is working… : D Any ideas? here’s my code: src/index.html <!---5RFM833');</script> <!-- End Google Tag Manager -→ main.js // G.A. Google Analytics import ga from './config/analytics.js' router.afterEach((to, from) => { ga.logPage(to.path, to.name, store.getters['user/id']) }) Is there anything else I need to add? That’s really strange. have a look at the rendered page in the browser and inspect the source if the script part for the Google Tag Manager is still there. - jannerantala last edited by This might be late for you but I hope this helps someone. I have written two tutorials for both SPA website and for Cordova how to set up Google Tag Manager / Google Analytics: @jannerantala said in Trying to install Google Analytics. Very confused!: This might be late for you but I hope this helps someone. I have written two tutorials for both SPA website and for Cordova how to set up Google Tag Manager / Google Analytics: Thanks, I got it working using these instructions. Some remarks: In newer Quasar version ‘plugins’ are now called ‘boot’ files And you need to publish GTM version first otherwise you get a 404 when is called @gvorster Hi! And where you put gtm.js component? It gives me an error that “dataLayer” is not defined. I’ve already post my question about, but nobody wants to speak with me However, I’m already solved this with vue-gtmmodule, but just want to understand. Thanks @nobilik said in Trying to install Google Analytics. Very confused!: @gvorster Hi! And where you put gtm.js component? I put gtm-plugin.js it in src/boot folder but renamed it to src/boot/gtm.js and enabled it in quasar.conf.js boot: [ 'gtm', 'init', 'settings', 'firebase', 'i18n', 'axios', 'vuelidate', ], and put the other gtm.js in src/components/gtm.js But I have only verified if Google Analytics dashboard is picking up the page views which is working. I have not checked out the Google Tag Manager yet, so maybe I will come across your issue with the “dataLayer” too I’m using Quasar 1.4.1 @gvorster said in Trying to install Google Analytics. Very confused!: I have not checked out the Google Tag Manager yet, so maybe I will come across your issue with the “dataLayer” too I’m using Quasar 1.4.1 I just did a quick test adding a logEvent and it works for me gtm.logEvent('test', 'test', 'Viewed home page', 0); And I see it back in the GA dashboard Events page @nobilik said in Trying to install Google Analytics. Very confused!: @gvorster could you please write step-by-step instruction? I can’t understand what I’m doing wrong… Here you go, created with the newest Qusar version 1.5.3 quasar new ga_test save this into; }, } Save this into file ./src/boot/gtm.js import gtm from 'src/components/gtm'; export default ({ router }) => { router.afterEach((to, from) => { gtm.logPage(to.path); }) } Add this to quasar.conf.js boot: [ 'gtm' ], I commented this in quasar.conf.js otherwise a lot of syntax errors are shown /* extendWebpack (cfg) { cfg.module.rules.push({ enforce: 'pre', test: /\.(js|vue)$/, loader: 'eslint-loader', exclude: /node_modules/, options: { formatter: require('eslint').CLIEngine.getFormatter('stylish') } }) } */ Add a test to ./src/pages/Index.vue <template> <q-page <img alt="Quasar logo" src="~assets/quasar-logo-full.svg"> </q-page> </template> <script> import gtm from "../components/gtm"; export default { name: 'PageIndex', created() { gtm.logEvent("myCat", "myAction", "myLabel", 0); } } </script> Add the Google scripts to ./src/index.template.html and change UA-XXXXXXXXX-X and GTM-XXXXXXX with your own keys <!DOCTYPE html> <html> <head> <!-- Global site tag (gtag.js) - Google Analytics --> <script async <meta name="description" content="<%= htmlWebpackPlugin.options.productDescription %>"> <meta name="format-detection" content="telephone=no"> <meta name="msapplication-tap-highlight" content="no"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (htmlWebpackPlugin.options.ctx.mode.cordova || htmlWebpackPlugin.options.ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>"> <link rel="icon" type="image/png" href="statics/app-logo-128x128.png"> <link rel="icon" type="image/png" sizes="16x16" href="statics/icons/favicon-16x16.png"> <link rel="icon" type="image/png" sizes="32x32" href="statics/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="96x96" href="statics/icons/favicon-96x96.png"> <link rel="icon" type="image/ico" href="statics/icons/favicon.ico"> </head> <body> <!-- DO NOT touch the following DIV --> <div id="q-app"></div>![alt text](image url) </body> </html> quasar dev When loading the app this is what I see in Google Analytics Dashboard real-time view. - jrhopkins83 last edited by @gvorster & @dikutandi I’ve followed the steps above and Firebase or Google Analytics are showing nothing . Where is firebase.analytics invoked? I tried adding firebase.analytics() to my firebase.js boot file but get the error: firebase.js?fc1b:29 Uncaught TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_0___default.a.analytics is not a function I’m just trying to get basic app usage information like users by date. Then I can drill into specific application usage but right now I don’t even have the basics working. Any suggestions? This post is deleted! - cynderkromi last edited by I’m also trying to get Google Analytics to work. Followed the tutorials in the links in this thread and when I try to add the file to the plugin section of the quasar.conf file I get an error. :(. Anyone have a fully complete tutorial that works?
https://forum.quasar-framework.org/topic/818/trying-to-install-google-analytics-very-confused/?
CC-MAIN-2022-21
refinedweb
1,082
60.01
Important changes to forums and questions All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com. 5 years, 2 months ago. how to end python rpc properly I am using Python mbed-rpc library as from mbedpcr import * myled = DigitalOut(mbed, 'myled') mbed = SerialRPC('my_com_port', 9600) ... ... After the program is done, I'd like to close the COM port. So I did mbed.ser.close() I got SerialException('Attempting to use a port that is not open') ... What is the proper way to end the RPC session in Python?
https://os.mbed.com/questions/5000/how-to-end-python-rpc-properly/
CC-MAIN-2020-05
refinedweb
101
76.72
Data types are declarations for variables. It specifies the type and size of data that a variable can store. Each data type requires different amounts of memory and has some specific operations which can be performed over it. There are the following data types in C - Basic Data Type - Derived Data Type - Enumeration Data Type - Void Data Type Basic Data Types:- It is also known as Primary Data Type. They are arithmetic types (integer-based and floating-point based). The memory size of the basic data types may change according to 32 or 64-bit operating system. We can use the sizeof() operator to check the size of a variable on a particular platform. C program to find the sizes of each of C’s data types in our system:– #include <stdio.h> #include <stdint.h> #include <stdbool.h> int main( void ) { printf( "Size of C data types:\n\n" ); printf( "Type Bytes\n\n" ); printf( "--------------------------------\n"); printf( "char %lu\n" , sizeof( char ) ); printf( "unsigned char %lu\n" , sizeof( unsigned char ) ); printf( "short %lu\n" , sizeof( short ) ); printf( "int %lu\n" , sizeof( int ) ); printf( "unsigned %lu\n" , sizeof( unsigned ) ); printf( "long %lu\n" , sizeof( long ) ); printf( "unsigned long %lu\n" , sizeof( unsigned long ) ); printf( "long long %lu\n" , sizeof( long long ) ); printf( "int64_t %lu\n" , sizeof( int64_t ) ); printf( "unsigned long long %lu\n" , sizeof( unsigned long long ) ); printf( "float %lu\n" , sizeof( float ) ); printf( "double %lu\n" , sizeof( double ) ); printf( "long double %lu\n" , sizeof( long double ) ); printf( "\n" ); return 0; } int:- Integers are whole numbers that can have both zero, positive and negative values but no decimal values. ** The keyword unsigned uses to store all the value of the number and always positive or Zero. int a = 5; Char:- It is used for declaring character type variables and stores a single character. char i = u; float:- It is used to store decimal numbers with single precision. Double:- It is used to store decimal numbers with double precision. Void Data Type:- It means nothing or no value available. If a function is not returning anything, its return type should be void. ** We cannot create variables of void data type. Derived Data Types:- Data types that are derived from fundamental data types are derived types. Enumerated Data Types:- It can only assign certain discrete integer values throughout the program.
https://www.programbr.com/c-programming/data-types-in-c/
CC-MAIN-2022-27
refinedweb
388
61.46
Hey, Scripting Guy! We recently implemented a scheme whereby Team Leads or Contract Sponsors may request server access for their Team members by submitting an Excel spreadsheet. To this end, I proposed a script that will open Outlook, look for items in the Inbox that contain a particular Subject line (we will pick the wording later) and, for each item in the collection, open the attached spreadsheet, copy the data to another spreadsheet, and then close the attachment. I have successfully completed all the steps except opening the attachment. Can you help me with that? -- FS Hey, FS. You know what’s the great thing about having kids? Oh, shoot; we were hoping you’d know the answer to that one. However, we have to admit that if you do have kids you’ll never have a dull moment. For example, the other night the Scripting Guy who writes this column was sitting around the house when the phone rang: “Hello?” “Hey, Dad. Do you want to take me to the hospital?” “Uh, yeah, I guess.” As it turned out, the Scripting Son and several of his friends were racing mountain bikes, and the Scripting Son took a corner a bit faster than he probably should have. Somehow – and nobody is totally sure how – when he did so his foot came off the pedal and the pedal, perhaps in an act of vengeance, carved a nice big gash in the back of his leg. The boys taped the leg up (by fortuitous coincidence the Scripting Son had just taken a first aid course a couple days ago), but when they checked the wound a half hour later and blood came gushing out they decided that maybe he should go have someone else – like, say a doctor – take a look at it. And so the Scripting Son and the Scripting Dad got to have a nice father-son outing to Evergreen Hospital in Kirkland. (True, a baseball game or even a trip to the zoo might have been better. But, hey a father-son outing is a father-son outing, right?) They then spent an hour and half in the emergency room, while 5 different people looked at the gash: And that doesn’t count the three different people who collected the Scripting Son’s address and phone number and – not incidentally, the Scripting Dad’s insurance information. But all’s well that ends well: the people at the hospital were extremely nice (all of them); the Scripting Son has a good story to tell people; and the Scripting Dad, who was supposed to do some work that evening, had the perfect excuse for not doing anything. Everything turned out perfect. Well, almost perfect; unfortunately, the Scripting Guy who writes this column can’t use the Scripting Son’s accident to get out of working today. (Not that he didn’t try, mind you.) Which means we better see what we can do about answering today’s question. Of course, as it turns out, we can’t answer the question, at least not as asked: we couldn’t figure out a way to programmatically open an attachment, either. But that’s OK; we found a workaround. And even though FS has already completed the other steps in his multi-step process we decided other people might be interested in that as well; therefore this script includes code that not only opens each attachment but also copies all the data from each file and pastes that data into another spreadsheet. Enjoy! Oh, right; guess we should show you the script, shouldn’t we? Here you go: Const olFolderInbox = 6 Const xlCellTypeLastCell = 11 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox) Dim arrFiles() intSize = 0 Set colItems = objFolder.Items Set colFilteredItems = colItems.Restrict("[Subject] = 'Test End If Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.DisplayAlerts = False Set objWorkbook2 = objExcel.Workbooks.Add Set objWorksheet2 = objWorkbook2.Worksheets("Sheet1") For Each strFile in arrFiles Set objWorkbook = objExcel.Workbooks.Open(strFile) Set objWorksheet = objWorkbook.Worksheets("Sheet1") Set objRange = objWorksheet.UsedRange objRange.Copy objWorksheet2.Activate objworksheet2.Range("A1").Activate If objWorksheet2.Cells(1,1).Value <> "" Then Set objRange2 = objWorksheet2.UsedRange objRange2.SpecialCells(xlCellTypeLastCell).Activate intNewRow = objExcel.ActiveCell.Row + 1 strNewCell = "A" & intNewRow objWorksheet2.Range(strNewCell).Activate End If objWorksheet2.Paste objWorkbook.Close objFSO.DeleteFile(strFile) As you can see, this is a relatively long, complicated script. Which can mean only one thing: we should probably leave now, before someone asks us to explain how it works. No, hey, just kidding. (Well, actually we weren’t kidding, but the Scripting Editor is making us explain how the script works anyway.) We start out in pretty straightforward fashion, defining a constant named olFolderInbox (which will tell the script that we want to work with the Inbox folder) and a second constant named xlCellTypeLastCell (which we’ll discuss in a little more detail later on). We next create an instance of the Scripting.FileSystemObject, an instance we’ll immediately set aside and save for future use. Finally, we use these three lines of code to create an instance of the Outlook.Application object, bind to the MAPI namespace, and then make a connection to the Inbox folder: Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox) So are we ready to start retrieving emails? Well, just about. First we need to use these two lines of code to create a dynamic array named arrFiles and to assign the value 0 to a counter variable named intSize, a variable we’ll use to periodically resize our array: Dim arrFiles() intSize = 0 Now we’re ready to start retrieving emails; in fact, that’s what these two lines of code are for: Set colItems = objFolder.Items Set colFilteredItems = colItems.Restrict("[Subject] = 'Test Subject'") In line 1 we’re using the Items property to retrieve a collection of all the emails found in the Inbox. And what are we doing in line 2? Well, as we noted earlier, we don’t want all the emails found in the Inbox, we want only those emails that have a specific Subject line. In line 2, we’re using the Restrict method to create a filtered collection, a collection in which all the items must have a Subject property equal to Test Subject. That brings us to this block of Next End If Next What we’re doing here is looping through our filtered collection. For each email in the collection we use this line of code to create an object reference to all the attachments accompanying that email:Set colAttachments = objMessage.Attachments Once we’ve done that we use the Count property to determine the number of attachments in the Attachments collection, assigning that value to a variable named intCount:intCount = colAttachments.Count We then check to see if intCount is equal to 0. If intCount is equal to 0 that means the message doesn’t have any attachments; in that case we go back to the top of the loop and try again with the next email in the collection. On the other hand, if the Count is equal to anything except 0 then that means the message has at least one attachment. With that in mind, we set up a For Next loop that runs from 1 to the number of attachments accompanying the email:For i = 1 To intCount As it turns out, there’s no way to programmatically open an email attachment. (Or, more correctly, we should say that there’s no way that we know of to programmatically open an email attachment. Such a method might very well exist; we just couldn’t figure out what it was.) Therefore, we’re going to cheat a little: instead of directly opening each attachment we’re going to save those attachments to the hard disk. We’ll then open each saved file, do our little copy-and-paste thing, and then close and delete each saved file. Clever, huh? Well, OK. Clever for us. At any rate, our first step to that end is to create a new file path for our first attachment; we do that by combining the string C:\Test\ with the value of the attachment’s FileName property. As soon as we’ve done that we can then use the SaveAsFile method to save the file to disk:objMessage.Attachments.Item(i).SaveAsFile strFileName We then execute these three lines of code:ReDim Preserve arrFiles(intSize) arrFiles(intSize) = strFileName intSize = intSize + 1 What we’re doing here is using the ReDim Preserve statement to resize our array, taking care to preserve any data currently in that array. (Running ReDim without the Preserve statement would resize the array, but would also erase any data in the array.) We then add the path for our just-saved attachment to the array; in other words, arrFiles will eventually contain the complete path to each and every attachment we saved to the hard disk. And then we increment the value of intSize by 1. Why? Because the next time we resize our array we have to make sure the array can hold one item more than it can currently hold. This is an easy way of doing that. After all the attachments have been retrieved and saved we then get Microsoft Excel up and running, something we use this block of code for:Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.DisplayAlerts = False Set objWorkbook2 = objExcel.Workbooks.Add Set objWorksheet2 = objWorkbook2.Worksheets("Sheet1") As you can see, we kick things off by creating an instance of the Excel.Application object, then setting the Visible property to True; that gives us a running instance of Excel that we can see onscreen. We then set the DisplayAlerts property to False. Why? Well, we’re going to repeatedly copy data from a workbook and then close that workbook; if we don’t set DisplayAlerts to False then every time we close a workbook Excel will say, “There is a large amount of Information on the Clipboard. Do you want to be able to paste this information into another program later?” Truthfully, we don’t really care; we just want to avoid having to deal with this dialog box. By setting DisplayAlerts to False we don’t see this dialog box; instead, Excel simply goes with the default choice (Yes). Once that’s done we use the Add method to add a new workbook to our instance of Excel, then bind to the first worksheet in that workbook. It’s at that point that things really get interesting. Oh, sorry; we’re watching a baseball game on TV. But things get pretty interesting with our script, too. How interesting? Well, to begin with, we set up a For Each loop to loop through all the files paths in the array arrFiles:For Each strFile in arrFiles Inside that loop we use these two lines of code to open the file and then bind to the first worksheet in that file:Set objWorkbook = objExcel.Workbooks.Open(strFile) Set objWorksheet = objWorkbook.Worksheets("Sheet1") After we’ve done that we can use the UsedRange property to select all the data on the worksheet, then use the Copy method to copy all that data to the Clipboard. That’s what these two lines are for:Set objRange = objWorksheet.UsedRange objRange.Copy We then use two more lines of code to activate our original worksheet (the one we’re going to paste the data into) and to make cell A1 on that sheet the active cell:objWorksheet2.Activate objworksheet2.Range("A1").Activate At this point things get a little tricky. If we were working with only one Excel file all we’d have to do is call the Paste method and we’d be done. However, we’re most likely going to be working with multiple Excel files. Suppose we paste in the data from the first file, and this data fills up the first 12 rows in the spreadsheet. When we go to paste in data from the next file, we have to start the paste operation in row 13. But how in the world do we do that? Well, the first thing we do is check to see if cell A1 is empty; if it is, then we can just paste data into the worksheet:If objWorksheet2.Cells(1,1).Value <> "" Then In fact, that’s what will happen when we go to paste in data from our first file: because cell A1 will be empty we can bypass this If Then statement and simply paste in the data. From that point on, however, cell A1 will no longer be empty. Because of that, we need to figure out where we can paste our new set of data. That’s what this block of code is for:Set objRange2 = objWorksheet2.UsedRange objRange2.SpecialCells(xlCellTypeLastCell).Activate intNewRow = objExcel.ActiveCell.Row + 1 strNewCell = "A" & intNewRow objWorksheet2.Range(strNewCell).Activate What we’re doing here is using the UsedRange property to create a Range object that encompasses all the cells in the spreadsheet that contain data. Once that’s done we use the SpecialCells method to go to the very last cell in that range; note the use of the constant xlCellTypeLastCell. And what do we do after we reach the last cell in the range? Why, we use the Activate method to make that cell the active cell in the spreadsheet. Of course, that’s not really what we want; after all, that cell has data in it. What we want to do is drop down to the next row, and make cell A in that row the active cell. One way to do that (and there are other ways) is to determine the current row and then add 1 to it; that’s what this line of code does:intNewRow = objExcel.ActiveCell.Row + 1 We then tack the letter A onto the front of that value (e.g., A13) giving us a cell reference that we can use with the Range property. And that’s exactly what we do here; we create a new range and then make that cell (e.g., cell A13) the active cell:strNewCell = "A" & intNewRow objWorksheet2.Range(strNewCell).Activate Once we’ve done that we can finally call the Paste method and paste in our data. We close the saved attachment file, then use this line of code to delete that file from the folder C:\Test:objFSO.DeleteFile(strFile) And then it’s back to the top of the loop, where we repeat the process with the next file path in arrFiles. That should do it, FS; let us know if you run into problems. Oh, and let us know if you need to go to the emergency room and get your leg stitched up: we’ve got plenty of experience doing that as well. thanks
https://blogs.technet.microsoft.com/heyscriptingguy/2008/06/24/hey-scripting-guy-how-can-i-open-and-close-outlook-attachments/
CC-MAIN-2018-13
refinedweb
2,502
62.48
I've only taken a semester of java, so I only know the basics here. I wrote this without guidance from my teacher, so I have a few questions about whether or not some of the stuff will work. Basically, what this program is supposed to do is take the text output of another program that lists duplicate files in a directory. My program will then take those files and check the file type (in this case, .mp3 and .mp4, because I'm merging music libraries and don't want copies) and, based on user input, either move one of each set of duplicates to a new folder as specified by the user or delete one of the duplicates. Here's an example of the output file I'm working from, and my code: Quote: 2 files size 49,793 checksum 66d368b669fd37e2f8e6f2156c004e82: C:\Users\Sawyer\Music\iTunes\iTunes Music\Third Eye Blind\Out Of The Vein\AlbumArt_{4866D027-C7C0-4B50-9597-512D5597A3F9}_Large.jpg C:\Users\Sawyer\Music\iTunes\iTunes Music\Third Eye Blind\Out Of The Vein\Folder.jpg 2 files size 3,163,090 checksum 28d502ad590d26bc245ac0c06f9414ad: C:\Users\Sawyer\Music\iTunes\iTunes Music\The Killers\Hot Fuss [US]\04 Somebody Told Me 1.mp3 C:\Users\Sawyer\Music\iTunes\iTunes Music\The Killers\Hot Fuss [US]\04 Somebody Told Me.mp3 2 files size 3,594,240 checksum 5790c6231855e94ee0c1236de81dc0cf: C:\Users\Sawyer\Music\iTunes\iTunes Music\The Who\Who's next\08 Behind the Blue Eyes 1.mp3 C:\Users\Sawyer\Music\iTunes\iTunes Music\The Who\Who's next\08 Behind the Blue Eyes.mp3 2 files size 5,103,252 checksum df9daa7ebf34b66329f5d910b9aec54d: C:\Users\Sawyer\Music\iTunes\iTunes Music\The White Stripes\Elephant\09 09 09 09 The Hardest Button To Bu.mp3 C:\Users\Sawyer\Music\iTunes\iTunes Music\The White Stripes\Elephant\09 09 09 The Hardest Button To Butto.mp3 2 files size 5,472,576 checksum 5ff8cec013b757b24d6220184b0ce94f: C:\Users\Sawyer\Music\iTunes\iTunes Music\The Killers\Hot Fuss\01 Mr Brightside 1.mp3 C:\Users\Sawyer\Music\iTunes\iTunes Music\The Killers\Hot Fuss\01 Mr Brightside.mp3 2 files size 8,018,057 checksum ec6a56521f4bf33fd32aebf986cdd025: C:\Users\Sawyer\Music\iTunes\iTunes Music\Weezer\Make Believe\01 Beverly Hills 1.mp3 C:\Users\Sawyer\Music\iTunes\iTunes Music\Weezer\Make Believe\01 Beverly Hills.mp3 Found 4,819 files and 905 folders with 480 possible duplicates. Deleting duplicates would save 29,336,709 bytes of disk space. Code : import java.io.*; import java.util.*; public class duplicateDeleter { private BufferedReader br; private Scanner sc; public String inputFileName; public duplicateDeleter (String infile) { String s, t; inputFileName = infile; sc = new Scanner (inputFileName); System.out.println("Would you like to:"); System.out.println("1. Send one of each set of duplicates to a separate folder to be checked"); System.out.println("2. Delete one of the duplicates automatically"); br = new BufferedReader (new InputStreamReader(System.in)); try {s = br.readLine(); switch (Integer.parseInt(s)){ case 1: {System.out.println("What is the full directory path of the folder you want them moved to (doesn't have to exist)?"); t = br.readLine(); checkFile1(t);} case 2: checkFile2(); default: System.out.println ("Invalid input, please restart and enter either 1 or 2."); } } catch (IOException e){ System.out.println ("I/O Exception in your input, please enter only 1, 2, and a valid directory path"); } } public void checkFile1(String directoryName){ String s; sc.useDelimiter("\\"); /*sets the delimiter to a backslash (refer to output example for the reason why)*/ while ((sc.hasNextLine()) == true){ if (sc.hasNext("*.mp3") == true || sc.hasNext("*.mp4")== true ){ /*if the next token is a .mp3 or .mp4 file*/ s=sc.next(); File file = new File(s); /*Takes the current token and uses it as the file name for a new file */ File dir = new File(directoryName); file.renameTo(new File(dir, file.getName())); /*Moves the file to the new directory*/ } else { sc.next(); } sc.nextLine(); } System.out.println("Duplicate files have been moved to " + directoryName); } public void checkFile2(){ String s; sc.useDelimiter("\\"); while ((sc.hasNextLine()) == true){ if (sc.hasNext("*.mp3") == true || sc.hasNext("*.mp4")== true ){ s=sc.next(); File f = new File(s); // Make sure the file or directory exists and isn't write protected if (!f.exists()) throw new IllegalArgumentException( "Delete: no such file or directory: " + s); if (!f.canWrite()) throw new IllegalArgumentException("Delete: write protected: " + s); // Attempt to delete it boolean success = f.delete(); if (!success) throw new IllegalArgumentException("Delete: deletion failed"); } else { sc.next(); } sc.nextLine(); } System.out.println("Duplicate files have been deleted."); } } Haven't tested the program as I don't want to deal with deleting the wrong files until I have a few questions answered: 1. The line sc.useDelimiter ("\\"); will use a single backslash as the delimiter, right? 2. Did I do the whole sending a string thing right? Namely when I ask for the directory name and then send it to the checkFile1 method. 3. Do you see any other errors, or ways I could improve upon this program? Thanks in advance from a newbie :) -A'den
http://www.javaprogrammingforums.com/%20java-theory-questions/4483-few-questions-printingthethread.html
CC-MAIN-2015-48
refinedweb
848
51.55
Many, perhaps most, of the early commercial applications developed on the J2ME platform were games. With all the obvious interest in gaming - and the many device-specific gaming extensions developed by different handset vendors - it was no surprise to anyone that the Java Community Process group responsible for defining MIDP 2.0 introduced basic gaming capabilities. Let's take a look at the core of those capabilities, the GameCanvas class. GameCanvas The GameCanvas class, found in the javax.microedition.lcdui.game package, extends the venerable Canvas class. As you know, Canvas lets an application draw screens using the low-level user-interface API, and also receive key and pointer events directly. The shortcoming of Canvas is that it. javax.microedition.lcdui.game Canvas The first thing to remember, though, is that a game canvas is still a canvas, so all the usual behavior is there. The showNotify() and hideNotify() methods are still called when the canvas is shown and hidden. Key and pointer events are still delivered, except for certain key events which optionally can be suppressed. You still have to do all the drawing yourself, and you can still attach Command objects to the canvas. Here's a very simple test canvas you can use inside a MIDlet you run with the J2ME Wireless Toolkit 2.0 or higher: showNotify() hideNotify() Command import javax.microedition.lcdui.*; import javax.microedition.lcdui.game.GameCanvas; public class DummyGameCanvas extends GameCanvas { public DummyGameCanvas( boolean suppress ){ super( suppress ); } private String getAction( int key ){ int action = getGameAction( key ); switch( action ){ case DOWN: return "DOWN"; case UP: return "UP"; case LEFT: return "LEFT"; case RIGHT: return "RIGHT"; case FIRE: return "FIRE"; case GAME_A: return "GAME_A"; case GAME_B: return "GAME_B"; case GAME_C: return "GAME_C"; case GAME_D: return "GAME_D"; } return ""; } protected void hideNotify(){ System.out.println( "hideNotify" ); } protected void keyPressed( int key ){ System.out.println( "keyPressed " + key + " " + getAction( key ) ); } protected void showNotify(){ System.out.println( "showNotify" ); } } Two differences appear when you compare this class to a standard canvas. First, the constructor takes a boolean to indicate whether certain key events are to be suppressed or not. Second, no paint() method is needed; GameCanvas supplies its own implementation. But the most significant difference - the game loop - doesn't show up in DummyGameCanvas. boolean paint() DummyGameCanvas In general, MIDP user-interface components are event-driven - the system invokes methods directly, in response to device events. These events are queued and delivered to the application one at a time, and there may be a delay between the time the event occurs and the time the application receives it, which particularly affects painting events. The GameCanvas is different: It lets the application poll for key events quickly and repaint the canvas in a timely fashion. This polling and repainting is normally done in a loop on a separate thread, hence the term game loop. To poll for key events, use getKeyStates(). It returns a bit mask representing the change in state of the action keys - defined by the Canvas class - since the last call to getKeyStates(). Each key's bit value in the mask will be 1 if it's currently down, or has been pressed since the last call, otherwise it will be 0. For example: getKeyStates() int state = getKeyStates(); if( ( state & FIRE_PRESSED ) != 0 ){ // user has pressed the FIRE key } This lets the application check the key state in a tight loop and respond quickly to any changes. Note that key events are still received by the game canvas as usual, except that you can suppress events involving the action keys - and customarily you do. By contrast, you never suppress key events for triggering commands. To paint itself smoothly, a game canvas uses a technique called double buffering: You perform drawing operations in an off-screen buffer, then quickly copy from the buffer to the visible area of the canvas. The canvas automatically creates and manages the off-screen buffer. The application draws into the buffer using a Graphics instance obtained from getGraphics(). (Note that each call returns a new instance, so you should call the method once outside the game loop and save the reference.) To update the display after drawing, a call to flushGraphics() will force an immediate repaint that's based on the current contents of the off-screen buffer. Graphics getGraphics() flushGraphics() The second example is a game canvas that scrolls a randomly generated star field: import java.util.Random; import javax.microedition.lcdui.*; import javax.microedition.lcdui.game.GameCanvas; // A simple example of a game canvas that displays // a scrolling star field. The UP and DOWN keys // speed up or slow down the rate of scrolling. public class StarField extends GameCanvas implements Runnable { private static final int SLEEP_INCREMENT = 10; private static final int SLEEP_INITIAL = 150; private static final int SLEEP_MAX = 300; private Graphics graphics; private Random random; private int sleepTime = SLEEP_INITIAL; private volatile Thread thread; public StarField(){ super( true ); graphics = getGraphics(); graphics.setColor( 0, 0, 0 ); graphics.fillRect( 0, 0, getWidth(), getHeight() ); } // When the game canvas is hidden, stop the thread. protected void hideNotify(){ thread = null; } // The game loop. public void run(){ int w = getWidth(); int h = getHeight() - 1; while( thread == Thread.currentThread() ){ // Increment or decrement the scrolling interval // based on key presses int state = getKeyStates(); if( ( state & DOWN_PRESSED ) != 0 ){ sleepTime += SLEEP_INCREMENT; if( sleepTime > SLEEP_MAX ) sleepTime = SLEEP_MAX; } else if( ( state & UP_PRESSED ) != 0 ){ sleepTime -= SLEEP_INCREMENT; if( sleepTime < 0 ) sleepTime = 0; } // Repaint the screen by first scrolling the // existing starfield down one and painting in // new stars... graphics.copyArea( 0, 0, w, h, 0, 1, Graphics.TOP | Graphics.LEFT ); graphics.setColor( 0, 0, 0 ); graphics.drawLine( 0, 0, w, 1 ); graphics.setColor( 255, 255, 255 ); for( int i = 0; i < w; ++i ){ int test = Math.abs( random.nextInt() ) % 100; if( test < 4 ){ graphics.drawLine( i, 0, i, 0 ); } } flushGraphics(); // Now wait... try { Thread.currentThread().sleep( sleepTime ); } catch( InterruptedException e ){ } } } // When the canvas is shown, start a thread to // run the game loop. protected void showNotify(){ random = new Random(); thread = new Thread( this ); thread.start(); } } The user presses the UP and DOWN action keys to increase and decrease the rate of scrolling. Not very exciting, but this canvas could easily form the heart of a simple "shoot-em-up" game. The game canvas gives you the flexibility you need to create simple but responsive games - have fun using it.
http://developers.sun.com/mobility/midp/ttips/gamecanvas/index.html
crawl-001
refinedweb
1,050
54.73
Opened 3 years ago Last modified 8 months ago I'd really like Trac to be able to handle Markdown formatted text. There is a python implementation of Markdown available here. Thanks! I would love to see this. It would make such a difference to working with non-technical wiki authors. I'd really dig this, too Very very easy solution is here. ## mkdown.py -- easy markdown formatter without trac links. rom markdown import markdown # as for wiki-macro def execute(hdf, txt, env): return markdown(txt.encode('utf-8')) This macro does not handle trac links at all but it might be possible using extension mechanism of current Markdown (1.6). but it might be possible using extension mechanism of current Markdown (1.6). but it might be possible using extension mechanism of current Markdown (1.6). A complete solution would be so fantastic, I'm weeping with anticipation. I wrote this today. It's a little buggy, but seems usable. Things like [Bob's patch]([40]) or [camel case]: CamelCase work. <CamelCase> works but shows the whole url. """Trac plugin for Markdown Syntax (with links) Everything markdown-ed as a link target is run through Trac's wiki formatter to get a substitute url. Tested with Trac 0.8.1 and python-markdown 1.4 on Debian GNU/Linux. Brian Jaress 2007-01-04 """ from re import sub, compile, search, I from markdown import markdown from trac.WikiFormatter import wiki_to_oneliner #links, autolinks, and reference-style links LINK = compile( r'(\]\()([^) ]+)([^)]*\))|(<)([^>]+)(>)|(\n\[[^]]+\]: *)([^ \n]+)(.*\n)' ) HREF = compile(r'href=[\'"]?([^\'" ]*)') def execute(hdf, txt, env): abs = env.abs_href.base abs = abs[:len(abs) - len(env.href.base)] def convert(m): pre, target, suf = filter(None, m.groups()) url = search( HREF, wiki_to_oneliner(target, hdf, env, env.get_db_cnx()), I).groups()[0] #Trac creates relative links, which markdown won't touch inside # <autolinks> because they look like HTML if pre == '<' and url != target: pre += abs return pre + str(url) + suf return markdown(sub(LINK, convert, txt)) + for markdown support However the only way Markdown is really going to be adopted this way is if we can use it as the default text markup. As soon as we need # etc and to close then Markdown will not get used. So we need it to be in trac.ini to support default without //!/# / tricks. There is implementation of markdown in pure js: And another js improvement of it (with syntax highlighting): For the trac version I have this needs a tiny edit: from trac.wiki.formatter import wiki_to_oneliner I'd like to see we can write in trac using Markdown syntax too... And also, here an Markdown Extra which extended original Markdown Markdown plugin for Trac 0.11 (ebta) i've adapted version by brian for Trac version 0.11. you can use it as wiki processor: {{{ #!Markdown markdown text goes here ======================= ... }}} (notice the capital letter M) if you get this error: Trac detected an internal error: AttributeError: 'unicode' object has no attribute 'parent' you have to get the latest python-markdown version with unicode support from and install it on your (most probably debian) system with python setup.py install after a server restart you should be able to use markdown 97 test mycomment test comment By Edgewall Software. Hosting sponsored by
http://trac-hacks.org/ticket/353
crawl-002
refinedweb
546
67.55
Answered by: I screwed up my Application.Current.Properties now I am dead in the water Question - User253269 posted I was playing around with adding stuff as a property and I added in a custom object that the serializer is choking on: "The deserializer has no knowledge of any type that maps to this contract...." Problem is that now I can't even touch the Application.Current.Properties without an exception, I try to Clear() , Remove(), and everything else I can think of and it always throws an exception and now my app is dead. How can I get my Application.Current.Properties back?Wednesday, January 4, 2017 9:14 PM Answers - User253269 posted Well, not sure if this is the recommended way, but I deleted some temp files (it is a Windows Universal project) from C:\Users\ \AppData\Local\Packages\ \LocalState and that got it working again.Wednesday, January 4, 2017 11:05 PM All replies - User28549 posted is it in production like this?Wednesday, January 4, 2017 9:48 PM - User253269 posted No, I can't release it not working :(Wednesday, January 4, 2017 10:01 PM - User253269 posted Well, not sure if this is the recommended way, but I deleted some temp files (it is a Windows Universal project) from C:\Users\ \AppData\Local\Packages\ \LocalState and that got it working again.Wednesday, January 4, 2017 11:05 PM - User28549 posted just fix your code and delete the app from your test device then. Deleting the app will also delete the local storage.Wednesday, January 4, 2017 11:09 PM - User89714 posted @BobHoward - The problem of any attempt to access the properties resulting in an exception was reported 18 months ago. See . If you have any information about how to get the problem to reoccur, can you add the info to that bug report please.Wednesday, January 4, 2017 11:37 PM - User253269 posted Sure, I will leave it here as well. I have a class called NameValue: public class NameValue { public NameValue() { this.name = ""; this.value = ""; } public NameValue(string sName, string sValue) { this.name = sName; this.value = sValue; } public string name { get; set; } public string value { get; set; } } When attempting to see what I can do with the properties, I was debugging and at a breakpoint, I added a List into the properties via the immediate window: Application.Current.Properties["BaseUrl"] = new List<NameValue>() It seemingly added it, but after that crashes.Thursday, January 5, 2017 2:31 PM - User253269 posted I have narrowed it down to the C:\Users\ \AppData\Local\Packages\ \RoamingStatePropertyStore.forms file. That is an XML file and if you edit it and delete the bogus key it will work again.Thursday, January 5, 2017 5:04 PM
https://social.msdn.microsoft.com/Forums/en-US/c92bdee6-d1f4-4dd8-8e00-430144b0d092/i-screwed-up-my-applicationcurrentproperties-now-i-am-dead-in-the-water?forum=xamarinforms
CC-MAIN-2021-43
refinedweb
456
60.04
Actions Panel Scott Dunn|Nashville|In-Person|Certified ScrumMaster|CSM |November 5-6,2022 Weekend In-Person Training! 2 days with EVERYTHING you need to get your Scrum team up and sprinting! When and where Date and time Location Hilton Garden Inn Mt. Juliet 1975 Providence Parkway Mt. Juliet, TN 37122 Map and directions How to get there Refund Policy About this event In-Person Certified ScrumMaster Training presented by Scott Dunn for Rocket Nine Solutions Certified ScrumMaster Workshop Your registration includes: - 2-Day In-Person Training Class - Virtual Training Materials - Certified ScrumMaster class by Certified Scrum Trainer (CST) - Ask The Instructor: post-class tutoring for exam - Access to RocketNine's Scrum Master Guide Videos: the beastly resource of videos, tips, ideas and research - 2 year membership to Scrum Alliance - 15 PMI PDUs and 16 Scrum Alliance SEUs - Lifetime membership in the Global Scrum Community - Plus, certification exam and membership fees are included! LAND THAT DREAM JOB Earning a CSM credential from Scrum Alliance will make you a more valuable employee to current or future employers while empowering you to make a difference or impact positive change in their workplace. Become certified as a Scrum Master and join one of the HIGHEST PAYING certifications of 2022. The CSM Certification opens new career opportunities for you in multiple industries. Scrum Alliance education and certifications give you endless ways to distinguish yourself as a Scrum and Agile practitioner. ABOUT THE CLASS The course is taught interactively. No death by PowerPoint. Students will learn hands-on via teams, discussions, numerous exercises and fun. Results: 99% of my students pass the exam, and class feedback has been more than 9.5. Experience. Are you a full time employee who is or will be a ScrumMaster? Check the LinkedIn experience of the other trainers and see what you find. I have 3 years experience as a full time ScrumMaster, and another 3 coaching at the best agile coaching organizations in the nation, Rally and BigVisible. Uniquely qualified in Nashville. Get what you pay for - the instructor. I'm local. If you need help, or have a question, I'll respond. Heck, I might even see you at the local user groups. :-). We made the video below to help people learn more about Rocket Nine Solution's style of leading Certified ScrumMaster and Certified Scrum Product Owner training. Watch the video below to learn about Scott Dunn's background and why he is so passionate about agile.." As a bonus, we wrap up some of our classes with a real life multi-sprint Scrum project, applying what you've been learning through building and programming robotics using the the Lego Mindstorm EV3. You can get an idea about how cool this is in the video link above. shares industry-tested practices for evolving Product Backlogs, planning your Releases and Sprints, tracking and reporting progress, and developing continuous improvement cycles. Participants will learn how to effectively plan and run daily Scrum Meetings, Sprint Planning Meetings, Sprint Reviews, Retrospectives, and more. "Great course to take me from very basic Scrum knowledge to confidence that I can implement on my own." Rocket Nine's Results: 99% of our students pass the exam on their first try, and class feedback has been more than 9.5. Details Lunch, snacks, coffee and drinks are provided both days. Upon completion of the course and a post-course online evaluation, participants are registered as Certified ScrumMasters (CSM's). Registration includes a two-year membership in the Scrum Alliance, () where valuable ScrumMaster material and information are available. This course is 15 Category 3 PDU's and 16 Scrum Education Units towards the Certified Scrum Professional credential. Class starts promptly at 9 AM and typically ends around 5 PM. Please arrive at 8:30 AM so we can start promptly at 9 AM. Dress comfortably. There will be a lot of interactivity both sitting & standing. Lunch, snacks, coffee and drinks are provided both days. Teams - Project Managers - Project Sponsors - Career Changers and Job Seekers - ANYONE INTERESTED IN LEARNING HOW SCRUM CAN IMPROVE YOUR WORLD OF WORK ANYONE CAN ATTEND - NO PRE-REQUISITES WHY ROCKET NINE Rocket Nine Solutions is an Agile Scrum Methodology and consulting company led by Scott Dunn, one of only 30 dual Certified Scrum Trainer and Certified Enterprise Coach worldwide. Previously a developer (MCSD), project manager (PMP) and Scrum Master for over 10 years, Scott has lead agile adoptions at many companies. Scott is also a SAFe Program Consultant and certified in Large Scale Scrum (LeSS) and Agile Leadership (CAL) as well. Previously an agile coach with Forrester-leading agile companies Rally (acquired by CA) and BigVisible (acquired by SolutionsIQ), Scott is a pragmatic and relational agile coach and trainer with over 20 years experience consulting or working internally within IT departments as a developer (MCSD), manager and project manager (PMP) at companies from Inc 500 to Fortune 500. Clients include Dell/EMC, Canon, Assurant, First American, Blizzard, Yahoo!, Kaiser Permanente, eBay, Technicolor, Rovi/TiVo, and many others. Product Owner Training Scrum Developer Training Certified Agile Leadership Training Kanban Training Large Scale Scrum Training in SoCal Agile Coaching and Private Training Cancellation Policy - Reschedule to another Rocket Nine Solutions public classes anytime, or cancel anytime up to 7 days before class for 100% refund. Fewer than 7 days notice will result in a 75% refund to cover hard costs. No-shows or move/cancellation requests on day of class are non-refundable. For minimum learning experience, the course must run with a minimum five registrants. If fewer than five are registered, the class may be cancelled three to seven days in advance, and attendees will be offered seats in the next Rocket Nine Solutions classes or a full refund. Please refer to our FAQs page if you have questions. If you need assistance, please contact us at ashley@rocketninesolutions.com or call Ashley Scanlan at 312-823-4789.
https://www.eventbrite.com/e/scott-dunnnashvillein-personcertified-scrummastercsm-november-5-62022-tickets-400027883167?aff=R9CSMPage
CC-MAIN-2022-40
refinedweb
986
52.29
#include <stdlib.h> /* In SunOS 4 */ /* In glibc or FreeBSD libcompat */ /* In SCO OpenServer */ /* In Solaris watchmalloc.so.1 */ This function should never be used. Use free(3) instead. Starting with version 2.26, it has been removed from glibc. In glibc, the function cfree() is a synonym for free(3), "added for compatibility with SunOS". Other systems have other functions with this name. The declaration is sometimes in < stdlib.h > and sometimes in < malloc.h >. For an explanation of the terms used in this section, see attributes(7). The 3-argument version of cfree() as used by SCO conforms to the iBCSe2 standard: Intel386 Binary Compatibility Specification, Edition 2.
https://manpages.courier-mta.org/htmlman3/cfree.3.html
CC-MAIN-2021-21
refinedweb
110
62.24
In yesterdays post I stated that the compiler checks the databindings on an asp.net webform. Fabrice stated that this is not the case. As usual the truth is a little more complicated. In this post I will take a closer look at the way data-bindings on asp.net webform work. Let's take a very simple web-form. It has a label, a textbox and a button. The label has one databinding, its text is bound to the custom binding expression TextBox1.Text. The button forces a postback, the page_load performs the databind. The result is that the content of the textbox is copied into the caption of the label on every postback. In the aspx of the page you can find this databinding At first sight this is a little snippet of server side script which provides the text of the label. To get an idea how the asp.net server resolves this I will turn it into something unresolvable, like MyStuff(TextBox1.Text). The project will compile fine and the new binding is in the aspx. Running the page now pops up an enormous amount of error info So the databinding expression leads to a compilation error, where the compiler points to the line in the aspx file describing the label. On the bottom of the page is a link "Show complete compilation source", clicking this reveals a C# source. You will find the file in the directory "temporary internet files". The simple webform has resulted in a source of over 300 lines. Line 1: //------------------------------------------------------------------------------Line 2: // <autogenerated>Line 3: // This code was generated by a tool.Line 4: // Runtime Version: 1.1.4322.573Line 5: //Line 6: // Changes to this file may cause incorrect behavior and will be lost if Line 7: // the code is regenerated.Line 8: // </autogenerated>Line 9: //------------------------------------------------------------------------------Line 10: Line 11: namespace ASP { This code was generated by the asp.net runtime from the webform1.aspx file and the associated webform1.cs file. It wraps up one class: Line 28: [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]Line 29: public class WebForm1_aspx : MyXSLTapp.WebForm1, System.Web.SessionState.IRequiresSessionState {Line 30: Line 31: Line 32: #line 12 ""Line 33: protected System.Web.UI.HtmlControls.HtmlForm Form1; This class inherits from the WebForm1 class and adds the functionality necessary for IIS to produce the page. Here I'll focus on the part which deals with our data-binding problem. Line 128: public void __DataBindLabel1(object sender, System.EventArgs e) {Line 129: System.Web.UI.Control Container;Line 130: System.Web.UI.WebControls.Label target;Line 131: Line 132: #line 14 ""Line 133: target = ((System.Web.UI.WebControls.Label)(sender));Line 134: Line 135: #line defaultLine 136: #line hiddenLine 137: Line 138: #line 14 ""Line 139: Container = ((System.Web.UI.Control)(target.BindingContainer));Line 140: Line 141: #line defaultLine 142: #line hiddenLine 143: Line 144: #line 14 ""Line 145: target.Text = System.Convert.ToString(MyStuff(TextBox1.Text));Line 146: Line 147: #line defaultLine 148: #line hiddenLine 149: } In line 145 the binding expression pops up as a part of the source. This implies that we can fix the error by including a MyStuff method. As this method is used in a class which descends from the MyWebForm1 class it can be a protected method of this base class: public class WebForm1 : System.Web.UI.Page{ protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.Label Label1; protected System.Web.UI.WebControls.Button Button1; protected string MyStuff(string anything) { return string.Format("You sent me this {0} at {1}", anything, DateTime.Now.ToLongTimeString()); } And after adding this method the page will run just fine and the result of the method will show up in the label. To summarize : The first time a page is requested asp.net generates and compiles the source file we just met. This is the main reason why the first request of a page takes so long. For all next requests the compiled page is used. Which makes them fast. The databindings on the page are all compiled. But they are compiled in IIS and not when you compile your pages in vs.net. Which is a pity because the errors are somewhat harder to find. But all databindings are compiled on the first request, you will not bump into a scripting error which does not show up until the binding is really used. A nice thing is that you can do virtually anything in a custom databinding expression as every binding expression is pure C#. So watch your casing !
http://codebetter.com/blogs/peter.van.ooijen/archive/2003/10/14/2562.aspx
crawl-002
refinedweb
759
67.45
A few months have passed since I last wrote anything about poobrains' development and I think it's about time I told you what I was up to since then. It's been a lot, so this is probably going to be a semi-long post, even without going into too much depth. The SVG system has seen the addition of maps and continued work on making plots better. An automatically calculated grid and the application of a hue-rotated color palette to datasets should reduce some of the visual clutter. Error bars are now rendered as well. Datasets and -points are linkable by fragment identifiers and show their respective info when addressed. Dataset descriptions use the <foreignObject> tag to show a nicely formatted and scrollable HTML description generated from markdown. The same technique is used for the points on a map. The only problem with <foreignObject> is that chrome simply doesn't support it, so I had to create a shitty text-only fallback as well. At least markdown is pretty human-readable, I guess… For easy extractability, a json-encoded version of the whole dataset is included in the generated SVG as well. The CLI can now be used to render plots and maps into files, too. It also has some important new commands. import and export consume and create ASCII-separated text files, which are just like CSV – only good. The form system got some TLC too, with paginated forms for foreign key relations, a bunch of fixes and better support for fieldsets through the addition of ProxyFieldset which allows wrapping any form inside a fieldset. Oh, and checkboxes now use SVG instead of the ugly native controls, sadly without working animation because both firefox and chrome fail at properly handling SVG backgrounds with fragment identifiers… Another big thing is that poobrains is now self-documenting. A poobrains site can now render its own documentation. This system comes with a custom-written HTML5 pydoc writer because there wasn't a good one. I also wrote a "quick"start which managed to break the 2000 word barrier. You can access it through the documentation system: documentation/quickstart. On a typographic note, I changed the default text font to ClearSans because OpenSans seems to have legibility issues on a lot of platforms and changed the default decorative font from Ostrich Sans to Orbitron (both by the dank League of Movable Type) because it's way more cybre. Last but not least, I spent the last few days making poobrains compatible to peewee 3, the new major version of the ORM poobrains utilizes. I should be mostly through with it now, but a bunch of issues might still be popping up. I don't want to stick my neck out too far here, but I think I have all systems I want in poobrains in place. There's still one or two things I'm not sure I want to include, but from now on poobrains development is probably going to be mostly bugfixing and styling/templating work as well as some UX things that are still missing (like letting users properly administer their client certs).
http://phryk.net/article/poobrains-devlog-6/
CC-MAIN-2019-22
refinedweb
526
58.52
24 November 2010 14:32 [Source: ICIS news] BERLIN (ICIS)--Demand for aromatics in ?xml:namespace> Speaking at the 9th European Aromatics and Derivatives Conference, she said that demand for derivatives including polystyrene (PS), acrylonitrile-butadiene-styrene (ABS), phenol and purified terephthalic acid (PTA) will continue to grow in the next five years. The Chinese government encourages the building of large-scale aromatics complexes with advanced technology and the increased use of domestic technology and equipment, she said. This will lead to supply and demand for the main aromatics to be nearly balanced by 2015. The consumption of benzene in However, with new refineries and aromatics projects coming on stream in 2009-2010, capacity is exceeding demand, leaving operating rates at low levels of 58% this year. In addition, restrictions on the benzene content of gasoline will increase benzene supplies to the market, she said. Paraxylene (PX) capacity in In 2010, PX demand is expected to be 9.72m tonnes and output around 6.3m tonnes. It is estimated that imports will be around 3.6m tonnes. PX demand in Net imports of PTA will be 5.5m tonnes in 2010. By 2015, PTA demand is expected to reach 24.2m tonnes, while capacity will reach 21.5m tonnes/year, she added. The 9th European Aromatics and Derivatives Conference takes place in For more on PS, ABS, phenol. PTA, benzene
http://www.icis.com/Articles/2010/11/24/9413601/china-demand-for-aromatics-will-continue-to-grow-engineer.html
CC-MAIN-2015-11
refinedweb
230
56.86
#include <rtt/DataPort.hpp> Inherits RTT::DataPortBase<T>. Use connection() to access the data object. If the port is not connected, connection() returns null. Definition at line 219 of file DataPort.hpp. Construct an unconnected Port to a writable DataObject. Definition at line 234 of file DataPort.hpp. Connect to another Port and create a new connection if necessary. Create a new connection object using a buffered connection implementation. Reimplemented in RTT::Corba::CorbaPort. Get the data object to write to. The Task may use this to write to a Data Object connected to this port. Definition at line 115 of file DataPort.hpp. Get the data object to read from. The Task may use this to read from a Data object connection connected to this port. Definition at line 108 of file DataPort.hpp. Write data to the connection of this port. If the port is not connected, this methods sets the initial value of the connection to data. Definition at line 243 of file DataPort.hpp. Change the name of this unconnected Port. One can only change the name when it is not yet connected.
http://people.mech.kuleuven.be/~orocos/pub/stable/documentation/rtt/v1.8.x/api/html/classRTT_1_1WriteDataPort.html
crawl-003
refinedweb
187
62.54
How do I pattern match arrays in Scala? My method definition looks as follows def processLine(tokens: Array[String]) = tokens match { // ... Suppose I wish to know whether the second string is blank case "" == tokens(1) => println("empty") Does not compile. How do I go about doing this? Answers If you want to pattern match on the array to determine whether the second element is the empty string, you can do the following: def processLine(tokens: Array[String]) = tokens match { case Array(_, "", _*) => "second is empty" case _ => "default" } The _* binds to any number of elements including none. This is similar to the following match on Lists, which is probably better known: def processLine(tokens: List[String]) = tokens match { case _ :: "" :: _ => "second is empty" case _ => "default" } Pattern matching may not be the right choice for your example. You can simply do: if( tokens(1) == "" ) { println("empty") } Pattern matching is more approriate for cases like: for( t <- tokens ) t match { case "" => println( "Empty" ) case s => println( "Value: " + s ) } which print something for each token. Edit: if you want to check if there exist any token which is an empty string, you can also try: if( tokens.exists( _ == "" ) ) { println("Found empty token") } What is extra cool is that you can use an alias for the stuff matched by _* with something like val lines: List[String] = List("Alice Bob Carol", "Bob Carol", "Carol Diane Alice") lines foreach { line => line split "\\s+" match { case Array(userName, friends@_*) => { /* Process user and his friends */ } } } case statement doesn't work like that. That should be: case _ if "" == tokens(1) => println("empty") Need Your Help How to properly overload the << operator for an ostream? c++ namespaces operator-overloading iostream ostreamI am writing a small matrix library in C++ for matrix operations. However my compiler complains, where before it did not. This code was left on a shelf for 6 months and in between I upgraded my com... Toggle the glyphicon with bootstrap collapse javascript jquery html twitter-bootstrap glyphiconsI have glyphicon-chevron-down when div is in collapsed state,i want to replace it with glyphicon-chevron-up when the div is in collapse in state.I have many of these collapsible divs in my project....
http://www.brokencontrollers.com/faq/21445290.shtml
CC-MAIN-2019-26
refinedweb
375
56.49
Part 1: An Introduction to Software Design Patterns and Threading For the past couple of months I have been required to undertake a games design project at University. One of the things that came out of this project is Phobos - an extensible engine built with JavaFX. Now, with the blessing of my course leader, I'm pleased to offer a series of tutorials which will culminate in you building your very own game engine. (that I'll actually complete for once). Throughout this journey of code and compilation I'll introduce you to topics that were new to me at one point. Today we'll be exploring Software Design Patterns and Threading. But first, a definition of terms. Software Design Patterns - The Singleton A Software Design Pattern (we're going to call this DP for brevity) is a way of doing something with code. A Pattern by design. Singletons are a DP. They're a way of ensuring only one of something can exist. Put simply, a Singleton contains a circular reference to itself. I'll talk more about this later on. Finite State Machine A Finite State Machine is a way of managing the states of a program. Again, we're going to come back to this in a bit. The two concepts above - Singletons and Finite State Machines - form the basis of Phobos. The very core of the engine, conveniently named Engine is a Singleton and a Finite State Machine. All of the key engine related processing - managing the state of the engine, it's screens, threads, data (or, in laymans terms, everything) - happens here. It's designed in a way that means it can be called from anywhere without instantiation and can manage everything from one place. Many engines are designed this way, though not necessarily as singletons. This design pattern is somewhat similar to MVC, another idea that we'll explore later in the series. Without further ado, however, let's explore... Finite States and Thread Safety Consider this: A program can have a number of states. It can be running. It can be asleep. It can be deadlocked or involved in a race condition. It can be many things, but only ever one at a time. We call this its state. Let's extrapolate that to a game. It can be paused. It can be on a menu. It could be on a pause menu (!). These are also states. Within the scope of the program we require a way to define and track these states. To do this we must build a Finite State Manager. First, though, we must explore the topic of threading. I looked for a decent threading tutorial but came up pretty dry. I'd recommend doing some reading on the topic but for the purposes of this I have an analogy relating to data access among threads. My absolutely fantastic thread analogy. Consider a person. That person is a thread. The person is assigned a task and assigned a box. That box is memory space. Now consider that there are 3 of these peoplethreads. Each person has their own box which only they can access. Now consider a bigger box that all 3 people can access. We'll call this global memory. Global Memory is volatile, meaning it will be affected by everything you can possibly imagine. What happens if 2 of the people try to change a part of the box at once? One of a few things could happen. They could both try to get to it at once - this is a race condition - or they could be super polite and keep offering it back and forth - a deadlock. Alternatively, you could have a sign telling them to form an orderly queue. This is the wonderful concept of thread synchronisation. When you have two portions of a program attempting to access shared memory space, you have to be incredibly careful to ensure that only one thread can access it at once. In Java, we do this using the synchronized statement. There's two ways of achieving thread synchronization using this method: public synchronized void doSomethingCool() { //I'm a synchronized method } //or public void doSomethingElseThatsCool() { //...some code... synchronized(this) { //I'm a thread-safe code block!! } } Choosing which one to use is important, but a relatively easy decision: If the entire method is accessing volatile memory, mark the method as synchronized. If only a small portion of the method is, mark that block as synchronized. In reality, creating thread-safe code is far more complicated than this and is outside of the scope of this tutorial - if it interests you I urge you to delve into some reading because it's a truly awesome topic. Alas, within the scope of this tutorial, the synchronized statement is as far as you need to go. You might be asking why this matters at all. Singletons. That's why. If only one of them can exist then it can only exist in the global memory space we discussed above. Because of this, the data that the Singleton might contain will be volatile. Our Finite State Manager will be a singleton, meaning to say that only one of it can exist - the FSM (we'll call it this from now on, so pay attention) will need to modify its internal state and that of the states it manages. Conversely, the states will exist within the global memory and need to modify the internal state of the FSM - indirectly, mind - when performing tasks such as telling the FSM to change state. A menu transition, perhaps? So, how does one write a Singleton? Well, that's fairly easy. Let's outline a basic singleton and have a look at how it works. public class Singleton { private static volatile Singleton _instance = null; private Singleton() { } public static Singleton getInstance() { if (_instance == null) { synchronized (Singleton.class) { if (_instance == null) { _instance = new Singleton(); } } } return _instance; } } So, we've got a class called Singleton. Singleton has a single field, a static Singleton. Singleton also has a private constructor - this means that you can't create an instance of this class (that would create some wicked cool nesting issues). Instead, to use the singleton we call Singleton.getInstance(). This returns the only singleton in existence. The getter first checks that the Singleton isn't null and, if it is, it creates it through a process known as "lazy initialisation" with "double-checked locking". After that, we have a single instance of a global object of whom we can access anything! What kind of a tutorial would this be if we didn't create a proper example? So let's add a field (and some getters / setters) to our Singleton. private int aScore = 0; public int getScore() { return aScore; } public void setScore(int val) { aScore = val; } We've got an int representing a score in our game - simple enough - with a getter (getScore) and a setter (setScore(int)). Let's put together a little console app to test this out. public class SingletonExample { public static void main(String[] args) { Singleton.getInstance().setScore(10); } } That really is bare bones, but to demonstrate a point. Something that is somewhat of a best-practice is to ensure that a singleton is initialised in something called "single-threaded space" - it's the point at which the program is running within one thread of execution. All it means for you is that nothing else can try cross-thread (get to that in a bit) access. Let's define some threads. public class OutputThread extends Thread { public OutputThread() { } public void run() { int loop = 0; while(loop < 100) { int score = Singlton.getInstance().getScore(); System.out.println("Score is: " + score); loop++; } } } public class AccessThread extends Thread { public AccessThread() { } public void run() { int loop = 0; while(loop < 100) { Singleton.getInstance().setScore(new Random().nextInt()); loop++; } } } Above we have extended the thread class to define two threads: one that continually accesses and outputs the score value in our Singleton and another that constantly attempts to set the score. For the sake of education, we'll let these run 100 times using an int as a loop counter. Let's finish the main function in our SingletonExample class: public static void main(String[] args) { Singleton.getInstance().setScore(10); Thread setter = new AccessThread(); Thread getter = new OutputThread(); setter.start(); getter.start(); } All we do here is create two threads - one of each of our AccessThread and OutputThread. Go ahead and run the application. What happens? It executes out of order, right? That's because we're only ensuring that more than one thread can't access the singleton at once. Unfortunately, this poses a problem: What if we want more than one thing to access the data, but in a specific order - one after the other? Thread blocking There are a couple of ways to do this, including the wait-notify method. However that's a story for another day. Within the scope of this tutorial, blocking isn't a concern. Phobos isn't multithreaded, but does need to be thread-safe due to the volatile nature of its core. What we've seen today is the basics you'll need to understand to move further. I can, however, recommend some great tutorials to those who are interested - they're at the end of this tutorial along with a complete code listing for everything we've covered. Thank you for reading. I'm looking forward to actually finishing something for once. Check back in a couple weeks and I'll be back for more Java powered goodness. Next time, we're going to look at the JavaFX windowing system and the ways that we will be using it. In fact, in part 2 we will write the bare minimum required to make Phobos run - including the an entire FSM. Get ready! Some tutorials that may be interesting to those curious about Threads The Java Tutorials - Concurrency. Modern threading: A Java concurrency primer Java - Multithreaded Programming Complete code listing. public class Singleton { private static volatile Singleton _instance = null; private int aScore = 0; private Singleton() { } public static Singleton getInstance() { if (_instance == null) { synchronized (Singleton.class) { if (_instance == null) { _instance = new Singleton(); } } } return _instance; } public int getScore() { return aScore; } public void setScore(int val) { aScore = val; } } public class OutputThread extends Thread { public OutputThread() { // TODO Auto-generated constructor stub } public synchronized void run() { int loop = 0; while(loop < 100) { synchronized(this) { int score = Singleton.getInstance().getScore(); System.out.println("Score is: " + score); } loop++; } } } public class AccessThread extends Thread { public AccessThread() { // TODO Auto-generated constructor stub } public synchronized void run() { int loop = 0; while(loop < 100) { synchronized(this) { System.out.println("Accessing"); Singleton.getInstance().setScore(new Random().nextInt()); } loop++; } } } public class SingletonExample { public static void main(String[] args) { //ensure the singleton is created in single-threaded mode and set the score to 10. Singleton.getInstance().setScore(10); Thread setter = new AccessThread(); Thread getter = new OutputThread(); setter.start(); getter.start(); } }
https://www.dreamincode.net/forums/topic/345784-phobos-a-javafx-games-engine-part-1-intro-to-threading-and-dp/
CC-MAIN-2020-05
refinedweb
1,819
64.91
If you’ve started work on a new ASP.NET 5, MVC 6 application you may have noticed that Sessions don’t quite work the way they did before. Here’s how to get up and running the new way. UPDATE: 2016-07-23 - ASP.NET Core 1.0 Sessions have changed again for ASP.NET Core 1.0 RTM. This post is still super useful for anyone migrating an old project, or still working on any of the betas or RC1, but for the latest you should go to my updated post: Using Sessions and HttpContext in ASP.NET Core and MVC Core. UPDATE: 2015-11-05 - Beta8 I’ve updated this post to suit beta8. I keep these beta posts up to date, but if you find something that doesn’t work, be sure to use the links at the bottom for more information. Remove DNX Core Reference Many simple ASP.NET components aren’t supported by the DNX Core Runtime. These usually surface with weird build errors. It’s much easier to just remove it from your project.json file. If it’s already not there, beautiful you don’t need to do anything :) "frameworks": { "dnx451": { }, "dnxcore50": { } // <-- Remove this line }, Add Session NuGet Package Add the Microsoft.AspNet.Session NuGet package to your project. VERSION WARNING: If you’re using ASP.NET 5 before RTM, make sure the beta version is the same across your whole project. Just look at your references and make sure they all end with beta8 (or whichever version you’re using). Update startup.cs Now that we have the Session nuget package installed, we can add sessions to the OWIN pipline. Open up startup.cs and add the AddSession() and AddCaching() lines to the ConfigureServices(IServiceCollection services) // Add MVC services to the services container. services.AddMvc(); services.AddCaching(); // Adds a default in-memory implementation of IDistributedCache services.AddSession(); Next, we’ll tell OWIN to use a Memory Cache to store the session data. Add the UseSession() call below. // IMPORTANT: This session call MUST go before UseMvc() app.UseSession(); //?}"); }); Where’s the Session variable gone? Relax it’s still there, just not where you think it is. You can now find the session object by using HttpContext.Session. HttpContext is just the current HttpContext exposed to you by the Controller class. If you’re not in a controller, you can still access the HttpContext by injecting IHttpContextAccessor. Let’s go ahead and add sessions to our Home Controller: public class HomeController : Controller { public IActionResult Index() { HttpContext.Session.SetString("Test", "Ben Rules!"); return View(); } public IActionResult About() { ViewBag.Message = HttpContext.Session.GetString("Test"); return View(); } } You’ll see the Index() and About() methods making use of the Session object. It’s pretty easy here, just use one of the Set() methods to store your data and one of the Get() methods to retrieve it. Just for fun, let’s inject the context into a random class: public class SomeOtherClass { private readonly IHttpContextAccessor _httpContextAccessor; private ISession _session => _httpContextAccessor.HttpContext.Session; public SomeOtherClass(IHttpContextAccessor httpContextAccessor) { _httpContextAccessor = httpContextAccessor; } public void TestSet() { _session.SetString("Test", "Ben Rules!"); } public void TestGet() { var message = _session.GetString("Test"); } } Let’s break this down. Firstly I’m setting up a private variable to hold the HttpContextAccessor. This is the way you get the HttpContext now. Next I’m adding a convenience variable as a shortcut directly to the session. Notice the =>? That means we’re using an expression body, aka a shortcut to writing a one liner method that returns something. Moving to the contructor you can see that I’m injecting the IHttpContextAccessor and assigning it to my private variable. If you’re not sure about this whole dependency injection thing, don’t worry, it’s not hard to get the hang of (especially constructor injection like I’m using here) and it will improve your code by forcing you to write it in a modular way. But wait a minute, how do I store a complex object? How do I store a complex object? I’ve got you covered here too. Here’s a quick JSON storage extension to let you store complex objects nice and simple. public static class SessionExtensions { public static void SetObjectAsJson(this ISession session, string key, object value) { session.SetString(key, JsonConvert.SerializeObject(value)); } public static T GetObjectFromJson<T>(this ISession session, string key) { var value = session.GetString(key); return value == null ? default(T) : JsonConvert.DeserializeObject<T>(value); } } Now you can store your complex objects like so: var myComplexObject = new MyClass(); HttpContext.Session.SetObjectAsJson("Test", myComplexObject); and retrieve them just as easily: var myComplexObject = HttpContext.Session.GetObjectFromJson<MyClass>("Test"); Use a Redis or SQL Server Cache instead Instead of using services.AddCaching() which implements the default in-memory cache, you can use either of the following. Firstly, install either one of these nuget packages: Microsoft.Framework.Caching.SqlServer Microsoft.Framework.Caching.Redis Secondly, add the appropriate code snippet below: // Microsoft SQL Server implementation of IDistributedCache. // Note that this would require setting up the session state database. services.AddSqlServerCache(o => { o.ConnectionString = "Server=.;Database=ASPNET5SessionState;Trusted_Connection=True;"; o.SchemaName = "dbo"; o.TableName = "Sessions"; }); // Redis implementation of IDistributedCache. // This will override any previously registered IDistributedCache service. services.AddSingleton<IDistributedCache, RedisCache>(); Stay up to date Since the API’s are still in beta at the time of writing, you should keep an eye on the ASP.NET Session Repository for any changes. Here’s a direct link to the Sample code.
https://benjii.me/2015/07/using-sessions-and-httpcontext-in-aspnet5-and-mvc6/
CC-MAIN-2018-09
refinedweb
912
51.04
Copyright © 2001 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use, and software licensing rules the result of joint work by the XSL and XML Query www-xpath-comments@w3.org (archived at). XPath For Expressions 2.9 Conditional Expressions 2.10 Quantified Expressions 2.11 Datatypes 2.11.1 Referring to Datatypes 2.11.2 Expressions on Datatypes A Complete BNF A.1 Grammar A.2 Precedence Order A.3 Lexical structure A.3.1 Lexical States B References B.1 Normative References B.2 Non-normative References B.3 Background References B.4 Informative Material C Glossary D Backwards Compatibility with XPath 1.0 (Non-Normative) E XPath 2.0 and XQuery 1.0 Issues (Non-Normative) [XQuery 1.0 and XPath 2.0 Data Model] document. XPath gets its name from its use of a path notation as in URLs for navigating through the hierarchical structure of an XML document. XPath is designed to be embedded in a host language such as [XSLT 2.0] or [XQuery]. XPath has a natural subset that can be used for matching (testing whether or not a node matches a pattern); this use of XPath is described in [XSLT 2.0]. XPath data model defines the information in an XML document that is available to an XPath processor. The data model is defined in [XQuery 1.0 and XPath 2.0 Data Model]. The static and dynamic semantics of XPath are formally defined in [XQuery 1.0 Formal Semantics]. This is done by mapping the full XPath language into a "core" subset for which the semantics is defined. This document is useful for implementors and others who require a rigorous definition of XPath. ]. The basic building block of XPath is the expression. The language provides several kinds of expressions which may be constructed from keywords, symbols, and operands. In general, the operands of an expression are other expressions. XPath is a functional language which allows various kinds of expressions to be nested with full generality. It is also a strongly-typed language in which the operands of various expressions, operators, and functions must conform to designated types. Like XML, XPath is a case-sensitive language. All keywords in XPathPath. XPath requires the information in the static context to be provided by the language environment in which the expression is being processed. Static context consists of the following components: Type exception policy. This is one of the values strict or flexible. The value indicates the action that should be taken when a type exception is raised. If the policy is strict, an error will be raised. If the policy is flexible, then a fallback conversion will be invoked; an error will be raised only if the fallback conversion fails. the host language environment in which an XPath expression is being evaluated.). The handling of type exceptions in XPath is described below.? The action taken when a type exception is raised depends on the language environment in which the XPath expression is being evaluated. A language environment may choose to treat a type exception as an error, or it may choose to handle the exception by applying a fixed set of rules called fallback conversions. language environment that implements fallback conversions must apply the following rules, in order: If the required type is anything other than a simple type or a single node, an error is, an error is raised. Otherwise if the given value is a sequence containing more than one item, only the first item is retained. If this item is a node, its typed value is extracted. If the typed value of the node is a sequence of more than one simple value, only the first of these simple values is retained. The resulting (supplied or extracted) simple. A literal is a direct syntactic representation of a simple value. XPath. XPath also allows variables to be bound in the host language environment. expression with informative information. Comments are lexical constructs only, and have no meaning within the expression. Comments may be used before and after major tokens within expressions . See A.3 Lexical structure for the exact lexical states where comments are recognized. Ed. Note: The EBNF here should disallow "--}" within the comment, rather than "}".Path defines a set of full set of axes for traversing documents, but a host language may define a subset of these axes. The following axes are defined: ancestor axis contains the ancestors of the context node; the ancestors of the context node consist of the parent of context node and the parent's parent and so on; thus, the ancestor axis will always include the root node, unless the context node is the root node the following-sibling axis contains all the following siblings of the context node; if the context node is an attribute node or namespace node, the following-sibling axis is empty the preceding-sibling axis contains all the preceding siblings of the context node; if the context node is an attribute node or namespace node, the preceding-sibling axis is empty the following axis contains all nodes in the same document of the context node; the axis will be empty unless the context node is an elementPath, the parent, ancestor, ancestor-or-self, preceding, and preceding-sibling axes are reverse axes; all other axes are forward axes. Since the self axis always contains at most one node, it makes no difference whether it is a forward or reverse axis. The ancestor, descendant, following, preceding and self axes partition a document (ignoring attribute and namespace nodes): they do not overlap and together they contain all the nodes in the document. following-sibling::chapter[position()=1] selects the next chapter sibling of the context node preceding-sibling::chapter[position()=1] selects the previous chapter siblingPathPathPathPath provides four kinds of comparison expressions, called value comparisons, general comparisons, node comparisons, and order comparisons.PathPath to refer to a datatype. Datatypes are used in specifying the parameters of functions, and they are used explicitly in several kinds of XPath expression. For example, element duck refers to the globally defined duck element in some schema that is available to the expression.Path expressions:PathPathPath processor to apply a check at expression analysis time to ensure that the static type of the given expression is an instance of a given type. The assert expression provides a stronger guarantee than a treat expression because it is applied at expression analysis time and is independent of input data, whereas treat is applied during expression execution and depends on the data that is being processed. The following example raises an error at expression.. This section provides a summary of the main areas of incompatibility between XPath 2.0 and [XPath 1.0]. Many of these are areas where the specification still has open issues outstanding, so this list should not be taken as final. It is the intention of the working group to review all known incompatibilities before final publication. The list given here assumes (a) that the source document is processed in the absence of a schema, and (b) that the policy for handling type exceptions is flexible: that is, that the software attempts wherever possible to perform conversions from the supplied type of a value to the type required by the operation or function where it is used. In the description below, the terms node-set and number are used with their XPath 1.0 meanings, that is, to describe expressions which according to the rules of XPath 1.0 would have generated a node-set or a number respecively. The rules for comparing a node-set to a boolean have changed. In XPath 1.0, an expression such as $nodeset=true() was evaluated by converting the node-set to a boolean and comparing the result: so this expression would return true if $nodeset was non-empty. In XPath 2.0, this expression is handled in the same way as other comparisons between a sequence and a singleton: it is true if $nodeset contains at least one node whose typed value is true. The rules for converting a string to a boolean have changed, so they are now aligned with XML Schema. In XPath 2.0, the strings "0" and "false" are treated as false, while in XPath 1.0, they were treated as true. All other strings are converted in the same way as XPath 1.0. Additional numeric types have been introduced, with the effect that arithmetic may now be done as an integer, decimal, or single-precision floating point calculation where previously it was always performed as double-precision floating point. The most notable difference (subject to resolution of an open issue) is that 10 div 4 is now an integer division, with the result 2, rather than a floating point division yielding 2.5. The rules for converting numbers to strings have changed. These will affect the way numbers are displayed in the output of a stylesheet. The output format depends on the data type of the result: floating point values, for example, will be displayed using scientific notation. The result of a decimal calculation such as 1.5 + 3.5 will be displayed as 5.0, not 5 as previously. The general rule is that the resulting string uses the canonical lexical representation for the data type as defined in XML Schema. The rules for converting strings to numbers have changed. A string that cannot be interpreted as a number now (subject to resolution of an open issue) produces an error, whereas in XPath 1.0 it produced the value NaN (not a number). The representation of special values such as Infinity has been aligned with XML Schema. Strings containing a leading plus sign, or numbers in scientific notation, may now be converted to ordinary numeric values, whereas in XPath 1.0 they were converted to NaN. Many operations in XPath 2.0 produce an empty sequence as their result when one of the arguments or operands is an empty sequence. With XPath 1.0, the result of such an operation was typically an empty string or the numeric value NaN. Examples include the numeric operators, and functions such as substring and name. Functions also produce an empty sequence when applied to an argument for which no other value is defined; for example, applying the name function to a text node now produces the empty sequence. This means, for example, that with XPath 1.0 the expression node()[name()!='item'] would return all the children of an element, except for elements named item; with XPath 2.0 it will exclude text and comment nodes, because the condition ()!='item' is treated as false. In XPath 1.0, the sum of an empty node-set was zero. At XPath 2.0, it is an empty sequence.. In XPath 1.0, the < and > operators, when applied to two strings, attempted to convert both the strings to numbers and then made a numeric comparison between the results. In XPath 2.0, subject to resolution of an open issue, it is proposed that these operators should perform a lexicographic comparison using the default collating sequence. In XPath 1.0, functions and operators that compared strings (for example, the = operator and the contains function) worked on the basis of character-by-character equality of Unicode codepoints, allowing Unicode normalization at the discretion of the implementor. In XPath 2.0 (subject to resolution of open issues), these comparisons are done using the default collating sequence. The working group may define mechanisms allowing codepoint comparison to be selected as the default collating sequence, but there is no such mechanism in the current draft. If an arithmetic operator is applied to an operand that is a sequence of two or more nodes, at XPath 1.0 the numeric value of the first node in the sequence was used. At XPath 2.0, this is an error. (The current XPath 2.0 specification does not invoke fallback conversion in this case). In..
http://www.w3.org/TR/2001/WD-xpath20-20011220/
CC-MAIN-2021-39
refinedweb
2,002
57.37
The Java Applet Viewer The Java Applet Viewer Applet viewer is a command line program to run Java applets... executes that code and displays the output.. So for running the applet,  The Java Applet Viewer The Java Applet Viewer Applet viewer is a command line program to run Java applets... the Java applet. We can use only one option -debug that starts the applet viewer The Java Applet Viewer The Java Applet Viewer Applet viewer is a command line program to run Java applets.... The other way to run an applet is through Java applet viewer. This is a tool The Java Applet Viewer The Java Applet Viewer Applet viewer is a command line program to run Java applets.... The other way to run an applet is through Java applet viewer. This is a tool Play Audio in Java Applet Play Audio in Java Applet Introduction Java has the feature of the playing the sound file. This program will show you how to play a audio clip in your java applet threads in java threads in java how to read a file in java , split it and write into two different files using threads such that thread is running twice Threads Threads Basic Idea Execute more than one piece of code at the "same... time slicing. Rotates CPU among threads / processes. Gives.... Threads vs Processes Multiple processes / tasks Separate programs Java threads Java threads What are the two basic ways in which classes that can be run as threads may be defined Java - Threads in Java Java - Threads in Java Thread is the feature of mostly languages including Java. Threads... or multiprogramming is delivered through the running of multiple threads concurrently Daemon Threads ; In Java, any thread can be a Daemon thread. Daemon threads are like a service providers for other threads or objects running in the same process as the daemon... needed while normal threads are executing. If normal threads are not running Threads in Java Threads in Java help in multitasking. They can stop or suspend a specific running process and start or resume the suspended processes. This helps... and allows other threads to execute. Example of Threads in Java: public class threads in java threads in java iam getting that the local variable is never read in eclipse in main classas:: class Synex4{ public static void main(String args[]){ Test1 ob1=new Test1(); //local variable never read Explain about threads:how to start program in threads? and print it simultaneously. Threads are called light weight processes. Every java...Explain about threads:how to start program in threads? import...; Learn Threads Thread is a path of execution of a program Introduction ; Introduction Applet is java program that can be embedded into HTML pages. Java applets... Disadvantages of Java Applet: Java plug-in is required to run applet Java.... In this example you will see, how to write an applet program. Java source of applet threads and events threads and events Can you explain threads and events in java for me. Thank you. Java Event Handling Java Thread Examples java disadvantage of threads is the disadvantage of threads? hello, The Main disadvantage of in threads... disadvantage of Threads. Let?s discuss the disadvantages of threads. The global... java libraries are not thread safe. So, you should be very care full while using threads in java - Java Beginners threads in java what is the difference between preemptive scheduling and time slicing? hi friend, In Preemptive scheduling, a thread... or the priority of one of the waiting threads is increased. While in Time Slicing Sync Threads Sync Threads "If two threads wants to execute a synchronized method in a class, and both threads are using the same instance of the class to invoke...:// Thanks java threads - Java Beginners java threads What is Thread in Java and why it is used Shutting down threads cleanly,java tutorial,java tutorials Shutting Down Threads Cleanly 2002-09-16 The Java Specialists' Newsletter... is running or not. However, Java already provides that flag in the form... of threads and you join() each one to make sure that it does finish. Java has: Beginners Threads hi, how to execute threads prgm in java? is it using appletviewer as in applet? Hi manju import java.awt.*; import...("/home/vinod/amarexamples:9090/" + "amarexamples/Threads/applet Synchronized Threads Synchronized Threads In Java, the threads are executed independently to each other. These types of threads are called as asynchronous threads. But there are two problems may java threads - Java Interview Questions the priority of thread. Thanks Hi, In Java the JVM defines priorities for Java threads in the range of 1 to 10. Following is the constaints defined...java threads How can you change the proirity of number of a thread threads - Java Interview Questions Threads - Java Beginners regardoing multi threads - Java Beginners regardoing multi threads Hi Please tell me how to declare global variables in main thread so that all other threads can use them and value will be available to all threads. Thanks - Java Interview Questions java threads what is difference between the Notify and NotifyAll. Running Java Applications as software Running Java Applications as software Please tell me what to do if you want your java application to run like a real software,eg a java GUI application that connects to the database(Mysql)running on the computer like any other Running JUnit Running JUnit Hi sir How can we run JUnit or Run test case Using JUnit using command prompt or CMD? Is there any alternate way of running test cases? Hi friend You can run JUnit test case by running following java java how to run applets in java Hi, In Java you can use Applet viewer to run the applet. Read more at Java Applet Viewer tutorial page. Thanks interfaces,exceptions,threads : Exception Handling in Java Threads A thread is a lightweight process which... with multiple threads is referred to as a multi-threaded process. In Java Programming...interfaces,exceptions,threads SIR,IAM JAVA BEGINER,I WANT KNOW process of compiling and running java program process of compiling and running java program Explain the process of compiling and running java program. Also Explain type casting Running threads in servlet only once - JSP-Servlet Running threads in servlet only once Hi All, I am developing a project with multiple threads which will run to check database continuously... process while mail thread is running. these two separate threads has to run creating multiple threads - Java Beginners creating multiple threads demonstrate a java program using multiple thread to create stack and perform both push and pop operation synchronously. Hi friend, Use the following code: import java.util.*; class Daemon Threads Daemon Threads This section describe about daemon thread in java. Any thread... running in same process, these threads are created by JVM for background task... or it will throw IllegalThreadStateException if thread is already started and running Running Java Applications as a Windows Service Running Java Applications as a Windows Service sample code for "Run a Java application as a Windows Service Introduction To pls tell me the difference between the run() and start() in threads in java.... pls tell me the difference between the run() and start() in threads in java.... difference between the run() and start() in threads in java Compilation and running error - RMI Java Compilation and running error The following set of programs runs with the lower versions of Java 6 update 13, but not with JAVA 6 update 13... some problem and gives following on compilation"java uses unchecked or unsafe Introduction to Java Java is an open source object oriented programming language... environment to code in. Hence they developed Java. The company was later overtaken by Oracle. Java is used in developing softwares for computers, application javascript introduction for programmers javascript introduction for programmers A brief Introduction of JavaScript(web scripting language) for Java Programmers implementing an algorithm using multi threads - Java Beginners to breakdown into two or three threads and need to implemented and need Java Multithreading threads of execution running concurrently independently. When a program contains..., the change affects the other threads. Java enables you to synchronize threads... Java Multithreading   Running the Test Plan Running the Test Plan  .... To indicate that the test is running a green square lits up in the upper-right... on unless and until all test threads exit. Furthermore the total number of currently Life Cycle of Threads ; When you are programming with threads, understanding... either running, waiting, sleeping or coming back from blocked state also...; Running state ? A thread is in running state that means the thread is currently applet running but no display - Applet applet running but no display Hai, Thanks for the post. I have... strDefault = "Hello! Java Applet."; public void paint(Graphics g) { String... from a client, the page appears with a blank applet part (just whitescreen java java what is ment by daemon Java Daemon Threads Daemon threads are like a service providers for other threads or objects running in the same process as the daemon thread. Daemon threads are used for background Trouble in running Dos Command from Java Servlet Trouble in running Dos Command from Java Servlet Hello All, I have to run following command from Java. The command is : vscanwin32 /S C:\Test > C... 'cmd /c dir /s'. Looking forward for the help. -Java Beginner error while running the applet - Java Beginners prompt. You will be got definitily your output in a applet viewer. Thanks...error while running the applet import java.applet.Applet; import...); ++num; } } } } i have problem while running the code , error Java Interpreter of a larger applications. For this we use Java Applet Viewer. It is a command line program to run Java applets. It is included in the SDK. It helps you to test an applet... see how to go about an Applet. Although Java applet is a compiled Java code Java Training and Tutorials, Core Java Training Java Training and Tutorials, Core Java Training Introduction to online..., Applet and Swing Components. Getting Started with Java...; Introduction to Threads Introduction To Enterprise Java Bean(EJB). WebLogic 6.0 Tutorial. Introduction To Enterprise Java Bean(EJB) Enterprise Java Bean architecture is the component... Applications with Enterprise Java Beans) (Online WebLogic 6.0 Introduction Java as an Object Oriented Language Introduction: In this section, we... the java applications and programs. OOP means Object Oriented Programming Creating multiple Threads In this section you will learn how to create multiple thread in java. Thread... or you can set or get the priority of thread. Java API provide method like... are lightweight process. There are two way to create thread in java Compiling and Running Java program from command line Compiling and Running Java program from command line - Video tutorial... of compiling and running java program from command line. We have also video... the process of compiling and running the Java program from command prompt Multithreading in Java Multithreading in java is running multiple threads sharing same address space concurrently. A multithreaded program has two or more parts running... various threads to run inside one process. Carrying out more than one task J2EE Tutorial - Running RMI Example J2EE Tutorial - Running RMI Example  ...? 1) We require jndi package for running this program.  ... most carefully without break!) (continuously). >java Introduction to Java Introduction to Java What is Java? Java is a high-level object-oriented programming... Wide Web but it is older than the origin of Web. New to Java threads threads what are threads? what is the use in progarmming Introduction Introduction  ... languages like C, C++ and java are case sensitive languages while...; The Java class Helloworld is a completely different class from the class Multithreading Example In Java threads to execute them concurrently. In multithreading in Java some of the non...Multithreading Example In Java In this section we will learn about multithreading in Java. Multithreading in Java is used to execute multiple tasks JFreeChart - An Introduction JFreeChart - An Introduction JFreeChart is a free open source java chart... that is based on JFreeChart version 1.0.4. For compiling and running these following JSF Introduction - An Introduction to JSF Technology...; Java Server Faces or JSF for short is another new exciting technology for developing web applications based on Java technologies. This JSF Introduction to Java from Java source code. Applet Viewer Applet viewer... Introduction to Java This section introduces you the Java programming language. These days Java Clock Applet in Java Java - Clock Applet in Java Introduction Here is a sample of running clock provided by the java applet to illustrate how to use the clock in an applet. This program shows
http://www.roseindia.net/tutorialhelp/comment/97374
CC-MAIN-2014-10
refinedweb
2,104
55.95
i'm creating a tic tac toe game (no functions unfortunately.....sorry!) and was trying to check for a winner at the end of each turn. Is there any way of doing this without using a hefty amount of "if" statements? I have already searched the forum but the only examples I could find included these statements in mass. I was thinking to using a nested "for" loop but the problem came that I would only be searching row wins and column wins...i'm stumped. If you would like to see my code, see below. Like I said, there is no check yet, but I added a comment line so you can see where it would start. Once again, I'm very sorry about the lack of functions, I am trying to go step by step in my book and every chapter I try to make a game out of what I've learned so far (and very limited, yes).Once again, I'm very sorry about the lack of functions, I am trying to go step by step in my book and every chapter I try to make a game out of what I've learned so far (and very limited, yes).Code://Tic Tac Toe //Dustin Hardin 12-12-08 //Play the classic game of tic tac toe #include <iostream> #include <string> #include <cstdlib> #include <ctime> using namespace std; int main() { const short NUM_ROWS = 3, NUM_COLUMNS = 3; const short unsigned MAX_PLAYERS = 2; short unsigned numPlayers, numComputer, rowSelect, columnSelect, xCheck = 0, oCheck = 0; bool playerMove, gameBoardFull = true; short unsigned int whoFirst, whoWin = 0, move, playerCheck, opponentCheck; srand(time(0)); string players[MAX_PLAYERS]; string board[NUM_ROWS][NUM_COLUMNS] = { {"|#|","|#|","|#|"}, {"|#|","|#|","|#|"}, {"|#|","|#|","|#|"} }; while (true) //Game Loop { //get number of players do{ system("cls"); cout << "\t\tWelcome to Tic-Tac-Toe!\n\n"; cout << "How many players will be joining us today? (1-2): "; cin >> numPlayers; cin.ignore(); }while (numPlayers != 1 && numPlayers != 2); numComputer = 2 - numPlayers; //inform player of who is playing if (numPlayers == 1) { cout << "\nGreat! So there will be " << numPlayers << " Human Vs. " << numComputer << " Computer!\n\n"; players[0] = "Player"; players[1] = "Computer"; } else { cout << "Great! So it will be Human Vs. Human!\n\n"; players[0] = "Player 1"; players[1] = "Player 2"; } cin.get(); //RULES! system("cls"); cout << "\t\tRULES: \n\n"; cout << "1. You must pick a position to start in. (1-9)\n" << "the top row is 1-3, second 4-6, third 7-9" << endl; cout << "\n2. Who goes 'first' is random....so no complaining!\n\n"; cin.get(); system("cls"); //Display who is first cout << "DECIDING WHO GOES FIRST...PLEASE WAIT....."; whoFirst = rand() % 2 + 1; //pick either one of the players to go first cin.get(); if(whoFirst == 1) { playerMove = true; cout << "\n\n" << players[0] << " goes first"; cin.get(); } else { playerMove = false; cout << "\n\n" << players[1] << " goes first"; cin.get(); } system("cls"); //now enter the game of tic-tac-toe do { gameBoardFull = true; system("cls"); //check to see if full board (draw) for(int j = 0; j < 3; j++) { for(int k = 0; k < 3; k++) { if (board[j][k] == "|#|") { gameBoardFull = false; } } } if(gameBoardFull == false) { //display board for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { cout << board[i][j]; } cout << endl; } //check who's move it is and get input do { if( playerMove == true) { cout << players[0] << ": "; cin >> move; cin.ignore(); } else if(playerMove == false && numPlayers == 2) { cout << players[1] << ": "; cin >> move; cin.ignore(); } else if(playerMove == false && numPlayers == 1) { move = rand() % 9 + 1; } } while(move < 1 && move > 9); //adjust move to the corresponding row and columns if (move > 0 && move < 4) { rowSelect = 0; columnSelect = move - 1; } else if (move > 3 && move < 7) { rowSelect = 1; columnSelect = move - 4; } else if (move > 6 && move < 10) { rowSelect = 2; columnSelect = move - 7; } if(board[rowSelect][columnSelect] == "|#|") { //place the marker on board if (playerMove == true) { board[rowSelect][columnSelect] = "|X|"; playerMove = false; } else if (playerMove == false && numPlayers == 2) { board[rowSelect][columnSelect] = "|O|"; playerMove = true; cin.get(); } else { board[rowSelect][columnSelect] = "|O|"; playerMove = true; cout << players[1] << ": " << move; cin.get(); } } } //check for winner for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { } } }while(gameBoardFull == false);//add whoWin == 0 so that it will check for winner before end loop system("cls"); if(gameBoardFull == true) cout << "\t\tGame Ended in Draw!"; cin.get(); break; } cin.get(); } Thanks again!
http://cboard.cprogramming.com/cplusplus-programming/122754-tic-tac-toe-check-winner.html
CC-MAIN-2016-07
refinedweb
724
69.72
'Addendum: Encoding tuples with numbers' I described how to encode tuples of natural numbers into natural numbers. Now, I wrote (hacked) a small piece in Haskell to try it in practice. So here it is: import Data.List import Maybe -- taken from -- primes = 2:3:primes' where l:p:candidates = [6*k+r | k <- [0..], r <- [1,5]] primes' = p : filter isPrime candidates isPrime n = all (not . divides n) $ takeWhile (\p -> p*p <= n) primes' divides n p = n `mod` p == 0 isPrime n = all not [n `mod` p == 0 | p <- takeWhile (\p -> p*p <= n) primes] ascendlist [] = [] ascendlist (h:t) = h : (ascendlist (map (+ h) t)) deascendlist [] = [] deascendlist (h:t) = h : map (flip (-) h) (deascendlist t) encode l = encode' (ascendlist l) where encode' [] = 1 encode' (h:t) = (primes !! (fromIntegral h)) * (encode' t) getsprime n = if isPrime n then n else fromJust (find (\x -> n `mod` x == 0) primes) decode n = deascendlist (decode' n) where decode' 1 = [] decode' n = (fromIntegral pi) : (decode' (n `div` p)) where p = getsprime n pi = fromJust (findIndex (== p) primes) The functions encode and decode do most of the work. Note that this implementation includes also the number 0 (by accident, since computers usually index lists starting with 0). However, as mentioned in the original post, it's not a very practicable solution, since we have to deal with quite large numbers and factorize them. The program can probably be sped up by explicitly stating the types of the functions and compiling the program. I omitted them because my compiler always complained about incompatible types ( [Int] and [Integer]). The program can be tested by simply calling decode (encode [1,2,3,4,5]) or similar.
http://phimuemue.com/posts/2011-09-04-addendum-encoding-tuples-with-numbers.html
CC-MAIN-2017-34
refinedweb
278
57.91
Polymorphism is when different subclasses can have their own unique implementations of methods while still falling under the same type as their parent class. When declaring a variable, we learned that on the left side of the equals sign is a type that specifies what kind of object the variable is able to hold, while the right side assigns that variable the actual object of that type or of a subclass. The great thing about this is that you can safely substitute different subclasses in for the object on the right, and you will get different behavior based on each of those subclasses’ implementation of their methods. For example, the type on the left could be an electronic reader and the object on the right could be anything that you can read books on, like an iPhone or a Kindle: ElectronicReader reader1 = new iPhone(); ElectronicReader reader2 = new Kindle(); // ElectronicReader is the type, iPhone and Kindle are the actual objects Remember that the type describes which methods are available to that variable, which means that you can’t call any methods that aren’t specified by that type, even if those methods are included in subclasses. This might seem like a limitation, but this actually helps to prevent any errors from occurring when someone tries to call a method on a specific subclass that might not be available on all subclasses and isn’t specified in the parent class. To explain this in terms of the electronic reader example, imagine that you had an object whose type is an electronic reader. Now try asking that object to make a call or text someone. You can definitely do that with an iPhone, but not with a Kindle; trying to call that method on a Kindle would produce an error. Because the actual electronic reader could be either an iPhone or a Kindle, you are restricted from all methods in an iPhone that aren’t specified in an electronic reader. This way, because people asked for an electronic reader, they will for sure get an electronic reader, but they are not going to get any extra features if they happen to get a more advanced iPhone instead of a Kindle. However, if you for sure know that you have an iPhone, you could cast your electronic reader into an iPhone to use the call and text features. For example, if you have an iPhone classified as an electronic reader, you can cast the electronic reader to be an iPhone and that will allow you to use an iPhone’s methods. However, be careful when doing this; if you tried to cast the electronic reader into an iPhone but it turned out that the electronic reader was a Kindle, you would have gotten a ClassCastException. Let’s move on to some examples. The following is the code for three different classes: public abstract class Shape { public abstract double area(); } public class Square extends Shape { private double length; public Square(double length) { this.length = length; } public double area() { return length * length; } } public class Circle extends Shape { private double radius; public Circle(double radius) { this.radius = radius; } public double area() { return Math.PI * radius * radius; } public double circumference() { return 2 * Math.PI * radius; } } Now consider the following variables: Shape s1 = new Square(5); Shape s2 = new Circle(2); And the following method calls: s1.area(); // 25 s2.area(); // 12.566 (4π) ((Circle) s2).circumference(); // 12.566 (4π) s2.circumference(); // Compiler error ((Circle) s1).circumference(); // Runtime error The first three calls are valid. The calls to the area method will find the respective methods in each of the Square and Circle classes and return the proper value through polymorphism. The third call casts s2 into a Circle. Although the actual object is already a circle, casting the type defined on the left side of the equals sign tells the computer to actually treat it as a circle instead of as a shape. Now that s2 has been casted, the call to the circumference method is valid. The last two calls, however, are invalid. The call to the circumference method on s2 is not valid in the fourth call because s2 has not been casted to a circle. Java still sees s2 as a simple Shape, and the Shape class does not have a circumference method. Therefore, this call will produce a compiler error. The fifth call is invalid because s1 holds a Square, and you can’t cast a Square into a Circle. At first, the compiler will allow the cast because it doesn’t check if the cast is valid. Instead it checks whether the Circle class, which s1 is being casted into, has the specified circumference method. As long as the method is found, the compiler tests will pass. However, once you run the program and attempt to cast s1 into a Circle, the runtime error will be produced. You still might be wondering why you would have defined the variables above as shapes instead of doing something like this: Square s1 = new Square(5); Circle s2 = new Circle(2); The reason is simple. Using inheritance allows you to be much more flexible if you ever decide to go back and change your code. For example, if you initially had the following variable and method: Square s = new Square(5); public boolean areaLessThanTen(Square s) { return s.area() < 10.0; } And then you later decided you wanted to switch the object to be a Circle instead of a Square, you’d have to change everything in bold from Circle to Square. On the other hand, consider this: Shape s = new Square(5); public boolean areaLessThanTen(Shape s) { return s.area() < 10.0; } There is only one snippet of code that needs changing. So if you frequently have to go back and make changes, or if let’s say you have many different types of shapes, taking advantage of inheritance and polymorphism can be extremely beneficial. Lesson Quiz 1. What is polymorphism? 2. Do casting errors result in a compiler error or runtime error? 3. A parent class has a method method1() and a subclass has a method method2(). Which of the following is true? Written by Alan Bi Notice any mistakes? Please email us at [email protected] so that we can fix any inaccuracies.
https://teamscode.com/learn/ap-computer-science/polymorphism/
CC-MAIN-2019-04
refinedweb
1,049
68.2
Integration with Kendo UI MVVM The Kendo UI hybrid mobile Application provides a close integration with the Kendo UI MVVM framework. The mobile widgets' configuration options can be bound and managed through a view model. Getting Started Initialization The recommended way to use the Kendo UI MVVM with the Hybrid UI Application is through the model configuration option of the mobile view. Example <script> var foo = { bar: "baz" } </script> <div data- <span data-</span> </div> A complex model reference can also be specified. <script> var foo = { bar: { baz: "qux" } } </script> <div data- <span data-</span> </div> MVVM Binding When initialized, the mobile View calls kendo.bind on its child elements, using the provided model. Important The mobile View binds all Kendo UI widgets—hybrid mobile and web widgets as well as the controls for data visualization—in that same order. This means that if an element with data-role="listview"is present, a hybrid mobile (and not web) ListView is going to be initialized. This behavior can be overridden by specifying the full widget class name, together with its namespace, in the roleattribute. As of the Kendo UI Q2 2014 release, the mobile view events may be bound to the view model, too, as demonstrated in the example below. Example <script> var foo = { onViewInit: function(e) { console.log(e); }, onViewShow: function(e) { console.log(e); } }; </script> <div data-</span> </div> See also Other articles on the integration of Kendo UI hybrid components:
https://docs.telerik.com/kendo-ui/controls/hybrid/support/mvvm
CC-MAIN-2019-09
refinedweb
242
53.71
Wikiversity:Bots/Status/Archive This is the archive of bot status requests User:Sebbot[edit source] - Bot operator: User:Sebmol - Aim of the bot: undo vandalism, rename categories - Script used: w:WP:AWB - Already used on, with bot status: German Wikipedia Done Bot was flagged: 05:08, 3 October 2006 Cormaggio (Talk | contribs | block) granted bot status to User:Sebbot (I trust you Seb :-)) User:DraiconeBot[edit source] - Bot operator: User:Draicone - Aim of the bot: Simplify common tasks, fetch data, update counts, remove categories etc. - Script used: Hmm... PHP? A mixture of w:WP:AWB, pywikipedia, PHP with snoopy, PHP using query.php, Manually operated using AJAXified query.php etc. - Already used on, with bot status: English Wikipedia, the now defunct MWT wiki Done sebmol ? 12:06, 31 October 2006 (UTC) User:Wherebot[edit source] - nomination for bot status. This bot from Wikipedia watches for copyright violations. An example of how this could work at Wikiversity is at User:Wherebot. --JWSchmidt 16:39, 1 November 2006 (UTC) - I'm willing to put the bot on as soon as it is approved. Here is the info (below): -- Where 00:10, 31 October 2006 (UTC) - Bot operator: w:User:Where - Aim of the bot: detect copyright violations - Script used: w:User:Wherebot - 'Already approved on the English Wikipedia Done, assigning responsibility for the bot to User:JWSchmidt. sebmol ? 17:08, 1 November 2006 (UTC) User:HagermanBot[edit source] - Bot Operator: User:Hagerman - Aim of the bot: Automatically detects unsigned comments left on the talk namespaces as well as requested pages (indicated by placing the page in a special category). It places the {{unsigned}} template after the comment. If the user leaves 2 unsigned comments within a 24 hour period, the bot leaves a message on the users talk page with information on how to properly sign a comment. - Language used: Visual C# .NET - Already approved on the English Wikipedia See HagermanBot Please run the bot without flag for a couple of days so we can get a picture of how it works. sebmol ? 11:00, 15 December 2006 (UTC) - Ok, the bot is running. Please contact me if you have any questions. Best, Hagerman 23:42, 15 December 2006 (UTC) Done Granted bot status after test phase. sebmol ? 09:36, 2 January 2007 (UTC) User:MichaelBillingtonBot[edit source] - Bot Operator: User:MichaelBillington - Aim of the bot: Checks pages on the open proxy project for IPs which have been missed, then relists them on WV:OP for blocking. Also categorises subpages of the project and archives lists which contain only blocked IP addresses. (so it's really an all-round helper bot for the project) - Language used: Visual Basic - Already approved: English Wikipedia under the same name (though that bot runs different software) - I wrote this after I noticed I missed a large number of IP addresses on the first open proxy list (a thing best to avoid) Michael Billington (talk • contribs) 11:58, 6 January 2007 (UTC) - Additional feature. I would like to have this bot also approved to post RSS feeds for Wikiversity blogs if a template is present. Michael Billington (talk • contribs) 07:24, 8 February 2007 (UTC) Please run it without bot flag for about a week to test its abilities and check for bugs. sebmol ? 07:42, 8 February 2007 (UTC) Done Granted bot status after test phase. sebmol ? 19:26, 25 March 2007 (UTC) User:ArchiveBot[edit source] - Bot operator: User:Sebmol - Aim of the bot: automatic archiving - Script used: self-made - Already used on, with bot status: German Wikipedia, German Wikiversity Done Bot was flagged: 14:11, 25 March 2007 Sebmol (Talk | contribs | block) granted bot status to User:ArchiveBot (for testing purposes) Commons Delinker[edit source] Done sebmol ? 20:07, 26 September 2007 (UTC) Crochet.david.bot[edit source] - Bot operator: fr:Utilisateur:Crochet.david - Aim of the bot: interwiki - Script used: interwiki.py of pywikipedia - Already used on, with bot status: fr: and it: --Crochet.david.bot 19:03, 10 August 2007 (UTC) Done sebmol ? 20:07, 26 September 2007 (UTC) Mike's bot account[edit source] - Bot operator: Mike.lifeguard (at en.wb: b:User:Mike.lifeguard) - Aim of the bot: So far, adding/removing categories/templates per request from SB Johnny. Any other tasks that can be done with AWB can be requested. In the future, I can tag all untagged images and notify their uploaders. - Script used: AutoWikiBrowser - Already used on: en.wb, but without a bot flag. SB Johnny asked me to request a bot flag for en.wv – MBA ( talk | block ) 15:43, 26 September 2007 (UTC) Done sebmol ? 20:07, 26 September 2007 (UTC) User:MichaelFreyTool[edit source] - Bot operator: User:MichaelFrey - Aim of the bot: simple cleanup task, like resolve redirects - Script used: w:WP:AWB - Already used on, with bot status: de.wb and de.wv -- MichaelFrey 12:04, 27 January 2008 (UTC) - This bot is running fine so far on de.WV (since it is just a piece of software and we know all Murphy's law: at least the edits I saw when asking the bot operator to do some changes). ----Erkan Yilmaz Wikiversity:Chat 22:43, 15 March 2008 (UTC) Done ----Erkan Yilmaz uses the Wikiversity:Chat (try) 20:58, 26 March 2008 (UTC) User:Computer[edit source] - Bot operator: User:White Cat (Commons:User:White Cat) - En-N, Tr-4, Ja-1 - List of botflags on other projects: Bot has a flag on wikimedia (meta,commons) wikipedia (ar, az, de, en, es, et, fr, is, ja, ku, nn, no, ru, sr, tr, uz, simple...) (See: m:User:White Cat#Bots) - Purpose: Interwiki linking, double redirect fixing, commons delinking (for cases where commonsdelinker fails) -- Cat chi? 17:42, 12 March 2008 (UTC) - Bot uses pywikipedia and AWB framework. ----Erkan Yilmaz Wikiversity:Chat 00:09, 16 March 2008 (UTC) - indicate on bot's user page: - which program / language is used (Pywikipedia, Ruby, javascript...) - who the owner is - choose a name containing the word "bot" so that editors realize they are dealing with an automaton - see also Name should include bot ? - Please also have a look at the other expectations. - Some feedback already at other Wikiversities about the request there: - Contributions at this Wikiversity to see how the bot is operating, ----Erkan Yilmaz Wikiversity:Chat 22:55, 15 March 2008 (UTC) Done --SB_Johnny | talk 10:53, 24 March 2008 (UTC) ArthurBot[edit source] - Contributions - Owner: Mercy - Language: pywikipedia - Functions: adding/correcting interwiki links - Flags: cs Hi, ArthurBot is a global bot with over 330,000 contribs. It's going to add interwiki links to newly created Czech pages and categories. Best regards, --Mercy 10:14, 10 January 2009 (UTC) Done [1] --mikeu talk 22:44, 16 January 2009 (UTC) User:It (tagbot)[edit source] - Bot Operator: [user=undefined] - Aim of the bot: tracks and catalogs future resources logged through the use of the Template:placeholder object, The "&..." pseudo-namespace and the Tag® gaming engine - Language used: XML/UML with definitions and stubs for Topic:Perl, Topic:Python, Topic:PHP, Topic:Smalltalk, &... - Under development: Proposed for use on any Topic:MediaWiki-driven site by the WikiaPerl group (Help Wanted). I'm not sure I quite understand the purpose of this bot or how it works. Can you post a simple demonstration that does not rely on Wikia? Feel free to use the bot account for that. sebmol ? 07:44, 8 February 2007 (UTC) Not done There has been no response to the questions about the function of this bot. --mikeu talk 02:33, 26 January 2009 (UTC) User:Dinybot[edit source] Hello, I would like to ask for the bot flag for the Dinybot robot. It is a classical global automatic interwiki robot which operates at all Wikiversities. Demonstrative editations are available. Also specification in English is available. Simple specifiation follows: - Bot Operator: User:Martin Kozák - Aim of the Bot: Periodical automated completing and keeping of the interwiki links of all projects. - Language used: The Python - Script used: Python Wikipedia Robot Framework - Already used on: - Czech Wikipedia for automated typographic corrections, code cleanups and redirects replacing, (Lightweight MediaWiki Robot Framework, since 2006-05-11) - Czech Wikiquote for typographic correction, code cleanups and redirects replacing, (Lightweight MediaWiki Robot Framework, since November 2006) - Wikiquote projects for completing and keeping the interwiki links. (Python Wikipedia Robot Framework, since March 2007, in pending) Thanks for Your complaisance. --Martin Kozák 17:33, 27 March 2007 (UTC) Not done This is a very old request, and it is not clear that the bot operator is still active. Please resubmit the request if you are still interested in running the bot. (and feel free to leave a note on the talk pages of the crats to insure a quicker response) --mikeu talk 02:33, 26 January 2009 (UTC) AdambroBot (talk • email • contribs • stats • logs • global account)[edit source] - Bot operator: Adambro (talk • email • contribs • stats • logs • global account) - Automatic or manually assisted: Semi-automatic - Purpose of the bot: Re-categorisation, other similar maintenance tasks as required - Edit period(s): As required - Programming language(s) (and API) used: AutoWikiBrowser - Other projects that are already using this bot: I have bot flagged accounts for similar maintenance tasks on the English Wikipedia, Commons, Meta. - Additional information: I'm an administrator on the English Wikipedia, the English Wikinews, and the Wikimedia Commons projects. I also operate a bot which uses the pywikipedia to make regular fully automated edits to the English and Finnish Wikinews projects which have amassed about 50,000 edits. See also AdambroBot on other projects. Done User:AdambroBot now has a bot flag. --mikeu talk 13:32, 3 July 2009 (UTC) Mu301Bot (talk • email • contribs • stats • logs • global account)[edit source] - Bot operator: Mu301 (talk • email • contribs • stats • logs • global account) - Automatic or manually assisted: manually assisted - Purpose of the bot: maintenance tasks - Edit period(s): as needed - Programming language(s) (and API) used: pywikipedia - Other projects that are already using this bot: none - Additional information: will also be used to develop a learning project on using bots Done After 6 weeks with no comments, I'm willing to flag for a trusted user. --SB_Johnny talk 00:23, 31 August 2009 (UTC) JackBot (talk • email • contribs • stats • logs • global account)[edit source] - Bot operator: JackPotte (talk • email • contribs • stats • logs • global account) - Automatic or manually assisted: Both. - Purpose of the bot: Cleaning the double redirections with the famous redirect.py. - Edit period(s): Every day. - Programming language(s) (and API) used: AWB, Pywikipedia. - Other projects that are already using this bot: Several - Additional information: If someone else absolutely wants to execute this script every day I'll stop this vote for my bot. - Requested test run of bot here. --mikeu talk 01:35, 13 August 2010 (UTC) - I've flagged JackBot. --mikeu talk 05:21, 13 August 2010 (UTC) EdoBot (talk • email • contribs • stats • logs • global account)[edit source] - Bot operator: EdoDodo (talk • email • contribs • stats • logs • global account) - Automatic or manually assisted: Automatic - Purpose of the bot: Creating and maintaining interwiki links. - Edit period(s): Lots of runs. - Programming language(s) (and API) used: Pywikipedia (interwiki.py) - Other projects that are already using this bot: Approved on Simple English Wikipedia. Requested on French, Italian, and English Wikipedias. - Additional information:. - EdoDodo talk 09:34, 6 September 2010 (UTC) - Hello! Thank you for the offer to run a bot to help maintain wikiversity. As described in the Wikiversity:Bots page I would like to request that you run a limited test (just once and without the bot flag) to demonstrate the work that your bot will perform. Please note the edit rate guidelines and the use of the MaxLag parameter. Let me know after you run the test. --mikeu talk 21:28, 8 September 2010 (UTC) GedawyBot (talk • email • contribs • stats • logs • global account)[edit source] - Bot operator: محمد الجداوي (talk • email • contribs • stats • logs • global account) - Automatic or manually assisted: Automatic - Purpose of the bot: Interwiki - Edit period(s): as needed - Programming language(s) (and API) used: Pywikibot - Other projects that are already using this bot: Global - Additional information: --محمد الجداوي 11:41, 20 October 2011 (UTC) Support bot status - does a good job at Wikipedia. However, I would suggest that the operator creates an English language talk page here or on meta, because it can be difficult for users whose language has a Roman script to use the arabic Wikipedia talk page due to the right-to-left typing. --Simone 17:51, 20 October 2011 (UTC) - Thanks. You can contact me on my talk page on meta.--محمد الجداوي 02:31, 21 October 2011 (UTC) - Question is this bot working on other WV projects currently? David.crochet's bot has been performing this task for several years now. --SB_Johnny talk 09:01, 1 November 2011 (UTC) - Yes; My bot has bot flag on arabic WV (Although there is not much to do there; As it's a new site). I really want to help here.--محمد الجداوي 11:59, 1 November 2011 (UTC) Comment - I'm noting that this bot was flagged on 21 other WMF wikis 18/11/2011. The question remains though what does it do better or worse than David.crochet's bot? -- Jtneill - Talk - c 00:35, 6 November 2011 (UTC) - I just want to run my interwiki bot here, I don't say i'm better or worth than anyone. You can test my edits.--محمد الجداوي 13:41, 6 November 2011 (UTC) SB_Johnny suggested I be contacted about this and I don't know why. What do people still want to know before granting the bot flag? What concerns are there to discuss? -- darklama 12:58, 24 November 2011 (UTC) - James and I don't know all that much about bots, so if you think the bot is fine, the bot is fine with me. Just looking for an expert nod. --SB_Johnny talk 18:17, 24 November 2011 (UTC) Not done This very old request is now archived. Please resubmit if you are interested in using a bot to contribe to Wikiversity. --mikeu talk 07:16, 9 November 2015 (UTC) Hazard-Bot (talk • email • contribs • stats • logs • global account)[edit source] - Bot operator: Hazard-SJ (talk • email • contribs • stats • logs • global account) - Automatic or manually assisted: Automatic - Purpose of the bot: Cleaning the sandbox - Edit period(s): I usually do this hourly, but as it has a much lower edit rate, I could change the frequency. - Programming language(s) (and API) used: Pywikipedia - Other projects that are already using this bot: enwiki, nlwiki, mediawikiwiki - Additional information: As stated above, I believe hourly checks for this task might be irrelevant. I could do it, though, or I could do it at less frequent intervals (best for you, the community to decide, I think?). Also, it would be nice to have a page with the content it should be reset with (protection would be good to prevent vandalism), or at least a confirmation of the text it should be replaced with. Hazard-SJ ± 23:13, 21 June 2012 (UTC) - Hello, and thank you for your offer to help maintain Wikiversity! I apologize for noticing this earlier. In the past I have run a bot to "rake" the sandbox once per week, but my bot is not currently editing this page. We do have a template at {{Please leave this line alone (sandbox heading)}} and you can see how it is used by viewing the wiki source at this revision: [3]. A few questions: - Do you plan to use the bot for other tasks? - Are you interested in becoming active at any of the Wikiversity learning projects? - --mikeu talk 17:43, 8 October 2012 (UTC) - As for other tasks, not immediately, but I'd request here if I find something else that I could do with the bot. As for becoming active on Wikiversity, hmm ... not specifically. I edit on other wikis fairly actively, though. I'm a member of the SWMT (and am a global rollbacker, by extension), merely suggesting that I've had many crosswiki experiences. I run bots on other projects, including sandbots on three other wikis, so that should be okay. Hazard-SJ ± 01:52, 23 January 2013 (UTC) Not done This very old request is now archived. Please resubmit if you are interested in using a bot to contribe to Wikiversity. --mikeu talk 07:17, 9 November 2015 (UTC) MaintenanceBot (talk • email • contribs • stats • logs • global account)[edit source] - Bot operator: Dave Braunschweig (talk • email • contribs • stats • logs • global account) - Automatic or manually assisted: Manually assisted for now. - Purpose of the bot: A variety of maintenance tasks, starting with identifying unlicensed files and adding notifications to the file and the user. - Edit period(s): As needed. - Programming language(s) (and API) used: Windows PowerShell - Other projects that are already using this bot: None - Additional information: Licensing information for contributed files is currently unmanaged. The scope of the problem is beyond the time and abilities of human efforts alone. A bot is necessary to address the problem. -- Dave Braunschweig (discuss • contribs) 11:42, 30 October 2013 (UTC) - Hi Dave, Thankyou for your diligent attention to unlicensed image uploads etc. I've enabled this bot. Would you mind listing the specific actions it should perform on the bot's user page? Sincerely, James -- Jtneill - Talk - c 06:07, 10 November 2013 (UTC) Done I'll also post an example on the MaintenanceBot talk page when it's ready. Thanks! -- Dave Braunschweig (discuss • contribs) 14:28, 10 November 2013 (UTC) Done This request was granted by User:Jtneill on 10 November 2013. --mikeu talk 07:20, 9 November 2015 (UTC) RileyBot[edit source] - Bot name: RileyBot (talk • email • contribs • stats • logs • global account) - Bot operator: Riley Huntley (talk • email • contribs • stats • logs • global account) - Automatic or manually assisted: Automatic - Purpose of the bot: Clean Wikiversity:Sandbox as the bot tasked to due so hasn't done it in nearly a month - Edit period(s): Every six hours, or as otherwise requested -) 22:52, 4 February 2016 (UTC) - @Riley Huntley: Hello, and thank you for offering to contribute to Wikiversity! Usually we leave these requests open for about a week in case the community has any questions. I don't expect any for a routine request like this. I was running the bot that watched the sandbox but I set it at a very slow clean of once per week. The more frequent clean with the delay you suggest sounds like a better method to prevent interruption of testing. I suspect most editors now test in the userspace sandbox in any case. I'll watch for comments here and check back in a little while. For now, go ahead and start the bot (w/o the flag) to make some periodic edits so I can see the revision history. --mikeu talk 03:00, 5 February 2016 (UTC) - Please also create User:RileyBot with info about the programming language and linking to the operator page. Include either {{User bot}} or add the bot userpage to Category:Wikiversity bots. --mikeu talk 03:06, 5 February 2016 (UTC) Not done - Very stale request. Requests made by mikeu were not act up (creating info), bot didn't run, and the owner of the request hasn't even commented on his/her own request. Please make a new request if you are still interested in your bot becoming an official, flagged bot here at Wikiversity... other than that, this request won't be accepted. ---Atcovi (Talk - Contribs) 19:28, 20 November 2016 (UTC) Texvc2LaTeXBot[edit source] - Bot name: Texvc2LaTeXBot (talk • email • contribs • stats • logs • global account) - Bot operator: Salix alba (talk • email • contribs • stats • logs • global account) -)
https://en.wikiversity.org/wiki/Wikiversity:Bots/Status/Archive
CC-MAIN-2022-40
refinedweb
3,284
59.64
Stu 2012-08-27 Initial development version. Documentation NAME treso - Resolver SYNOPSIS package require Tcl 8.5 package require treso 0.1 namespace import ::treso::* treso::resolve ?-option ...? what ?-option ...? treso::resolvers treso::running treso::cancel runId DESCRIPTION This extension uses the system's resolver to resolve names to addresses or addresses to names. When resolving addresses to names, the first address found is returned unless one of the return options is given. A single return option returns the option's value. More than one return option or the -all return option will return a dict of option/value pairs. Lookups are performed in the inet domain by default. RESOLVERS The resolvers command returns a list of available resolvers that may be passed as parameters to the -resolver option of the resolve command. At minimum, four resolvers are available: none Returns a result based on the input and options. Doesn't attempt to resolve anything. Possibly useful for testing. Nonblocking. simple Simple resolver. Returns result directly. Most likely blocking. direct Direct resolver. Calls callback immediately, before the resolve command returns. Callback is called with one extra argument: the requested return data. Returns an empty string. Most likely blocking. basync Blocking async resolver. Creates an event that should happen immediately and calls the callback from the event handler. Callback is called with one extra argument: the requested return data. Returns an identifier. Needs event loop. Most likely blocking. The following resolvers may also be available: thread Threaded resolver. All potentially blocking operations happen in a thread. Callback is called with one extra argument: the requested return data. Returns an identifier. Needs threads. Needs event loop. Nonblocking. async Asynchronous resolver. Callback is called with one extra argument: the requested return data. Returns an identifier. Needs event loop. Nonblocking. RESOLVERS COMMAND The resolvers command returns a list of available resolvers. RESOLVE COMMAND The resolve command performs name resolution. PARAMETERS what Name or numeric address RESOLVER OPTIONS -domain domain Domain, inet or inet6 -resolver resolver Resolver to use -answerto cmdprefix Callback -to to Resolve to a name or addr, default name. RETURN OPTIONS -name Name -aliases List of aliases -addresses List of addresses -domain Domain -resolver Resolver -to To -all All of the above RUNNING COMMAND The running command returns a list of running queries. CANCEL COMMAND The cancel command cancels a running query. Returns an empty string. PARAMETERS runId Run id to cancel EXAMPLES resolve localhost resolve -aliases localhost -domain inet -addresses resolve -domain -domain inet6 localhost resolve -aliases -resolver basync localhost -answerto [list myproc someparm] -name COPYRIGHT Copyright (c) 2012 Stuart Cassoff
http://wiki.tcl.tk/36864
CC-MAIN-2016-50
refinedweb
430
53.17
Details Description My thoughts are a new trait CompressionDependencies for KafkaProject.scala, adding snappy as the first library. refactor CompressionUtil for better code reuse and provide a way on startup to select what the default codec is instead of the default always gziping Issue Links Activity Thanks for the patch Joe! A couple of comments 1. There is quite a lot of overlap in the code for the GZIP and Snappy codec in CompressionUtils. Wonder if you were up for refactoring it so that they use the same code path ? ? 3. I think we will have to wait for the unit test to get fixed before accepting this patch. Have you tried running the system and performance tests yet ? 1. There is quite a lot of overlap in the code for the GZIP and Snappy codec in CompressionUtils. Wonder if you were up for refactoring it so that they use the same code path ? Agreed, I am. Should I open a new ticket for refactoring CompressionUtils or just part of this ticket? ? Yeah, we could so something at startup that changes the default behavior to be a specific codec. Incorporating this into refactoring that class should not be a big deal where the default case will check an object instead of implementing gzip (like it does now) and depending on that object call either the gzip or snappy function i create (which will also get used by the case match). same JIRA as this? a new JIRA for refactoring and put this into that? a third JIRA? 3. I think we will have to wait for the unit test to get fixed before accepting this patch. Have you tried running the system and performance tests yet ? Sounds good, I should be able to chip away at that tomorrow or early this week. I did try running the performance tests but ran into some errors. it is possible something I was doing wrong so I want to go through and set it up again before sending email about that. same, will try that in the next few days too. 1. I think we might as well do the refactoring it as part of this patch. Copy pasting code doesn't seem like a good idea. 2. Yes. Same JIRA as this one. We might as well think through all the issues with supporting multiple codecs cleanly now, rather than later. 3. I've updated the perf patch. Do you want to submit a patch for the unit test ? >> provide a way on startup to select what the default codec is instead of the default always gziping Today, we have a config named "compression.codec" that picks the compression codec. Today compression.codec is a numeric value. It is 0 for no compression and 1 for GZIP. Now we are supporting multiple codecs. It makes sense for this to be a string value, which can be one of "none, gzip, snappy". Default is still "none". As part of 2., I was raising a different question. In the general case, should snappy always be a core dependency of Kafka or not ? I don't know the right answer here. Maybe we need to think more. re-factored CompressionUtil, added snappy compression and test case for its use. I have not run the perf test to compare gzip vs snappy yet. It would be good if the snappy jar is only a compile time dependency, but not a runtime dependency. This way, people not using snappy doesn't have to include the jar. Could we verify this? Yes, this patch allows for that. Here is how to verify. apply the patch ./sbt update ./sbt package then remove the jar rm -f core/lib_managed/scala_2.8.0/compile/snappy-java-1.0.4.1.jar then launch up bin/zookeeper-server-start.sh config/zookeeper.properties bin/kafka-server-start.sh config/server.properties bin/kafka-producer-shell.sh --props config/producer.properties --topic test bin/kafka-consumer-shell.sh --topic test --props config/consumer.properties send messages, things are good shutdown down bin/kafka-producer-shell.sh --props config/producer.properties --topic test then in config/producer.properties change the codec to 1 startup bin/kafka-producer-shell.sh --props config/producer.properties --topic test send messages, things are good to go shutdown bin/kafka-producer-shell.sh --props config/producer.properties --topic test then in config/producer.properties change the codec to 2 startup bin/kafka-producer-shell.sh --props config/producer.properties --topic test starts up fine, then try to send a message..... Exception in thread "main" java.lang.NoClassDefFoundError: org/xerial/snappy/SnappyOutputStream at kafka.message.SnappyCompression.<init>(CompressionUtils.scala:61) at kafka.message.CompressionFactory$.apply(CompressionUtils.scala:82) at kafka.message.CompressionUtils$.compress(CompressionUtils.scala:111) at kafka.message.MessageSet$.createByteBuffer(MessageSet.scala:71) at kafka.message.ByteBufferMessageSet.<init>(ByteBufferMessageSet.scala:45) at kafka.producer.ProducerPool$$anonfun$send$1$$anonfun$3.apply(ProducerPool.scala:108) at kafka.producer.ProducerPool$$anonfun$send$1$$anonfun$3.apply(ProducerPool.scala:107) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:57) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:43) at scala.collection.TraversableLike$class.map(TraversableLike.scala:206) at scala.collection.mutable.ArrayBuffer.map(ArrayBuffer.scala:43) at kafka.producer.ProducerPool$$anonfun$send$1.apply$mcVI$sp(ProducerPool.scala:107) at kafka.producer.ProducerPool$$anonfun$send$1.apply(ProducerPool.scala:102) at kafka.producer.ProducerPool$$anonfun$send$1.apply(ProducerPool.scala:102) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:57) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:43) at kafka.producer.ProducerPool.send(ProducerPool.scala:102) at kafka.producer.Producer.configSend(Producer.scala:167) at kafka.producer.Producer.send(Producer.scala:106) at kafka.tools.ProducerShell$.main(ProducerShell.scala:68) at kafka.tools.ProducerShell.main(ProducerShell.scala) Caused by: java.lang.ClassNotFoundException: org.xerial.snappy.SnappyOutput) ... 23 more So, this raises a bigger question, how do clients signal that they can't handle codec 'xyz' ? Is it up to the consumer or could / should the broker re-encode it? Granted this probably isn't an issue for snappy since there are appear to be several implementations - but in general is there a need for an 'accept' style header? My thought is that if you leave it up to the client then you could run into an issue where you have client A and client B, and neither support the same compression codecs so you are stuck with uncompressed.. This is not a problem for java/scala clients. But it could be a problem for non-java clients. I think this is tied to some of the discussions that we had on non-java language support (see "different language binding support" thread in). Ideally, we'd rather each language not re-implement a thick client. Right I agree it overlaps that thread, but is compression support a thick or thin attribute? Maybe we should move this to the mailing list? Patch v2 looks good to me. Attaching Patch v3 with minor changes in CompressionCodec to avoid duplicating constants. If nobody objects, I will commit this patch later today. What is the difference between Joe's v2 patch and the v3 patch ? Can you please describe the changes when uploading a new patch ? The following are the changes that I made. Index: core/src/main/scala/kafka/message/CompressionCodec.scala =================================================================== — core/src/main/scala/kafka/message/CompressionCodec.scala (revision 1200967) +++ core/src/main/scala/kafka/message/CompressionCodec.scala (working copy) @@ -20,8 +20,9 @@ object CompressionCodec { def getCompressionCodec(codec: Int): CompressionCodec = { codec match } +1 on the latest patch. I like the changes. Leaving a comment here, as Joe didn't appear to be in the JIRA list. Assigning this JIRA to Joe.
https://issues.apache.org/jira/browse/KAFKA-187?page=com.atlassian.jira.plugin.ext.subversion:subversion-commits-tabpanel
CC-MAIN-2016-07
refinedweb
1,313
53.68